import type { defineOptions, Ref, VNode } from 'vue'; import type { IBeanSceneRecord } from '../decorator/interface/beanOptions.ts'; import type { RequiredSome } from '../types/utils/requiredSome.ts'; import type { TypeRecordValues } from '../types/utils/type.ts'; import type { TypeErrorsInternal } from './resource/error/errorInternal.ts'; export interface IBeanRecordGeneral {} export interface IBeanRecordLocal {} export type IBeanRecord = IBeanRecordGeneral & IBeanRecordLocal; export type TypeBeanRecordKeys = keyof IBeanRecord; export type TypeBeanRecordGeneralSelector = { [K in keyof IBeanRecordGeneral as K extends `${string}.${SCENE}.${string}` ? K : never]: IBeanRecordGeneral[K]; }; export type TypeBeanRecordGeneralSelectorKeys = keyof TypeBeanRecordGeneralSelector; export type TypeBeanRecordGeneralSelectorSpecificName = { [K in keyof IBeanRecordGeneral as K extends `${string}.${SCENE}.${NAME}` ? K : never]: IBeanRecordGeneral[K]; }; export type TypeBeanRecordGeneralSelectorSpecificNameKeys< SCENE extends keyof IBeanSceneRecord, NAME extends string, > = keyof TypeBeanRecordGeneralSelectorSpecificName; export interface IBeanScopeRecord {} export type TypeBeanScopeRecordKeys = keyof IBeanScopeRecord; export interface IBeanScopeConfig {} export type TypeBeanScopeConfigKeys = keyof IBeanScopeConfig; export interface IBeanScopeLocale {} export type TypeBeanScopeLocaleKeys = keyof IBeanScopeLocale; export interface IBeanScopeErrors {} export type TypeBeanScopeErrorsKeys = keyof IBeanScopeErrors; export type TypeScopesErrorsHelper = { // @ts-ignore: ignore [K in keyof Errors as `${ModuleName}:${Errors[K]}`]: K; }; export type TypeScopesErrorCodes = TypeRecordValues<{ [ModuleName in keyof IBeanScopeErrors]: keyof TypeScopesErrorsHelper; }>; export type TypeAllErrorCodes = TypeScopesErrorCodes | keyof TypeErrorsInternal; export interface IControllerDataContext { slots?: object; } export interface IControllerData { context: IControllerDataContext; } export const BeanControllerIdentifier = '$$c'; export const BeanRenderIdentifier = '$$r'; export const BeanStyleIdentifier = '$$s'; export const SymbolControllerRefDisable = Symbol('SymbolControllerRefDisable'); export function $getBeanName(beanFullName: K): K { return beanFullName; } export type ModelRef = Ref & [ModelRef, Record]; export interface DefineModelOptions { get?: (v: T) => G; set?: (v: S) => any; } export type IComponentOptions = Parameters[0]; export type IEmit = () => void; export type ISlot = (...args: any[]) => VNode; export interface ISlotsDefault { default?: ISlot; } export type TypePropValueFromModel = T extends 'vModel' ? 'modelValue' : T extends `vModel:${string}_${string}` ? never : T extends `vModel:${infer ARG}` ? ARG : never; export type TypePropUpdateFromModel = T extends 'vModel' ? 'onUpdate:modelValue' : T extends `vModel:${string}_${string}` ? never : T extends `vModel:${infer ARG}` ? `onUpdate:${ARG}` : never; // @ts-ignore ignore export type TypeControllerInnerProps = RequiredSome;