kr-observable
Version:
Adds reactivity power for your JavaScript
35 lines • 1.74 kB
TypeScript
import { Runnable } from 'kr-observable';
import { VNode } from 'preact';
export declare function observer<P>(rc: ((props: P) => VNode<any>), debug?: boolean): {
new (props?: P, context?: any): {
run: (props: P) => VNode<any>;
debug: boolean;
active: boolean;
deps?: Set<Set<Runnable>>;
runId: number;
shouldComponentUpdate(nextProps: any): boolean;
componentWillUnmount(): void;
subscriber(): void;
render(props: Object): any;
componentWillMount?(): void;
componentDidMount?(): void;
getChildContext?(): object;
componentWillReceiveProps?(nextProps: Readonly<P>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<P>, nextState: Readonly<any>, nextContext: any): void;
getSnapshotBeforeUpdate?(oldProps: Readonly<P>, oldState: Readonly<any>): any;
componentDidUpdate?(previousProps: Readonly<P>, previousState: Readonly<any>, snapshot: any): void;
componentDidCatch?(error: any, errorInfo: import("preact").ErrorInfo): void;
state: Readonly<any>;
props: import("preact").RenderableProps<P, any>;
context: any;
base?: Element | Text;
setState<K extends string | number | symbol>(state: Partial<any> | ((prevState: Readonly<any>, props: Readonly<P>) => Partial<any> | Pick<any, K>) | Pick<any, K>, callback?: () => void): void;
forceUpdate(callback?: () => void): void;
};
displayName?: string;
defaultProps?: any;
contextType?: import("preact").Context<any>;
getDerivedStateFromProps?(props: object, state: object): object;
getDerivedStateFromError?(error: any): object;
};
//# sourceMappingURL=index.d.ts.map