@prismshadow/penguin-core/kernel · Authoring

Opaque

type-alias type-only
Source ↗
IMPORT import type { Opaque } from "@prismshadow/penguin-core/kernel";

Type-level markers the interface generator (bin/gen-ifaces.mjs) recognizes in a package. They exist only to be projected; at runtime they are the types they wrap.

A host object compared by NAME across the push boundary: Opaque<"AbortSignal"> projects to { opaque: "<declaring package>#AbortSignal" } — the generator qualifies the name by the package that declares the type, so two packages' Resources never match each other. The generator refuses an unmarked class type — writing this out is how a declaration says "structure not checked here".

Declaration

export type Opaque<Name extends string, T = unknown> = T & { readonly __opaque?: Name };

Members (1)

__opaque

readonly __opaque?: Name