added LeState type definitions

This commit is contained in:
hadriandeoliveira
2015-12-11 03:48:23 -02:00
parent f8af639bf2
commit e1fa07aaf8
2 changed files with 47 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
/// <reference path="./lestate.d.ts"/>
let State = LeState.createState()
State.set({
test : {}
})
let currentState = State.get()
State.insert({
test : {}
})
let currentDescription = State.getDescription()
State.createListener({
id : 0,
selector : state => ({ test : state.test })
})
+27
View File
@@ -0,0 +1,27 @@
// Type definitions for LeState v0.1.3
// Project: https://github.com/LeTools/LeState
// Definitions by: Hadrian Oliveira <https://github.com/thelambdaparty/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare let LeState : {
createState: (props?: {
initialState: {};
}) => {
set(newValue: {}): [{
id: number;
state: {};
}];
get(): any;
insert(newValue: {}): void;
getDescription(): {};
createListener({ id, selector, force }: {
id: number;
selector: (state :any) => {};
force?: boolean;
}): void;
};
};
declare module "lestate" {
export default LeState;
}