import { ReactiveSignal, ReactiveDefinition } from './reactive.js'; import { Context } from '../types.js'; /** * Install or clear an optional source for a per-request (or per-environment) {@link SignalScope} * consulted by {@link getCurrentScope} after `CURRENT_SCOPE` and the reactive consumer's scope, * but before the definition-time fallback. Pass `undefined` to restore default behavior. * * React Server Components: use `setupRscRequestScope()` from `signalium/react/server` instead of * calling this directly. */ export declare function setRequestScopeGetter(get: (() => SignalScope | undefined) | undefined): void; export type ContextPair = { [K in keyof T]: [Context, NoInfer]; }; export declare class ContextImpl { readonly defaultValue: T; _key: symbol; _description: string; constructor(defaultValue: T, desc?: string); } export declare const context: (initialValue: T, description?: string) => Context; export declare function withContexts(contexts: [...ContextPair], fn: () => U): U; export declare const getContext: (context: Context) => T; export declare class SignalScope { private parentScope?; constructor(contexts: [ContextImpl, unknown][], parent?: SignalScope); private contexts; private children; private signals; setContexts(contexts: [ContextImpl, unknown][]): void; getChild(contexts: [ContextImpl, unknown][]): SignalScope; getContext(_context: Context): T | undefined; get(def: ReactiveDefinition, args: Args): ReactiveSignal; } export declare const getGlobalScope: () => SignalScope; export declare function setGlobalContexts(contexts: [...ContextPair]): void; export declare const clearGlobalContexts: () => void; export declare const setCurrentScope: (scope: SignalScope | undefined) => void; export declare const getInternalCurrentScope: () => SignalScope | undefined; export declare const getCurrentScope: (fallback?: SignalScope) => SignalScope; export declare const setScopeOwner: (obj: object, ownerObject: object) => void; export declare const getScopeOwner: (obj: object) => SignalScope; export declare function getSignalsMap(scope: SignalScope): Map>>; //# sourceMappingURL=contexts.d.ts.map