function / @typed/ui/Dom

toggleState

Reads the standards-based ToggleEvent.newState value when present.

Learn this UI primitive →

Package version
1.0.0-beta.13
Category
Event inspection
Since
1.0.0

Import

import { toggleState } from "@typed/ui/Dom";

This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.

Signatures

export declare function toggleState(event: Event): "open" | "closed" | undefined;

Why

Popover and details components can follow the browser’s real toggle event while remaining usable with DOM libraries whose Event types lag the platform.

Ownership and lifetime

Pure read of the current event; no state or listener is retained.

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source