дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 03:05:40 +02:00
21 рядки
657 B
TypeScript
21 рядки
657 B
TypeScript
/**
|
|
* The xterm.js-backed part of the terminal (`runtime.ts`) loads on first use:
|
|
* xterm is ~100 KB gzip that start-up does not need. No terminal session can
|
|
* exist before it has loaded.
|
|
*/
|
|
import type * as Runtime from "./runtime";
|
|
|
|
export type TerminalRuntime = typeof Runtime;
|
|
|
|
let loaded: TerminalRuntime | null = null;
|
|
let pending: Promise<TerminalRuntime> | null = null;
|
|
|
|
/** The runtime if it has been loaded, else `null`. */
|
|
export function terminalRuntime(): TerminalRuntime | null {
|
|
return loaded;
|
|
}
|
|
|
|
export function loadTerminalRuntime(): Promise<TerminalRuntime> {
|
|
return (pending ??= import("./runtime").then((m) => (loaded = m)));
|
|
}
|