@dxos/echo
    Preparing search index...

    Type Alias Name<T>

    Name: [string] extends [T]
        ? string
        : T extends `${infer Head}.${infer Rest}`
            ? Rest extends `${string}.${string}`
                ? [ValidSegmentChain<Rest>] extends [never] ? never : T
                : [string] extends [Head]
                    ? [Segment<Rest>] extends [never] ? never : T
                    : never
            : never

    Compile-time validation for NSID strings (the dxn: prefix is absent here).

    Checks two rules expressible with template literal types:

    • Three-segment minimum (at least two dots) for names that are fully known at compile time — matches the runtime grammar in DXN_SPEC_REGEXP and parse.
    • Final segment (after the last dot) is a valid Segment.

    The three-segment minimum only applies once Head (the portion before the first dot) resolves to a concrete literal, so a fully literal two-segment name like a.b is rejected. Template-literal call sites whose prefix is a runtime string (e.g. `${meta.key}.event`) can't be proven to have enough segments at compile time — Head there infers as string itself — so only the known final segment is checked; the rest is validated at runtime by the regex inside parse.

    Type Parameters

    • T extends string