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.

Reading env requires --allow-env permission. The adapter checks permissions before reading, so a missing or scoped grant leaves the ungranted variables unset instead of failing or prompting.

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

Signatures ​

ts
interface DenoNamespace {}

Members ​

Properties ​

build ​

Build target metadata (OS detection).

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

version ​

Deno version info — used for minimum-version guard.

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

args ​

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

ts
args: readonly string[];

permissions ​

Permission state queries; read without prompting the user.

ts
permissions?: { querySync(descriptor: { name: "env"; variable?: string; }): { state: "granted" | "denied" | "prompt"; }; };

env ​

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

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

stdout ​

Standard output — synchronous byte writer with TTY detection.

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

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>; setRaw(mode: boolean): void; isTerminal(): boolean; };

Methods ​

cwd ​

Current working directory (may throw if --allow-read is denied for cwd).

ts
cwd(): string;

consoleSize ​

Current console dimensions.

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

addSignalListener ​

Register a native signal listener.

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

removeSignalListener ​

Remove a native signal listener.

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

exit ​

Exit the process with the given code.

ts
exit(code: number): never;

readTextFile ​

Read a file as UTF-8 text (requires --allow-read).

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

stat ​

Probe a filesystem path (requires --allow-read).

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

mkdir ​

Create a directory (requires --allow-write).

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

See Also ​

Released under the MIT License.