Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConsoleHistory

A console history manager object.

Hierarchy

  • ConsoleHistory

Implements

Index

Constructors

constructor

  • Construct a new console history object.

    Parameters

    Returns ConsoleHistory

Properties

Private _cursor

_cursor: any

Private _editor

_editor: any

Private _filtered

_filtered: any

Private _handleKernel

_handleKernel: any

Handle the current kernel changing.

Private _hasSession

_hasSession: any

Private _history

_history: any

Private _isDisposed

_isDisposed: any

Private _placeholder

_placeholder: any

Private _setByHistory

_setByHistory: any

Readonly sessionContext

sessionContext: ISessionContext

The client session used by the foreign handler.

Accessors

editor

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

    Returns CodeEditor.IEditor | null

  • The current editor used by the history manager.

    Parameters

    • value: CodeEditor.IEditor | null

    Returns any

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

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
  • Dispose of the resources held by the console history manager.

    Returns 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: CodeEditor.IEditor, location: CodeEditor.EdgeLocation): void
  • Handle an edge requested signal.

    Parameters

    • editor: CodeEditor.IEditor
    • location: CodeEditor.EdgeLocation

    Returns void

Protected onHistory

  • 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
  • Reset the history navigation state, i.e., start a new history session.

    Returns void

Protected setFilter

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

    Parameters

    • Optional filterStr: string

      The string to use when filtering the data.

    Returns void

Generated using TypeDoc