/** * Overrides kept across reloads: the ones marked to persist are saved, per * page path, and put back on the matching elements of the next load. * * Elements are found again by {@link keyOf}. A saved override goes back on * during the element's first update, from a one-shot reactive controller's * `hostUpdate`: after Lit's dev-mode check that no own property shadows a * reactive accessor (the override's accessor would trip it), before * `update` renders, so the first paint already shows it. Elements that had * rendered before the store was installed get theirs at once, at the cost of * a second render. * * A saved override that no longer fits (the property was renamed, or holds * another type now) is refused by the same guards a panel edit goes through, * and reported as dropped. One that finds no element stays waiting, since the * element may come later (a lazy route, a list that loads). * * Nothing is saved until {@link installOverrideStore} hands over a storage: * the dev-server hosts do, with the tab's `sessionStorage`; the browser * extension does not, as a page it visits never asked for its storage to be * written. */ import type { ValueSegment } from '../../../types/inspector.js'; /** sessionStorage key holding the saved overrides, by page path. */ export declare const OVERRIDES_SS_KEY = "lit-devtools-overrides"; type Leaf = string | number | boolean; /** Set an override with the panel's guards; true when it applied. */ export type ApplyOverride = (el: Element, name: string, value: Leaf, keys: ValueSegment[]) => boolean; /** * Start keeping overrides in `into`, and put back the ones saved for this * path. `applyWith` is `setProp`, handed in so this module does not import * the inspector's answers. */ export declare const installOverrideStore: (into: Pick, applyWith: ApplyOverride) => void; /** * Take saved overrides that arrive after install, for a host whose storage * answers asynchronously (the extension's). A path this load has saved to * already keeps what it saved. Elements that rendered before they arrived * get theirs now, at the cost of a second render. */ export declare const loadSaved: (json: string) => void; /** Hear of overrides put back, so the panel can be told. One listener. */ export declare const onRestored: (listener: () => void) => void; /** Whether overrides can be kept here at all. */ export declare const canPersist: () => boolean; /** How many saved overrides for this path wait for an element. */ export declare const waitingCount: () => number; /** * Save the overrides marked to persist, with those still waiting, under this * path. An element no longer in the document has no key to save it under, * and its override goes. */ export declare const saveOverrides: () => void; /** Forget the saved overrides still waiting for an element on this path. */ export declare const forgetWaiting: () => void; export {}; //# sourceMappingURL=override-store.d.ts.map