Skip to content

Latest commit

 

History

History
215 lines (132 loc) · 6.33 KB

kui_shell_core.REPL.md

File metadata and controls

215 lines (132 loc) · 6.33 KB

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

Interface: REPL

@kui-shell/core.REPL

Table of contents

Methods

Methods

click

click(command, evt): Promise<void>

Execute a command in response to an in-view click in a sidecar view. This is helpful if you wish to participate in the view nesting logic, e.g. where clicking on a link in a sidecar allows the user to return to the previous view. In contrast, pexec calls will not participate in view stacking.

Parameters

Name Type
command string | () => Promise<string>
evt MouseEvent

Returns

Promise<void>

Defined in

packages/core/src/models/repl.ts:58


encodeComponent

encodeComponent(component, quote?): string

Prepare a string to be part of a command argument to the *exec functions, quoting and escaping as necessary.

Parameters

Name Type
component string | number | boolean
quote? string

Returns

string

Defined in

packages/core/src/models/repl.ts:71


pexec

pexec<T>(command, execOptions?): Promise<T>

Programmatic eval. Useful to execute one command from another, e.g. as the result of a click handler --- where you would like the REPL interaction to appear on the console.

Type parameters

Name Type
T extends KResponse<any>

Parameters

Name Type
command string
execOptions? ExecOptions

Returns

Promise<T>

Defined in

packages/core/src/models/repl.ts:48


qexec

qexec<T>(command, block?, contextChangeOK?, execOptions?, nextBlock?): Promise<T>

Quiet eval. Useful to execute one command from another, without emitting output to the console.

Type parameters

Name Type
T extends KResponse<any>

Parameters

Name Type
command string
block? boolean | HTMLElement
contextChangeOK? boolean
execOptions? ExecOptions
nextBlock? HTMLElement

Returns

Promise<T>

Defined in

packages/core/src/models/repl.ts:27


reexec

reexec<T>(command, execOptions): Promise<T>

Evaluate a command and place the result in the current active view for the given tab

Type parameters

Name Type
T extends KResponse<any>

Parameters

Name Type
command string
execOptions ExecOptionsWithUUID

Returns

Promise<T>

Defined in

packages/core/src/models/repl.ts:64


rexec

rexec<Raw>(command, execOptions?): Promise<RawResponse<Raw>>

Raw eval. Useful to execute one command from another, where you want the original model back, not the view-oriented model.

Type parameters

Name Type
Raw extends unknown

Parameters

Name Type
command string
execOptions? ExecOptions

Returns

Promise<RawResponse<Raw>>

Defined in

packages/core/src/models/repl.ts:40


split

split(str, removeOuterQuotes?, removeInlineOuterQuotes?): string[]

Split the given string into an argv

Parameters

Name Type
str string
removeOuterQuotes? boolean
removeInlineOuterQuotes? boolean

Returns

string[]

Defined in

packages/core/src/models/repl.ts:80