/* eslint-disable */ /** * @description M Component Object Props Options * @author 阿怪 * @date 2022/12/13 00:01 * @version v1.0.0 * * 江湖的业务千篇一律,复杂的代码好几百行。 * M means Shuimo */ export declare type MPropOptions = { type?: MPropType | true | null, required: true, default?: D | DefaultFactory | null | undefined | object, enum?: T[], } export declare type MPropOptionsWithDefault = { type?: MPropType | true | null, required?: false, default: D | DefaultFactory | null | undefined | object, enum?: T[], } /** * @description MComponentObjectPropsOptions */ export type MCOPO>>> = { [K in keyof OK]: MPropOptionsWithDefault } & { [K in keyof Pick>]-?: MPropOptions } type DefaultFactory = (props: Data) => T; type RequiredKeys = { [K in keyof T]-?: {} extends Pick ? never : K }[keyof T]; type OptionalKeys = Exclude>; type MPropConstructor = | { new(...args: any[]): T & {} } | { (): T } | MPropMethod type MPropMethod = [T] extends [ ((...args: any) => any) | undefined ] // if is function with args, allowing non-required functions ? { new(): TConstructor; (): T; readonly prototype: TConstructor } // Create Function like constructor : never export type MPropType = MPropConstructor | MPropConstructor[];