import { _ as ValueState, a as CacheFunction, c as CreateCacheResult, d as ResourceGroup, f as allResources, g as PendingState, h as ErrorState, i as CacheBundle, l as createCache, m as CacheState, n as createScope, o as CacheGetOptions, p as createResourceGroup, r as Cache, s as CacheOptions, t as Scope, u as Resource } from "./scope-qdOAlRWQ.js"; import { B as Value, C as Selector, D as UpdateFunction, E as UpdateFrom, F as PathAsString, I as SettablePath, K as Constrain, L as SettablePathAsArray, M as KeyType, N as Path, O as Use, P as PathAsArray, R as SettablePathAsString, S as Listener, T as Update, _ as Connection, a as StoreOptions, b as Duration, c as arrayMethods, d as setMethods, f as AsyncConnectionActions, g as Cancel, h as CalculationActions, i as StoreMethods, l as mapMethods, m as BaseConnectionActions, o as StoreOptionsWithMethods, p as AsyncUpdateFunction, r as Store, s as createStore, t as BoundStoreMethods, u as recordMethods, v as ConnectionActions, w as SubscribeOptions, x as Effect, y as DisposableCancel, z as SettableValue } from "./store-Cq1PqvEo.js"; import { n as Patch, r as diff } from "./diff-CwiTYAVK.js"; import { a as PersistStorageBase, c as PersistStorageWithListItems, i as PersistStorage, n as PersistOptions, o as PersistStorageWithKeys, r as persist, s as PersistStorageWithLength, t as Persist } from "./persist-3Nff6j1f.js"; //#region src/core/pagedCache.d.ts interface PageCacheFunctionProps extends CalculationActions>> { /** * Previously fetched pages (in order). */ pages: T[]; /** * Last fetched page or null if there are no previously fetched pages. */ prevPage: T | null; } interface PageCacheFunction { (props: PageCacheFunctionProps): Promise; } interface PagedCacheDefinition { /** * Function to fetch a page. * The function receives the current state of the cache, including previously fetched pages. */ fetchPage: (this: PagedCache, props: PageCacheFunctionProps) => Promise; /** * Optional function to determine the total number of pages - usually based on data in the fetched pages. */ getPageCount?: (this: PagedCache, pages: T[]) => number | null; /** * Optional function to determine if there are more pages to fetch - usually based on data in the fetched pages. * If not provided, it will be assumed there are more pages until getPageCount is provided and the number of fetched pages equals the page count or until fetchPage returns null. */ hasMorePages?: (this: PagedCache, pages: T[]) => boolean; } interface PagedCacheDefinitionFunction { (...args: Args): PagedCacheDefinition; } interface PagedCacheState { pages: T[]; hasMore: boolean; pageCount: number | null; } interface FetchNextPageOptions { /** * If true, will throw if the cache is in an error state or if another page is being fetched. */ throwOnError?: boolean; } declare class PagedCache extends Cache, Args> { readonly definition: PagedCacheDefinition; constructor(definition: PagedCacheDefinition, args: Args, options?: CacheOptions, Args>); fetchNextPage({ throwOnError }?: FetchNextPageOptions): Promise; } declare function createPaged(definition: PagedCacheDefinitionFunction, options?: CacheOptions, Args>): CreateCacheResult, Args, PagedCache>; declare function createPaged(definition: PagedCacheDefinition, options?: CacheOptions, []>): CreateCacheResult, [], PagedCache>; declare const createPagedCache: typeof createPaged & { defaultOptions: CacheOptions; }; //#endregion //#region src/lib/applyPatches.d.ts declare function applyPatches(target: T, ...patches: Patch[]): T; //#endregion //#region src/lib/duration.d.ts declare function calcDuration(t: Duration): number; //#endregion //#region src/lib/equals.d.ts interface EqualityOptions { /** Treat undefined values as absent * @default false */ undefinedEqualsAbsent?: boolean; } declare function strictEqual(a: any, b: any): boolean; declare function shallowEqual(a: any, b: any, options?: EqualityOptions): boolean; declare function deepEqual(a: any, b: any, options?: EqualityOptions): boolean; //#endregion //#region src/lib/extendedJson.d.ts declare function toExtendedJson(value: unknown): unknown; declare function toExtendedJsonString(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string; declare function toExtendedJsonString(value: any, replacer?: (number | string)[] | null, space?: string | number): string; declare function fromExtendedJson(value: unknown): unknown; declare function fromExtendedJsonString(value: string, reviver?: (this: any, key: string, value: any) => any): unknown; //#endregion //#region src/lib/hash.d.ts interface Hashable { [hash](): string; } declare const hash: unique symbol; declare function simpleHash(value: unknown): string; //#endregion //#region src/lib/instanceCache.d.ts declare class InstanceCache { readonly factory: (...args: Args) => T; readonly cacheTime?: number | undefined; private cache; private interval; constructor(factory: (...args: Args) => T, cacheTime?: number | undefined); cleanup(): void; get(...args: Args): T; getWithKey(args: Args, cacheKey: unknown): T; values(): T[]; stop(): void; stats(): { count: number; withRef: number; withWeakRef: number; }; private now; } //#endregion //#region src/lib/propAccess.d.ts declare function get(object: T, path: Constrain>): Value; declare function set(object: T, path: Constrain>, value: SettableValue, rootPath?: string | readonly KeyType[]): T; //#endregion //#region src/lib/updateHelpers.d.ts declare function findOrDefault(array: T[], predicate: (item: T) => boolean, defaultValue: T | (() => T)): T; //#endregion export { AsyncConnectionActions, AsyncUpdateFunction, BaseConnectionActions, BoundStoreMethods, Cache, CacheBundle, CacheFunction, CacheGetOptions, CacheOptions, CacheState, CalculationActions, Cancel, Connection, ConnectionActions, CreateCacheResult, DisposableCancel, Duration, Effect, ErrorState, FetchNextPageOptions, type Hashable, InstanceCache, Listener, PageCacheFunction, PageCacheFunctionProps, PagedCache, PagedCacheDefinition, PagedCacheDefinitionFunction, PagedCacheState, type Patch, type Path, type PathAsArray, type PathAsString, PendingState, Persist, PersistOptions, PersistStorage, PersistStorageBase, PersistStorageWithKeys, PersistStorageWithLength, PersistStorageWithListItems, Resource, ResourceGroup, Scope, Selector, type SettablePath, type SettablePathAsArray, type SettablePathAsString, Store, StoreMethods, StoreOptions, StoreOptionsWithMethods, SubscribeOptions, Update, UpdateFrom, UpdateFunction, Use, type Value, ValueState, allResources, applyPatches, arrayMethods, calcDuration, createCache, createPagedCache, createResourceGroup, createScope, createStore, deepEqual, diff, findOrDefault, fromExtendedJson, fromExtendedJsonString, get, hash, mapMethods, persist, recordMethods, set, setMethods, shallowEqual, simpleHash, strictEqual, toExtendedJson, toExtendedJsonString }; //# sourceMappingURL=index.d.ts.map