Installation
npm install --save @types/reflux
Summary
This package contains type definitions for RefluxJS (https://github.com/reflux/refluxjs).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/reflux/v0.
export as namespace Reflux;
export interface StoreDefinition {
listenables?: any[] | undefined;
init?: Function | undefined;
getInitialState?: Function | undefined;
[propertyName: string]: any;
}
export interface ListenFn {
(...params: any[]): any;
completed: Function;
failed: Function;
}
export interface Listenable {
listen: ListenFn;
}
export interface Subscription {
stop: Function;
listenable: Listenable;
}
export interface Store {
hasListener(listenable: Listenable): boolean;
listenToMany(listenables: Listenable[]): void;
validateListening(listenable: Listenable): string;
listenTo(listenable: Listenable, callback: Function, defaultCallback?: Function): Subscription;
stopListeningTo(listenable: Listenable): boolean;
stopListeningToAll(): void;
fetchInitialState(listenable: Listenable, defaultCallback: Function): void;
trigger(state: any): void;
listen(callback: Function, bindContext: any): Function;
}
export interface ActionsDefinition {
[index: string]: any;
}
export interface Actions {
[index: string]: Listenable;
}
export function createStore(definition: StoreDefinition): Store;
export function createAction(definition?: ActionsDefinition): any;
export function createActions(definitions: ActionsDefinition | string[]): any;
export function connect(store: Store, key?: string): void;
export function listenTo(store: Store, handler: string): void;
export function setState(state: any): void;
export function ListenerMixin(): any;
Additional Details
- Last updated: Thu, 08 Jul 2021 22:41:56 GMT
- Dependencies: none
- Global values:
Reflux
Credits
These definitions were written by Maurice de Beijer.