@pisell/core 1.0.40 → 1.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,52 +0,0 @@
1
- import { CreateAxiosDefaults } from "axios";
2
- import { CacheType } from './cache';
3
- export interface RequestConfig {
4
- interceptorsRequest?: ((value: any) => any | Promise<any>) | null;
5
- interceptorsRequestError?: ((error: any) => any) | null;
6
- interceptorsResponse?: any;
7
- interceptorsResponseError?: ((error: any) => any) | null;
8
- axiosConfig?: CreateAxiosDefaults;
9
- storage?: any;
10
- getToken?: () => string | null;
11
- setToken?: (token: string) => void;
12
- getLocale?: () => string | null;
13
- getUrl?: (config: any) => string;
14
- requestCallbacks?: {
15
- 200?: (data: any) => void;
16
- 401?: (data: any) => void;
17
- 403?: (data: any) => void;
18
- other?: (data: any) => void;
19
- [key: string]: any;
20
- };
21
- }
22
- export declare enum RequestModeENUM {
23
- LOCAL = "local",
24
- REMOTE = "remote",
25
- LOCAL_REMOTE = "local_remote",
26
- REMOTE_LOCAL = "remote_local",
27
- OS_SERVER = "os_server"
28
- }
29
- export declare type RequestModeType = RequestModeENUM.LOCAL | RequestModeENUM.REMOTE | RequestModeENUM.LOCAL_REMOTE | RequestModeENUM.REMOTE_LOCAL | RequestModeENUM.OS_SERVER;
30
- export interface CacheProps {
31
- key?: string;
32
- type?: CacheType;
33
- updateCache?: boolean;
34
- cacheUpdateChange?: (data: any) => void;
35
- mode?: RequestModeType;
36
- cacheKeyData?: any;
37
- }
38
- export interface RequestSetting {
39
- abort?: boolean;
40
- headers?: any;
41
- cache?: CacheProps;
42
- signal?: any;
43
- token?: string;
44
- osServer?: boolean;
45
- [key: string]: any;
46
- }
47
- export interface RequestWrapperProps {
48
- url: string;
49
- method: 'get' | 'post' | 'remove' | 'put';
50
- data?: any;
51
- config?: RequestSetting;
52
- }
@@ -1,46 +0,0 @@
1
- import { InternalAxiosRequestConfig } from "axios";
2
- import { RequestSetting, RequestConfig, RequestWrapperProps } from "./type";
3
- export declare const getRequestHeaders: (config: InternalAxiosRequestConfig<RequestSetting> & Record<string, any>) => Record<string, string | null>;
4
- /**
5
- * @title: 请求前拦截
6
- * @description:
7
- * @param {any} config
8
- * @return {*}
9
- * @Author: zhiwei.Wang
10
- * @Date: 2024-07-04 10:51
11
- */
12
- export declare const interceptorsRequest: (config: InternalAxiosRequestConfig<RequestSetting> & Record<string, any>) => Promise<InternalAxiosRequestConfig<RequestSetting> & Record<string, any>>;
13
- /**
14
- * @title: 请求前error
15
- * @description:
16
- * @param {any} err
17
- * @return {*}
18
- * @Author: zhiwei.Wang
19
- * @Date: 2024-07-04 10:51
20
- */
21
- export declare const interceptorsRequestError: (err: RequestConfig["interceptorsRequestError"]) => any;
22
- /**
23
- * @title: 请求后拦截
24
- * @description:
25
- * @param {any} response
26
- * @return {*}
27
- * @Author: zhiwei.Wang
28
- * @Date: 2024-07-04 10:51
29
- */
30
- export declare const interceptorsResponse: (response: RequestConfig["interceptorsResponse"]) => any;
31
- /**
32
- * @title: 请求后错误拦截
33
- * @description:
34
- * @param {any} response
35
- * @return {*}
36
- * @Author: zhiwei.Wang
37
- * @Date: 2024-07-04 10:51
38
- */
39
- export declare const interceptorsResponseError: (response: RequestConfig["interceptorsResponseError"]) => any;
40
- export declare const requestCallback: (resData: {
41
- res?: any;
42
- props: RequestWrapperProps;
43
- resolve: (value: unknown) => void;
44
- reject: () => void;
45
- err?: any;
46
- }) => void;
@@ -1,127 +0,0 @@
1
- import { Task, TasksModule, RunTaskParams, AddTaskParams, DeleteTaskParams } from "./type";
2
- import App from "../app";
3
- export declare class TasksManager {
4
- private static instance;
5
- private taskFunctions;
6
- private tasks;
7
- private app;
8
- private db;
9
- useTasks: () => {
10
- tasks: TasksModule;
11
- };
12
- watchTaskCallback: (taskModule: TasksModule) => void;
13
- private timerIds;
14
- constructor(app: App);
15
- static getInstance(app?: App): TasksManager;
16
- addTaskFunction<T>(name: string, fun: T): void;
17
- addTaskFunctions<T>(tasks: {
18
- name: string;
19
- fun: T;
20
- }[]): void;
21
- getTasks(): TasksModule;
22
- getTaskFunction(name: string): any;
23
- init(): Promise<void>;
24
- private saveTaskQueueToLocal;
25
- private loadTaskQueueFromLocal;
26
- /**
27
- * @title: 执行任务
28
- * @description:
29
- * @param {Task} task
30
- * @return {*}
31
- * @Author: zhiwei.Wang
32
- * @Date: 2024-09-26 13:53
33
- */
34
- private runTask;
35
- /**
36
- * @title: 清除任务定时器
37
- */
38
- private clearTaskTimer;
39
- /**
40
- * @title: 计算下一次执行时间
41
- * @description: 根据定时任务配置计算下一次执行时间
42
- * @param {Task} task
43
- * @return {string | null} 下一次执行时间
44
- */
45
- private calculateNextExecuteTime;
46
- /**
47
- * @title: 启动定时任务
48
- * @description: 在特定时间点执行任务(仅在 scheduledTasks 模块中生效)
49
- * @param {Task} task
50
- * @return {*}
51
- */
52
- private startScheduledTask;
53
- /**
54
- * @title: 启动轮询
55
- * @description: 根据轮询间隔定期执行任务
56
- * @param {Task} task
57
- * @return {*}
58
- */
59
- private startPolling;
60
- /**
61
- * @title: 创建任务数据
62
- * @description:
63
- * @param {Partial} payload
64
- * @return {*}
65
- * @Author: zhiwei.Wang
66
- * @Date: 2024-09-26 13:54
67
- */
68
- private createTaskData;
69
- private getTaskQueue;
70
- private timeout;
71
- /**
72
- * @title: 执行任务队列
73
- * @description:
74
- * @return {*}
75
- * @Author: zhiwei.Wang
76
- * @Date: 2024-09-26 13:52
77
- */
78
- run(payload: RunTaskParams): Promise<void>;
79
- deleteTask(payload: DeleteTaskParams): void;
80
- /**
81
- * @title: 重试任务
82
- * @description:
83
- * @return {*}
84
- * @Author: zhiwei.Wang
85
- * @Date: 2024-09-26 13:53
86
- */
87
- retryTask(payload: RunTaskParams): void;
88
- addTask(payload: AddTaskParams): void;
89
- private updateTask;
90
- private updateQueueStatus;
91
- /**
92
- * @title: 更新队列运行状态
93
- * @description: 标记队列是否正在执行
94
- */
95
- private updateQueueRunningState;
96
- private setTasksData;
97
- private setTasks;
98
- clearAllTaskTimer(tasks: Task[]): void;
99
- clearTasks(payload: RunTaskParams): void;
100
- clearAllTasks(): void;
101
- watchTask(callback: (taskModule: TasksModule) => void): void;
102
- /**
103
- * @title: 获取队列执行状态
104
- * @description: 获取指定队列的执行状态和进度信息
105
- * @param {string} module - 模块名
106
- * @param {string} queueId - 队列ID
107
- * @return {object} 队列状态信息
108
- */
109
- getQueueStatus(module: string, queueId: string): {
110
- isRunning: boolean;
111
- status: "uncompleted" | "completed";
112
- progress: {
113
- total: number;
114
- completed: number;
115
- failed: number;
116
- inProgress: number;
117
- };
118
- lastRunAt: string | null;
119
- tasksCount: number;
120
- } | null;
121
- /**
122
- * @title: 获取所有队列状态
123
- * @description: 获取所有任务队列的执行状态概览
124
- * @return {object} 所有队列的状态信息
125
- */
126
- getAllQueuesStatus(): any;
127
- }
@@ -1,61 +0,0 @@
1
- /**
2
- * 定时任务示例代码
3
- * 本文件展示了如何使用定时任务功能
4
- *
5
- * 重要提示:
6
- * - 定时任务必须添加到 'scheduledTasks' 模块才能生效
7
- * - 在其他模块中,scheduled 配置会被忽略,任务将作为普通任务立即执行
8
- * - 这是为了性能优化,避免在所有模块中检查定时任务配置
9
- */
10
- import { TasksManager } from './index';
11
- /**
12
- * 示例1:创建一次性定时任务
13
- * 在特定时间点执行一次
14
- *
15
- * 注意:定时任务必须添加到 'scheduledTasks' 模块才能生效
16
- */
17
- export declare function createOnceScheduledTask(tasksManager: TasksManager): void;
18
- /**
19
- * 示例2:创建每日重复的定时任务
20
- * 每天在固定时间执行
21
- */
22
- export declare function createDailyScheduledTask(tasksManager: TasksManager): void;
23
- /**
24
- * 示例3:创建带结束时间的重复任务
25
- * 在特定时间段内重复执行
26
- */
27
- export declare function createLimitedRepeatTask(tasksManager: TasksManager): void;
28
- /**
29
- * 示例4:创建多个时间点的任务
30
- * 在一天中的多个时间点分别执行
31
- */
32
- export declare function createMultiTimeTask(tasksManager: TasksManager): void;
33
- /**
34
- * 示例5:创建每周重复任务
35
- * 每周一早上9点执行周报
36
- */
37
- export declare function createWeeklyTask(tasksManager: TasksManager): void;
38
- /**
39
- * 示例6:创建每月重复任务
40
- * 每月1号生成月报
41
- */
42
- export declare function createMonthlyTask(tasksManager: TasksManager): void;
43
- /**
44
- * 示例7:查询和管理定时任务
45
- */
46
- export declare function manageScheduledTasks(tasksManager: TasksManager): void;
47
- /**
48
- * 完整使用示例
49
- */
50
- export declare function fullExample(app: any): void;
51
- declare const _default: {
52
- createOnceScheduledTask: typeof createOnceScheduledTask;
53
- createDailyScheduledTask: typeof createDailyScheduledTask;
54
- createLimitedRepeatTask: typeof createLimitedRepeatTask;
55
- createMultiTimeTask: typeof createMultiTimeTask;
56
- createWeeklyTask: typeof createWeeklyTask;
57
- createMonthlyTask: typeof createMonthlyTask;
58
- manageScheduledTasks: typeof manageScheduledTasks;
59
- fullExample: typeof fullExample;
60
- };
61
- export default _default;
@@ -1,100 +0,0 @@
1
- export declare type TaskRunStatus = "pending" | "in-progress" | "success" | "failure";
2
- export interface Task {
3
- id?: string;
4
- type?: "local" | "cloud";
5
- retries?: number;
6
- maxRetries?: number;
7
- status?: TaskRunStatus;
8
- action: string;
9
- payload: any;
10
- beforeAction?: string;
11
- beforePayload?: any;
12
- afterAction?: string;
13
- afterPayload?: any;
14
- polling?: {
15
- interval?: number;
16
- };
17
- pollingResult?: {
18
- count: number;
19
- timerId?: any;
20
- };
21
- scheduled?: {
22
- executeAt: string | string[];
23
- repeat?: boolean;
24
- repeatType?: 'daily' | 'weekly' | 'monthly' | 'yearly';
25
- repeatInterval?: number;
26
- endAt?: string;
27
- };
28
- scheduledResult?: {
29
- count: number;
30
- timerId?: any;
31
- nextExecuteTime?: string;
32
- };
33
- manual?: boolean;
34
- destroy?: boolean;
35
- [key: string]: any;
36
- }
37
- export interface TaskConfig {
38
- tasks: Task[];
39
- }
40
- declare type TaskModuleName = string;
41
- declare type TaskQueueName = string;
42
- declare type TaskStatus = "uncompleted" | "completed";
43
- export interface TaskQueue {
44
- status: TaskStatus;
45
- tasks: Task[];
46
- isRunning?: boolean;
47
- progress?: {
48
- total: number;
49
- completed: number;
50
- failed: number;
51
- inProgress: number;
52
- };
53
- lastRunAt?: string;
54
- }
55
- export interface RunTaskParams {
56
- module: TaskModuleName;
57
- queueId: TaskQueueName;
58
- callback?: () => void;
59
- }
60
- export interface DeleteTaskParams {
61
- module: TaskModuleName;
62
- queueId: TaskQueueName;
63
- taskId: string;
64
- }
65
- export interface AddTaskParams {
66
- module: TaskModuleName;
67
- queueId: TaskQueueName;
68
- tasks: Task[];
69
- }
70
- export interface AddTaskDataParams {
71
- module: TaskModuleName;
72
- queueId: TaskQueueName;
73
- [key: string]: any;
74
- }
75
- export interface TaskRunResult {
76
- status: TaskRunStatus;
77
- [key: string]: any;
78
- }
79
- /**
80
- * 任务模块
81
- * 注意:'scheduledTasks' 是保留的模块名,专门用于定时任务
82
- * 在其他模块中,scheduled 配置会被忽略,任务将作为普通任务执行
83
- */
84
- export interface TasksModule {
85
- [key: TaskModuleName]: {
86
- [key: TaskQueueName]: {
87
- status: TaskStatus;
88
- tasks: Task[];
89
- isRunning?: boolean;
90
- progress?: {
91
- total: number;
92
- completed: number;
93
- failed: number;
94
- inProgress: number;
95
- };
96
- lastRunAt?: string;
97
- };
98
- };
99
- }
100
- export {};
package/lib/app/app.d.ts DELETED
@@ -1,99 +0,0 @@
1
- import { RouterManager } from '../routes';
2
- import { ApplicationManager } from '../applicationManager';
3
- import { History, HistoryOptions } from '../history';
4
- import { Data } from '../data';
5
- import { Locales, LocalesOptions } from '../locales';
6
- import { Storage, StorageOptions } from '../storage';
7
- import { MenuManager } from '../menuManager';
8
- import LoggerManager, { LoggerOptions } from '../logger';
9
- import { TasksManager } from '../tasks';
10
- import IndexDBManager, { DBOptions } from '../indexDB';
11
- import CMD, { CMDOptions } from "../cmd";
12
- import AWS, { AWSOptions } from "../aws";
13
- declare global {
14
- interface Window {
15
- app: App;
16
- }
17
- }
18
- export interface Bootstrap {
19
- hooks: {
20
- [key: string]: () => Promise<void>;
21
- };
22
- }
23
- export interface AppOptions {
24
- logger?: LoggerOptions;
25
- db?: DBOptions;
26
- constants?: any;
27
- history?: HistoryOptions;
28
- storage?: StorageOptions;
29
- locales?: LocalesOptions;
30
- cmd?: CMDOptions;
31
- aws?: AWSOptions;
32
- getPisellos?: () => any;
33
- }
34
- declare class App {
35
- private static instance;
36
- private plugins;
37
- globalData: any;
38
- router: RouterManager;
39
- applicationManager: ApplicationManager;
40
- history: History;
41
- data: Data;
42
- hooks: import("../hooks").HooksExport;
43
- locales: Locales;
44
- models: {
45
- getStore: () => import("../models").Store;
46
- StoreProvider: typeof import("react-redux").Provider;
47
- setConfig: (models: any[]) => void;
48
- };
49
- request: {
50
- get: (url: string, data: any, config: import("../request").RequestSetting | undefined) => Promise<any>;
51
- post: (url: string, data: any, config: import("../request").RequestSetting | undefined) => Promise<any>;
52
- put: (url: string, data: any, config: import("../request").RequestSetting | undefined) => Promise<any>;
53
- remove: (url: string, data: any, config: import("../request").RequestSetting | undefined) => Promise<any>;
54
- custom: (url: string, config: import("../request").RequestSetting | undefined) => any;
55
- setConfig: (newConfig: Partial<import("../request").RequestConfig>) => void;
56
- getConfig: () => import("../request").RequestConfig;
57
- };
58
- storage: Storage;
59
- menuManager: MenuManager;
60
- cookie: {
61
- setCookie: (name: string, value: string, domain?: string | undefined) => void;
62
- getCookie: (name: string) => string | null;
63
- deleteCookie: (name: string, domain?: string | undefined) => void;
64
- checkCookie: (name: string) => boolean;
65
- updateCookie: (name: string, value: string, domain?: string | undefined) => void;
66
- };
67
- website: {
68
- setTitle: (title: string) => void;
69
- setIcon: (paramsIcon: string) => void;
70
- setAppleWebAppTitle: (title: string) => void;
71
- };
72
- logger: LoggerManager;
73
- pubsub: import("../pubsub").PubSub;
74
- cmd: CMD;
75
- aws: AWS;
76
- tasksManager: TasksManager;
77
- getPisellos: any;
78
- bootstrap?: Bootstrap;
79
- dbManager: IndexDBManager | null;
80
- constants: {
81
- channel: string;
82
- [key: string]: string;
83
- };
84
- private constructor();
85
- static getInstance(options?: AppOptions): App;
86
- setGlobalData(globalData: any): void;
87
- usePlugin(name: string, plugin: any): void;
88
- usePlugins(plugins: {
89
- name: string;
90
- plugin: any;
91
- }[]): void;
92
- getPlugin(name: string): any;
93
- getGlobalData(): any;
94
- install(): void;
95
- unInstall(): void;
96
- setBootstrap(bootstrap: Bootstrap): void;
97
- getBootstrap(): Bootstrap | undefined;
98
- }
99
- export default App;
@@ -1,197 +0,0 @@
1
- import App from '../app';
2
- import { LoadLibraryByUrlParams } from '../locales/type';
3
- import { MenuItem } from '../menuManager/index';
4
- /**
5
- * 应用接口类型定义
6
- * @description 描述应用中单个页面、组件或功能的接口结构
7
- */
8
- export declare type ApplicationInterface = {
9
- page_type: 'low_code' | 'code';
10
- page_id: number | string;
11
- page_code: string;
12
- page_version?: string;
13
- page_name: string;
14
- router: string;
15
- category: 'page' | 'component' | 'function';
16
- Component?: any;
17
- children?: any;
18
- layout?: string;
19
- originalUrl?: string;
20
- routeConfig?: {
21
- cache?: boolean;
22
- preload?: boolean;
23
- prerender?: boolean;
24
- priority?: 'high' | 'normal' | 'low';
25
- };
26
- autoRender?: boolean;
27
- };
28
- /**
29
- * 应用数据类型定义
30
- * @description 描述完整应用的数据结构,包含应用的基本信息、接口、功能等
31
- */
32
- export declare type ApplicationData = {
33
- /** 应用唯一标识 */
34
- app_id: number;
35
- /** 应用名称 */
36
- app_name: string;
37
- /** 应用类型:系统应用或自定义应用 */
38
- app_type: 'system' | 'custom';
39
- /** 应用包含的接口列表 */
40
- interfaces: ApplicationInterface[];
41
- /** 应用包含的功能列表,可选 */
42
- functions?: any[];
43
- /** 应用的菜单配置 */
44
- menu?: {
45
- [key: string]: MenuItem[];
46
- };
47
- /** 多语言配置,可选 */
48
- locales?: LoadLibraryByUrlParams;
49
- /** 其他扩展属性 */
50
- [key: string]: any;
51
- };
52
- /**
53
- * 应用管理类
54
- * @description 负责管理单个应用的生命周期,包括接口、组件、功能的初始化和管理
55
- * @class Application
56
- * @author zhiwei.Wang
57
- */
58
- export declare class Application {
59
- /** 应用配置数据 */
60
- options: ApplicationData;
61
- /** 应用名称 */
62
- name: ApplicationData['app_name'];
63
- /** 应用内的页面接口映射表,以页面名称为键 */
64
- interfaces: Map<ApplicationInterface['page_name'], ApplicationInterface>;
65
- /** 应用内的组件映射表,以组件编码为键 */
66
- components: Map<string, any>;
67
- /** 应用内的功能函数映射表,比如跳转登录页面的方法等 */
68
- functions: Map<string, any>;
69
- /** 应用实例引用 */
70
- app: App;
71
- /**
72
- * 构造函数
73
- * @description 初始化应用实例,设置基本属性并初始化接口和功能
74
- * @param {ApplicationData} options - 应用配置数据
75
- * @param {App} app - 应用实例引用
76
- */
77
- constructor(options: ApplicationData, app: App);
78
- /**
79
- * 应用添加后的内部处理方法
80
- * @description 在应用被添加到应用管理器后执行的内部逻辑,包括加载多语言配置和执行用户自定义的afterAdd方法
81
- * @param {Application} application - 被添加的应用实例
82
- * @returns {Promise<void>}
83
- * @private
84
- */
85
- _afterAdd(application: Application): Promise<void>;
86
- /**
87
- * 应用加载前的内部处理方法
88
- * @description 在应用开始加载前执行的内部逻辑,调用用户自定义的beforeLoad方法
89
- * @returns {Promise<void>}
90
- * @private
91
- */
92
- _beforeLoad(): Promise<void>;
93
- /**
94
- * 应用加载的内部处理方法
95
- * @description 执行应用的实际加载逻辑,将应用中的所有接口注册为路由
96
- * @returns {Promise<void>}
97
- * @private
98
- */
99
- _load(): Promise<void>;
100
- /**
101
- * 初始化应用接口
102
- * @description 遍历应用配置中的接口列表,根据类别将它们分别设置到对应的映射表中
103
- * @param {ApplicationData['interfaces']} interfaces - 接口配置数组
104
- * @returns {void}
105
- */
106
- initInterfaces(interfaces: ApplicationData['interfaces']): void;
107
- /**
108
- * 初始化应用功能函数
109
- * @description 遍历应用配置中的功能列表,将它们设置到功能映射表中
110
- * @param {ApplicationData['functions']} functions - 功能配置数组,可选
111
- * @returns {void}
112
- */
113
- initFunctions(functions: ApplicationData['functions']): void;
114
- /**
115
- * 加载接口组件
116
- * @description 根据接口类型加载对应的组件,支持低代码和普通代码两种类型
117
- * @param {ApplicationInterface} interfaceItem - 接口配置项
118
- * @returns {Promise<ApplicationInterface>} 加载后的接口配置
119
- */
120
- loadInterface(interfaceItem: ApplicationInterface): Promise<ApplicationInterface>;
121
- /**
122
- * 设置页面
123
- * @description 将页面接口添加到接口映射表中
124
- * @param {string} code - 页面编码
125
- * @param {ApplicationInterface} interfaceItem - 接口配置项
126
- * @returns {void}
127
- */
128
- setInterface(code: string, interfaceItem: ApplicationInterface): void;
129
- /**
130
- * 设置组件
131
- * @description 将组件添加到组件映射表中
132
- * @param {string} code - 组件编码
133
- * @param {ApplicationInterface} component - 组件配置项
134
- * @returns {void}
135
- */
136
- setComponent(code: string, component: ApplicationInterface): void;
137
- /**
138
- * 设置功能函数
139
- * @description 将功能函数添加到功能映射表中
140
- * @param {string} code - 功能编码
141
- * @param {ApplicationInterface} functionItem - 功能配置项
142
- * @returns {void}
143
- */
144
- setFunction(code: string, functionItem: ApplicationInterface): void;
145
- /**
146
- * 获取页面
147
- * @description 根据编码从接口映射表中获取页面接口
148
- * @param {string} code - 页面编码
149
- * @returns {ApplicationInterface | undefined} 接口配置项或undefined
150
- */
151
- getInterface(code: string): ApplicationInterface | undefined;
152
- /**
153
- * 获取组件
154
- * @description 根据编码从组件映射表中获取组件
155
- * @param {string} code - 组件编码
156
- * @returns {any | undefined} 组件或undefined
157
- */
158
- getComponent(code: string): any;
159
- /**
160
- * 获取功能函数
161
- * @description 根据编码从功能映射表中获取功能函数
162
- * @param {string} code - 功能编码
163
- * @returns {any | undefined} 功能函数或undefined
164
- */
165
- getFunction(code: string): any;
166
- /**
167
- * 执行功能函数
168
- * @description 根据编码执行对应的功能函数,自动注入应用实例并合并参数
169
- * @param {string} code - 功能编码
170
- * @param {any} params - 传递给功能函数的参数对象,可选
171
- * @param {...any} args - 传递给功能函数的其他参数
172
- * @returns {any} 功能函数的执行结果
173
- */
174
- runFunction(code: string, params?: any, ...args: any): any;
175
- /**
176
- * 应用添加后触发的钩子函数
177
- * @description 在应用被添加到应用管理器后触发,可被子类覆盖以实现自定义逻辑
178
- * @param {Application} application - 被添加的应用实例
179
- * @returns {Promise<void>}
180
- * @author zhiwei.Wang
181
- */
182
- afterAdd(application: Application): Promise<void>;
183
- /**
184
- * 应用加载前触发的钩子函数
185
- * @description 在应用开始加载前触发,可被子类覆盖以实现自定义预处理逻辑
186
- * @returns {Promise<void>}
187
- * @author zhiwei.Wang
188
- */
189
- beforeLoad(application: Application): Promise<void>;
190
- /**
191
- * 应用加载完成后触发的钩子函数
192
- * @description 在应用完成加载后触发,可被子类覆盖以实现自定义后处理逻辑
193
- * @returns {Promise<void>}
194
- * @author zhiwei.Wang
195
- */
196
- load(application: Application): Promise<void>;
197
- }