# BeforeNavigationEvent

Describes the pre-commit event presented to navigation guards.

## Signatures

```ts
export declare const BeforeNavigationEvent: Schema.Struct<{
    readonly type: Schema.Union<readonly [
        Schema.Literal<"push">,
        Schema.Literal<"replace">,
        Schema.Literal<"reload">,
        Schema.Literal<"traverse">
    ]>;
    readonly from: Schema.Struct<{
        readonly id: Schema.String;
        readonly key: Schema.String;
        readonly url: Schema.URLFromString;
        readonly state: Schema.Unknown;
        readonly sameDocument: Schema.Boolean;
    }>;
    readonly delta: Schema.Int;
    readonly to: Schema.Struct<{
        readonly url: Schema.URLFromString;
        readonly state: Schema.Unknown;
        readonly sameDocument: Schema.Boolean;
        readonly key: Schema.optional<Schema.String>;
    }>;
    readonly info: Schema.Unknown;
}>;
```

```ts
export type BeforeNavigationEvent = typeof BeforeNavigationEvent.Type;
```

## Why

Guards need the old and proposed destinations plus traversal delta before a backend mutates
history. This event is deliberately distinct from post-commit {@link NavigationEvent}.

## Ownership and lifetime

The schema acquires no resources. The navigation operation owns each event until its registered
handlers settle; handlers must copy data they need later.

## Examples

```ts
import { BeforeNavigationEvent } from "@typed/navigation/model"
import * as Schema from "effect/Schema"

const isBeforeEvent = Schema.is(BeforeNavigationEvent)
```
