Files
DefinitelyTyped/f1/index.d.ts
Mohamed Hegazy 1cf9dfb2aa Ports https://github.com/DefinitelyTyped/DefinitelyTyped/pull/13284 (#13375)
* Use the right types for the callback

* Update the apply method

* Add paramters to callback

* Fix lint errors
2016-12-15 12:10:47 -08:00

39 lines
897 B
TypeScript

// Type definitions for f1 8.0
// Project: https://github.com/jam3/f1
// Definitions by: Neo <https://github.com/neolwc>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
interface F1Options {
onState?: (...args: any[]) => void;
onUpdate?: (...args: any[]) => void;
name: string;
targets: any;
states: any;
transitions: any[];
parsers: any;
}
interface F1 extends NodeJS.EventEmitter {
targets(targets: any): F1;
states(states: any): F1;
transitions(transitions: any[]): F1;
parsers(parser: any): F1;
init(initState: string): F1;
destroy(): void;
apply(pathToTarget: string, target: any, parserDefinition: any): void;
go(state: string, callback?: (state: any, currentState: any) => void): F1;
set(state: string): F1;
step(deltaTime: number): F1;
update(): F1;
}
declare function F1(settings?: F1Options): F1;
export = F1;