mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Merge pull request #7149 from thelambdaparty/master
added LeState type definitions
This commit is contained in:
@@ -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 })
|
||||
})
|
||||
Vendored
+27
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user