gtsoft-snail-job-admin/src/typings/common.d.ts

26 lines
582 B
TypeScript
Raw Normal View History

2024-03-08 17:59:45 +08:00
/** The common type namespace */
2024-03-21 10:57:53 +08:00
declare namespace CommonType {
2024-03-08 17:59:45 +08:00
/** The strategic pattern */
interface StrategicPattern {
/** The condition */
condition: boolean;
/** If the condition is true, then call the action function */
callback: () => void;
}
/**
* The option type
*
* @property value: The option value
* @property label: The option label
*/
2024-03-26 11:47:11 +08:00
type Option<K = string> = { value: K; label: string };
2024-03-08 17:59:45 +08:00
type YesOrNo = 'Y' | 'N';
2024-03-21 10:57:53 +08:00
/** add null to all properties */
type RecordNullable<T> = {
[K in keyof T]?: T[K] | null;
};
2024-03-08 17:59:45 +08:00
}