Skip to content

Latest commit

 

History

History
3452 lines (2055 loc) · 127 KB

kui_shell_core.md

File metadata and controls

3452 lines (2055 loc) · 127 KB

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

Module: @kui-shell/core

Table of contents

Namespaces

Enumerations

Classes

Interfaces

Type aliases

Properties

Variables

Functions

Type aliases

Badge

Ƭ Badge: string | BadgeSpec | Element

Defined in

packages/core/src/webapp/views/registrar/badges.ts:35


Button

Ƭ Button<T>: DrilldownButton<T> | ViewButton<T>

Type parameters

Name Type
T ResourceWithMetadata

Defined in

packages/core/src/models/mmr/types.ts:142


CommandHandler

Ƭ CommandHandler<T, O>: (args: Arguments<O>) => T | Promise<T>

Type parameters

Name Type
T extends KResponse
O extends ParsedOptions

Type declaration

▸ (args): T | Promise<T>

base command handler

Parameters
Name Type
args Arguments<O>
Returns

T | Promise<T>

Defined in

packages/core/src/models/command.ts:215


CommandStringContent

Ƭ CommandStringContent: WithOptionalContentType<SupportedStringContent> & { contentFrom: string }

Content as CommandStringContent will be executed via a REPL.qexec; the command is assumed to return either ScalarRersource or ScalarContent.

Defined in

packages/core/src/models/mmr/content-types.ts:173


CommentaryResponse

Ƭ CommentaryResponse: Object

Type declaration

Name Type
apiVersion "kui-shell/v1"
kind "CommentaryResponse"
props Object
props.baseUrl? string
props.children string
props.codeBlockResponses? { response: KResponse ; status: "done" | "error" }[]
props.edit? boolean
props.filepath? string
props.header? boolean
props.preview? boolean
props.receive? string
props.repl? REPL
props.replace? boolean
props.send? string
props.title? string

Defined in

packages/core/src/models/CommentaryResponse.ts:21


CompletionResponse

Ƭ CompletionResponse: string | { addSpace?: boolean ; completion: string ; docs?: string ; label?: string }

Defined in

packages/core/src/repl/tab-completion.ts:38


Content

Ƭ Content<T>: ScalarContent | StringContent | StringDiffContent | FunctionContent<T> | CommandStringContent | ReactProvider

The classes of supported Content are:

  • ScalarContent: such as pre-formatted HTML, or or Table model
  • StringContent: a string with an optional contentType
  • FunctionContent<T>: a function that takes a T and produces ScalarContent
  • CommandStringContent: a string to be executed as a Kui command, and producing ScalarContent

Type parameters

Name Type
T extends ResourceWithMetadata = ResourceWithMetadata

Defined in

packages/core/src/models/mmr/content-types.ts:196


Editable

Ƭ Editable: Object

The Resource trait

Type declaration

Name Type
spec EditableSpec

Defined in

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


ExecOptionsWithUUID

Ƭ ExecOptionsWithUUID: Exclude<ExecOptions, "execUUID"> & Required<Pick<ExecOptions, "execUUID">>

Transform the execUUID field of ExecOptions to be required.

Defined in

packages/core/src/models/execOptions.ts:112


FunctionThatProducesContent

Ƭ FunctionThatProducesContent<T>: (tab: Tab, entity: T, args: { argsForMode?: Arguments ; argvNoOptions: string[] ; parsedOptions: ParsedOptions }) => ReactProvider | ScalarResource | ScalarContent | Promise<ScalarResource | ScalarContent | ReactProvider> | CommandStringContent

Type parameters

Name Type
T extends ResourceWithMetadata = ResourceWithMetadata

Type declaration

▸ (tab, entity, args): ReactProvider | ScalarResource | ScalarContent | Promise<ScalarResource | ScalarContent | ReactProvider> | CommandStringContent

Content as FunctionThatProducesContent<T> is a function that takes a T and produces either a resource or some { content, contentType } wrapper.

Parameters
Name Type
tab Tab
entity T
args Object
args.argsForMode? Arguments
args.argvNoOptions string[]
args.parsedOptions ParsedOptions
Returns

ReactProvider | ScalarResource | ScalarContent | Promise<ScalarResource | ScalarContent | ReactProvider> | CommandStringContent

Defined in

packages/core/src/models/mmr/content-types.ts:141


Job

Ƭ Job: Abortable & FlowControllable & Partial<Resizable>

Defined in

packages/core/src/core/jobs/job.ts:44


KResponse

Ƭ KResponse<Content>: Entity<Content>

A command KResponse can be any supported Entity type

Type parameters

Name Type
Content extends any = any

Defined in

packages/core/src/models/command.ts:32


Link

Ƭ Link: Label & Command | Href

Defined in

packages/core/src/models/NavResponse.ts:44


Menu

Ƭ Menu: Label & MenuItems

Defined in

packages/core/src/models/NavResponse.ts:37


MixedResponse

Ƭ MixedResponse: MixedResponsePart[]

Defined in

packages/core/src/models/entity.ts:158


Mode

Ƭ Mode<T>: MultiModalMode<T> | Button<T>

Type parameters

Name Type
T ResourceWithMetadata

Defined in

packages/core/src/models/mmr/types.ts:75


ModeDeclaration

Ƭ ModeDeclaration<Resource>: Mode

Type parameters

Name Type
Resource extends ResourceWithMetadata

Defined in

packages/core/src/webapp/views/registrar/modes.ts:29


ModeFilter

Ƭ ModeFilter<Resource>: (resource: Resource) => boolean

Type parameters

Name Type
Resource extends ResourceWithMetadata

Type declaration

▸ (resource): boolean

Parameters
Name Type
resource Resource
Returns

boolean

Defined in

packages/core/src/webapp/views/registrar/modes.ts:27


MultiModalMode

Ƭ MultiModalMode<T>: Label & ModeTraits & VisibilityTraits & Content<T>

A Mode is a Label plus some Content and ModeTraits

Type parameters

Name Type
T ResourceWithMetadata

Defined in

packages/core/src/models/mmr/types.ts:81


MultiModalResponse

Ƭ MultiModalResponse<Resource>: Resource & View<Resource>

A MultiModalResponse has all the fields of a class of Resource plus a way to View those resources.

Type parameters

Name Type
Resource ResourceWithMetadata

Defined in

packages/core/src/models/mmr/types.ts:31


NavResponse

Ƭ NavResponse: Object

A NavResponse is a collection of MultiModalResponse with menu navigation

Type declaration

Name Type
apiVersion "kui-shell/v1"
breadcrumbs? Breadcrumb[]
kind "NavResponse"
links? Link[]
menus Menu[]

Defined in

packages/core/src/models/NavResponse.ts:29


NewSplitRequest

Ƭ NewSplitRequest: Object

Type declaration

Name Type
modification "NewSplit"
options? Object
options.cmdline? string
options.if? string
options.ifnot? string
options.index? number
options.inverseColors? boolean
options.position? "default" | "left-strip" | "bottom-strip"
options.swap? Object
options.swap.a number
options.swap.b number

Defined in

packages/core/src/models/TabLayoutModificationResponse.ts:32


PluginRegistration

Ƭ PluginRegistration: (commandTree: Registrar, options?: { usage: PrescanUsage }) => KuiPlugin

Type declaration

▸ (commandTree, options?): KuiPlugin

Parameters
Name Type
commandTree Registrar
options? Object
options.usage PrescanUsage
Returns

KuiPlugin

Defined in

packages/core/src/models/plugin.ts:26


PreloadRegistration

Ƭ PreloadRegistration: (registrar: PreloadRegistrar) => Promise<void | void[]>

Type declaration

▸ (registrar): Promise<void | void[]>

Parameters
Name Type
registrar PreloadRegistrar
Returns

Promise<void | void[]>

Defined in

packages/core/src/models/plugin.ts:41


PrettyUsageModel

Ƭ PrettyUsageModel: Object

Type declaration

Name Type
examples? Example[]
intro? string
options? Option[]
related? Related[]
title Title
usages Usage[]

Defined in

packages/core/src/core/usage/types.ts:36


RadioTableCell

Ƭ RadioTableCell: string | { hints?: CellShould | CellShould[] ; key?: string ; title?: string ; value: string }

Defined in

packages/core/src/models/RadioTable.ts:87


ReactProvider

Ƭ ReactProvider: Object

Type declaration

Name Type
react (props: ToolbarProps) => ReactElement<any, string | JSXElementConstructor<any>>

Defined in

packages/core/src/models/mmr/content-types.ts:42


ReactResponse

Ƭ ReactResponse: Object

Type declaration

Name Type
react ReactNode

Defined in

packages/core/src/models/entity.ts:139


ResourceByReferenceWithContent

Ƭ ResourceByReferenceWithContent<T>: ResourceByReference<T>

Type parameters

Name Type
T extends any = any

Defined in

packages/core/src/models/entity.ts:111


ResourceWithMetadataWithContent

Ƭ ResourceWithMetadataWithContent<T>: ResourceWithMetadata<T>

Type parameters

Name Type
T extends any = any

Defined in

packages/core/src/models/entity.ts:86


ScalarResource

Ƭ ScalarResource: string | HTMLElement | Table | DescriptionList

A ScalarResource is Any kind of resource that is directly represented, as opposed to being implicitly represented by a function call.

Defined in

packages/core/src/models/mmr/content-types.ts:34


ScalarResponse

Ƭ ScalarResponse<RowType>: SimpleEntity | Table<RowType> & Partial<WithSourceReferences> | MixedResponse | CommentaryResponse | TabLayoutModificationResponse | XtermResponse | RandomErrorResponse1 | RandomErrorResponse2

This type covers all responses with no complex internal structure that views may wish to interpret into fancier views.

Type parameters

Name Type
RowType extends Row = Row

Defined in

packages/core/src/models/entity.ts:213


SnapshottedEvent

Ƭ SnapshottedEvent<E>: Omit<E, "tab"> & { tab: E["tab"]["uuid"] }

In order to snapshot an event, we'll need to remember just the tab uuid

Type parameters

Name Type
E extends CommandStartEvent | CommandCompleteEvent

Defined in

packages/core/src/repl/events.ts:68


Stream

Ƭ Stream: (response: Streamable) => void | Promise<void>

Type declaration

▸ (response): void | Promise<void>

Parameters
Name Type
response Streamable
Returns

void | Promise<void>

Defined in

packages/core/src/models/streamable.ts:22


Streamable

Ƭ Streamable: ScalarResponse

Defined in

packages/core/src/models/streamable.ts:19


StringContent

Ƭ StringContent<ContentType>: ScalarContent<string> & WithOptionalContentType<ContentType> & Partial<Editable>

Special case of ScalarContent for strings; string content may optionally provide a contentType.

Type parameters

Name Type
ContentType SupportedStringContent

Defined in

packages/core/src/models/mmr/content-types.ts:95


StringDiffContent

Ƭ StringDiffContent<ContentType>: Object

Compare 2 StringContent

Type parameters

Name Type
ContentType SupportedStringContent

Type declaration

Name Type
content Object
content.a string
content.b string
contentType ContentType

Defined in

packages/core/src/models/mmr/content-types.ts:114


SupportedStringContent

Ƭ SupportedStringContent: "yaml" | "text/markdown" | "text/html" | "json" | "shell" | "text/plain"

Supported String content types

Defined in

packages/core/src/models/mmr/content-types.ts:69


Suspendable

Ƭ Suspendable: Omit<FlowControllable, "write">

Defined in

packages/core/src/core/jobs/job.ts:35


TabLayoutModificationResponse

Ƭ TabLayoutModificationResponse<Request>: Object

If your controller wants to manipulate the tab layout, this is your response type!

Type parameters

Name Type
Request extends ModificationRequest = ModificationRequest

Type declaration

Name Type
apiVersion "kui-shell/v1"
kind "TabLayoutModificationResponse"
spec Request & { ok: MarkdownResponse }

Defined in

packages/core/src/models/TabLayoutModificationResponse.ts:24


ToolbarProps

Ƭ ToolbarProps: Object

Type declaration

Name Type
willUpdateToolbar? (toolbarText: ToolbarText, extraButtons?: Button<ResourceWithMetadata<void>>[], extraButtonsOverride?: boolean) => void

Defined in

packages/core/src/models/mmr/content-types.ts:39


ViewTransformer

Ƭ ViewTransformer<T, O>: (args: Arguments<O>, response: T) => Promise<T> | void | Promise<void>

Type parameters

Name Type
T extends KResponse
O extends ParsedOptions

Type declaration

▸ (args, response): Promise<T> | void | Promise<void>

Parameters
Name Type
args Arguments<O>
response T
Returns

Promise<T> | void | Promise<void>

Defined in

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

Properties

Store

Store: () => LocalStorage

Type declaration

▸ (): LocalStorage

This shim allows clients to define a localStorage scheme, if they cannot provide window.localStorage.

Returns

LocalStorage


SymbolTable

SymbolTable: SymbolTable


boot

boot: (client: ClientRender) => Promise<void>

Type declaration

▸ (client): Promise<void>

Usage: clients will invoke this with their main renderer.

For reference, the HTML template is to be found in ../../../templates/index.ejs. This template is in turn managed by packages/webpack/webpack.config.js.

Parameters
Name Type
client ClientRender
Returns

Promise<void>


encodeComponent

encodeComponent: (component: string | number | boolean, quote: string) => string

Type declaration

▸ (component, quote?): string

Add quotes if the argument needs it; compare to encodeURIComponent

Parameters
Name Type Default value
component string | number | boolean undefined
quote string '"'
Returns

string


i18n

i18n: (plugin: string, namespace: string) => (key: string, ...parameters: (string | number)[]) => string

Type declaration

▸ (plugin, namespace?): (key: string, ...parameters: (string | number)[]) => string

Parameters
Name Type Default value
plugin string undefined
namespace string 'resources'
Returns

fn

▸ (key, ...parameters): string

Parameters
Name Type
key string
...parameters (string | number)[]
Returns

string

Variables

KeyCodes

KeyCodes: Object

Type declaration

Name Type
A number
B number
BACKSPACE number
C number
D number
DOWN number
E number
END number
ENTER number
ESCAPE number
F number
HOME number
K number
L number
LEFT_ARROW number
N number
P number
PAGEDOWN number
PAGEUP number
R number
RIGHT_ARROW number
T number
TAB number
U number
UP number

Defined in

packages/core/src/webapp/keys.ts:17


badgeRegistrar

badgeRegistrar: BadgeRegistration<ResourceWithMetadata>[] = []

registered badge handlers

Defined in

packages/core/src/webapp/views/registrar/badges.ts:48


commandsTrie

commandsTrie: TrieSearch<string>

Defined in

packages/core/src/commands/typeahead.ts:21

Functions

History

History(tab): HistoryModel

Parameters

Name Type
tab string | Tab

Returns

HistoryModel

Defined in

packages/core/src/index.ts:93


_split

Const _split(str, removeOuterQuotes?, returnIndices?, removeInlineOuterQuotes?, splitBy?, startIdx?, endIdx?): string[] | Split

Parameters

Name Type Default value
str string undefined
removeOuterQuotes boolean true
returnIndices boolean false
removeInlineOuterQuotes boolean false
splitBy string ' '
startIdx number 0
endIdx number str.length

Returns

string[] | Split

Defined in

packages/core/src/repl/split.ts:61


addRelevantModes

addRelevantModes<Resource>(tab, modes, command, resource): void

Apply all registered modes that are relevant to the given resource to the given modes model

Type parameters

Name Type
Resource extends ResourceWithMetadata<void, Resource>

Parameters

Name Type
tab Tab
modes Mode<ResourceWithMetadata<void>>[]
command string
resource Object
resource.resource Resource

Returns

void

Defined in

packages/core/src/webapp/views/registrar/modes.ts:66


bootIntoSandbox

bootIntoSandbox(): Promise<void>

For booting into an external browser sandbox, such as codesandbox.io

Returns

Promise<void>

Defined in

packages/core/src/webapp/bootstrap/boot.ts:103


cellShouldHaveBadge

cellShouldHaveBadge(cell): void | CellShould

Should the cell be rendered with a traffic light badge?

Parameters

Name Type
cell RadioTableCell

Returns

void | CellShould

Defined in

packages/core/src/models/RadioTable.ts:63


commandsOfferedByPlugin

Const commandsOfferedByPlugin(plugin?): Promise<Table<Row>>

Render the commands provided by a given plugin

Parameters

Name Type
plugin? string

Returns

Promise<Table<Row>>

Defined in

packages/core/src/api/plugins.ts:46


disableInputQueueing

Const disableInputQueueing(tab): string

Parameters

Name Type
tab Tab

Returns

string

Defined in

packages/core/src/webapp/queueing.ts:60


doCancel

doCancel(tab, block, valueTypedSoFar): void

Parameters

Name Type
tab Tab
block Block
valueTypedSoFar string

Returns

void

Defined in

packages/core/src/webapp/cancel.ts:33


doEval

Const doEval(_tab, block, command, execUUID?): Promise<KResponse<any> | CodedError<number>>

User hit enter in the REPL

Parameters

Name Type Description
_tab Tab -
block Block -
command string -
execUUID? string for command re-execution

Returns

Promise<KResponse<any> | CodedError<number>>

Defined in

packages/core/src/repl/exec.ts:609


empty

Const empty(node): void

Clean out the given DOM node

Parameters

Name Type
node Node

Returns

void

Defined in

packages/core/src/webapp/util/dom.ts:21


executeSequentially

executeSequentially(): boolean

Returns

boolean

Defined in

packages/core/src/api/client.ts:78


findCompletions

findCompletions(tab, commandLine, spec): Promise<CompletionResponse[]>

Consult each registered enumerator to see what it has to offer in the way of completions. Pick the one with highest priority, or the first to register in the case of a tie-breaker.

Parameters

Name Type
tab Object
tab.REPL REPL
commandLine Omit<CommandLine<ParsedOptions>, "pipeStages" | "pipeStagesNoOptions">
spec TabCompletionSpec

Returns

Promise<CompletionResponse[]>

Defined in

packages/core/src/repl/tab-completion.ts:70


getCurrentTab

Const getCurrentTab(): Tab

Returns

Tab

Defined in

packages/core/src/webapp/tab.ts:90


getPrimaryTabId

getPrimaryTabId(tab): string

Parameters

Name Type
tab Pick<Tab, "uuid">

Returns

string

Defined in

packages/core/src/webapp/tab.ts:78


getTab

Const getTab(idx): Tab

Parameters

Name Type
idx number | Tab

Returns

Tab

Defined in

packages/core/src/webapp/tab.ts:100


getTabId

getTabId(tab): string

Return the unique identifier for the given tab

Parameters

Name Type
tab Pick<Tab, "uuid">

Returns

string

Defined in

packages/core/src/webapp/tab.ts:64


hasContent

hasContent<T>(resource): resource is Content<T>

Type parameters

Name Type
T extends ResourceWithMetadata<void, T>

Parameters

Name Type
resource ScalarResource | Content<T> | Mode<T>

Returns

resource is Content<T>

Defined in

packages/core/src/models/mmr/content-types.ts:204


hasDisplayName

hasDisplayName(resource): resource is WithDisplayName

Parameters

Name Type
resource ResourceWithMetadata<void>

Returns

resource is WithDisplayName

Defined in

packages/core/src/models/entity.ts:99


hasSourceReferences

hasSourceReferences(response): response is Required<WithSourceReferences>

Parameters

Name Type
response Partial<WithSourceReferences>

Returns

response is Required<WithSourceReferences>

Defined in

packages/core/src/models/entity.ts:243


hideReplayOutput

hideReplayOutput(): boolean

Returns

boolean

Defined in

packages/core/src/api/client.ts:68


i18nFromMap

i18nFromMap(map): string

Parameters

Name Type
map Record<string, string>

Returns

string

Defined in

packages/core/src/util/i18n.ts:30


initializeSession

initializeSession(tab): Promise<void>

Initialize the session for the given Tab. Await the response if you need to block until all session initializers have completed.

Parameters

Name Type
tab Tab

Returns

Promise<void>

Defined in

packages/core/src/session/init.ts:28


internalBeCarefulExec

Const internalBeCarefulExec(commandUntrimmed, execOptions?): Promise<KResponse<any> | CodedError<number>>

Parameters

Name Type
commandUntrimmed string
execOptions ExecOptions

Returns

Promise<KResponse<any> | CodedError<number>>

Defined in

packages/core/src/repl/exec.ts:599


internalBeCarefulPExec

Const internalBeCarefulPExec<T>(command, execOptions?): Promise<T>

Programmatic exec, as opposed to human typing and hitting enter

Type parameters

Name Type
T extends KResponse<any>

Parameters

Name Type
command string
execOptions? ExecOptions

Returns

Promise<T>

Defined in

packages/core/src/repl/exec.ts:695


is404

is404<Code>(err): err is CodedError<404>

Type parameters

Name Type
Code number

Parameters

Name Type
err string | object | Error

Returns

err is CodedError<404>

Defined in

packages/core/src/models/errors.ts:33


is404or409

is404or409<Code>(err): err is CodedError<404 | 409>

Type parameters

Name Type
Code number

Parameters

Name Type
err string | object | Error

Returns

err is CodedError<404 | 409>

Defined in

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


is409

is409<Code>(err): err is CodedError<409>

Type parameters

Name Type
Code number

Parameters

Name Type
err string | object | Error

Returns

err is CodedError<409>

Defined in

packages/core/src/models/errors.ts:38


isAbortableResponse

isAbortableResponse(entity): entity is AbortableResponse<ScalarResponse<Row>>

Parameters

Name Type
entity Entity<void, Row, ResourceWithMetadata<void>>

Returns

entity is AbortableResponse<ScalarResponse<Row>>

Defined in

packages/core/src/models/entity.ts:251


isButton

isButton<T>(mode): mode is Button<T>

Type parameters

Name Type
T extends ResourceWithMetadata<void, T> = ResourceWithMetadata<void>

Parameters

Name Type
mode Button<T> | Content<T> | MultiModalMode<T>

Returns

mode is Button<T>

Defined in

packages/core/src/models/mmr/types.ts:144


isCodedError

isCodedError<Code>(err): err is CodedError<Code>

Type parameters

Name Type
Code number

Parameters

Name Type
err string | object | Error

Returns

err is CodedError<Code>

Defined in

packages/core/src/models/errors.ts:28


isCommandHandlerWithEvents

isCommandHandlerWithEvents<T, O>(evaluator): evaluator is CommandHandlerWithEvents<T, O>

Type parameters

Name Type
T extends KResponse<any>
O extends ParsedOptions

Parameters

Name Type
evaluator Evaluator<T, O>

Returns

evaluator is CommandHandlerWithEvents<T, O>

Defined in

packages/core/src/models/command.ts:282


isCommandStringContent

isCommandStringContent<T>(content): content is CommandStringContent

Type parameters

Name Type
T extends ResourceWithMetadata<void, T>

Parameters

Name Type
content ResourceWithMetadata<void> | ScalarResource | Content<T> | Mode<T>

Returns

content is CommandStringContent

Defined in

packages/core/src/models/mmr/content-types.ts:177


isCommentaryResponse

isCommentaryResponse(entity): entity is CommentaryResponse

Parameters

Name Type
entity Entity<void, Row, ResourceWithMetadata<void>>

Returns

entity is CommentaryResponse

Defined in

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


isCommentarySectionBreak

isCommentarySectionBreak(entity): boolean

is this commentary reponse be able to treated as a section break

Parameters

Name Type
entity Entity<void, Row, ResourceWithMetadata<void>>

Returns

boolean

Defined in

packages/core/src/models/CommentaryResponse.ts:70


isCursorMovement

Const isCursorMovement(evt): boolean

does the given keycode correspond to a cursor movement?

Parameters

Name Type
evt KeyboardEvent

Returns

boolean

Defined in

packages/core/src/webapp/keys.ts:48


isDescriptionList

isDescriptionList(content): content is DescriptionList

Parameters

Name Type
content ScalarResource

Returns

content is DescriptionList

Defined in

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


isError

isError(response): response is ErrorLike

Parameters

Name Type
response KResponse<any>

Returns

response is ErrorLike

Defined in

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


isExecutableClient

isExecutableClient(): boolean

Is the current client running in an executable mode?

Returns

boolean

Defined in

packages/core/src/api/client.ts:53


isFunctionContent

isFunctionContent<T>(content): content is FunctionContent<T>

Type parameters

Name Type
T extends ResourceWithMetadata<void, T> = ResourceWithMetadata<void>

Parameters

Name Type
content Entity<void, Row, ResourceWithMetadata<void>> | Content<T> | Mode<T>

Returns

content is FunctionContent<T>

Defined in

packages/core/src/models/mmr/content-types.ts:160


isLink

isLink(link): link is Link

Parameters

Name Type
link Link

Returns

link is Link

Defined in

packages/core/src/models/NavResponse.ts:54


isLinkWithCommand

isLinkWithCommand(link): link is Label & Command

Parameters

Name Type
link Link

Returns

link is Label & Command

Defined in

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


isLinkWithHref

isLinkWithHref(link): link is Label & Href

Parameters

Name Type
link Link

Returns

link is Label & Href

Defined in

packages/core/src/models/NavResponse.ts:50


isMarkdownResponse

isMarkdownResponse(entity): entity is MarkdownResponse

Parameters

Name Type
entity Entity<void, Row, ResourceWithMetadata<void>>

Returns

entity is MarkdownResponse

Defined in

packages/core/src/models/entity.ts:134


isMessageWithCode

isMessageWithCode(msg): msg is MessageWithCode

Parameters

Name Type
msg UsageLike

Returns

msg is MessageWithCode

Defined in

packages/core/src/core/usage-error.ts:877


isMessageWithUsageModel

isMessageWithUsageModel(msg): msg is MessageWithUsageModel

Parameters

Name Type
msg UsageLike

Returns

msg is MessageWithUsageModel

Defined in

packages/core/src/core/usage-error.ts:133


isMixedResponse

isMixedResponse(response): response is MixedResponse

Parameters

Name Type
response Entity<void, Row, ResourceWithMetadata<void>>

Returns

response is MixedResponse

Defined in

packages/core/src/models/entity.ts:160


isMultiModalResponse

isMultiModalResponse(entity): entity is MultiModalResponse<ResourceWithMetadata<void>>

Parameters

Name Type
entity Entity<void, Row, ResourceWithMetadata<void>>

Returns

entity is MultiModalResponse<ResourceWithMetadata<void>>

Defined in

packages/core/src/models/mmr/is.ts:20


isNavResponse

isNavResponse(entity): entity is NavResponse

Parameters

Name Type
entity Entity<void, Row, ResourceWithMetadata<void>>

Returns

entity is NavResponse

Defined in

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


isNewSplitRequest

isNewSplitRequest(req): req is TabLayoutModificationResponse<NewSplitRequest>

Parameters

Name Type
req TabLayoutModificationResponse<NewSplitRequest>

Returns

req is TabLayoutModificationResponse<NewSplitRequest>

Defined in

packages/core/src/models/TabLayoutModificationResponse.ts:60


isOfflineClient

isOfflineClient(): boolean

Is the current client running in offline/disconnected mode?

Returns

boolean

Defined in

packages/core/src/api/client.ts:21


isPopup

Const isPopup(): boolean

are we operating in popup mode?

Returns

boolean

Defined in

packages/core/src/webapp/popup-core.ts:18


isRadioTable

isRadioTable(response): response is RadioTable

Parameters

Name Type
response KResponse<any>

Returns

response is RadioTable

Defined in

packages/core/src/models/RadioTable.ts:100


isRandomErrorResponse1

isRandomErrorResponse1(response): response is RandomErrorResponse1

Parameters

Name Type
response Entity<void, Row, ResourceWithMetadata<void>>

Returns

response is RandomErrorResponse1

Defined in

packages/core/src/models/entity.ts:197


isRandomErrorResponse2

isRandomErrorResponse2(response): response is RandomErrorResponse2

Parameters

Name Type
response Entity<void, Row, ResourceWithMetadata<void>>

Returns

response is RandomErrorResponse2

Defined in

packages/core/src/models/entity.ts:203


isReactProvider

isReactProvider(entity): entity is ReactProvider

Parameters

Name Type
entity ScalarLike<ResourceWithMetadata<void>>

Returns

entity is ReactProvider

Defined in

packages/core/src/models/mmr/content-types.ts:43


isReactResponse

isReactResponse(entity): entity is ReactResponse

Parameters

Name Type
entity Entity<void, Row, ResourceWithMetadata<void>>

Returns

entity is ReactResponse

Defined in

packages/core/src/models/entity.ts:141


isReadOnlyClient

isReadOnlyClient(): boolean

Is the current client running in readonly mode?

Returns

boolean

Defined in

packages/core/src/api/client.ts:37


isResizable

isResizable(job): job is Resizable

Parameters

Name Type
job Partial<Resizable>

Returns

job is Resizable

Defined in

packages/core/src/core/jobs/job.ts:25


isResourceByReference

isResourceByReference<T>(spec): spec is T

Type parameters

Name Type
T extends ResourceByReference<void, T>

Parameters

Name Type
spec Entity<void, Row, ResourceWithMetadata<void>> | T | ResourceWithMetadataWithContent<any>

Returns

spec is T

Defined in

packages/core/src/models/entity.ts:112


isResourceWithMetadata

isResourceWithMetadata(spec): spec is ResourceWithMetadata<void>

Parameters

Name Type
spec Entity<void, Row, ResourceWithMetadata<void>>

Returns

spec is ResourceWithMetadata<void>

Defined in

packages/core/src/models/entity.ts:88


isScalarContent

isScalarContent<T>(entity): entity is ScalarContent<ScalarResource>

Type parameters

Name Type
T extends ResourceWithMetadata<void, T>

Parameters

Name Type
entity ScalarLike<T>

Returns

entity is ScalarContent<ScalarResource>

Defined in

packages/core/src/models/mmr/content-types.ts:56


isScalarResponse

isScalarResponse(response): response is ScalarResponse<Row>

Parameters

Name Type
response Entity<void, Row, ResourceWithMetadata<void>>

Returns

response is ScalarResponse<Row>

Defined in

packages/core/src/models/entity.ts:223


isStringDiffContent

isStringDiffContent<T>(entity): entity is StringDiffContent<SupportedStringContent>

Type parameters

Name Type
T extends ResourceWithMetadata<void, T>

Parameters

Name Type
entity Entity<void, Row, ResourceWithMetadata<void>> | Content<T> | Mode<T>

Returns

entity is StringDiffContent<SupportedStringContent>

Defined in

packages/core/src/models/mmr/content-types.ts:122


isStringResponse

isStringResponse(response): response is string

Parameters

Name Type
response CompletionResponse

Returns

response is string

Defined in

packages/core/src/repl/tab-completion.ts:39


isStringWithOptionalContentType

isStringWithOptionalContentType<T>(entity): entity is StringContent<SupportedStringContent>

Type parameters

Name Type
T extends ResourceWithMetadata<void, T>

Parameters

Name Type
entity Entity<void, Row, ResourceWithMetadata<void>> | Content<T> | Mode<T>

Returns

entity is StringContent<SupportedStringContent>

Defined in

packages/core/src/models/mmr/content-types.ts:99


isSupportedContentType

isSupportedContentType(contentType): boolean

Parameters

Name Type
contentType string

Returns

boolean

Defined in

packages/core/src/models/mmr/content-types.ts:71


isSupportedToolbarTextType

isSupportedToolbarTextType(type): type is ToolbarTextType

Parameters

Name Type
type string

Returns

type is ToolbarTextType

Defined in

packages/core/src/webapp/views/toolbar-text.ts:24


isSuspendable

isSuspendable(watch): () => void

Parameters

Name Type
watch Partial<Suspendable>

Returns

fn

▸ (): void

Returns

void

Defined in

packages/core/src/core/jobs/job.ts:40


isTabLayoutModificationResponse

isTabLayoutModificationResponse(entity): entity is TabLayoutModificationResponse<NewSplitRequest>

Parameters

Name Type
entity Entity<void, Row, ResourceWithMetadata<void>>

Returns

entity is TabLayoutModificationResponse<NewSplitRequest>

Defined in

packages/core/src/models/TabLayoutModificationResponse.ts:66


isTable

isTable<C>(model): model is Table<Row>

Type parameters

Name
C

Parameters

Name Type
model Entity<void, Row, ResourceWithMetadata<void>> | ResourceWithMetadata<C>

Returns

model is Table<Row>

Defined in

packages/core/src/webapp/models/table.ts:234


isTableWithCount

isTableWithCount(table): boolean

Parameters

Name Type
table Table<Row>

Returns

boolean

Defined in

packages/core/src/webapp/models/table.ts:225


isTableWithTimestamp

isTableWithTimestamp(table): boolean

Parameters

Name Type
table Table<Row>

Returns

boolean

Defined in

packages/core/src/webapp/models/table.ts:221


isTopLevelTab

isTopLevelTab(tab): boolean

Parameters

Name Type
tab Pick<Tab, "uuid">

Returns

boolean

Defined in

packages/core/src/webapp/tab.ts:82


isUsageError

isUsageError(error): error is UsageErrorLike

Parameters

Name Type
error Entity<void, Row, ResourceWithMetadata<void>> | UsageErrorLike

Returns

error is UsageErrorLike

Defined in

packages/core/src/core/usage-error.ts:935


isViewButton

isViewButton<T>(button): button is ViewButton<T>

Type parameters

Name Type
T ResourceWithMetadata<void>

Parameters

Name Type
button Button<T>

Returns

button is ViewButton<T>

Defined in

packages/core/src/models/mmr/types.ts:138


isWatchable

isWatchable(model): model is string & Watchable & number & Watchable & false & Watchable & true & Watchable & HTMLElement & Watchable & Error & Watchable & MarkdownResponse & Watchable & ReactResponse & Watchable & MixedResponse & Watchable & CommentaryResponse & Watchable & TabLayoutModificationResponse<NewSplitRequest> & Watchable & XtermResponse & Watchable & RandomErrorResponse1 & Watchable & RandomErrorResponse2 & Watchable & Table<Row> & Partial<WithSourceReferences> & Watchable & Abortable & Object & Watchable & ResourceWithMetadata<void> & Watchable & ResourceWithMetadata<void> & View<ResourceWithMetadata<void>> & Watchable & NavResponse & Watchable & RadioTable & Watchable & UsageModel & Watchable & RawResponse<void> & Watchable & ResourceWithMetadata<void>[] & Watchable

Parameters

Name Type
model string & Partial<Watchable> & number & Partial<Watchable> & false & Partial<Watchable> & true & Partial<Watchable> & HTMLElement & Partial<Watchable> & Error & Partial<Watchable> & MarkdownResponse & Partial<Watchable> & ReactResponse & Partial<Watchable> & MixedResponse & Partial<Watchable> & CommentaryResponse & Partial<Watchable> & TabLayoutModificationResponse<NewSplitRequest> & Partial<Watchable> & XtermResponse & Partial<Watchable> & RandomErrorResponse1 & Partial<Watchable> & RandomErrorResponse2 & Partial<Watchable> & Table<Row> & Partial<WithSourceReferences> & Partial<Watchable> & Abortable & { response: ScalarResponse<Row> } & Partial<Watchable> & ResourceWithMetadata<void> & Partial<Watchable> & ResourceWithMetadata<void> & View<ResourceWithMetadata<void>> & Partial<Watchable> & NavResponse & Partial<Watchable> & RadioTable & Partial<Watchable> & UsageModel & Partial<Watchable> & RawResponse<void> & Partial<Watchable> & ResourceWithMetadata<void>[] & Partial<Watchable>

Returns

model is string & Watchable & number & Watchable & false & Watchable & true & Watchable & HTMLElement & Watchable & Error & Watchable & MarkdownResponse & Watchable & ReactResponse & Watchable & MixedResponse & Watchable & CommentaryResponse & Watchable & TabLayoutModificationResponse<NewSplitRequest> & Watchable & XtermResponse & Watchable & RandomErrorResponse1 & Watchable & RandomErrorResponse2 & Watchable & Table<Row> & Partial<WithSourceReferences> & Watchable & Abortable & Object & Watchable & ResourceWithMetadata<void> & Watchable & ResourceWithMetadata<void> & View<ResourceWithMetadata<void>> & Watchable & NavResponse & Watchable & RadioTable & Watchable & UsageModel & Watchable & RawResponse<void> & Watchable & ResourceWithMetadata<void>[] & Watchable

Defined in

packages/core/src/core/jobs/watchable.ts:88


isXtermErrorResponse

isXtermErrorResponse(entity): boolean

Parameters

Name Type
entity Entity<void, Row, ResourceWithMetadata<void>>

Returns

boolean

Defined in

packages/core/src/models/XtermResponse.ts:38


isXtermResponse

isXtermResponse(entity): entity is XtermResponse

Parameters

Name Type
entity Entity<void, Row, ResourceWithMetadata<void>>

Returns

entity is XtermResponse

Defined in

packages/core/src/models/XtermResponse.ts:33


maybeKuiLink

maybeKuiLink(link): string

Parameters

Name Type
link string

Returns

string

Defined in

packages/core/src/models/CommentaryResponse.ts:74


offQuit

offQuit(handler): void

Parameters

Name Type
handler () => void

Returns

void

Defined in

packages/core/src/api/window-events.ts:47


onQuit

onQuit(handler): void

Parameters

Name Type
handler () => void

Returns

void

Defined in

packages/core/src/api/window-events.ts:39


pexecInCurrentTab

pexecInCurrentTab(command, topLevelTab?, isInternalCallpath?, incognito?, execUUID?): Promise<KResponse<any>>

Execute the given command in the current (or given) tab.

Parameters

Name Type Default value Description
command string undefined -
topLevelTab? Tab undefined -
isInternalCallpath boolean false -
incognito boolean false Execute the command quietly but do not display the result in the Terminal
execUUID? string undefined -

Returns

Promise<KResponse<any>>

Defined in

packages/core/src/webapp/tab.ts:137


pluginUserHome

Const pluginUserHome(): Promise<string>

Home for user-installed plugins

Returns

Promise<string>

Defined in

packages/core/src/api/plugins.ts:55


radioTableAddHint

radioTableAddHint(row, cidx, newHints): void

Add the hint to the given RadioTableCell

Parameters

Name Type
row RadioTableRow
cidx number
newHints CellShould[]

Returns

void

Defined in

packages/core/src/models/RadioTable.ts:68


radioTableCellToString

radioTableCellToString(cell, useTitle?): string

Project the string value of the given cell

Parameters

Name Type Default value
cell RadioTableCell undefined
useTitle boolean false

Returns

string

Defined in

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


radioTableHintsAsCss

radioTableHintsAsCss(cell): string

Parameters

Name Type
cell RadioTableCell

Returns

string

Defined in

packages/core/src/models/RadioTable.ts:47


registerBadge

registerBadge<Resource>(registration): void

Register a new badge

Type parameters

Name Type
Resource extends ResourceWithMetadata<void, Resource>

Parameters

Name Type
registration BadgeRegistration<Resource>

Returns

void

Defined in

packages/core/src/webapp/views/registrar/badges.ts:54


registerMode

registerMode<Resource>(registration): void

Register a new mode

Type parameters

Name Type
Resource extends ResourceWithMetadata<void, Resource>

Parameters

Name Type
registration ModeRegistration<Resource>

Returns

void

Defined in

packages/core/src/webapp/views/registrar/modes.ts:50


registerModeWhen

Const registerModeWhen<Resource>(when): (mode: ModeDeclaration<Resource>) => void

Type parameters

Name Type
Resource extends ResourceWithMetadata<void, Resource>

Parameters

Name Type
when ModeFilter<Resource>

Returns

fn

▸ (mode): void

Parameters
Name Type
mode ModeDeclaration<Resource>
Returns

void

Defined in

packages/core/src/webapp/views/registrar/modes.ts:55


registerTabCompletionEnumerator

registerTabCompletionEnumerator(enumerator, priority?): void

A plugin has offered a tab completion Enumerator

Parameters

Name Type Default value
enumerator Enumerator undefined
priority number 0

Returns

void

Defined in

packages/core/src/repl/tab-completion.ts:60


registerTabState

registerTabState(registration): void

Parameters

Name Type
registration TabStateRegistration

Returns

void

Defined in

packages/core/src/models/tab-state.ts:38


renderUsage

renderUsage(_): string

Parameters

Name Type
_ PrettyUsageModel

Returns

string

Defined in

packages/core/src/core/usage/render-usage.ts:20


sameRow

sameRow(A, B): boolean

Are the two Rows the same?

Parameters

Name Type
A Row
B Row

Returns

boolean

Defined in

packages/core/src/webapp/models/table.ts:242


sameTab

Const sameTab(tab1, tab2): boolean

Parameters

Name Type
tab1 Tab
tab2 Tab

Returns

boolean

Defined in

packages/core/src/webapp/tab.ts:86


setEvaluatorImpl

Const setEvaluatorImpl(impl): void

Parameters

Name Type
impl ReplEval

Returns

void

Defined in

packages/core/src/repl/exec.ts:76


split

Const split(str, removeOuterQuotes?, removeInlineOuterQuotes?, splitBy?, startIdx?, endIdx?): string[]

Parameters

Name Type Default value
str string undefined
removeOuterQuotes boolean true
removeInlineOuterQuotes boolean false
splitBy? string undefined
startIdx number 0
endIdx number str.length

Returns

string[]

Defined in

packages/core/src/repl/split.ts:197


splitFor

splitFor(topLevelTab): Tab

We need to find the instance of the Split that has a REPL controller

  • if given a topLevelTab that is already a Split, then we're "good to go"
  • if we are given an actual top-level tab (i.e. not a split), then we need to find the first Split child of that given tab
  • if we aren't given a tab as input, then we search from document

Parameters

Name Type
topLevelTab Tab

Returns

Tab

Defined in

packages/core/src/webapp/tab.ts:117


splitIntoPipeStages

splitIntoPipeStages(command): CommandLine["pipeStages"]

Split a given command line into the stages of the pipeline

e.g. if command=a -- b c|d > e, then pipeStages={ prefix: 'a', stages: [['b','c'],'d'], redirect: 'e' }

Parameters

Name Type
command string

Returns

CommandLine["pipeStages"]

Defined in

packages/core/src/repl/pipe-stages.ts:27


teeToFile

teeToFile(response): Promise<void>

Parameters

Name Type
response Entity<void, Row, ResourceWithMetadata<void>>

Returns

Promise<void>

Defined in

packages/core/src/util/tee.ts:21


tellMain

Const tellMain(message, channel?): Promise<unknown>

Send a synchronous message to the main process

Parameters

Name Type
message string | Record<string, any>
channel? "asynchronous-message" | "synchronous-message"

Returns

Promise<unknown>

Defined in

packages/core/src/webapp/electron-events.ts:64


typeahead

typeahead(prefix): string[]

Typeahead find lookup

Parameters

Name Type
prefix string

Returns

string[]

list of matches

Defined in

packages/core/src/commands/typeahead.ts:100


unparse

Const unparse(options): string

Turn an options struct into a cli string

Parameters

Name Type Description
options ParsedOptions is the command line options struct given by the user.

Returns

string

Defined in

packages/core/src/core/utility.ts:26


withLanguage

withLanguage(execOptions): LanguageBearing

Parameters

Name Type
execOptions ExecOptions

Returns

LanguageBearing

Defined in

packages/core/src/models/execOptions.ts:123