Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

conditional-pick.d.ts 933B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import {ConditionalKeys} from './conditional-keys';
  2. /**
  3. Pick keys from the shape that matches the given `Condition`.
  4. This is useful when you want to create a new type from a specific subset of an existing type. For example, you might want to pick all the primitive properties from a class and form a new automatically derived type.
  5. @example
  6. ```
  7. import {Primitive, ConditionalPick} from 'type-fest';
  8. class Awesome {
  9. name: string;
  10. successes: number;
  11. failures: bigint;
  12. run() {}
  13. }
  14. type PickPrimitivesFromAwesome = ConditionalPick<Awesome, Primitive>;
  15. //=> {name: string; successes: number; failures: bigint}
  16. ```
  17. @example
  18. ```
  19. import {ConditionalPick} from 'type-fest';
  20. interface Example {
  21. a: string;
  22. b: string | number;
  23. c: () => void;
  24. d: {};
  25. }
  26. type StringKeysOnly = ConditionalPick<Example, string>;
  27. //=> {a: string}
  28. ```
  29. */
  30. export type ConditionalPick<Base, Condition> = Pick<
  31. Base,
  32. ConditionalKeys<Base, Condition>
  33. >;