type AnyFunction = (...args: any[]) => any; type Path = (string | symbol)[]; type Op = [op: 'set', path: Path, value: unknown, prevValue: unknown] | [op: 'delete', path: Path, prevValue: unknown] | [op: 'resolve', path: Path, value: unknown] | [op: 'reject', path: Path, error: unknown]; type Listener = (op: Op, nextVersion: number) => void; type Primitive = string | number | boolean | null | undefined | symbol | bigint; 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 ? Awaited : 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) => Awaited

; type CreateSnapshot = (target: T, version: number, handlePromise?: HandlePromise) => T; type RemoveListener = () => void; type AddListener = (listener: Listener) => RemoveListener; type ProxyState = readonly [ target: object, ensureVersion: (nextCheckVersion?: number) => number, createSnapshot: CreateSnapshot, addListener: AddListener ]; 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: (objectIs?: (value1: any, value2: any) => boolean, newProxy?: (target: T, handler: ProxyHandler) => T, canProxy?: (x: unknown) => boolean, defaultHandlePromise?:

>(promise: P & { status?: 'pending' | 'fulfilled' | 'rejected'; value?: Awaited

; reason?: unknown; }) => Awaited

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

>(promise: P & { status?: 'pending' | 'fulfilled' | 'rejected'; value?: Awaited

; reason?: unknown; }) => Awaited

, WeakMap, CreateSnapshot, WeakMap, [number, number]]; export {};