Index

Type aliases

HintBuilder

HintBuilder: function

Type declaration

HintFilter

HintFilter: function

Type declaration

    • (string: any): void
    • Parameters

      • string: any

      Returns void

HintSelectedCallback

HintSelectedCallback: function

Type declaration

    • (Hint: any): any
    • Parameters

      • Hint: any

      Returns any

Variables

Const logger

logger: Logger = new Logger("hinting")

Let modeState

modeState: HintState = undefined

Functions

buildHintsSimple

buildHintsVimperator

defaultHintBuilder

defaultHintChars

  • defaultHintChars(): any

defaultHintFilter

elementFilterableText

  • elementFilterableText(el: Element): string

filterHintsSimple

  • filterHintsSimple(fstr: any): void
  • Show only hints prefixed by fstr. Focus first match

    Parameters

    • fstr: any

    Returns void

filterHintsVimperator

  • filterHintsVimperator(fstr: any, reflow?: boolean): void
  • Partition the filter string into hintchars and content filter strings. Apply each part in sequence, reducing the list of active hints.

    Update display after all filtering, adjusting labels if appropriate.

    Consider: This is a poster child for separating data and display. If they weren't so tied here we could do a neat dynamic programming thing and just throw the data at a reactalike.

    Parameters

    • fstr: any
    • Default value reflow: boolean = false

    Returns void

hintPage

  • hintPage(hintableElements: Element[], onSelect: HintSelectedCallback, resolve?: (Anonymous function), reject?: (Anonymous function), rapid?: boolean): void
  • For each hintable element, add a hint

    Parameters

    • hintableElements: Element[]
    • onSelect: HintSelectedCallback
    • Default value resolve: (Anonymous function) = () => {}
    • Default value reject: (Anonymous function) = () => {}
    • Default value rapid: boolean = false

    Returns void

hintableImages

  • hintableImages(): Element[]

hintables

  • hintables(selectors?: string, withjs?: boolean): Element[]
  • Array of hintable elements in viewport

    Elements are hintable if

    1. they can be meaningfully selected, clicked, etc
    2. they're visible
    3. Within viewport
    4. Not hidden by another element

    Parameters

    • Default value selectors: string = DOM.HINTTAGS_selectors
    • Default value withjs: boolean = false

    Returns Element[]

hintnames

  • hintnames(n: number, hintchars?: any): IterableIterator<string>
  • Parameters

    • n: number
    • Default value hintchars: any = defaultHintChars()

    Returns IterableIterator<string>

hintnames_numeric

  • hintnames_numeric(n: number): IterableIterator<string>

hintnames_short

  • hintnames_short(n: number, hintchars?: any): IterableIterator<string>
  • Shorter hints

    Hints that are prefixes of other hints are a bit annoying because you have to select them with Enter or Space.

    This function removes hints that prefix other hints by observing that: let h = hintchars.length if n < h ** 2 then n / h = number of single character hintnames that would prefix later hints

    So it removes them. This function is not yet clever enough to realise that if n > h ** 2 it should remove h + (n - h*2 - h) / h * 2 and so on, but we hardly ever see that many hints, so whatever.

    Parameters

    • n: number
    • Default value hintchars: any = defaultHintChars()

    Returns IterableIterator<string>

hintnames_simple

  • hintnames_simple(hintchars?: any): IterableIterator<string>
  • An infinite stream of hints

    Earlier hints prefix later hints

    Parameters

    • Default value hintchars: any = defaultHintChars()

    Returns IterableIterator<string>

hintnames_uniform

  • hintnames_uniform(n: number, hintchars?: any): IterableIterator<string>
  • Uniform length hintnames

    Parameters

    • n: number
    • Default value hintchars: any = defaultHintChars()

    Returns IterableIterator<string>

killables

  • killables(): Element[]
  • Array of items that can be killed with hint kill

    Returns Element[]

parser

  • parser(keys: KeyboardEvent[]): object
  • Parameters

    • keys: KeyboardEvent[]

    Returns object

    • ex_str: string
    • isMatch: boolean
    • keys: undefined[]

pipe

  • pipe(selectors?: string, action?: HintSelectedCallback, rapid?: boolean): Promise<[Element, number]>
  • Parameters

    • Default value selectors: string = DOM.HINTTAGS_selectors
    • Default value action: HintSelectedCallback = _ => _
    • Default value rapid: boolean = false

    Returns Promise<[Element, number]>

pipe_elements

  • pipe_elements(elements?: any, action?: HintSelectedCallback, rapid?: boolean): Promise<[Element, number]>
  • Parameters

    • Default value elements: any = DOM.elementsWithText
    • Default value action: HintSelectedCallback = _ => _
    • Default value rapid: boolean = false

    Returns Promise<[Element, number]>

pushKey

  • pushKey(ke: any): void
  • If key is in hintchars, add it to filtstr and filter

    Parameters

    • ke: any

    Returns void

reset

  • reset(): void

saveableElements

  • saveableElements(): Element[]
  • Returns elements that point to a saveable resource

    Returns Element[]

selectFocusedHint

  • selectFocusedHint(delay?: boolean): void
  • Parameters

    • Default value delay: boolean = false

    Returns void