devtypes - v2.0.0
    Preparing search index...

    Type Alias ReadonlyPropertyNames<T>

    ReadonlyPropertyNames: {
        [K in keyof T]-?: T[K] extends (...args: any[]) => any
            ? never
            : IfEquals<{ [P in K]: T[K] }, { -readonly [P in K]: T[K] }, never, K>
    }[keyof T]

    Extract public readonly property names from a class.

    Type Parameters

    • T

      A class or object type

    Returns a union of all readonly properties, excluding methods. Uses IfEquals to determine whether a property is readonly.

    class Config { readonly version = '1.0'; readonly name = 'app'; }
    type ReadonlyProps = ReadonlyPropertyNames< Config >; // 'version' | 'name'