Skip to content

DenoNamespace

Minimal subset of the Deno namespace needed by the adapter.

We avoid @types/deno to keep the core runtime-agnostic at the type level. This interface declares only what createDenoAdapter actually reads.

The env property is optional because it requires --allow-env permission. When permission is denied, the adapter catches the error and falls back to an empty env object.

  • Import: @kjanat/dreamcli/runtime
  • Export kind: interface
  • Declared in: src/runtime/deno.ts
  • Source link: src/runtime/deno.ts:39

Signatures

ts
interface DenoNamespace {}

Members

Properties

args

Raw command-line args (excludes the binary/script — Deno pre-strips them).

ts
args: readonly string[];

build

Build target metadata (OS detection).

ts
build: { os: "darwin" | "linux" | "android" | "windows" | "freebsd" | "netbsd" | "aix" | "solaris" | "illumos"; };

env

Environment variable access (requires --allow-env).

ts
env: { get(key: string): string | undefined; toObject(): Record<string, string>; };

stderr

Standard error — synchronous byte writer.

ts
stderr: { writeSync(p: Uint8Array): number; };

stdin

Standard input — TTY detection and readable byte stream.

ts
stdin: { readable: ReadableStream<Uint8Array<ArrayBufferLike>>; isTerminal(): boolean; };

stdout

Standard output — synchronous byte writer with TTY detection.

ts
stdout: { isTerminal(): boolean; writeSync(p: Uint8Array): number; };

version

Deno version info — used for minimum-version guard.

ts
version?: { deno?: string; };

Methods

addSignalListener

ts
addSignalListener(signal: "SIGWINCH", listener: { (): void; }): void;

consoleSize

ts
consoleSize(): { columns: number; rows: number; };

cwd

ts
cwd(): string;

exit

ts
exit(code: number): never;

mkdir

ts
mkdir(path: string, options?: { recursive?: boolean; }): Promise<void>;

readTextFile

ts
readTextFile(path: string): Promise<string>;

removeSignalListener

ts
removeSignalListener(signal: "SIGWINCH", listener: { (): void; }): void;

stat

ts
stat(path: string): Promise<{ isDirectory: boolean; }>;

See Also

Released under the MIT License.