mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Vendored
+9
-5
@@ -1,6 +1,6 @@
|
||||
// Type definitions for Finite State Machine 2.2
|
||||
// Type definitions for Finite State Machine 2.3.5
|
||||
// Project: https://github.com/jakesgordon/javascript-state-machine
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Maarten Docter <https://github.com/mdocter>, William Sears <https://github.com/MrBigDog2U>
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>, Maarten Docter <https://github.com/mdocter>, William Sears <https://github.com/MrBigDog2U>, samael <https://github.com/samael65535>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface StateMachineErrorCallback {
|
||||
@@ -27,9 +27,13 @@ interface StateMachineConfig {
|
||||
error?: StateMachineErrorCallback;
|
||||
}
|
||||
|
||||
interface StateMachineIsFinished {
|
||||
(state: string): boolean;
|
||||
}
|
||||
|
||||
interface StateMachineStatic {
|
||||
|
||||
VERSION: string; // = "2.2.0"
|
||||
VERSION: string; // = "2.3.5"
|
||||
WILDCARD: string; // = '*'
|
||||
ASYNC: string; // = 'async'
|
||||
|
||||
@@ -37,7 +41,7 @@ interface StateMachineStatic {
|
||||
SUCCEEDED: number; // = 1, the event transitioned successfully from one state to another
|
||||
NOTRANSITION: number; // = 2, the event was successfull but no state transition was necessary
|
||||
CANCELLED: number; // = 3, the event was cancelled by the caller in a beforeEvent callback
|
||||
ASYNC: number; // = 4, the event is asynchronous and the caller is in control of when the transition occurs
|
||||
PENDING: number; // = 4, the event is asynchronous and the caller is in control of when the transition occurs
|
||||
};
|
||||
|
||||
Error: {
|
||||
@@ -68,7 +72,7 @@ interface StateMachine {
|
||||
can: StateMachineCan;
|
||||
cannot: StateMachineCan;
|
||||
error: StateMachineErrorCallback;
|
||||
|
||||
isFinished: StateMachineIsFinished;
|
||||
/* transition - only available when performing async state transitions; otherwise null. Can be a:
|
||||
[1] fsm.transition(); // called from async callback
|
||||
[2] fsm.transition.cancel();
|
||||
|
||||
Reference in New Issue
Block a user