Files
v10/dist/dev/dom/ui/transition.d.ts

26 lines
1.0 KiB
TypeScript

import { TransitionState } from "../../core/ui/transition.js";
import { State } from "@videojs/store";
//#region src/dom/ui/transition.d.ts
interface TransitionApi {
state: State<TransitionState>;
open(el?: HTMLElement | null): Promise<void>;
close(el: HTMLElement | null): Promise<void>;
cancel(): void;
destroy(): void;
}
/**
* Manages open/close transition lifecycle via `createState`.
*
* **Open:** patches `{ active: true, status: 'starting' }`, then after a
* double-RAF patches `{ status: 'idle' }` so the browser paints the
* initial ("from") state before transitioning. Reopening an active transition
* flushes styles first so CSS transitions can restart.
*
* **Close:** patches `{ status: 'ending' }` (keeping `active: true` so the
* element stays mounted), then after a double-RAF waits for
* `getAnimations()` to settle before patching `{ active: false, status: 'idle' }`.
*/
declare function createTransition(): TransitionApi;
//#endregion
export { TransitionApi, createTransition };
//# sourceMappingURL=transition.d.ts.map