tianji/src/types/utils.ts
2024-01-20 16:22:44 +08:00

7 lines
223 B
TypeScript

export type ExactType<T, U extends Partial<T>> = Omit<T, keyof U> & U;
export type PickRequired<T, U extends keyof T> = Omit<T, keyof U> &
Required<Pick<T, U>>;
export type MaybePromise<TType> = Promise<TType> | TType;