From 53c367420cac82f7c5baba55bad29432f77a9633 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sun, 15 Feb 2026 11:21:38 -0800 Subject: [PATCH] Align web keybinding types with shared contract aliases - Reuse `KeybindingRule` and `KeybindingsConfig` directly for resolved keybinding types - Update normalization helper to accept `KeybindingRule` for consistent typing --- apps/web/src/keybindings.ts | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/apps/web/src/keybindings.ts b/apps/web/src/keybindings.ts index c876f8bc81c56fa46448db2fbd6387117e993b9b..1a6d7b4886abfb1e036418a2251dab8347146b50 100644 --- a/apps/web/src/keybindings.ts +++ b/apps/web/src/keybindings.ts @@ -1,4 +1,4 @@ -import type { KeybindingCommand, KeybindingsConfig } from "@t3tools/contracts"; +import type { KeybindingCommand, KeybindingRule, KeybindingsConfig } from "@t3tools/contracts"; export interface ShortcutEventLike { key: string; @@ -14,13 +14,8 @@ export interface ShortcutMatchContext { [key: string]: boolean; } -export interface ResolvedTerminalKeybinding { - key: string; - command: KeybindingCommand; - when?: string | undefined; -} - -export type ResolvedTerminalKeybindings = ResolvedTerminalKeybinding[]; +export type ResolvedTerminalKeybinding = KeybindingRule; +export type ResolvedTerminalKeybindings = KeybindingsConfig; export const DEFAULT_TERMINAL_KEYBINDINGS: ResolvedTerminalKeybindings = [ { key: "mod+j", command: "terminal.toggle" }, @@ -312,7 +307,7 @@ function resolveContext(options: ShortcutMatchOptions | undefined): ShortcutMatc } function normalizeConfiguredKeybinding( - keybinding: KeybindingsConfig[number], + keybinding: KeybindingRule, ): ResolvedTerminalKeybinding | null { const key = keybinding.key.trim(); if (key.length === 0) return null; -- 2.54.0