Index

Type aliases

HintBuilder

HintBuilder: function

Type declaration

HintFilter

HintFilter: function

Type declaration

    • (string: any): void
    • Parameters

      • string: any

      Returns void

HintSaveType

HintSaveType: "link" | "img"

Type for "hint save" actions:

  • "link": elements that point to another resource (eg
        links to pages/files) - the link target is saved
    
  • "img": image elements

HintSelectedCallback

HintSelectedCallback: function

Type declaration

    • (Hint: any): any
    • Parameters

      • Hint: any

      Returns any

Variables

logger

logger: Logger = new Logger("hinting")

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

hintFocus

  • hintFocus(selectors?: any): void
  • Hint elements to focus

    Parameters

    • Optional selectors: any

    Returns void

hintImage

  • hintImage(inBackground: any): void
  • Hint images, opening in the same tab, or in a background tab

    Parameters

    • inBackground: any

      opens the image source URL in a background tab, as opposed to the current tab

    Returns void

hintKill

  • hintKill(): void
  • Hint elements and delete the selection from the page

    Returns void

hintPage

hintPageWindow

  • hintPageWindow(): void

hintPageWindowPrivate

  • hintPageWindowPrivate(): void

hintRead

  • hintRead(): void
  • Hint items and read out the content of the selection

    Returns void

hintSave

  • Hint link elements to save

    Parameters

    • hintType: HintSaveType

      the type of elements to hint and save:

                       - "link": elements that point to another resource (eg
                         links to pages/files) - the link targer is saved
                       - "img": image elements
      
    • saveAs: boolean

      prompt for save location

    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 - h2 - 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[]

pipe

  • pipe(selectors?: string): Promise<[any, number]>
  • Parameters

    • Default value selectors: string = DOM.HINTTAGS_selectors

    Returns Promise<[any, number]>

pipe_elements

  • pipe_elements(elements?: any): Promise<any>
  • Parameters

    • Default value elements: any = DOM.elementsWithText

    Returns Promise<any>

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(): void