import type { StorageEventListener } from "./StorageEvent"; export type RefValue = { k: string; v: TValue; __isRef: true }; export type ExtractRawValue = TValue extends RefValue ? TRefValue : TValue; export type AutoRefValue = RefValue>; export type MaybeRefValue = TValue | AutoRefValue; export type DiffOne = { oldValue?: T; newValue?: T }; export type Diff = { [K in keyof T]?: DiffOne }; export type StorageOnSetStatePayload = { [K in keyof TState]?: MaybeRefValue; }; export type StorageStateChangedEvent = Diff; export type StorageStateChangedListener = StorageEventListener< StorageStateChangedEvent >; export type StorageStateChangedListenerDisposer = () => void;