import { i as reactGizmo, n as JustReactApp, r as ReactGizmo, t as JustAppRootContext } from "./just_app_context-DDleaL0k.cjs"; import { GizmoIncubator, JustApp } from "@just-web/app"; import React, { Context } from "react"; import { Store, Updater } from "@just-web/states"; //#region src/contexts/create_just_app_context.d.ts /** * Creates a context of a `JustReactApp` to be used in `useJustAppContext()`. * * Typically, you would specify the generic type `App` when callying this function. * * You can also call it and pass the `appIncubator` to infer the generic type `App`. * However, that is not the typical usage. * * @example * ```ts * const App1Context = createJustAppContext() * * function App1Info() { * const app = useContext(App1Context) * // ... * } * ``` */ export declare function createJustAppContext(_appIncubator?: GizmoIncubator): React.Context; //#endregion //#region src/contexts/just_app_provider.d.ts export declare function JustAppProvider>({ value, children }: { value: App; children: React.ReactNode; }): React.JSX.Element; //#endregion //#region src/contexts/store_context.d.ts /** * Creates a `Store`context to be used in `useStoreContext()` * @type T Type of the store value. */ export declare function createStoreContext>(): import("react").Context>; //#endregion //#region src/hooks/use_just_app_context.d.ts export declare function useJustAppContext(context: Context): App; export declare function useJustAppContext(): Exclude; //#endregion //#region src/hooks/use_store.d.ts /** * Use a value in the store for `useState()`. * @param getState a function to get the value to be used in `useState()`. * @param updater optional function to update the store value when the state changes */ export declare function useStore, V>(store: Store, getState: (s: S) => V, updater?: (draft: S, value: V) => ReturnType>): [value: V, setValue: (value: V | ((value: V) => V)) => void]; //#endregion //#region src/hooks/use_store_context.d.ts /** * Uses a store context. * @param reactContext The context created from `createStoreContext()`. * @param getState The function to get a particular value from the store. * @param updateStore Optional. The function to update the store when the returning `setValue()` is called. */ export declare function useStoreContext, V>(reactContext: Context>, getState: (s: S) => V, updateStore?: (draft: S, value: V) => ReturnType>): [value: V, setValue: (value: V | ((value: V) => V)) => void]; //#endregion export { JustAppRootContext, JustReactApp, ReactGizmo, reactGizmo }; //# sourceMappingURL=index.d.cts.map