type-alias / @typed/router/Uri

FormatUri

Formats a type-level Uri record as a string literal, optionally after applying a base URI.

Package version
1.0.0-beta.7
Category
URI type inference
Since
1.0.0

Import

import type { FormatUri } from "@typed/router/Uri";

Signatures

export type FormatUri<Uri extends Uri.Any, BaseUri extends string = never> = Apply<FormatUrlLambda, [
    BaseUri
] extends [
    never
] ? Uri : Apply<ApplyBaseUriLambda<ParseUri<BaseUri>>, Uri>>;

Why

Type-level URI transformations can return the exact normalized string shape.

Ownership and lifetime

FormatUri assembles only a string-literal type from the supplied Uri; it produces no runtime string.

Source