@dxos/echo
    Preparing search index...

    Type Alias Segment<T>

    Segment: [string] extends [T]
        ? T
        : T extends ""
            ? never
            : T extends `${string}${Invalid}${string}`
                ? never
                : T extends `${Digit}${string}` ? never : T

    Compile-time validation of a single NSID segment in final position: alphanumeric with a leading letter, per the final group of DXN_SPEC_REGEXP. Resolves to T when valid and never otherwise.

    Matches on excluded characters rather than walking the string character by character, so an interpolated segment (`item${number}`) is accepted rather than rejected for a placeholder the type cannot evaluate — a walk cannot tell a placeholder from a bad character. A widened string passes through for the same reason, leaving both to the runtime check.

    Type Parameters

    • T extends string