Kui API Documentation - v11.0.0 / @kui-shell/core / TabState
@kui-shell/core.TabState
State that we want to keep per tab
• new TabState(uuid
, _desiredStatusStripeDecoration?
, _parent?
)
Name | Type |
---|---|
uuid |
string |
_desiredStatusStripeDecoration |
StatusStripeChangeEvent |
_parent? |
TabState |
packages/core/src/models/tab-state.ts:68
• Private
_state: Record
<string
, Record
<string
, any
>> = {}
state map
outer key is TabStateRegistrar.name
, inner key is TabStateRegistrar.apiVersion
e.g. { 'plugins/plugin-core': {'v1': {'cwd': '/'}}}
packages/core/src/models/tab-state.ts:57
• Private
captures: CaptureFn
[] = []
functions to capture the states of tab
packages/core/src/models/tab-state.ts:60
• closed: boolean
is the tab closed?
packages/core/src/models/tab-state.ts:51
• ready: boolean
= false
is the tab ready for command execution?
packages/core/src/models/tab-state.ts:48
• Private
restores: RestoreFn
[] = []
functions to restore the states of the tab
packages/core/src/models/tab-state.ts:63
• Private
switchTos: SwitchToFn
[] = []
functions to capture this tab state and restore another tab state
packages/core/src/models/tab-state.ts:66
• Readonly
uuid: string
• get
desiredStatusStripeDecoration(): StatusStripeChangeEvent
packages/core/src/models/tab-state.ts:154
• set
desiredStatusStripeDecoration(decor
): void
Name | Type |
---|---|
decor |
StatusStripeChangeEvent |
void
packages/core/src/models/tab-state.ts:158
• get
state(): Record
<string
, Record
<string
, any
>>
Record
<string
, Record
<string
, any
>>
packages/core/src/models/tab-state.ts:78
▸ capture(): void
Capture contextual global state
void
packages/core/src/models/tab-state.ts:124
▸ Private
checkExistence(name
, apiVersion
): boolean
Name | Type |
---|---|
name |
string |
apiVersion |
string |
boolean
packages/core/src/models/tab-state.ts:82
▸ cloneWithUUID(uuid
): TabState
Clone the captured state
Name | Type |
---|---|
uuid |
string |
packages/core/src/models/tab-state.ts:137
▸ getState(name
, apiVersion
, key
): any
Name | Type |
---|---|
name |
string |
apiVersion |
string |
key |
string |
any
packages/core/src/models/tab-state.ts:107
▸ register(name
, apiVersion
, capture
, restore
, switchTo
): void
Name | Type |
---|---|
name |
string |
apiVersion |
string |
capture |
CaptureFn |
restore |
RestoreFn |
switchTo |
SwitchToFn |
void
packages/core/src/models/tab-state.ts:92
▸ restore(): Promise
<void
>
Restore tab state
Promise
<void
>
packages/core/src/models/tab-state.ts:171
▸ setState(name
, apiVersion
, key
, value
): Promise
<void
>
Name | Type |
---|---|
name |
string |
apiVersion |
string |
key |
string |
value |
any |
Promise
<void
>
packages/core/src/models/tab-state.ts:117
▸ switchTo(nextTabState
): Promise
<void
>
Capture contextual global state and then restore nextTabState
Name | Type |
---|---|
nextTabState |
TabState |
Promise
<void
>
packages/core/src/models/tab-state.ts:129
▸ updateStatusStripe(): void
Enforce our desired status stripe decorations
void