fix: register models type error

This commit is contained in:
gchust 2025-06-23 18:36:36 +08:00
parent 42294a4ce5
commit 82c8ff766d

View File

@ -110,14 +110,16 @@ export type CreateSubModelOptions = CreateModelOptions | FlowModel;
/** /**
* Constructor for model classes. * Constructor for model classes.
*/ */
export type ModelConstructor<T extends FlowModel = FlowModel> = new (options: { export type ModelConstructor<T extends FlowModel = FlowModel> = new (
uid: string; options: FlowModelOptions & {
props?: IModelComponentProps; uid: string;
stepParams?: StepParams; props?: IModelComponentProps;
meta?: FlowModelMeta; stepParams?: StepParams;
subModels?: Record<string, CreateSubModelOptions | CreateSubModelOptions[]>; meta?: FlowModelMeta;
[key: string]: any; // Allow additional options subModels?: Record<string, CreateSubModelOptions | CreateSubModelOptions[]>;
}) => T; [key: string]: any; // Allow additional options
},
) => T;
/** /**
* Defines a reusable action with generic model type support. * Defines a reusable action with generic model type support.
@ -292,7 +294,7 @@ export interface FlowModelOptions<Structure extends { parent?: any; subModels?:
use?: string; use?: string;
async?: boolean; // 是否异步加载模型 async?: boolean; // 是否异步加载模型
props?: IModelComponentProps; props?: IModelComponentProps;
stepParams?: Record<string, any>; stepParams?: StepParams;
subModels?: Structure['subModels']; subModels?: Structure['subModels'];
flowEngine?: FlowEngine; flowEngine?: FlowEngine;
parentId?: string; parentId?: string;