Type Alias ExtractProps<T>

ExtractProps<T>: {
    [k in keyof T as IsProp<T, k>]: T[k]
}

Type Parameters

  • T
class Player {
name!: string;
points!: number;
constructor(props: ExtractProps<Player>) {
Object.assign(this, props);
}
}
new Player({ name: 'colin', points: 42 });