UNPKG

nervjs

Version:

A react-like framework based on virtual-dom

25 lines (24 loc) 902 B
import { Props, ComponentLifecycle, Refs } from 'nerv-shared'; interface Component<P = {}, S = {}> extends ComponentLifecycle<P, S> { _rendered: any; dom: any; } declare class Component<P, S> implements ComponentLifecycle<P, S> { static defaultProps: {}; state: Readonly<S>; props: Readonly<P> & Readonly<Props>; context: any; _dirty: boolean; _disable: boolean; _pendingStates: any[]; _pendingCallbacks: Function[]; refs: Refs; isReactComponent: Object; constructor(props?: P, context?: any); setState<K extends keyof S>(state: ((prevState: Readonly<S>, props: P) => Pick<S, K> | S) | (Pick<S, K> | S), callback?: () => void): void; getState(): {}; clearCallBacks(): void; forceUpdate(callback?: Function): void; render(nextProps?: P, nextState?: any, nextContext?: any): any; } export default Component;