Package APIs

@master/css-server

Server-side HTML renderer for Master CSS

Public entrypoints

Render generated CSS into HTML and produce hydration data for the browser. Use a one-shot helper, a reusable renderer or a streaming HTML session to match the host lifecycle.

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-server

HTML rendering, streaming sessions and hydration options.

Exports · 13

createHTMLRenderSession

TypeScript
export declare function createHTMLRenderSession(  options: MasterCSSHTMLRenderOptions): MasterCSSHTMLRenderSession;

createServerRenderer

TypeScript
export declare function createServerRenderer(  options: MasterCSSServerRendererOptions): MasterCSSServerRenderer;

MasterCSSExternalHydrationManifestOptions

TypeScript
export interface MasterCSSExternalHydrationManifestOptions {    readonly type: 'external';    readonly source: MasterCSSExternalHydrationManifestSource;}

MasterCSSExternalHydrationManifestSource

TypeScript
export type MasterCSSExternalHydrationManifestSource = string | ((json: string, hydrationManifest: MasterCSSHydrationManifest) => string);

MasterCSSHTMLDocumentOptions

TypeScript
export interface MasterCSSHTMLDocumentOptions {    readonly hydrationManifest?: MasterCSSHydrationManifestRenderMode;}

MasterCSSHTMLRenderOptions

TypeScript
export interface MasterCSSHTMLRenderOptions extends MasterCSSServerRendererOptions, MasterCSSHTMLDocumentOptions {}

MasterCSSHTMLRenderResult

TypeScript
export interface MasterCSSHTMLRenderResult {    readonly html: string;    readonly cssText: string;    readonly classNames: readonly string[];    readonly invalidClassNames: readonly string[];    readonly hydrationManifest?: MasterCSSHydrationManifest;    readonly diagnostics: readonly MasterCSSDiagnostic[];}

MasterCSSHTMLRenderSession

TypeScript
export declare class MasterCSSHTMLRenderSession implements Disposable {    private constructor();    write(chunk: string): string;    end(finalChunk?: string): MasterCSSHTMLStreamEndResult;    dispose(): void;    [Symbol.dispose](): void;}

MasterCSSHTMLStreamEndResult

TypeScript
export interface MasterCSSHTMLStreamEndResult {    readonly chunk: string;    readonly result: MasterCSSHTMLRenderResult;}

MasterCSSHydrationManifestRenderMode

TypeScript
export type MasterCSSHydrationManifestRenderMode = 'return' | 'inject' | false | MasterCSSExternalHydrationManifestOptions;

MasterCSSServerRenderer

TypeScript
export declare class MasterCSSServerRenderer implements Disposable {    readonly maxCachedClasses: number;    private constructor();    renderHTML(      html: string,      options?: MasterCSSHTMLDocumentOptions    ): MasterCSSHTMLRenderResult;    createHTMLRenderSession(      options?: MasterCSSHTMLDocumentOptions    ): import("./html-render-session").MasterCSSHTMLRenderSession;    dispose(): void;    [Symbol.dispose](): void;}

MasterCSSServerRendererOptions

TypeScript
export interface MasterCSSServerRendererOptions extends MasterCSSRenderSessionOptions {    readonly maxCachedClasses?: number;}

renderHTML

TypeScript
export declare function renderHTML(  html: string,  options: MasterCSSHTMLRenderOptions): MasterCSSHTMLRenderResult;

Using this contract

Provide a compiled manifest before rendering. Keep emitted-global and hydration metadata aligned with the CSS delivered to the client, and dispose reusable sessions after use. See Rendering Modes for complete HTML examples.


© 2026 Aoyue Design LLC.MIT License
Trademark Policy