Type Alias WritableDataPropertyKeys<T>

WritableDataPropertyKeys: {
    [K in WritablePropertyKeys<T>]-?: ContainsCallable<T[K]> extends true
        ? never
        : K
}[WritablePropertyKeys<T>]

Produces the writable property keys of T whose value types contain no callable member.

Methods, function-valued properties, optional function-valued properties, and unions containing a callable type are excluded. Properties typed as any are also conservatively excluded.

Type Parameters

  • T extends object

    Object type to inspect.

interface Example
{
value: number;
callback: () => void;
optionalCallback?: () => void;
mixed: string | (() => void);
}

type Keys = WritableDataPropertyKeys<Example>;
// "value"