## API Report File for "@microsoft/fast-ssr"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

import { AsyncLocalStorage } from 'async_hooks';
import { Binding } from '@microsoft/fast-element';
import { ComposableStyles } from '@microsoft/fast-element';
import { Constructable } from '@microsoft/fast-element';
import { DOMContainer } from '@microsoft/fast-element/di.js';
import { ExecutionContext } from '@microsoft/fast-element';
import { FASTElement } from '@microsoft/fast-element';
import { FASTElementDefinition } from '@microsoft/fast-element';
import { ViewBehaviorFactory } from '@microsoft/fast-element';
import { ViewTemplate } from '@microsoft/fast-element';

// @beta (undocumented)
export interface AsyncElementRenderer extends Omit<ElementRenderer, "renderShadow" | "renderAttributes"> {
    // (undocumented)
    renderAttributes(): IterableIterator<string | Promise<string>>;
    // (undocumented)
    renderShadow(renderInfo: RenderInfo): IterableIterator<string | Promise<string>>;
}

// @beta (undocumented)
export interface AsyncTemplateRenderer {
    // (undocumented)
    createRenderInfo(): RenderInfo;
    // (undocumented)
    render(template: ViewTemplate | string, renderInfo?: RenderInfo, source?: unknown, context?: ExecutionContext): IterableIterator<string | Promise<string>>;
    // (undocumented)
    withDefaultElementRenderers(...renderers: ConstructableElementRenderer<AsyncElementRenderer>[]): void;
}

// @beta (undocumented)
export interface ConstructableElementRenderer<T extends ElementRenderer | AsyncElementRenderer = ElementRenderer> {
    // (undocumented)
    new (tagName: string, renderInfo: RenderInfo): T;
    // Warning: (ae-forgotten-export) The symbol "AttributesMap" needs to be exported by the entry point exports.d.ts
    matchesClass(ctor: typeof HTMLElement, tagName: string, attributes: AttributesMap): boolean;
}

// @beta (undocumented)
export interface ConstructableFASTElementRenderer<T extends ElementRenderer | AsyncElementRenderer = ElementRenderer> extends ConstructableElementRenderer<T> {
    disable(...args: Array<string | typeof FASTElement | FASTElementDefinition>): void;
}

// @beta
export const DeclarativeShadowDOMPolyfill: Readonly<{
    undefinedElementStyles: string;
    nonStreamingTemplateUpgrade: string;
}>;

// @beta (undocumented)
export interface ElementRenderer {
    // (undocumented)
    attributeChangedCallback(name: string, prev: string | null, next: string | null): void;
    // (undocumented)
    connectedCallback(): void;
    // (undocumented)
    dispatchEvent(event: Event): boolean;
    // (undocumented)
    renderAttributes(): IterableIterator<string>;
    // (undocumented)
    renderShadow(renderInfo: RenderInfo): IterableIterator<string>;
    // (undocumented)
    setAttribute(name: string, value: string): void;
    // (undocumented)
    setProperty(name: string, value: unknown): void;
    // (undocumented)
    readonly tagName: string;
}

// @beta (undocumented)
function fastSSR(): {
    templateRenderer: TemplateRenderer;
    ElementRenderer: ConstructableFASTElementRenderer<SyncFASTElementRenderer>;
};

// Warning: (ae-incompatible-release-tags) The symbol "fastSSR" is marked as @public, but its signature references "SSRConfiguration" which is marked as @beta
//
// @public (undocumented)
function fastSSR(config: Omit<SSRConfiguration, "renderMode">): {
    templateRenderer: TemplateRenderer;
    ElementRenderer: ConstructableFASTElementRenderer<SyncFASTElementRenderer>;
};

// @beta (undocumented)
function fastSSR(config: SSRConfiguration & Record<"renderMode", "sync">): {
    templateRenderer: TemplateRenderer;
    ElementRenderer: ConstructableFASTElementRenderer<SyncFASTElementRenderer>;
};

// @beta (undocumented)
function fastSSR(config: SSRConfiguration & Record<"renderMode", "async">): {
    templateRenderer: AsyncTemplateRenderer;
    ElementRenderer: ConstructableFASTElementRenderer<AsyncFASTElementRenderer>;
};
export default fastSSR;

// @beta
export type Middleware = (req: any, res: any, next: () => any) => void;

// @beta (undocumented)
export type RenderInfo = {
    elementRenderers: ConstructableElementRenderer[];
    customElementInstanceStack: ElementRenderer[];
    customElementHostStack: ElementRenderer[];
};

// @beta
export const RequestStorage: Readonly<{
    readonly container: DOMContainer;
    set(key: any, value: any): any;
    get: typeof getItem;
    clear(): void;
    delete(key: any): boolean;
    has(key: any): boolean;
}>;

// @beta
export const RequestStorageManager: Readonly<{
    backend: AsyncLocalStorage<unknown>;
    installDOMShim(): void;
    uninstallDOMShim(): void;
    installDIContextRequestStrategy(): void;
    createStorage(options?: StorageOptions): Map<any, any>;
    run<T = unknown>(storage: Map<any, any>, callback: () => T): T;
    middleware(options?: StorageOptions): Middleware;
}>;

// @beta
export interface SSRConfiguration {
    deferHydration?: boolean;
    renderMode?: "sync" | "async";
    viewBehaviorFactoryRenderers?: ViewBehaviorFactoryRenderer<any>[];
}

// @beta
export type StorageOptions = {
    createWindow?: () => {
        [key: string]: unknown;
    };
    storage?: Map<any, any>;
};

// @beta
export interface StyleRenderer {
    render(styles: ComposableStyles): string;
}

// @beta (undocumented)
export interface TemplateRenderer {
    // (undocumented)
    createRenderInfo(): RenderInfo;
    // (undocumented)
    render(template: ViewTemplate | string, renderInfo?: RenderInfo, source?: unknown, context?: ExecutionContext): IterableIterator<string>;
    // (undocumented)
    withDefaultElementRenderers(...renderers: ConstructableElementRenderer[]): void;
}

// @beta
export interface ViewBehaviorFactoryRenderer<T extends ViewBehaviorFactory> {
    matcher: Constructable<T>;
    // Warning: (ae-forgotten-export) The symbol "DefaultTemplateRenderer" needs to be exported by the entry point exports.d.ts
    render(behaviorFactory: T, renderInfo: RenderInfo, source: any, renderer: DefaultTemplateRenderer, context: ExecutionContext): IterableIterator<string>;
}

// Warnings were encountered during analysis:
//
// dist/dts/exports.d.ts:41:5 - (ae-forgotten-export) The symbol "SyncFASTElementRenderer" needs to be exported by the entry point exports.d.ts
// dist/dts/exports.d.ts:44:5 - (ae-incompatible-release-tags) The symbol "templateRenderer" is marked as @public, but its signature references "TemplateRenderer" which is marked as @beta
// dist/dts/exports.d.ts:45:5 - (ae-incompatible-release-tags) The symbol "ElementRenderer" is marked as @public, but its signature references "ConstructableFASTElementRenderer" which is marked as @beta
// dist/dts/exports.d.ts:55:5 - (ae-forgotten-export) The symbol "AsyncFASTElementRenderer" needs to be exported by the entry point exports.d.ts
// dist/dts/request-storage.d.ts:32:5 - (ae-forgotten-export) The symbol "getItem" needs to be exported by the entry point exports.d.ts

// (No @packageDocumentation comment for this package)

```
