Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConsoleHistory

A console history manager object. A namespace for ConsoleHistory statics.

Hierarchy

  • ConsoleHistory

Implements

Index

Constructors

constructor

Properties

Private _cursor

_cursor: number = 0

Private _editor

_editor: IEditor | null = null

Private _filtered

_filtered: string[] = []

Private _hasSession

_hasSession: boolean = false

Private _history

_history: string[] = []

Private _isDisposed

_isDisposed: boolean = false

Private _placeholder

_placeholder: string = ""

Private _setByHistory

_setByHistory: boolean = false

session

session: IClientSession

The client session used by the foreign handler.

Accessors

editor

  • get editor(): IEditor | null
  • set editor(value: IEditor | null): void
  • The current editor used by the history manager.

    Returns IEditor | null

  • The current editor used by the history manager.

    Parameters

    • value: IEditor | null

    Returns void

isDisposed

  • get isDisposed(): boolean
  • Get whether the console history manager is disposed.

    Returns boolean

placeholder

  • get placeholder(): string
  • The placeholder text that a history session began with.

    Returns string

Methods

Private _handleKernel

  • _handleKernel(): Promise<void>
  • Handle the current kernel changing.

    Returns Promise<void>

back

  • back(placeholder: string): Promise<string>
  • Get the previous item in the console history.

    Parameters

    • placeholder: string

      The placeholder string that gets temporarily added to the history only for the duration of one history session. If multiple placeholders are sent within a session, only the first one is accepted.

    Returns Promise<string>

    A Promise for console command text or undefined if unavailable.

dispose

  • dispose(): void

forward

  • forward(placeholder: string): Promise<string>
  • Get the next item in the console history.

    Parameters

    • placeholder: string

      The placeholder string that gets temporarily added to the history only for the duration of one history session. If multiple placeholders are sent within a session, only the first one is accepted.

    Returns Promise<string>

    A Promise for console command text or undefined if unavailable.

Protected onEdgeRequest

  • onEdgeRequest(editor: IEditor, location: CodeEditor.EdgeLocation): void
  • Handle an edge requested signal.

    Parameters

    • editor: IEditor
    • location: CodeEditor.EdgeLocation

    Returns void

Protected onHistory

  • onHistory(value: IHistoryReplyMsg): void
  • Populate the history collection on history reply from a kernel.

    Parameters

    • value: IHistoryReplyMsg

      The kernel message history reply.

      Notes

      History entries have the shape: [session: number, line: number, input: string] Contiguous duplicates are stripped out of the API response.

    Returns void

Protected onTextChange

  • onTextChange(): void
  • Handle a text change signal from the editor.

    Returns void

push

  • push(item: string): void
  • Add a new item to the bottom of history.

    Parameters

    • item: string

      The item being added to the bottom of history.

      Notes

      If the item being added is undefined or empty, it is ignored. If the item being added is the same as the last item in history, it is ignored as well so that the console's history will consist of no contiguous repetitions.

    Returns void

reset

  • reset(): void

Protected setFilter

  • setFilter(filterStr?: string): void
  • Set the filter data.

    Parameters

    • Default value filterStr: string = ""

      The string to use when filtering the data.

    Returns void

Generated using TypeDoc