From e348fb97b5a21d123b9669d6f6c4134288c5d36f Mon Sep 17 00:00:00 2001 From: samael Date: Mon, 14 Dec 2015 17:20:49 +0800 Subject: [PATCH 1/3] Update state-machine.d.ts Update to 2.3.5 --- state-machine/state-machine.d.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/state-machine/state-machine.d.ts b/state-machine/state-machine.d.ts index d17c58dc69..7065ee1983 100644 --- a/state-machine/state-machine.d.ts +++ b/state-machine/state-machine.d.ts @@ -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 , Maarten Docter , William Sears +// Definitions by: Boris Yankov , Maarten Docter , William Sears , samael // Definitions: https://github.com/borisyankov/DefinitelyTyped interface StateMachineErrorCallback { @@ -29,7 +29,7 @@ interface StateMachineConfig { interface StateMachineStatic { - VERSION: string; // = "2.2.0" + VERSION: string; // = "2.3.5" WILDCARD: string; // = '*' ASYNC: string; // = 'async' @@ -37,7 +37,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: { @@ -62,13 +62,16 @@ interface StateMachineCan { (evt: string): boolean; } +interface StateMachineIsFinished { + (state: string): boolean; +} interface StateMachine { current: string; is: StateMachineIs; 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(); From 70e18515c62fc1232ee8a4260ac28018d1f30b52 Mon Sep 17 00:00:00 2001 From: samael Date: Mon, 14 Dec 2015 17:23:31 +0800 Subject: [PATCH 2/3] Update to 2.3.5 Update to 2.3.5 --- state-machine/state-machine.d.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/state-machine/state-machine.d.ts b/state-machine/state-machine.d.ts index d17c58dc69..7065ee1983 100644 --- a/state-machine/state-machine.d.ts +++ b/state-machine/state-machine.d.ts @@ -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 , Maarten Docter , William Sears +// Definitions by: Boris Yankov , Maarten Docter , William Sears , samael // Definitions: https://github.com/borisyankov/DefinitelyTyped interface StateMachineErrorCallback { @@ -29,7 +29,7 @@ interface StateMachineConfig { interface StateMachineStatic { - VERSION: string; // = "2.2.0" + VERSION: string; // = "2.3.5" WILDCARD: string; // = '*' ASYNC: string; // = 'async' @@ -37,7 +37,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: { @@ -62,13 +62,16 @@ interface StateMachineCan { (evt: string): boolean; } +interface StateMachineIsFinished { + (state: string): boolean; +} interface StateMachine { current: string; is: StateMachineIs; 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(); From d26e41e78c7f9589b53b18e1d4bf96e23d94e676 Mon Sep 17 00:00:00 2001 From: samael Date: Tue, 28 Jun 2016 08:36:42 +0800 Subject: [PATCH 3/3] update 2.3.5 --- state-machine/state-machine.d.ts | 97 ++------------------------------ 1 file changed, 6 insertions(+), 91 deletions(-) diff --git a/state-machine/state-machine.d.ts b/state-machine/state-machine.d.ts index b30e94ddd1..b3f5446531 100644 --- a/state-machine/state-machine.d.ts +++ b/state-machine/state-machine.d.ts @@ -1,8 +1,7 @@ -<<<<<<< HEAD // Type definitions for Finite State Machine 2.3.5 // Project: https://github.com/jakesgordon/javascript-state-machine // Definitions by: Boris Yankov , Maarten Docter , William Sears , samael -// Definitions: https://github.com/borisyankov/DefinitelyTyped +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface StateMachineErrorCallback { (eventName?: string, from?: string, to?: string, args?: any[], errorCode?: number, errorMessage?: string, ex?: Error): void; // NB. errorCode? See: StateMachine.Error @@ -28,6 +27,10 @@ interface StateMachineConfig { error?: StateMachineErrorCallback; } +interface StateMachineIsFinished { + (state: string): boolean; +} + interface StateMachineStatic { VERSION: string; // = "2.3.5" @@ -63,16 +66,13 @@ interface StateMachineCan { (evt: string): boolean; } -interface StateMachineIsFinished { - (state: string): boolean; -} interface StateMachine { current: string; is: StateMachineIs; can: StateMachineCan; cannot: StateMachineCan; error: StateMachineErrorCallback; - isFinished: StateMachineIsFinished; + 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(); @@ -85,88 +85,3 @@ declare var StateMachine: StateMachineStatic; declare module "state-machine" { export = StateMachine; } -======= -// Type definitions for Finite State Machine 2.2 -// Project: https://github.com/jakesgordon/javascript-state-machine -// Definitions by: Boris Yankov , Maarten Docter , William Sears -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -interface StateMachineErrorCallback { - (eventName?: string, from?: string, to?: string, args?: any[], errorCode?: number, errorMessage?: string, ex?: Error): void; // NB. errorCode? See: StateMachine.Error -} - -interface StateMachineEventDef { - name: string; - from: any; // string or string[] - to: string; -} - -interface StateMachineEvent { - (...args: any[]): void; -} - -interface StateMachineConfig { - initial?: any; // string or { state: 'foo', event: 'setup', defer: true|false } - events?: StateMachineEventDef[]; - callbacks?: { - [s: string]: (event?: string, from?: string, to?: string, ...args: any[]) => any; - }; - target?: StateMachine; - error?: StateMachineErrorCallback; -} - -interface StateMachineStatic { - - VERSION: string; // = "2.2.0" - WILDCARD: string; // = '*' - ASYNC: string; // = 'async' - - Result: { - 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 - }; - - Error: { - INVALID_TRANSITION: number; // = 100, caller tried to fire an event that was innapropriate in the current state - PENDING_TRANSITION: number; // = 200, caller tried to fire an event while an async transition was still pending - INVALID_CALLBACK: number; // = 300, caller provided callback function threw an exception - }; - - create(config: StateMachineConfig, target?: StateMachine): StateMachine; -} - -interface StateMachineTransition { - (): void; - cancel(): void; -} - -interface StateMachineIs { - (state: string): boolean; -} - -interface StateMachineCan { - (evt: string): boolean; -} - -interface StateMachine { - current: string; - is: StateMachineIs; - can: StateMachineCan; - cannot: StateMachineCan; - error: StateMachineErrorCallback; - - /* transition - only available when performing async state transitions; otherwise null. Can be a: - [1] fsm.transition(); // called from async callback - [2] fsm.transition.cancel(); - */ - transition: StateMachineTransition; -} - -declare var StateMachine: StateMachineStatic; - -declare module "state-machine" { - export = StateMachine; -} ->>>>>>> cdddb5911e05a783ce2ea2f3927be9f5921fa8a9