Open countnazgul opened 1 year ago
For example
export type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
export interface ICommonCreateUpdate {
customProperties?: string[];
owner?: string;
tags?: string[];
}
export type IStreamCreate = Omit<
IStream,
| "customProperties"
| "createdDate"
| "modifiedDate"
| "schemaPath"
| "privileges"
| "modifiedByUserName"
| "id"
| "owner"
| "tags"
> &
ICommonCreateUpdate;
export type IStreamUpdate = Optional<
Omit<
IStream,
| "customProperties"
| "createdDate"
| "modifiedDate"
| "schemaPath"
| "privileges"
| "modifiedByUserName"
| "id"
| "owner"
| "tags"
>,
"name"
> &
ICommonCreateUpdate;
At the moment for (almost) each entity there are 3 interfaces - IEntity, IEntityCreate and IEntityUpdate.
The 3 interfaces are described independently of each other but create and update ones can be derived from the main interface by:
string[]
instead ofITagContensed
in the entity)Not a problem if this is not done at the end but the interfaces/types will look nicer this way