Skip to content

Commit 32d906f

Browse files
author
hyperandroid
committed
Fixed some d.ts definitions.
Added better global environemnt detenction for modules. Better browser support.
1 parent 11a07a5 commit 32d906f

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

automata.d.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ declare module FSM {
3434
onExit? : string | StateCallback;
3535
}
3636

37+
export interface SessionCreationData {
38+
fda : string;
39+
controller? : any;
40+
}
41+
3742
export interface TransitionMessage {
3843
msgId : string;
3944
data? : any;
@@ -98,6 +103,7 @@ declare module FSM {
98103
getProperty( key:string ) : any;
99104
start( callback:ConsumeCallback ) : void;
100105
fireCustomEvent( e:any ) : void;
106+
serialize() : any;
101107
}
102108

103109
class GuardException {
@@ -131,11 +137,11 @@ declare module FSM {
131137
}
132138
}
133139

134-
declare module Automata {
140+
declare module "automata" {
135141

136142
export function registerFSM( object:FSM.FSMDefinition );
137143
export function registerFDA( object:FSM.FSMDefinition );
138-
export function createSession( fda_name : string, controller : any ) : FSM.Session;
144+
export function createSession( data:FSM.SessionCreationData ) : FSM.Session;
139145
export function newGuardException( message : string ) : FSM.GuardException;
140146
export function newSessionListener( obj : any ) : FSM.SessionListener;
141147
export function deserializeSession( obj : any, controllerDeserializerFunction ) : FSM.Session;

automata.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,6 +2261,6 @@
22612261

22622262
}
22632263

2264-
exports = module.exports = _export;
2264+
root.exports = root.module.exports = _export;
22652265

2266-
})( typeof window!=='undefined' ? window : global );
2266+
})( typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {} );

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "automata",
3-
"version": "2.0.2",
3+
"version": "2.0.3",
44
"main": "automata",
55
"keywords": [
66
"DFA",
@@ -19,5 +19,6 @@
1919
"engines": {
2020
"node": "*"
2121
},
22+
"license": "MIT",
2223
"homepage": "http://github.com/hyperandroid/automata"
2324
}

0 commit comments

Comments
 (0)