import type TVue from '@vue/runtime-core'; import type { Context, EntityConstructor, EntityProps, GenericEntity } from '../../imperative/Entities'; import type { optionsKeyVuefy, overrideKeyVuefy } from '../../imperative/wrappers'; export type BaseModule = Record; export type DefaultEntity = GenericEntity; export type DefaultContext = Context; export type DefaultCtor = EntityConstructor; export type PropsFromCtor = EntityProps>; export type VuefyPropsModule = { [Key in keyof TModule]: TModule[Key] extends GenericEntity ? VuefyPropsObject | VuefyPropsArray : unknown; }; export type VuefyPropsObject = { [K in keyof RawProps]-?: TVue.PropType | TVue.Prop; }; export type VuefyPropsNullObject = { [K in keyof RawProps]-?: null; }; export type VuefyPropsArray = Array; export type Vuefy = { module: VuefyModuleFn; entity: VuefyEntityFn; }; export interface VuefyModuleFn { (module: TModule, props?: VuefyPropsModule): VuefiedModule; } export type VuefyEntityFn = >(...args: Parameters>) => ReturnType>; export type VuefyEntityFnGen> = (ctor: TCtor, props?: VuefyPropsObject | VuefyPropsArray, displayName?: string) => TVue.Component; export type VuefyContextFn = (context?: TContext) => symbol; export type InternalVuefyEntityFn = >(...args: Parameters>) => ReturnType>; export type InternalVuefyEntityFnGen> = (ctor: TCtor, props: VuefyPropsObject, displayName: string) => TVue.Component; export type VuefiedModule = { [Property in keyof TModule]: TModule[Property] extends DefaultCtor ? ReturnType> : TModule[Property] extends typeof Context ? ReturnType : TModule[Property]; }; export type Overrided = { [overrideKeyVuefy]: CustomVuefyFn, TVueProps>; }; export type Options = { [optionsKeyVuefy]: CustomVuefyOptions, TVueProps>; }; export type CustomVuefyFn> = (ctor: EntityConstructor, props: VuefyPropsObject, params: { vuefy: { module: VuefyModuleFn; entity: VuefyEntityFn; context: VuefyContextFn; }; Vue: typeof TVue; }) => TVue.Component; export type CustomVuefyOptions> = { props: VuefyPropsObject | VuefyPropsArray; };