import { ReactNode } from "react";
import { GlobalContext } from "@pastweb/tools";
//#region src/GlobalContext/types.d.ts
/**
* Installs one or more values into a {@link GlobalContext} provider.
*
* The function receives the keys already available in the local context. It must
* return a plain object whose keys will be merged into that context before
* descendants render.
*
* @param globalContextKeys - Keys currently available in the local provider scope.
* @returns Values to expose through the provider.
*
* @example
* ```tsx
* const installTheme = () => ({ theme: 'dark' });
*
*
*
*
* ```
*/
type Installer = (globalContextKeys: string[]) => Record;
/**
* Props accepted by {@link GlobalContext}.
*/
interface ContextProviderProps {
/** React children rendered inside the provider. */
children: ReactNode;
/**
* Installer or installers that merge values into the local context once,
* before the provider's descendants render.
*/
use?: Installer | Installer[];
/**
* Values merged into the local context on every render. Use this for dynamic
* provider-scoped updates such as route depth or temporary overrides.
*/
update?: Record;
}
//#endregion
export { ContextProviderProps, type GlobalContext, Installer };
//# sourceMappingURL=types.d.ts.map