import { m as CacheState, r as Cache, t as Scope } from "./scope-qdOAlRWQ.js"; import { B as Value, C as Selector, K as Constrain, N as Path, T as Update, r as Store, w as SubscribeOptions } from "./store-Cq1PqvEo.js"; import { Context, ReactNode } from "react"; //#region src/react/useStore.d.ts interface UseStoreOptions extends Omit { /** * If true, the cache content can be consumed but no fetch will be triggered. * @default false */ passive?: boolean; /** * (experimental) If true, the a rerender will only be triggered when a property of the returned value changes that was * actually accessed during the last render. * @default false */ enableTrackingProxy?: boolean; /** * (experimental) If provided, a rerender will be wrapped in a browser view transition. */ withViewTransition?: boolean | ((value: T) => unknown); } interface UseStoreOptionsWithSelector extends UseStoreOptions { /** * Equality function to compare the raw store values before reevaluating the selector. * Can be used to avoid unnecessary selector evaluations. * @default strictEqual */ storeValueEquals?: (newValue: T, oldValue: T) => boolean; } declare function useStore(store: Store, selector: Selector, option?: UseStoreOptionsWithSelector): S; declare function useStore(store: Store, selector: Constrain>, option?: UseStoreOptionsWithSelector>): Value; declare function useStore(store: Store, option?: UseStoreOptions): T; //#endregion //#region src/react/useCache.d.ts type UseCacheArray = [value: T | undefined, error: unknown | undefined, isUpdating: boolean, isStale: boolean]; type UseCacheValue = UseCacheArray & CacheState; interface UseCacheOptions extends UseStoreOptions & CacheState> { /** * If true, will always return undefined as value and no fetch will be triggered. * @default false */ disabled?: boolean; /** * If true, the cache will be invalidated when the component mounts. * @default false */ updateOnMount?: boolean; /** * If true, `useCache` will throw a promise when the cache is pending. This can be used with React Suspense. * @see https://react.dev/reference/react/Suspense * @default false */ suspense?: boolean; /** * If true, `useCache` will register its loading state with the nearest `LoadingBoundary`. * @default false */ loadingBoundary?: boolean; } declare function useCache(cache: Cache, { passive, disabled, updateOnMount, withViewTransition, suspense, loadingBoundary, ...options }?: UseCacheOptions): UseCacheValue; //#endregion //#region src/react/cacheMethods.d.ts declare const cacheMethods: { useCache(this: Cache, options?: UseCacheOptions): UseCacheValue; }; //#endregion //#region src/react/scope.d.ts type ScopeProps = { scope: Scope; store?: Store; children?: ReactNode; }; declare module ".." { interface Scope { context?: Context>; } } declare function ScopeProvider({ scope, store: inputStore, children }: ScopeProps): React.JSX.Element; declare function useScope(scope: Scope): Store; //#endregion //#region src/react/scopeMethods.d.ts declare function boundUseScope(this: Scope): Store; declare function boundUseScopeStore(this: Scope, selector: Selector, option?: UseStoreOptions): S; declare function boundUseScopeStore(this: Scope, selector: Constrain>, option?: UseStoreOptions>): Value; declare function boundUseScopeStore(this: Scope, option?: UseStoreOptions): T; declare function boundUseScopeProp(this: Scope, selector: Selector, updater: (value: S) => Update, options?: UseStoreOptions): [value: S, setValue: Store["set"]]; declare function boundUseScopeProp(this: Scope, selector: Constrain>, options?: UseStoreOptions>): [value: Value, setValue: Store>["set"]]; declare function boundUseScopeProp(this: Scope, options?: UseStoreOptions): [value: T, setValue: Store["set"]]; declare function Provider(this: Scope, props: Omit, "scope">): React.JSX.Element; declare const scopeMethods: { useScope: typeof boundUseScope; useStore: typeof boundUseScopeStore; useProp: typeof boundUseScopeProp; Provider: typeof Provider; }; //#endregion //#region src/react/storeMethods.d.ts declare function boundUseStore(this: Store, selector: Selector, option?: UseStoreOptions): S; declare function boundUseStore(this: Store, selector: Constrain>, option?: UseStoreOptions>): Value; declare function boundUseStore(this: Store, option?: UseStoreOptions): T; declare function boundUseProp(this: Store, selector: Selector, updater: (value: S) => Update, options?: UseStoreOptions): [value: S, setValue: Store["set"]]; declare function boundUseProp(this: Store, selector: Constrain>, options?: UseStoreOptions>): [value: Value, setValue: Store>["set"]]; declare function boundUseProp(this: Store, options?: UseStoreOptions): [value: T, setValue: Store["set"]]; declare const storeMethods: { useStore: typeof boundUseStore; useProp: typeof boundUseProp; }; //#endregion export { useScope as a, UseCacheValue as c, useStore as d, ScopeProvider as i, useCache as l, scopeMethods as n, cacheMethods as o, ScopeProps as r, UseCacheArray as s, storeMethods as t, UseStoreOptions as u }; //# sourceMappingURL=storeMethods-CK9-Q17H.d.ts.map