devtypes
    Preparing search index...

    Type Alias LiteralUnion<T, U>

    LiteralUnion: T | U & Record<never, never>

    Create a union type that can be assigned a literal or its base type while maintaining autocomplete for the literal type

    Type Parameters

    • T extends U
    • U = string
    type LU = LiteralUnion<'small' | 'medium' | 'large'>;
    // 'small' | 'medium' | 'large' | (string & {})