/** * This function allow us to use a pubsub store * preventing the reload of the whole app even * if the provider is used at the root level * https://www.youtube.com/watch?v=ZKlXqrcBx88 * https://github.com/jherr/fast-react-context */ import { ReactNode } from 'react'; export declare function createPubSubContext(initialState: State, name: string): Readonly<{ Provider: ({ children }: { children: ReactNode; }) => JSX.Element; useStore: { (): State; (selector: (store: State) => SelectorOutput): SelectorOutput; }; useStoreDispatch: { (): (payload: Partial extends infer T ? T extends Partial ? T extends Function ? never : T | ((previousValue: T) => T) : never : never) => void; (key: Key): (payload: State[Key] extends infer T_1 ? T_1 extends State[Key] ? T_1 extends Function ? never : T_1 | ((previousValue: T_1) => T_1) : never : never) => void; }; getState: () => State; setState: { (state: Partial extends infer T ? T extends Partial ? T extends Function ? never : T | ((previousValue: T) => T) : never : never): void; (key: Key_1, property: State[Key_1] extends infer T_2 ? T_2 extends State[Key_1] ? T_2 extends Function ? never : T_2 | ((previousValue: T_2) => T_2) : never : never): void; }; subscribe(callback: (state: State) => void): () => boolean; }>;