@mwillbanks/tuil-core
Core runtime, lifecycle, capability, command, semantic, and terminal contracts for tuil.
Overview
Core runtime, lifecycle, capability, command, semantic, and terminal contracts for tuil.
@mwillbanks/tuil-core is independently installable and also participates in the
umbrella @mwillbanks/tuil runtime where applicable.
Installation
npm install @mwillbanks/tuil-coreHow it operates
Core owns the framework-neutral contracts used by every adapter: lifecycle stages, services, commands, terminal capabilities, semantic metadata, disposables, and render-mode resolution.
API
| API | Signature | Description |
|---|---|---|
AppLifecycleState | type AppLifecycleState | Public type AppLifecycleState. |
ColorDepth | type ColorDepth | Public type ColorDepth. |
Command | interface Command | Public interface Command. |
CommandContext | interface CommandContext | Public interface CommandContext. |
CommandExecution | interface CommandExecution | Public interface CommandExecution. |
CommandRegistry | class CommandRegistry | Public class CommandRegistry. |
CommandRegistryChange | type CommandRegistryChange | Public type CommandRegistryChange. |
createGlobalSearchExpression | function createGlobalSearchExpression | Public function createGlobalSearchExpression. |
defineCommand | function defineCommand | Public function defineCommand. |
defineService | function defineService | Public function defineService. |
deleteOnDispose | function deleteOnDispose | Public function deleteOnDispose. |
detectTerminalCapabilities | function detectTerminalCapabilities | Public function detectTerminalCapabilities. |
Disposable | interface Disposable | Public interface Disposable. |
DisposableStack | class DisposableStack | Public class DisposableStack. |
Disposer | type Disposer | Public type Disposer. |
escapeTerminalControlCharacters | function escapeTerminalControlCharacters | Public function escapeTerminalControlCharacters. |
hasTerminalControlCharacters | function hasTerminalControlCharacters | Public function hasTerminalControlCharacters. |
isSafeRegularExpressionSource | function isSafeRegularExpressionSource | Public function isSafeRegularExpressionSource. |
Lifecycle | class Lifecycle | Public class Lifecycle. |
RenderMode | type RenderMode | Public type RenderMode. |
resolveRenderMode | function resolveRenderMode | Public function resolveRenderMode. |
resolveTerminalViewport | function resolveTerminalViewport | Public function resolveTerminalViewport. |
SemanticMetadata | interface SemanticMetadata | Public interface SemanticMetadata. |
SemanticRole | type SemanticRole | Public type SemanticRole. |
ServiceContainer | class ServiceContainer | Public class ServiceContainer. |
ServiceDefinition | interface ServiceDefinition | Public interface ServiceDefinition. |
ServiceFactoryContext | interface ServiceFactoryContext | Public interface ServiceFactoryContext. |
ServiceMap | type ServiceMap | Public type ServiceMap. |
sliceTerminalText | function sliceTerminalText | Public function sliceTerminalText. |
TerminalBounds | interface TerminalBounds | Public interface TerminalBounds. |
TerminalCapabilities | interface TerminalCapabilities | Public interface TerminalCapabilities. |
TerminalCapabilityInput | interface TerminalCapabilityInput | Public interface TerminalCapabilityInput. |
TerminalInputProbe | interface TerminalInputProbe | Public interface TerminalInputProbe. |
TerminalOutputProbe | interface TerminalOutputProbe | Public interface TerminalOutputProbe. |
TerminalPlatform | type TerminalPlatform | Public type TerminalPlatform. |
terminalTextWidth | function terminalTextWidth | Public function terminalTextWidth. |
TerminalViewport | type TerminalViewport | Public type TerminalViewport. |
terminalViewportBreakpoints | constant terminalViewportBreakpoints | Public constant terminalViewportBreakpoints. |
toDisposable | function toDisposable | Public function toDisposable. |
truncateTerminalText | function truncateTerminalText | Public function truncateTerminalText. |
wrapTerminalText | function wrapTerminalText | Public function wrapTerminalText. |
Events and lifecycle
Core defines lifecycle state but does not own the event transport. The umbrella runtime projects lifecycle transitions onto app:* events.
All subscriptions and registrations return a disposer or belong to an owning runtime that disposes them in reverse order.
Example
import { Lifecycle } from "@mwillbanks/tuil-core";
const lifecycle = new Lifecycle();
await lifecycle.transition("initializing");