示例工程 21-keyboard-focus-a11y

21-keyboard-focus-a11y/app/.tsc/src/lib/shortcuts.d.ts

typescript · 1.0 KB

export type Scope = "global" | "dialog" | "input";
export type KeyLike = {
    key: string;
    metaKey?: boolean;
    ctrlKey?: boolean;
    altKey?: boolean;
    shiftKey?: boolean;
    isComposing?: boolean;
};
export type Binding = {
    id: string;
    title: string;
    combo: string;
    scope: Scope;
    enabled: boolean;
};
export type Context = "app" | "dialog" | "input";
export declare function normalizeKey(key: string): string;
export declare function normalizeCombo(input: KeyLike): string;
export declare function formatCombo(combo: string): string;
export declare function findBinding(bindings: Binding[], combo: string, context: Context): Binding | undefined;
export type Conflict = {
    combo: string;
    scope: Scope;
    ids: string[];
};
export declare function findConflicts(bindings: Binding[]): Conflict[];
export declare function allowsInInput(combo: string): boolean;
export declare function isEditable(target: EventTarget | null): boolean;
//# sourceMappingURL=shortcuts.d.ts.map