{
  "id": "@typed/navigation#memory",
  "canonicalId": "@typed/navigation#memory",
  "symbol": {
    "id": "@typed/navigation#memory",
    "packageName": "@typed/navigation",
    "moduleName": ".",
    "exportName": "memory",
    "kind": "constant",
    "signatures": [
      "export declare const memory: (options: MemoryOptions) => Layer.Layer<Navigation, never, Uuid7State>;"
    ],
    "summary": "Provides Navigation from an in-memory history state.",
    "sections": {
      "Why": "The same Router and application code can run during SSR or tests without browser globals. Back and\nforward are bounded, `traverseTo` uses stable entry keys, and history retention is deterministic.\nThis constructor expects at least one entry, a positive `maxEntries`, and an active index that\nsurvives tail retention. If truncation is needed, the active entry must lie in the newest\n`maxEntries` entries; equivalently, `currentIndex >= entries.length - maxEntries`. These\npreconditions are not validated. `maxEntries: 0` currently behaves as unbounded retention rather\nthan zero capacity. Use `initialMemory` for the common one-URL case.",
      "Ownership and lifetime": "Layer acquisition creates the navigation state and handler registries; Layer release finalizes\ntheir Scope. The Layer requires `Uuid7State` for newly committed destinations and fails with\n`NavigationError` when identifier generation or a custom backend commit fails."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { memory } from \"@typed/navigation/memory\"\nimport type { Destination } from \"@typed/navigation/model\"\n\nconst entry: Destination = {\n  id: \"entry-1\",\n  key: \"entry-1\",\n  url: new URL(\"https://example.com/products\"),\n  state: undefined,\n  sameDocument: true\n}\nconst NavigationLive = memory({ entries: [entry], currentIndex: 0, maxEntries: 50 })"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/navigation/src/memory.ts",
      "line": 271
    },
    "since": "1.0.0",
    "category": "Memory history providers"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/navigation#memory",
    "packageName": "@typed/navigation",
    "packageVersion": "1.0.0-beta.7",
    "moduleName": ".",
    "consumerSpecifier": "@typed/navigation",
    "exportName": "memory",
    "qualifiedName": "memory",
    "declarationKey": "declaration:2e9dd2e42b8d61b741325201",
    "family": "variable",
    "signatures": [
      "export declare const memory: (options: MemoryOptions) => Layer.Layer<Navigation, never, Uuid7State>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/navigation/src/memory.ts",
        "start": {
          "line": 271,
          "column": 14
        },
        "end": {
          "line": 298,
          "column": 4
        }
      }
    ],
    "aliases": [
      "@typed/navigation/memory#memory"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:2e9dd2e42b8d61b741325201",
    "name": "memory",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const memory: (options: MemoryOptions) => Layer.Layer<Navigation, never, Uuid7State>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/navigation/src/memory.ts",
            "start": {
              "line": 271,
              "column": 14
            },
            "end": {
              "line": 298,
              "column": 4
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const memory: (options: MemoryOptions) => Layer.Layer<Navigation, never, Uuid7State>;"
    ],
    "typeParameters": [],
    "summary": "Provides Navigation from an in-memory history state.",
    "sections": {
      "Why": "The same Router and application code can run during SSR or tests without browser globals. Back and\nforward are bounded, `traverseTo` uses stable entry keys, and history retention is deterministic.\nThis constructor expects at least one entry, a positive `maxEntries`, and an active index that\nsurvives tail retention. If truncation is needed, the active entry must lie in the newest\n`maxEntries` entries; equivalently, `currentIndex >= entries.length - maxEntries`. These\npreconditions are not validated. `maxEntries: 0` currently behaves as unbounded retention rather\nthan zero capacity. Use `initialMemory` for the common one-URL case.",
      "Ownership and lifetime": "Layer acquisition creates the navigation state and handler registries; Layer release finalizes\ntheir Scope. The Layer requires `Uuid7State` for newly committed destinations and fails with\n`NavigationError` when identifier generation or a custom backend commit fails."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { memory } from \"@typed/navigation/memory\"\nimport type { Destination } from \"@typed/navigation/model\"\n\nconst entry: Destination = {\n  id: \"entry-1\",\n  key: \"entry-1\",\n  url: new URL(\"https://example.com/products\"),\n  state: undefined,\n  sameDocument: true\n}\nconst NavigationLive = memory({ entries: [entry], currentIndex: 0, maxEntries: 50 })"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/navigation/src/memory.ts",
        "start": {
          "line": 271,
          "column": 14
        },
        "end": {
          "line": 298,
          "column": 4
        }
      }
    ],
    "since": "1.0.0",
    "category": "Memory history providers"
  }
}
