import type { MaybeGetter } from "./types"; type EqualityCheck = boolean | ((prev: T, next: T) => boolean); type SyncedArgsBase = { onChange?: (value: T) => void; /** * Optional equality check function. If this is set to true, * the `===` operator will be used. * * If it's a function and returns true, no changes will occur. */ equalityCheck?: EqualityCheck; }; type SyncedArgs = SyncedArgsBase & ({ value: MaybeGetter; defaultValue?: never; } | { value: MaybeGetter; defaultValue: T; }); /** * Setting `current` calls the `onChange` callback with the new value. * * If the value arg is static, it will be used as the default value, * and subsequent sets will set an internal state that gets read as `current`. * * Otherwise, if it is a getter, it will be called every time `current` is read, * and no internal state is used. */ export declare class Synced { #private; constructor({ value, onChange, ...args }: SyncedArgs); get current(): T; set current(value: T); } export {};