2.1.4 • Published 6 months ago
@types/promise-state-machine-es6 v2.1.4
Installation
npm install --save @types/promise-state-machine-es6
Summary
This package contains type definitions for promise-state-machine-es6 (https://github.com/faleij/promise-state-machine).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/promise-state-machine-es6.
index.d.ts
// Type definitions for promise-state-machine-es6 2.1
// Project: https://github.com/faleij/promise-state-machine
// Definitions by: Dmitry Zakablukov <https://github.com/dmitry-zakablukov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as events from 'events';
interface DotNode<State, Transitions> {
from: State;
to: State;
transition: Transitions;
}
interface DotNodeStringified {
from: string;
to: string;
transition: string;
}
interface FsmBase<State, Transitions> {
state: State;
is(state: State): boolean;
is(...args: State[]): boolean;
can(state: Transitions): boolean;
can(...args: Transitions[]): boolean;
toDOTsync(options?: { replacer: (data: DotNode<State, Transitions>) => DotNodeStringified}): string;
}
declare const PromiseStateMachine: {
new <State, Transitions extends string>(payload: {
initial: State;
events: PromiseStateMachine.Events<State, Transitions>;
}): events.EventEmitter & FsmBase<State, Transitions> & {
[name in Transitions]: () => Promise<any>;
};
};
declare namespace PromiseStateMachine {
type Events<State, Transitions extends string> = {
[name in Transitions]: { from: State | State[]; to: State };
};
}
export = PromiseStateMachine;
Additional Details
- Last updated: Fri, 04 Jun 2021 16:31:40 GMT
- Dependencies: none
- Global values: none
Credits
These definitions were written by Dmitry Zakablukov.