/** * Shared ownership registry for the ambient (no-focus) Cmd/Ctrl+F shortcut. * * Several SuperDoc instances can be mounted on one page, and each registers a * document-level capture listener for the find shortcut. When focus is inside * an instance that instance handles the shortcut, but when focus is on * (fresh page load, clicks on page chrome) every instance would otherwise * consider itself eligible — and `stopPropagation()` cannot suppress sibling * listeners already registered on the same node, so multiple find bars would * open. This registry elects a single ambient owner: the most recently mounted * or interacted-with instance. */ /** * Make `owner` the ambient find-shortcut owner. Call on mount and on user * interaction (pointerdown / focusin inside the instance) so "the SuperDoc the * user last touched" wins the ambient shortcut. */ export declare function claimFindShortcut(owner: unknown): void; /** * Clear ownership if `owner` currently holds it. Call on unmount. */ export declare function releaseFindShortcut(owner: unknown): void; /** * Whether `owner` may handle the ambient (no-focus) find shortcut. With no * claimed owner any instance may handle it (single-instance pages), relying on * the `defaultPrevented` check in {@link shouldHandleFindShortcut} to keep the * shortcut single-fire. */ export declare function ownsAmbientFindShortcut(owner: unknown): boolean; /** * Decide whether one SuperDoc instance's capture listener should handle a * find-shortcut keydown. `defaultPrevented` covers the cross-instance race * directly: the first instance to act marks the event, and sibling capture * listeners on the same node skip it. */ export declare function shouldHandleFindShortcut(event: KeyboardEvent, { focusInside, owner }: { focusInside: boolean; owner: unknown; }): boolean;