{
  "id": "@typed/navigation#fromWindow",
  "canonicalId": "@typed/navigation#fromWindow",
  "symbol": {
    "id": "@typed/navigation#fromWindow",
    "packageName": "@typed/navigation",
    "moduleName": ".",
    "exportName": "fromWindow",
    "kind": "constant",
    "signatures": [
      "export declare const fromWindow: (window?: Window) => Layer.Layer<Navigation, NavigationError, Uuid7State>;"
    ],
    "summary": "Provides Navigation by adapting a browser Window's History API and `popstate` events.",
    "sections": {
      "Why": "Browser history remains the platform authority while Typed adds reactive entries, stable keys,\nscoped handlers, and typed failures. Existing or foreign history state is reconciled instead of\nassuming every entry was created by Typed.",
      "Ownership and lifetime": "Layer acquisition reads and normalizes current history, allocates entry identity through `Uuid7State`,\nand installs the `popstate` listener. The Layer Scope owns that listener, pending traversals,\nreactive state, and handler registrations. Browser calls, malformed URLs, and unknown traversal\nstate fail as `NavigationError`; interruption runs Effect finalizers but cannot undo a platform\nhistory mutation that already completed."
    },
    "examples": [
      {
        "language": "text",
        "code": "```ts\nimport { fromWindow } from \"@typed/navigation/fromWindow\"\n\nconst NavigationLive = fromWindow(window)\n```\n\nBrowser and server providers expose the same Navigation contract; server code should use\n`@typed/navigation/memory` and must not evaluate the default `globalThis.window` argument."
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/navigation/src/fromWindow.ts",
      "line": 129
    },
    "since": "1.0.0",
    "category": "Browser history provider"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/navigation#fromWindow",
    "packageName": "@typed/navigation",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/navigation",
    "exportName": "fromWindow",
    "qualifiedName": "fromWindow",
    "declarationKey": "declaration:295530482a8869ac5ca2a5d8",
    "family": "variable",
    "signatures": [
      "export declare const fromWindow: (window?: Window) => Layer.Layer<Navigation, NavigationError, Uuid7State>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/navigation/src/fromWindow.ts",
        "start": {
          "line": 129,
          "column": 14
        },
        "end": {
          "line": 316,
          "column": 4
        }
      }
    ],
    "aliases": [
      "@typed/navigation/fromWindow#fromWindow"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:295530482a8869ac5ca2a5d8",
    "name": "fromWindow",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const fromWindow: (window?: Window) => Layer.Layer<Navigation, NavigationError, Uuid7State>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/navigation/src/fromWindow.ts",
            "start": {
              "line": 129,
              "column": 14
            },
            "end": {
              "line": 316,
              "column": 4
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const fromWindow: (window?: Window) => Layer.Layer<Navigation, NavigationError, Uuid7State>;"
    ],
    "typeParameters": [],
    "summary": "Provides Navigation by adapting a browser Window's History API and `popstate` events.",
    "sections": {
      "Why": "Browser history remains the platform authority while Typed adds reactive entries, stable keys,\nscoped handlers, and typed failures. Existing or foreign history state is reconciled instead of\nassuming every entry was created by Typed.",
      "Ownership and lifetime": "Layer acquisition reads and normalizes current history, allocates entry identity through `Uuid7State`,\nand installs the `popstate` listener. The Layer Scope owns that listener, pending traversals,\nreactive state, and handler registrations. Browser calls, malformed URLs, and unknown traversal\nstate fail as `NavigationError`; interruption runs Effect finalizers but cannot undo a platform\nhistory mutation that already completed."
    },
    "examples": [
      {
        "language": "text",
        "code": "```ts\nimport { fromWindow } from \"@typed/navigation/fromWindow\"\n\nconst NavigationLive = fromWindow(window)\n```\n\nBrowser and server providers expose the same Navigation contract; server code should use\n`@typed/navigation/memory` and must not evaluate the default `globalThis.window` argument."
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/navigation/src/fromWindow.ts",
        "start": {
          "line": 129,
          "column": 14
        },
        "end": {
          "line": 316,
          "column": 4
        }
      }
    ],
    "since": "1.0.0",
    "category": "Browser history provider"
  }
}
