@omnia/fx-models
Version:
Provide Omnia Fx Models Stuffs.
15 lines (14 loc) • 541 B
TypeScript
/**
* Obsolete
* */
export interface IdDict<T> {
[id: string]: T;
}
/**
* Use this to omit the specified properties from a type e.g. an interface
* Creates a new type based on T but without some properties
* (Example: type withoutProp1AndProp2 = OmitProperties<IProp1Prop2Prop3Interface, "Prop1"|"Prop2">)
* This is typesafe i.e. IProp1Prop2Prop3Interface must have the property names else a build error is raised.
* I.e. safe for refactoring
* */
export type OmitProperties<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;