Skip to content

Interface: OnCommandDecorator()<R, P, T>

Defined in: src/wirestate-lit/commands/on-command.ts:16

Describes type returned by onCommand.

Remarks

Supports both TC39 and legacy experimental decorators.

Type Parameters

Type ParameterDefault type
Runknown
Punknown
T extends CommandTypeCommandType

Call Signature

ts
OnCommandDecorator<This>(value: (this: This, payload: P) => MaybePromise<R>, context: ClassMethodDecoratorContext<This>): void;

Defined in: src/wirestate-lit/commands/on-command.ts:22

Describes type returned by onCommand.

Type Parameters

Type Parameter
This extends Interface<Omit<ReactiveElement, "renderRoot">>

Parameters

ParameterType
value(this: This, payload: P) => MaybePromise<R>
contextClassMethodDecoratorContext<This>

Returns

void

Remarks

Supports both TC39 and legacy experimental decorators.

Call Signature

ts
OnCommandDecorator(
   target: object, 
   propertyKey: string | symbol, 
   descriptor: PropertyDescriptor): void;

Defined in: src/wirestate-lit/commands/on-command.ts:27

Describes type returned by onCommand.

Parameters

ParameterType
targetobject
propertyKeystring | symbol
descriptorPropertyDescriptor

Returns

void

Remarks

Supports both TC39 and legacy experimental decorators.

Properties

type?

ts
readonly optional type?: T;

Defined in: src/wirestate-lit/commands/on-command.ts:20

Phantom field carrying the command type T.