type AnyFunction = (...args: any[]) => any; type OpValue = unknown; type OpPrevValue = unknown; type OpError = unknown; type Path = (string | symbol)[]; type Op = ['set', Path, OpValue, OpPrevValue] | ['delete', Path, OpPrevValue] | ['resolve', Path, OpValue] | ['reject', Path, OpError]; type Listener = (op: Op, nextVersion: number) => void; type Primitive = string | number | boolean | null | undefined | symbol | bigint; type AwaitedPolyfill = T extends PromiseLike ? U : T; type SnapshotIgnore = Date | Map | Set | WeakMap | WeakSet | Error | RegExp | AnyFunction | Primitive; type Snapshot = T extends { $$valtioSnapshot: infer S; } ? S : T extends SnapshotIgnore ? T : T extends Promise ? AwaitedPolyfill : T extends object ? { readonly [K in keyof T]: Snapshot; } : T; /** * This is not a public API. * It can be changed without any notice. */ export type INTERNAL_Snapshot = Snapshot; type HandlePromise =

>(promise: P) => AwaitedPolyfill

; type CreateSnapshot = (target: T, version: number, handlePromise?: HandlePromise) => T; type RemoveListener = () => void; type AddListener = (listener: Listener) => RemoveListener; type ProxyStateTarget = object; type ProxyStateEnsureVersion = (nextCheckVersion?: number) => number; type ProxyStateCreateSnapshot = CreateSnapshot; type ProxyStateAddListener = AddListener; type ProxyState = readonly [ProxyStateTarget, ProxyStateEnsureVersion, ProxyStateCreateSnapshot, ProxyStateAddListener]; declare function buildProxyFunction(objectIs?: (value1: any, value2: any) => boolean, newProxy?: (target: T, handler: ProxyHandler) => T, canProxy?: (x: unknown) => boolean, defaultHandlePromise?:

>(promise: P & { status?: "pending" | "fulfilled" | "rejected"; value?: AwaitedPolyfill

; reason?: unknown; }) => AwaitedPolyfill

, snapCache?: WeakMap, createSnapshot?: (target: T, version: number, handlePromise?: HandlePromise) => T, proxyCache?: WeakMap, versionHolder?: [number, number], proxyFunction?: (initialObject: T) => T): readonly [(initialObject: T) => T, WeakMap, WeakSet, (value1: any, value2: any) => boolean, (target: T, handler: ProxyHandler) => T, (x: unknown) => boolean,

>(promise: P & { status?: "pending" | "fulfilled" | "rejected"; value?: AwaitedPolyfill

; reason?: unknown; }) => AwaitedPolyfill

, WeakMap, (target: T, version: number, handlePromise?: HandlePromise) => T, WeakMap, [number, number]]; export declare function proxy(initialObject?: T): T; export declare function getVersion(proxyObject: unknown): number | undefined; export declare function subscribe(proxyObject: T, callback: (ops: Op[]) => void, notifyInSync?: boolean): () => void; export declare function snapshot(proxyObject: T, handlePromise?: HandlePromise): Snapshot; export declare function ref(obj: T): T & { $$valtioSnapshot: T; }; export declare const unstable_buildProxyFunction: typeof buildProxyFunction; export {};