variable / @typed/navigation/model

Transition

Describes the currently proposed navigation before handlers and commit finish.

Package version
1.0.0-beta.7
Category
Transition schemas
Since
1.0.0

Import

import { Transition } from "@typed/navigation/model";

Signatures

export declare const Transition: 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 to: Schema.Struct<{
        readonly url: Schema.URLFromString;
        readonly state: Schema.Unknown;
        readonly sameDocument: Schema.Boolean;
        readonly key: Schema.optional<Schema.String>;
    }>;
    readonly info: Schema.optional<Schema.Unknown>;
}>;
export type Transition = typeof Transition.Type;

Why

Publishing an explicit transition lets renderers expose pending work without confusing it with a post-commit event or prematurely changing the current entry.

Ownership and lifetime

The schema acquires no resources. A navigation service owns the current transition and clears it on commit, cancellation, redirect, failure, or interruption.

Examples

import { Transition } from "@typed/navigation/model"
import * as Schema from "effect/Schema"

const isTransition = Schema.is(Transition)

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source