UNPKG

@grapecity/gcpdfviewer

Version:
25 lines (24 loc) 959 B
import { IStore, IStateBinder } from '../api/PluginModel'; /** @hidden * Intermediator object between the React View and state "owner". * Stores state internally to allow arbitrary initialization order and even viewless operation. */ export declare class ReactStateBinder<TState, TMessage> implements IStateBinder<TState> { constructor(initialStore: IStore<TState, TMessage>); private _view; private _store; private _unsubscribe; /** Gets the current store */ get store(): IStore<TState, TMessage>; private handleStoreUpdate; bind(store: IStore<TState, TMessage>): void; /** Exposes props for component view (dispatch and ref). * Usage: render(<MyView {...this._myState.connect} />, host("gc-errorpanel")); */ get connect(): { dispatch: (msg: TMessage) => void; ref: (c: any) => void; }; dispatch: (msg: TMessage) => void; bindView: (c: any) => void; }