import { QueryStoreConfig } from '../queryStore/types'; import { SyncEngine } from '../sync/types'; import { AsyncStorageInterface, SyncStorageInterface } from '../types'; import { NonFunction } from '../types/functions'; import { Prettify } from '../types/objects'; import { Logger } from './logger'; /** * Global configuration for all stores. */ export type StoresConfig = { /** * Custom logger for debug output. Defaults to a no-op logger in production. */ logger: Logger; /** * Default options used by all query stores. */ queryStoreDefaults: QueryStoreDefaults; /** * Storage backend for persisted stores. Defaults to `localStorage` in browsers, * MMKV in React Native. */ storage: AsyncStorageInterface | SyncStorageInterface; /** * Prefix for storage keys built by the default storage adapter. * Should include a delimiter, e.g., `'myapp:'`. * @default 'stores:' */ storageKeyPrefix: string; /** * Sync engine for cross-client state synchronization. Defaults to cross-tab sync * in browsers, no-op in other environments. */ syncEngine: SyncEngine; }; export type QueryStoreDefaults = Prettify>, 'disableCache' | 'enabled' | 'params', 'retryDelay'>> & { /** * Minimum stale time for auto-refetching query stores under which to log warnings in development. * `false` disables warnings. * @default false */ minStaleTime?: number | false; }; type ConfigDefaults = Omit<{ [K in keyof C as K extends AllowedFunctions ? K : NonFunction extends undefined ? never : K]?: K extends AllowedFunctions ? C[K] : NonFunction; }, Excluded>; /** * Configures global defaults for all stores. * * If used, must be called before creating any stores. * * @see {@link StoresConfig} * * @example * ```ts * configureStores({ * logger: { debug: console.debug, error: console.error }, * storageKeyPrefix: 'myapp:', * }); * ``` */ export declare function configureStores(config: Partial): void; export {}; //# sourceMappingURL=config.d.ts.map