Skip to content

zidane-ui/keybindings/testing

import { … } from 'zidane-ui/keybindings/testing'ui/src/keybindings/testing/index.ts

Functions#

createFixtureKeybindingsHostFunction#

Creates a KeybindingsHost held in memory.

TypeScript
function createFixtureKeybindingsHost(
  options?: FixtureKeybindingsOptions,
): FixtureKeybindingsHost
Parameters
NameTypeDefaultDescription
options?FixtureKeybindingsOptions{}

The stored overrides, and whether they can be saved.

ui/src/keybindings/headless/fixture-host.ts:31

Interfaces#

FixtureKeybindingsControlInterface#

Changes the stored overrides from outside.

TypeScript
interface FixtureKeybindingsControl
FixtureKeybindingsControl properties
NameTypeDescription
store(overrides: Readonly<Record<string, string>>) => void

The file changed on disk (the next refresh reads it).

stored() => Readonly<Record<string, string>>

The stored map now.

ui/src/keybindings/headless/fixture-host.ts:16

FixtureKeybindingsOptionsInterface#

Options of createFixtureKeybindingsHost.

TypeScript
interface FixtureKeybindingsOptions
FixtureKeybindingsOptions properties
NameTypeDescription
editable?boolean

Offer save. Default: true.

overrides?Readonly<Record<string, string>>

The stored overrides (action → spec; unknown actions are dropped on read). Default: none.

ui/src/keybindings/headless/fixture-host.ts:8

Types#

FixtureKeybindingsHostType#

An in-memory KeybindingsHost and its control.

TypeScript
type FixtureKeybindingsHost = KeybindingsHost & { control: FixtureKeybindingsControl }

ui/src/keybindings/headless/fixture-host.ts:24