preline
Version:
Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.
43 lines (40 loc) • 1.16 kB
text/typescript
export interface IAccessibilityKeyboardHandlers {
onEnter?: (evt: KeyboardEvent) => boolean | void;
onEsc?: () => boolean | void;
onSpace?: () => boolean | void;
onArrow?: (event: KeyboardEvent) => void;
onTab?: (event: KeyboardEvent) => void;
onShiftTab?: (event: KeyboardEvent) => void;
onHome?: () => boolean | void;
onEnd?: () => boolean | void;
onFirstLetter?: (key: string) => void;
[key: string]: ((...args: any[]) => boolean | void) | undefined;
}
export interface IAccessibilityComponent {
wrapper: HTMLElement;
handlers: IAccessibilityKeyboardHandlers;
isOpened: boolean;
name: string;
selector: string;
context?: HTMLElement;
isRegistered: boolean;
stopPropagation?: {
[key: string]: boolean;
};
}
export interface HSAccessibilityObserver {
registerComponent(
wrapper: HTMLElement,
handlers: IAccessibilityKeyboardHandlers,
isActive?: boolean,
name?: string,
selector?: string,
context?: HTMLElement,
stopPropagation?: {
[key: string]: boolean;
},
): IAccessibilityComponent;
addAllowedKeybinding(key: string): void;
removeAllowedKeybinding(key: string): void;
getAllowedKeybindings(): string[];
}