are-message
Version:
This is a React global notification message component. It is a standalone implementation of the are-visual message component.
29 lines (28 loc) • 614 B
TypeScript
/**
* 从 interface 排除某些选项
*/
export declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
/**
* 将 interface 所有值转为可选
*/
export declare type Options<T> = {
[P in keyof T]+?: T[P];
};
/**
* 将 interface 所有值转为必填
*/
export declare type Required<T> = {
[P in keyof T]-?: T[P];
};
/**
* 获取对象中的值作为类型
*
* ```ts
* type NewType = ValueOf<typeof {A: 0, B: 1}>
* ```
*/
export declare type ValueOf<T> = T[keyof T];
/**
* 过滤 undefined, null, '', NaN
*/
export declare function isTruthy<T>(value: unknown): value is T;