import { setStyle as setStyleImpl, type AnimateOptions, type AnimateTargets, type AnimationTarget } from '../dom/animate'; import type { AnimationHandle } from '../value/animatable'; import { type StaggerOptions } from './composition'; import { type ResponsiveSetup } from './responsive'; import type { DelayFn } from './stagger-delay'; /** * A teardown boundary: everything created through it is collected, and a single * `revert()` undoes it all - stops the animations, removes the media listeners, * runs the registered disposers (LIFO), and releases the inline styles back to * computed. Named `region` (not `scope`) to avoid the `AnimateOptions.scope` * callback-receiver field. This is the mount/unmount seam a framework adapter * sits on. Collection is EXPLICIT (call the region's methods) - never ambient, * so it cannot silently miss or capture an unrelated animation. */ export interface Region { /** Scope-bound animate(): auto-stopped and its elements released on revert. */ animate(target: AnimationTarget, targets: AnimateTargets, options?: AnimateOptions): AnimationHandle; /** Scope-bound stagger(): the aggregate is auto-stopped on revert. */ /** * Scope-bound stagger(): the aggregate is auto-stopped on revert. Note: styles * set INSIDE the item animations are NOT released (the items are opaque) - use * region.animate() per item if you need the styles reverted to computed. */ stagger(items: readonly T[], animation: (item: T, index: number) => AnimationHandle, delay?: number | DelayFn, options?: StaggerOptions): AnimationHandle; /** Scope-bound responsive(): its unsubscribe is auto-run on revert. */ responsive(query: string | { reducedMotion: boolean; }, setup: ResponsiveSetup): () => void; /** Scope-bound setStyle(): the touched element is released on revert. */ setStyle(...args: Parameters): void; /** Register any disposer (a gesture/interactive handle's dispose, a raw cleanup). Returns it unchanged. */ add void>(cleanup: T): T; /** Register an externally created handle so its stop() runs on revert. Returns it unchanged. */ track(handle: AnimationHandle): AnimationHandle; /** Tear everything down, LIFO, then release touched styles. Idempotent. */ revert(): void; } export declare function region(setup?: (region: Region) => void): Region; //# sourceMappingURL=region.d.ts.map