Kui API Documentation - v11.0.0 / @kui-shell/core / HistoryModel
@kui-shell/core.HistoryModel
A tuple of History entries, one per Tab (as specified by its given uuid)
- add
- find
- findIndex
- first
- guardedChange
- key
- last
- line
- lineByIncr
- next
- previous
- restore
- save
- slice
- update
- wipe
• new HistoryModel(uuid
)
Name | Type |
---|---|
uuid |
string |
packages/core/src/models/history.ts:52
• Private
_cursor: number
packages/core/src/models/history.ts:43
• Private
_lines: HistoryLine
[]
packages/core/src/models/history.ts:42
▪ Static
Private
masterUUID: string
Facilitate copying master history to new Tabs
packages/core/src/models/history.ts:46
• get
cursor(): number
number
packages/core/src/models/history.ts:98
▸ add(line
): number
add a line of repl history
Name | Type |
---|---|
line |
Pick <HistoryLine , "raw" > |
number
packages/core/src/models/history.ts:147
▸ find(filter
): HistoryLine
Search the history model
Name | Type | Description |
---|---|---|
filter |
FilterFunction |
a search string, search regexp, or search function |
packages/core/src/models/history.ts:226
▸ findIndex(filter
, startIdx?
): number
Search the history model
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 |
number
packages/core/src/models/history.ts:199
▸ first(): HistoryLine
return to the oldest entry
packages/core/src/models/history.ts:180
▸ Private
guardedChange(incr
): number
change the cursor, protecting against under- and overflow
Name | Type |
---|---|
incr |
number |
number
packages/core/src/models/history.ts:103
▸ Private
key(uuid?
): string
The persistence key for this tab
Name | Type |
---|---|
uuid |
string |
string
packages/core/src/models/history.ts:85
▸ last(): HistoryLine
return to the newest entry
packages/core/src/models/history.ts:186
▸ line(idx
): HistoryLine
return the given line of history
Name | Type |
---|---|
idx |
number |
packages/core/src/models/history.ts:90
▸ lineByIncr(incr
): HistoryLine
Name | Type |
---|---|
incr |
number |
packages/core/src/models/history.ts:165
▸ next(): HistoryLine
go forward one entry
packages/core/src/models/history.ts:175
▸ previous(): HistoryLine
go back one entry
packages/core/src/models/history.ts:170
▸ Private
restore(uuid?
): any
Low-level restore from persistent storage
Name | Type |
---|---|
uuid |
string |
any
packages/core/src/models/history.ts:124
▸ Private
save(lines?
, uuid?
): void
Low-level save to persistent storage
Name | Type |
---|---|
lines |
HistoryLine [] |
uuid |
string |
void
packages/core/src/models/history.ts:119
▸ slice(start
, end?
): HistoryLine
[]
Name | Type |
---|---|
start |
number |
end? |
number |
packages/core/src/models/history.ts:94
▸ update(cursor
, updateFn
): Promise
<void
>
update a line of repl history -- for async operations
Name | Type |
---|---|
cursor |
number |
updateFn |
(line : HistoryLine ) => void | Promise <void > |
Promise
<void
>
packages/core/src/models/history.ts:159
▸ wipe(): boolean
Clear out all history
boolean