Package APIs

@master/css-runtime

Browser runtime for Master CSS

Public entrypoints

Observe classes in a document or shadow root and maintain their generated CSS. Runtime startup requires a compiled manifest and returns an owned session.

Declarations show the public surface of each import path. Referenced type names may be local to the package; import only names listed as exports here. Private implementation is omitted, while constructor restrictions remain visible.

@master/css-runtime

Runtime startup, observation, snapshots and custom-element integration.

Exports · 11

MasterCSSRuntime

TypeScript
export declare class MasterCSSRuntime extends RuntimeHost implements Disposable {    private constructor();    get binding(): MasterCSSEngine['binding'];    static start(options: MasterCSSRuntimeStartOptions): Promise<MasterCSSRuntime>;    ensureClassRules(classNames: readonly string[]): MasterCSSEngineTransition;    deleteClassRules(classNames: readonly string[]): MasterCSSEngineTransition;    observe(): this;    disconnect(): this;    refresh(manifest?: MasterCSSManifest): this;    snapshot(): MasterCSSRuntimeSnapshot;    dispose(): void;    [Symbol.dispose](): void;}

MasterCSSRuntimeBinding

TypeScript
export type MasterCSSRuntimeBinding = 'auto' | 'native' | 'wasm';

MasterCSSRuntimeClassSnapshot

TypeScript
export interface MasterCSSRuntimeClassSnapshot {    readonly usageCount: number;    readonly retained: boolean;    readonly rules: readonly MasterCSSRuntimeRuleSnapshot[];}

MasterCSSRuntimeFacade

TypeScript
export interface MasterCSSRuntimeFacade extends Disposable {    readonly binding: MasterCSSEngine['binding'];    observe(): this;    disconnect(): this;    refresh(manifest?: MasterCSSManifest): this;    ensureClassRules(classNames: readonly string[]): MasterCSSEngineTransition;    deleteClassRules(classNames: readonly string[]): MasterCSSEngineTransition;    snapshot(): MasterCSSRuntimeSnapshot;    dispose(): void;}

MasterCSSRuntimeLayerSnapshot

TypeScript
export interface MasterCSSRuntimeLayerSnapshot {    readonly name: typeof LAYER_ORDER[number] | 'keyframes';    readonly cssText: string;    readonly ruleCount: number;}

MasterCSSRuntimeOptions

TypeScript
export interface MasterCSSRuntimeOptions {    readonly manifest: MasterCSSManifest;    readonly root?: Document | ShadowRoot;    readonly emittedGlobals?: MasterCSSEmittedGlobals;    readonly hydrationManifest?: MasterCSSHydrationManifest;}

MasterCSSRuntimeRuleSnapshot

TypeScript
export interface MasterCSSRuntimeRuleSnapshot {    readonly key: string;    readonly layer: MasterCSSManifestUtilityLayerName;    readonly text: string;}

MasterCSSRuntimeSnapshot

TypeScript
export interface MasterCSSRuntimeSnapshot {    readonly binding: MasterCSSEngine['binding'];    readonly cssText: string;    readonly observing: boolean;    readonly classRules: Readonly<Record<string, MasterCSSRuntimeClassSnapshot>>;    readonly usageCounts: Readonly<Record<string, number>>;    readonly layers: readonly MasterCSSRuntimeLayerSnapshot[];    readonly hydration: {        readonly state: 'none' | 'runtime' | 'progressive';        readonly manifestLoaded: boolean;        readonly failureReason?: string;    };}

MasterCSSRuntimeStartOptions

TypeScript
export interface MasterCSSRuntimeStartOptions extends MasterCSSRuntimeOptions {    readonly binding?: MasterCSSRuntimeBinding;    readonly startupTimeoutMs?: number;    readonly onDiagnostic?: (diagnostic: MasterCSSDiagnostic) => void;}

withMasterCSSRuntime

TypeScript
export declare function withMasterCSSRuntime(  options: WithMasterCSSRuntimeOptions): <T extends MasterCSSRuntimeHostConstructor>(target: T) => T;

WithMasterCSSRuntimeOptions

TypeScript
export interface WithMasterCSSRuntimeOptions {    readonly manifest: MasterCSSRuntimeManifest;    readonly root?: MasterCSSRuntimeRoot;    readonly emittedGlobals?: MasterCSSRuntimeEmittedGlobals;    readonly hydrationManifest?: MasterCSSRuntimeHydrationManifest;}

Using this contract

Await MasterCSSRuntime.start() before using the session, and call dispose() when its owner is finished. withMasterCSSRuntime() integrates startup and disposal with custom-element connection callbacks and requires a shadow root. See Rendering Modes for the browser workflow.


© 2026 Aoyue Design LLC.MIT License
Trademark Policy