In a TypeScript interface, save(): void declares a method signature. save: () => void declares a property whose value is callable. Both describe a contract; neither creates a function or binds this.
There is also a type-checking difference: with strictFunctionTypes, function properties receive stricter parameter checking than method signatures.
1interface MethodContract {
2 save(): void;
3}
4
5interface PropertyContract {
6 save: () => void;
7}
These are separate interfaces so we can compare the alternatives without declaring the same member twice.
| Question | Method signature | Function property |
|---|---|---|
| Syntax | save(): void | save: () => void |
| Requires a callable member? | Yes | Yes |
| Creates a function at runtime? | No | No |
Automatically binds this? | No | No |
Stricter parameter checks with strictFunctionTypes? | Method exception applies | Yes |
An interface does not choose the implementation
An implementation can satisfy either contract with a class method:
1class MethodImplementation implements MethodContract, PropertyContract {
2 save(): void {
3 console.log("Saved");
4 }
5}
It can also satisfy either contract with an arrow-function field:
1class ArrowImplementation implements MethodContract, PropertyContract {
2 save = (): void => {
3 console.log("Saved");
4 };
5}
The interface describes what consumers may call. The class decides which JavaScript implementation exists. Function-property syntax in an interface does not require an arrow function in the class.
Why callback parameter checking can differ
Suppose a consumer is allowed to pass any animal. A handler that only accepts dogs cannot safely serve every call: it may try to call bark() on a cat.
1interface Animal {
2 name: string;
3}
4
5interface Dog extends Animal {
6 bark(): void;
7}
8
9interface MethodHandler {
10 handle(animal: Animal): void;
11}
12
13interface PropertyHandler {
14 handle: (animal: Animal) => void;
15}
16
17const handleDog = (dog: Dog): void => dog.bark();
18
19// Accepted: method signatures have a compatibility exception.
20const methodHandler: MethodHandler = { handle: handleDog };
21
22// Rejected when strictFunctionTypes is enabled:
23// const propertyHandler: PropertyHandler = { handle: handleDog };
The stricter check rejects a callback that accepts less than its contract promises. In type-system terminology, function parameter checking here is contravariant, while method parameter compatibility is bivariant. You do not need the terminology to apply the rule: a replacement callback must handle every input its caller is permitted to supply.
For callback-oriented contracts, function properties can therefore catch an unsafe assignment that method signatures allow. This does not make methods universally wrong; it explains one consequence of choosing the syntax.
this depends on the implementation and the call
A normal method receives its this value from how it is invoked. Extracting it does not keep the original receiver.
1class Counter {
2 value = 0;
3
4 increment(): void {
5 this.value += 1;
6 }
7}
8
9const counter = new Counter();
10counter.increment(); // Works: the receiver is counter.
11
12const increment = counter.increment;
13// increment(); // Throws: class methods run in strict mode; this is undefined.
The interface spelling cannot repair this call. Choose the binding behavior where the callback is created:
1const wrappedIncrement = (): void => counter.increment();
2const boundIncrement = counter.increment.bind(counter);
3
4wrappedIncrement();
5boundIncrement();
An arrow-function field is another option:
1class ArrowCounter {
2 value = 0;
3
4 increment = (): void => {
5 this.value += 1;
6 };
7}
8
9const arrowCounter = new ArrowCounter();
10const incrementArrow = arrowCounter.increment;
11incrementArrow(); // Works: the arrow captures the instance's this.
With these class implementations, a method lives on the prototype, while an arrow-function field creates a separate function for each instance. Choose the latter when its callback behavior is useful; do not change every method just to match an interface’s punctuation. Binding once is also useful when an API needs the same callback reference later, for example to remove a listener.
Which should you choose?
- Use method signatures when they clearly describe an object’s operations and fit the surrounding API.
- Consider function properties for callback contracts where stricter parameter checking is valuable.
- Choose class methods, arrow fields or explicit binding based on runtime behavior, separately from the interface syntax.
The useful distinction is not “object-oriented methods versus ordinary functions.” Both interface forms describe callable members. Their parameter compatibility can differ, and neither makes a detached callback retain this.
I explore explicit TypeScript contracts in ScreamJS. You can also read my resume.
