import type { AtomType, SuperAtomType } from "../Mutables/atom/atom"; type Updater = (prev: T) => T; type UpdateFn = (draft: T) => void; /** * Atom whose public `set`/`update` navigate via `navigateTo`. * * Second argument is `replace` (passed through to `navigateTo`), not atom * `silently`. Use `originalSet` / `originalUpdate` for direct writes. */ export type NavigableAtomType = Omit, "set" | "update"> & { /** Navigate when the value changes. `replace` is forwarded to `navigateTo`. */ set(value: T | Updater, replace?: boolean): void; /** Navigate when the draft differs. `replace` is forwarded to `navigateTo`. */ update(fn: UpdateFn, replace?: boolean): void; /** Bypass navigateTo — used by navigateTo / popstate / internal sync. */ originalSet(value: T | Updater, silently?: boolean): void; /** Bypass navigateTo — used for internal in-place sync only. */ originalUpdate(fn: UpdateFn, silently?: boolean): void; }; export type NavigableSuperAtomType = SuperAtomType & NavigableAtomType; /** * Serialize a plain object to a query/hash param string (no `?` / `#` prefix). * Objects are JSON-encoded; `null` / `undefined` values are skipped. */ export declare function recordToSearchParams(obj: Record): string; /** * Convert a query object to a search string including `?`. * Empty / all-null objects return `""`. * * @example * qsObjToString({ tab: "bio", n: 2 }) // "?tab=bio&n=2" * qsObjToString({}) // "" */ export declare function qsObjToString(obj: Record): string; /** * Convert a hash object to a hash string including `#`. * Empty / all-null objects return `""`. */ export declare function hashObjToString(obj: Record): string; /** Shallow equality for string-valued param records. */ export declare function shallowEqualRecords(a: Record, b: Record): boolean; /** Content equality for qs/hash objects (key order independent). */ export declare function recordContentEqual(a: Record, b: Record): boolean; /** * Stash the current `set`/`update` as `originalSet`/`originalUpdate` once. * Safe to call multiple times. */ export declare function attachOriginalMutators(atom: AtomType | NavigableAtomType): NavigableAtomType; /** * Replace public `set`/`update` so they call `onNavigate(next, replace)` when * the value actually changes. `originalSet` / `originalUpdate` keep writing * the atom directly (used by `navigateTo`, popstate, and computed sync). * * @param defaultReplace - Used when callers omit the second argument. * `pathAtom` defaults to `false` (push); `qsAtom` / `hashAtom` / * `paramsAtom` default to `true` (replace). */ export declare function wireAtomToNavigate(atom: NavigableAtomType, onNavigate: (next: T, replace: boolean) => void, equals?: (a: T, b: T) => boolean, defaultReplace?: boolean): void; export {}; //# sourceMappingURL=navigableAtom.d.ts.map