(key: string | (() => CommandOption[]), cb?: () => CommandOption[])
| 399 | function register(cb: () => CommandOption[]): void |
| 400 | function register(key: string, cb: () => CommandOption[]): void |
| 401 | function register(key: string | (() => CommandOption[]), cb?: () => CommandOption[]) { |
| 402 | const id = typeof key === "string" ? key : undefined |
| 403 | const next = typeof key === "function" ? key : cb |
| 404 | if (!next) return |
| 405 | const options = createMemo(next) |
| 406 | const entry: CommandRegistration = { |
| 407 | key: id, |
| 408 | options, |
| 409 | } |
| 410 | setStore("registrations", (arr) => upsertCommandRegistration(arr, entry)) |
| 411 | onCleanup(() => { |
| 412 | setStore("registrations", (arr) => arr.filter((x) => x !== entry)) |
| 413 | }) |
| 414 | } |
| 415 | |
| 416 | const keybindConfig = (id: string) => { |
| 417 | if (id === PALETTE_ID) return settings.keybinds.get(PALETTE_ID) ?? DEFAULT_PALETTE_KEYBIND |
nothing calls this directly
no test coverage detected