collectype

collectype v0.11.0


collectype / types/collection / ChainableMethod

Type Alias: ChainableMethod()<T>

ChainableMethod<T> = (…args) => T

Defined in: types/collection.ts:42

Type for a chainable method that accepts any arguments and returns the instance (this). Used for methods that support chaining in collection/function classes.

Type Parameters

T

T

The type of the instance returned for chaining.

Parameters

args

any[]

Arguments for the method.

Returns

T

The instance for chaining.

Example

class MyClass {
  set(val: number): this { ...; return this; }
}