mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
30 lines
1.5 KiB
TypeScript
30 lines
1.5 KiB
TypeScript
import { TransitionState } from "../../core/ui/transition.js";
|
|
import { TransitionApi } from "./transition.js";
|
|
import { State } from "@videojs/store";
|
|
//#region src/dom/ui/dismiss-layer.d.ts
|
|
interface DismissLayerOptions {
|
|
/** Transition API for animated open/close. */
|
|
transition: TransitionApi;
|
|
/** Whether pressing Escape closes the layer. Defaults to `() => true`. */
|
|
closeOnEscape?: (() => boolean) | undefined;
|
|
/** Called when Escape should trigger a close. */
|
|
onEscapeDismiss: (event: KeyboardEvent) => void;
|
|
/** Register additional document listeners when the layer becomes active. Cleaned up via signal when inactive. */
|
|
onDocumentActive?: (signal: AbortSignal) => void;
|
|
}
|
|
interface DismissLayerApi {
|
|
/** Reactive transition state for platforms to subscribe to. */
|
|
input: State<TransitionState>;
|
|
/** Start the open transition. Returns animation promise, or `null` if already open or destroyed. */
|
|
open(): Promise<void> | null;
|
|
/** Start the close transition. Returns animation promise, or `null` if already closed or destroyed. */
|
|
close(element: HTMLElement | null): Promise<void> | null;
|
|
/** Lifecycle signal. Aborted on destroy. */
|
|
signal: AbortSignal;
|
|
/** Tear down transition, listeners, and subscriptions. */
|
|
destroy(): void;
|
|
}
|
|
declare function createDismissLayer(options: DismissLayerOptions): DismissLayerApi;
|
|
//#endregion
|
|
export { DismissLayerApi, DismissLayerOptions, createDismissLayer };
|
|
//# sourceMappingURL=dismiss-layer.d.ts.map
|