UNPKG

@sandstack/neuron

Version:

Neuron is a lightweight framework agnostic global state manager for Javascript apps, with React support

32 lines (31 loc) 1.31 kB
import { ReactNode } from "react"; import { ClientName, INeuronClient, NeuronClient, NeuronOptions, IModule } from "../core"; import { Actions, StateOrSlice } from "./usePrivateSubscriber"; export declare class PrivateNeuronClient implements IPrivateNeuronClient { private clientContext; private modules; readonly privateNeuron: <T, A = unknown>(initialState: T, options?: NeuronOptions<T, A> | undefined) => [(client: INeuronClient) => void, <S>(slice?: ((state: T) => S) | undefined) => [StateOrSlice<S, T>, Actions<T, S, A>]]; readonly useNeuronClient: (options?: { name?: ClientName; }) => { client: NeuronClient; Private: ({ children }: PrivateProps) => import("react/jsx-runtime").JSX.Element; }; constructor(options?: ClientOptions); } interface IPrivateNeuronClient { privateNeuron: <T, A>(initialState: T, options?: NeuronOptions<T, A>) => (((client: INeuronClient) => void) | (<S>(slice?: (state: T) => S) => [StateOrSlice<S, T>, Actions<T, S, A>]))[]; useNeuronClient: (options?: { name?: ClientName; }) => { client: NeuronClient; Private: ({ children }: PrivateProps) => JSX.Element; }; } interface ClientOptions { modules?: IModule[]; } interface PrivateProps { children?: ReactNode; } export {};