{
  "id": "@typed/ui/Storybook#mount",
  "canonicalId": "@typed/ui/Storybook#mount",
  "symbol": {
    "id": "@typed/ui/Storybook#mount",
    "packageName": "@typed/ui",
    "moduleName": "Storybook",
    "exportName": "mount",
    "kind": "function",
    "signatures": [
      "export declare function mount<E>(content: Fx.Fx<RenderEvent, E, Scope.Scope | RenderTemplate>, document?: Document): Promise<MountedStory>;"
    ],
    "summary": "Mounts a Typed component in an isolated Storybook canvas.\n\nThe mount stays alive after its first render so reactive attributes and event\nhandlers remain attached. It is released explicitly or when Storybook\nremoves the canvas from its document.",
    "sections": {
      "Why": "Waiting only for the first `RenderEvent` and then ending the fiber would\ndetach reactive attributes and event handlers. This helper keeps the Typed\nrenderer alive while still giving tests an explicit disposal boundary.",
      "Ownership and lifetime": "`mount` creates an unsafe Scope dedicated to this story, starts the render\nfiber, and resolves only after the first event. `dispose` interrupts and\ncloses it idempotently. After the canvas has once been connected, a\ndocument-scoped MutationObserver disposes it when removed and then disconnects.\nCalling `dispose` while the canvas is still connected does **not** disconnect\nthat observer: it continues retaining the document, canvas, and disposal\nclosure until the canvas is removed. Tests or hosts that keep a disposed\ncanvas connected must remove it themselves to release that observer. If\nrendering fails before the first event, Scope cleanup runs before rejection\nand no removal observer is installed.",
      "Platform requirements": "This is a browser/testing API. The provided Document supplies element and\nMutationObserver implementations. The canvas is returned detached so\nStorybook or a test controls where it enters the DOM."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { mount } from \"@typed/ui/Storybook\"\nimport { html } from \"@typed/template\"\n\nconst story = await mount(html`<button type=\"button\">Save</button>`)\ndocument.body.append(story.canvas)\n// Run interactions and assertions against story.canvas.\nawait story.dispose()\nstory.canvas.remove() // disconnects the removal observer"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/ui/src/Storybook.ts",
      "line": 86
    },
    "since": "1.0.0",
    "category": "Story mounting"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/ui/Storybook#mount",
    "packageName": "@typed/ui",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": "Storybook",
    "consumerSpecifier": "@typed/ui/Storybook",
    "exportName": "mount",
    "qualifiedName": "mount",
    "declarationKey": "declaration:4b0046bc4acd26a7ad536980",
    "family": "function",
    "signatures": [
      "export declare function mount<E>(content: Fx.Fx<RenderEvent, E, Scope.Scope | RenderTemplate>, document?: Document): Promise<MountedStory>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/Storybook.ts",
        "start": {
          "line": 86,
          "column": 1
        },
        "end": {
          "line": 126,
          "column": 2
        }
      }
    ],
    "aliases": [],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:4b0046bc4acd26a7ad536980",
    "name": "mount",
    "family": "function",
    "facets": [
      {
        "family": "function",
        "syntaxKind": "FunctionDeclaration",
        "signatures": [
          "export declare function mount<E>(content: Fx.Fx<RenderEvent, E, Scope.Scope | RenderTemplate>, document?: Document): Promise<MountedStory>;"
        ],
        "typeParameters": [
          "E"
        ],
        "sourceSpans": [
          {
            "file": "packages/ui/src/Storybook.ts",
            "start": {
              "line": 86,
              "column": 1
            },
            "end": {
              "line": 126,
              "column": 2
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare function mount<E>(content: Fx.Fx<RenderEvent, E, Scope.Scope | RenderTemplate>, document?: Document): Promise<MountedStory>;"
    ],
    "typeParameters": [
      "E"
    ],
    "summary": "Mounts a Typed component in an isolated Storybook canvas.\n\nThe mount stays alive after its first render so reactive attributes and event\nhandlers remain attached. It is released explicitly or when Storybook\nremoves the canvas from its document.",
    "sections": {
      "Why": "Waiting only for the first `RenderEvent` and then ending the fiber would\ndetach reactive attributes and event handlers. This helper keeps the Typed\nrenderer alive while still giving tests an explicit disposal boundary.",
      "Ownership and lifetime": "`mount` creates an unsafe Scope dedicated to this story, starts the render\nfiber, and resolves only after the first event. `dispose` interrupts and\ncloses it idempotently. After the canvas has once been connected, a\ndocument-scoped MutationObserver disposes it when removed and then disconnects.\nCalling `dispose` while the canvas is still connected does **not** disconnect\nthat observer: it continues retaining the document, canvas, and disposal\nclosure until the canvas is removed. Tests or hosts that keep a disposed\ncanvas connected must remove it themselves to release that observer. If\nrendering fails before the first event, Scope cleanup runs before rejection\nand no removal observer is installed.",
      "Platform requirements": "This is a browser/testing API. The provided Document supplies element and\nMutationObserver implementations. The canvas is returned detached so\nStorybook or a test controls where it enters the DOM."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { mount } from \"@typed/ui/Storybook\"\nimport { html } from \"@typed/template\"\n\nconst story = await mount(html`<button type=\"button\">Save</button>`)\ndocument.body.append(story.canvas)\n// Run interactions and assertions against story.canvas.\nawait story.dispose()\nstory.canvas.remove() // disconnects the removal observer"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/ui/src/Storybook.ts",
        "start": {
          "line": 86,
          "column": 1
        },
        "end": {
          "line": 126,
          "column": 2
        }
      }
    ],
    "since": "1.0.0",
    "category": "Story mounting"
  }
}
