Skip to content

Latest commit

 

History

History
426 lines (236 loc) · 9.98 KB

kui_shell_core.HistoryModel.md

File metadata and controls

426 lines (236 loc) · 9.98 KB

Kui API Documentation - v11.0.0 / @kui-shell/core / HistoryModel

Class: HistoryModel

@kui-shell/core.HistoryModel

A tuple of History entries, one per Tab (as specified by its given uuid)

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new HistoryModel(uuid)

Parameters

Name Type
uuid string

Defined in

packages/core/src/models/history.ts:52

Properties

_cursor

Private _cursor: number

Defined in

packages/core/src/models/history.ts:43


_lines

Private _lines: HistoryLine[]

Defined in

packages/core/src/models/history.ts:42


masterUUID

Static Private masterUUID: string

Facilitate copying master history to new Tabs

Defined in

packages/core/src/models/history.ts:46

Accessors

cursor

get cursor(): number

Returns

number

Defined in

packages/core/src/models/history.ts:98

Methods

add

add(line): number

add a line of repl history

Parameters

Name Type
line Pick<HistoryLine, "raw">

Returns

number

Defined in

packages/core/src/models/history.ts:147


find

find(filter): HistoryLine

Search the history model

Parameters

Name Type Description
filter FilterFunction a search string, search regexp, or search function

Returns

HistoryLine

Defined in

packages/core/src/models/history.ts:226


findIndex

findIndex(filter, startIdx?): number

Search the history model

Parameters

Name Type Description
filter string | RegExp | FilterFunction a search string, search regexp, or search function
startIdx? number if undefined or negative, start from the end, otherwise, search backwards from the given index

Returns

number

Defined in

packages/core/src/models/history.ts:199


first

first(): HistoryLine

return to the oldest entry

Returns

HistoryLine

Defined in

packages/core/src/models/history.ts:180


guardedChange

Private guardedChange(incr): number

change the cursor, protecting against under- and overflow

Parameters

Name Type
incr number

Returns

number

Defined in

packages/core/src/models/history.ts:103


key

Private key(uuid?): string

The persistence key for this tab

Parameters

Name Type
uuid string

Returns

string

Defined in

packages/core/src/models/history.ts:85


last

last(): HistoryLine

return to the newest entry

Returns

HistoryLine

Defined in

packages/core/src/models/history.ts:186


line

line(idx): HistoryLine

return the given line of history

Parameters

Name Type
idx number

Returns

HistoryLine

Defined in

packages/core/src/models/history.ts:90


lineByIncr

lineByIncr(incr): HistoryLine

Parameters

Name Type
incr number

Returns

HistoryLine

Defined in

packages/core/src/models/history.ts:165


next

next(): HistoryLine

go forward one entry

Returns

HistoryLine

Defined in

packages/core/src/models/history.ts:175


previous

previous(): HistoryLine

go back one entry

Returns

HistoryLine

Defined in

packages/core/src/models/history.ts:170


restore

Private restore(uuid?): any

Low-level restore from persistent storage

Parameters

Name Type
uuid string

Returns

any

Defined in

packages/core/src/models/history.ts:124


save

Private save(lines?, uuid?): void

Low-level save to persistent storage

Parameters

Name Type
lines HistoryLine[]
uuid string

Returns

void

Defined in

packages/core/src/models/history.ts:119


slice

slice(start, end?): HistoryLine[]

Parameters

Name Type
start number
end? number

Returns

HistoryLine[]

Defined in

packages/core/src/models/history.ts:94


update

update(cursor, updateFn): Promise<void>

update a line of repl history -- for async operations

Parameters

Name Type
cursor number
updateFn (line: HistoryLine) => void | Promise<void>

Returns

Promise<void>

Defined in

packages/core/src/models/history.ts:159


wipe

wipe(): boolean

Clear out all history

Returns

boolean

Defined in

packages/core/src/models/history.ts:140