{
  "id": "@typed/navigation/_core#makeNavigationCore",
  "canonicalId": "@typed/navigation#makeNavigationCore",
  "symbol": {
    "id": "@typed/navigation/_core#makeNavigationCore",
    "packageName": "@typed/navigation",
    "moduleName": "_core",
    "exportName": "makeNavigationCore",
    "kind": "constant",
    "signatures": [
      "export declare const makeNavigationCore: (origin: string, base: string, state: RefSubject.RefSubject<NavigationState, never, never>, commit: (before: BeforeNavigationEvent, runHandlers: (destination: Destination) => Effect.Effect<void>) => Effect.Effect<Destination, NavigationError>) => Effect.Effect<{\n    origin: string;\n    base: string;\n    entries: RefSubject.Computed<readonly {\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }[], never, never>;\n    currentEntry: RefSubject.Computed<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, never, never>;\n    transition: RefSubject.Filtered<{\n        readonly type: \"push\" | \"replace\" | \"reload\" | \"traverse\";\n        readonly from: {\n            readonly id: string;\n            readonly key: string;\n            readonly url: URL;\n            readonly state: unknown;\n            readonly sameDocument: boolean;\n        };\n        readonly to: {\n            readonly url: URL;\n            readonly state: unknown;\n            readonly sameDocument: boolean;\n            readonly key?: string | undefined;\n        };\n        readonly info?: unknown;\n    }, never, never>;\n    canGoBack: RefSubject.Computed<boolean, never, never>;\n    canGoForward: RefSubject.Computed<boolean, never, never>;\n    navigate: (pathOrUrl: string | URL, options?: NavigationNavigateOptions | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    back: (options?: {\n        readonly info?: unknown;\n    } | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    forward: (options?: {\n        readonly info?: unknown;\n    } | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    traverseTo: (key: string, options?: {\n        readonly info?: unknown;\n    } | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    reload: (options?: NavigationReloadOptions | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    onBeforeNavigation: <R = never, R2 = never>(handler: BeforeNavigationHandler<R, R2>) => Effect.Effect<void, never, R | R2 | Scope.Scope>;\n    onNavigation: <R = never, R2 = never>(handler: NavigationHandler<R, R2>) => Effect.Effect<void, never, R | R2 | Scope.Scope>;\n    updateCurrentEntry: (options: {\n        readonly state: unknown;\n    }) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n}, never, Scope.Scope>;"
    ],
    "summary": "Builds the Navigation service state machine around a provider-specific commit Effect.",
    "sections": {
      "Why": "Browser and memory providers must agree on ordering: publish the transition, run before handlers\nsequentially, follow redirect/cancel control flow, commit, update state, clear the transition,\nthen run post-commit handlers. Centralizing that protocol prevents backend drift.",
      "Ownership and lifetime": "The calling Layer owns the supplied state and returned service. Handler registration captures its\nEffect context and unregisters when its Scope closes. Redirects are capped at ten; malformed URLs,\nbackend failures, and redirect cycles surface as `NavigationError`. Interruption clears a still-\ncurrent transition through normal Effect cleanup."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { makeNavigationCore, type NavigationState } from \"@typed/navigation/_core\"\nimport type { RefSubject } from \"@typed/fx\"\nimport * as Effect from \"effect/Effect\"\nimport type { BeforeNavigationEvent, Destination } from \"@typed/navigation/model\"\n\ndeclare const state: RefSubject.RefSubject<NavigationState>\ndeclare const commit: (\n  event: BeforeNavigationEvent,\n  runHandlers: (destination: Destination) => Effect.Effect<void>\n) => Effect.Effect<Destination, never>\n\nconst NavigationLive = makeNavigationCore(\"https://example.com\", \"/\", state, commit)"
      }
    ],
    "relations": [],
    "source": {
      "file": "packages/navigation/src/_core.ts",
      "line": 124
    },
    "since": "1.0.0",
    "category": "Backend history state"
  },
  "exposure": {
    "recordKind": "declaration",
    "id": "@typed/navigation/_core#makeNavigationCore",
    "packageName": "@typed/navigation",
    "packageVersion": "1.0.0-beta.13",
    "moduleName": "_core",
    "consumerSpecifier": "@typed/navigation/_core",
    "exportName": "makeNavigationCore",
    "qualifiedName": "makeNavigationCore",
    "declarationKey": "declaration:0c0404fe6c42961048b124dd",
    "family": "variable",
    "signatures": [
      "export declare const makeNavigationCore: (origin: string, base: string, state: RefSubject.RefSubject<NavigationState, never, never>, commit: (before: BeforeNavigationEvent, runHandlers: (destination: Destination) => Effect.Effect<void>) => Effect.Effect<Destination, NavigationError>) => Effect.Effect<{\n    origin: string;\n    base: string;\n    entries: RefSubject.Computed<readonly {\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }[], never, never>;\n    currentEntry: RefSubject.Computed<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, never, never>;\n    transition: RefSubject.Filtered<{\n        readonly type: \"push\" | \"replace\" | \"reload\" | \"traverse\";\n        readonly from: {\n            readonly id: string;\n            readonly key: string;\n            readonly url: URL;\n            readonly state: unknown;\n            readonly sameDocument: boolean;\n        };\n        readonly to: {\n            readonly url: URL;\n            readonly state: unknown;\n            readonly sameDocument: boolean;\n            readonly key?: string | undefined;\n        };\n        readonly info?: unknown;\n    }, never, never>;\n    canGoBack: RefSubject.Computed<boolean, never, never>;\n    canGoForward: RefSubject.Computed<boolean, never, never>;\n    navigate: (pathOrUrl: string | URL, options?: NavigationNavigateOptions | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    back: (options?: {\n        readonly info?: unknown;\n    } | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    forward: (options?: {\n        readonly info?: unknown;\n    } | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    traverseTo: (key: string, options?: {\n        readonly info?: unknown;\n    } | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    reload: (options?: NavigationReloadOptions | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    onBeforeNavigation: <R = never, R2 = never>(handler: BeforeNavigationHandler<R, R2>) => Effect.Effect<void, never, R | R2 | Scope.Scope>;\n    onNavigation: <R = never, R2 = never>(handler: NavigationHandler<R, R2>) => Effect.Effect<void, never, R | R2 | Scope.Scope>;\n    updateCurrentEntry: (options: {\n        readonly state: unknown;\n    }) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n}, never, Scope.Scope>;"
    ],
    "sourceSpans": [
      {
        "file": "packages/navigation/src/_core.ts",
        "start": {
          "line": 124,
          "column": 14
        },
        "end": {
          "line": 498,
          "column": 3
        }
      }
    ],
    "aliases": [
      "@typed/navigation#makeNavigationCore"
    ],
    "isAlias": false,
    "static": false
  },
  "declaration": {
    "declarationKey": "declaration:0c0404fe6c42961048b124dd",
    "name": "makeNavigationCore",
    "family": "variable",
    "facets": [
      {
        "family": "variable",
        "syntaxKind": "VariableDeclaration",
        "signatures": [
          "export declare const makeNavigationCore: (origin: string, base: string, state: RefSubject.RefSubject<NavigationState, never, never>, commit: (before: BeforeNavigationEvent, runHandlers: (destination: Destination) => Effect.Effect<void>) => Effect.Effect<Destination, NavigationError>) => Effect.Effect<{\n    origin: string;\n    base: string;\n    entries: RefSubject.Computed<readonly {\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }[], never, never>;\n    currentEntry: RefSubject.Computed<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, never, never>;\n    transition: RefSubject.Filtered<{\n        readonly type: \"push\" | \"replace\" | \"reload\" | \"traverse\";\n        readonly from: {\n            readonly id: string;\n            readonly key: string;\n            readonly url: URL;\n            readonly state: unknown;\n            readonly sameDocument: boolean;\n        };\n        readonly to: {\n            readonly url: URL;\n            readonly state: unknown;\n            readonly sameDocument: boolean;\n            readonly key?: string | undefined;\n        };\n        readonly info?: unknown;\n    }, never, never>;\n    canGoBack: RefSubject.Computed<boolean, never, never>;\n    canGoForward: RefSubject.Computed<boolean, never, never>;\n    navigate: (pathOrUrl: string | URL, options?: NavigationNavigateOptions | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    back: (options?: {\n        readonly info?: unknown;\n    } | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    forward: (options?: {\n        readonly info?: unknown;\n    } | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    traverseTo: (key: string, options?: {\n        readonly info?: unknown;\n    } | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    reload: (options?: NavigationReloadOptions | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    onBeforeNavigation: <R = never, R2 = never>(handler: BeforeNavigationHandler<R, R2>) => Effect.Effect<void, never, R | R2 | Scope.Scope>;\n    onNavigation: <R = never, R2 = never>(handler: NavigationHandler<R, R2>) => Effect.Effect<void, never, R | R2 | Scope.Scope>;\n    updateCurrentEntry: (options: {\n        readonly state: unknown;\n    }) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n}, never, Scope.Scope>;"
        ],
        "typeParameters": [],
        "sourceSpans": [
          {
            "file": "packages/navigation/src/_core.ts",
            "start": {
              "line": 124,
              "column": 14
            },
            "end": {
              "line": 498,
              "column": 3
            }
          }
        ],
        "static": false,
        "readonly": false,
        "optional": false
      }
    ],
    "signatures": [
      "export declare const makeNavigationCore: (origin: string, base: string, state: RefSubject.RefSubject<NavigationState, never, never>, commit: (before: BeforeNavigationEvent, runHandlers: (destination: Destination) => Effect.Effect<void>) => Effect.Effect<Destination, NavigationError>) => Effect.Effect<{\n    origin: string;\n    base: string;\n    entries: RefSubject.Computed<readonly {\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }[], never, never>;\n    currentEntry: RefSubject.Computed<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, never, never>;\n    transition: RefSubject.Filtered<{\n        readonly type: \"push\" | \"replace\" | \"reload\" | \"traverse\";\n        readonly from: {\n            readonly id: string;\n            readonly key: string;\n            readonly url: URL;\n            readonly state: unknown;\n            readonly sameDocument: boolean;\n        };\n        readonly to: {\n            readonly url: URL;\n            readonly state: unknown;\n            readonly sameDocument: boolean;\n            readonly key?: string | undefined;\n        };\n        readonly info?: unknown;\n    }, never, never>;\n    canGoBack: RefSubject.Computed<boolean, never, never>;\n    canGoForward: RefSubject.Computed<boolean, never, never>;\n    navigate: (pathOrUrl: string | URL, options?: NavigationNavigateOptions | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    back: (options?: {\n        readonly info?: unknown;\n    } | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    forward: (options?: {\n        readonly info?: unknown;\n    } | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    traverseTo: (key: string, options?: {\n        readonly info?: unknown;\n    } | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    reload: (options?: NavigationReloadOptions | undefined) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n    onBeforeNavigation: <R = never, R2 = never>(handler: BeforeNavigationHandler<R, R2>) => Effect.Effect<void, never, R | R2 | Scope.Scope>;\n    onNavigation: <R = never, R2 = never>(handler: NavigationHandler<R, R2>) => Effect.Effect<void, never, R | R2 | Scope.Scope>;\n    updateCurrentEntry: (options: {\n        readonly state: unknown;\n    }) => Effect.Effect<{\n        readonly id: string;\n        readonly key: string;\n        readonly url: URL;\n        readonly state: unknown;\n        readonly sameDocument: boolean;\n    }, NavigationError, never>;\n}, never, Scope.Scope>;"
    ],
    "typeParameters": [],
    "summary": "Builds the Navigation service state machine around a provider-specific commit Effect.",
    "sections": {
      "Why": "Browser and memory providers must agree on ordering: publish the transition, run before handlers\nsequentially, follow redirect/cancel control flow, commit, update state, clear the transition,\nthen run post-commit handlers. Centralizing that protocol prevents backend drift.",
      "Ownership and lifetime": "The calling Layer owns the supplied state and returned service. Handler registration captures its\nEffect context and unregisters when its Scope closes. Redirects are capped at ten; malformed URLs,\nbackend failures, and redirect cycles surface as `NavigationError`. Interruption clears a still-\ncurrent transition through normal Effect cleanup."
    },
    "examples": [
      {
        "language": "ts",
        "code": "import { makeNavigationCore, type NavigationState } from \"@typed/navigation/_core\"\nimport type { RefSubject } from \"@typed/fx\"\nimport * as Effect from \"effect/Effect\"\nimport type { BeforeNavigationEvent, Destination } from \"@typed/navigation/model\"\n\ndeclare const state: RefSubject.RefSubject<NavigationState>\ndeclare const commit: (\n  event: BeforeNavigationEvent,\n  runHandlers: (destination: Destination) => Effect.Effect<void>\n) => Effect.Effect<Destination, never>\n\nconst NavigationLive = makeNavigationCore(\"https://example.com\", \"/\", state, commit)"
      }
    ],
    "sourceSpans": [
      {
        "file": "packages/navigation/src/_core.ts",
        "start": {
          "line": 124,
          "column": 14
        },
        "end": {
          "line": 498,
          "column": 3
        }
      }
    ],
    "since": "1.0.0",
    "category": "Backend history state"
  }
}
