UNPKG

darian

Version:

A Naive state container for JavaScript apps

49 lines (48 loc) 2.04 kB
/// <reference types="rx-core-binding" /> import * as React from "react"; import { Subject } from "rx"; import Store from "./Store"; import { actionT } from "./type"; interface eventT { event: string; data?: any; } interface bindLinkT { stream: Subject<any>; store: Store; dispath: (action: actionT) => any; } interface bindCfgT { subjectPath?: string; dispathPath?: string; } declare const _default: (bindLink: bindLinkT) => (bindCfg: bindCfgT) => (Target: React.ComponentType<any>) => { new (props: any): { componentDidMount(): void; componentWillUnmount(): void; handleChange: (e: eventT) => void; render(): JSX.Element; context: any; setState<K extends string | number | symbol>(state: any, callback?: () => void): void; forceUpdate(callBack?: () => void): void; readonly props: Readonly<any> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<any>; refs: { [key: string]: React.ReactInstance; }; shouldComponentUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>): any; componentDidUpdate?(prevProps: Readonly<any>, prevState: Readonly<any>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly<any>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly<any>, nextState: Readonly<any>, nextContext: any): void; }; contextType?: React.Context<any>; }; export default _default;