import { A as AsyncUpdateFunction, B as Selector, C as Value, F as ConnectionActions, G as Use, H as Update, I as DisposableCancel, L as Duration, M as CalculationActions, N as Cancel, O as Constrain, P as Connection, R as Effect, S as SettableValue, U as UpdateFrom, V as SubscribeOptions, W as UpdateFunction, _ as PathAsArray, a as StoreOptions, b as SettablePathAsArray, c as arrayMethods, d as setMethods, g as Path, i as StoreMethods, j as BaseConnectionActions, k as AsyncConnectionActions, l as mapMethods, o as StoreOptionsWithMethods, r as Store, s as createStore, t as BoundStoreMethods, u as recordMethods, v as PathAsString, x as SettablePathAsString, y as SettablePath, z as Listener } from "./store-dThvqc0k.cjs"; import { _ as createResourceGroup, a as CacheFunction, c as CreateCacheResult, d as ErrorState, f as PendingState, g as allResources, h as ResourceGroup, i as CacheBundle, l as createCache, m as Resource, n as createScope, o as CacheGetOptions, p as ValueState, r as Cache, s as CacheOptions, t as Scope, u as CacheState } from "./scope-BQjncWGt.cjs"; import { n as Patch, r as diff } from "./diff-BzE2cDaU.cjs"; 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-CoSWtRt0.cjs"; //#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): T; //#endregion //#region src/lib/updateHelpers.d.ts declare function findOrDefault(array: T[], predicate: (item: T) => boolean, defaultValue: T | (() => T)): T; //#endregion export { type AsyncConnectionActions, type AsyncUpdateFunction, type BaseConnectionActions, type BoundStoreMethods, Cache, type CacheBundle, type CacheFunction, type CacheGetOptions, type CacheOptions, CacheState, type CalculationActions, type Cancel, type Connection, type ConnectionActions, type CreateCacheResult, type DisposableCancel, type Duration, type Effect, ErrorState, type FetchNextPageOptions, type Hashable, InstanceCache, type Listener, type PageCacheFunction, type PageCacheFunctionProps, PagedCache, type PagedCacheDefinition, type PagedCacheDefinitionFunction, type PagedCacheState, type Patch, type Path, type PathAsArray, type PathAsString, PendingState, type Persist, type PersistOptions, type PersistStorage, type PersistStorageBase, type PersistStorageWithKeys, type PersistStorageWithLength, type PersistStorageWithListItems, type Resource, ResourceGroup, Scope, type Selector, type SettablePath, type SettablePathAsArray, type SettablePathAsString, Store, type StoreMethods, type StoreOptions, type StoreOptionsWithMethods, type SubscribeOptions, type Update, type UpdateFrom, type UpdateFunction, type 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.cts.map