@nextcloud/vue
Version:
Nextcloud vue components
33 lines (32 loc) • 1.12 kB
TypeScript
import { FocusTrap } from 'focus-trap';
declare global {
interface Window {
_nc_focus_trap: FocusTrap[];
}
}
/**
* Get the default global focus trap stack
*/
export declare function getTrapStack(): FocusTrap[];
/**
* Create controller to pause/unpause the global focus trap stack.
*
* When some component manually implements its own focus-trap without using global focus-trap stack,
* it also needs to pause the global stack to avoid conflict.
*
* Note: if global focus-trap stack was modified outside TrapStackController (likely due to user actions),
* trap queue should be correctly handled by focus-trap itself.
* It is no longer safe to unpause cached `pausedStack`, as it can disrupt the current focus trap state.
* We assume that the focus-trap stack is self-regulated and ignore unpause.
*/
export declare function createTrapStackController(): {
/**
* Pause the current focus-trap stack
*/
pause(): void;
/**
* Unpause the paused focus trap stack
* If the actual stack is different from the paused one, ignore unpause.
*/
unpause(): void;
};