@pisell/core 1.0.33 → 1.0.35

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.
Files changed (63) hide show
  1. package/es/app/app.d.ts +7 -7
  2. package/es/app/index.d.ts +1 -1
  3. package/es/applicationManager/application.d.ts +2 -2
  4. package/es/cmd/const.d.ts +5 -5
  5. package/es/hooks/useStore/index.d.ts +1 -1
  6. package/es/indexDB/index.d.ts +2 -2
  7. package/es/indexDB/index.js +633 -572
  8. package/es/locales/type.d.ts +3 -3
  9. package/es/logger/index.d.ts +1 -1
  10. package/es/models/index.d.ts +4 -4
  11. package/es/pubsub/index.d.ts +1 -1
  12. package/es/request/cache.d.ts +1 -1
  13. package/es/request/pisell2Request.d.ts +1 -1
  14. package/es/request/type.d.ts +1 -1
  15. package/es/routes/index.d.ts +2 -2
  16. package/es/socket/monitor.js +2 -0
  17. package/es/socket/types.d.ts +4 -3
  18. package/es/tasks/index.d.ts +0 -1
  19. package/es/tasks/index.js +0 -1
  20. package/es/tasks/type.d.ts +4 -4
  21. package/es/variables/index.d.ts +3 -3
  22. package/lib/app/app.d.ts +7 -7
  23. package/lib/app/app.js +21 -51
  24. package/lib/app/index.d.ts +1 -1
  25. package/lib/applicationManager/application.d.ts +2 -2
  26. package/lib/applicationManager/application.js +6 -12
  27. package/lib/applicationManager/index.js +4 -2
  28. package/lib/aws/index.js +0 -3
  29. package/lib/cmd/const.d.ts +5 -5
  30. package/lib/cmd/const.js +5 -5
  31. package/lib/cmd/index.js +0 -2
  32. package/lib/cookie/index.js +4 -2
  33. package/lib/data/index.js +0 -3
  34. package/lib/history/index.js +22 -24
  35. package/lib/hooks/useStore/index.d.ts +1 -1
  36. package/lib/indexDB/index.d.ts +2 -2
  37. package/lib/indexDB/index.js +233 -327
  38. package/lib/locales/index.js +94 -95
  39. package/lib/locales/type.d.ts +3 -3
  40. package/lib/logger/index.d.ts +1 -1
  41. package/lib/logger/index.js +8 -18
  42. package/lib/menuManager/index.js +12 -9
  43. package/lib/models/index.d.ts +4 -4
  44. package/lib/pubsub/index.d.ts +1 -1
  45. package/lib/pubsub/index.js +3 -1
  46. package/lib/request/cache.d.ts +1 -1
  47. package/lib/request/pisell2Request.d.ts +1 -1
  48. package/lib/request/type.d.ts +1 -1
  49. package/lib/routes/index.d.ts +2 -2
  50. package/lib/routes/index.js +1 -3
  51. package/lib/socket/components/SocketMonitorPage.js +12 -6
  52. package/lib/socket/heartbeat.js +5 -10
  53. package/lib/socket/index.js +3 -1
  54. package/lib/socket/monitor.js +26 -26
  55. package/lib/socket/reconnect.js +3 -10
  56. package/lib/socket/socket.js +10 -12
  57. package/lib/socket/types.d.ts +4 -3
  58. package/lib/storage/index.js +24 -25
  59. package/lib/tasks/index.d.ts +0 -1
  60. package/lib/tasks/index.js +329 -334
  61. package/lib/tasks/type.d.ts +4 -4
  62. package/lib/variables/index.d.ts +3 -3
  63. package/package.json +3 -2
@@ -1,5 +1,5 @@
1
- export declare type Locale = 'original' | 'en' | 'zh-CN' | 'zh-HK' | string;
2
- export declare type MultiLanguage = {
1
+ export type Locale = 'original' | 'en' | 'zh-CN' | 'zh-HK' | string;
2
+ export type MultiLanguage = {
3
3
  [key in Locale]: string;
4
4
  };
5
5
  export interface LibraryItem {
@@ -16,4 +16,4 @@ export interface LocaleConfig {
16
16
  [key in Locale]: LibraryItem;
17
17
  };
18
18
  }
19
- export declare type LoadLibraryByUrlParams = (string | Promise<LibraryItem> | (() => Promise<LibraryItem>) | LibraryItem)[];
19
+ export type LoadLibraryByUrlParams = (string | Promise<LibraryItem> | (() => Promise<LibraryItem>) | LibraryItem)[];
@@ -1,5 +1,5 @@
1
1
  import App from "../app";
2
- export declare type LogConsoleType = "info" | "warning" | "error" | "debug";
2
+ export type LogConsoleType = "info" | "warning" | "error" | "debug";
3
3
  /**
4
4
  * 日志项接口
5
5
  */
@@ -1,7 +1,7 @@
1
1
  import hooks from '../hooks';
2
2
  import { Provider as StoreProvider } from "react-redux";
3
3
  declare const models: import("./global").GlobalModal[];
4
- declare type ModalsType = (typeof models[number]);
4
+ type ModalsType = (typeof models[number]);
5
5
  export interface Store {
6
6
  getDataByModel: typeof getDataByModel;
7
7
  useStore: typeof hooks.useStore;
@@ -10,8 +10,8 @@ export interface Store {
10
10
  dispatch: any;
11
11
  getState: any;
12
12
  }
13
- export declare type ModelsNames = ModalsType['namespace'];
14
- export declare type ModelsState = {
13
+ export type ModelsNames = ModalsType['namespace'];
14
+ export type ModelsState = {
15
15
  [K in (ModalsType['namespace'])]: Extract<ModalsType, {
16
16
  namespace: K;
17
17
  }>['state'];
@@ -25,7 +25,7 @@ export declare type ModelsState = {
25
25
  * @Author: zhiwei.Wang
26
26
  * @Date: 2024-09-03 11:07
27
27
  */
28
- declare const getDataByModel: <T extends "global", D extends keyof ModelsState[T]>(model: string, key?: D | undefined) => D extends undefined ? ModelsState[T] : ModelsState[T][D];
28
+ declare const getDataByModel: <T extends "global", D extends keyof ModelsState[T]>(model: string, key?: D) => D extends undefined ? ModelsState[T] : ModelsState[T][D];
29
29
  /**
30
30
  * @title: 设置数据到store
31
31
  * @description:
@@ -2,7 +2,7 @@
2
2
  * 发布订阅模块
3
3
  * 用于组件/服务间的事件通信
4
4
  */
5
- declare type EventCallback = (...args: any[]) => void;
5
+ type EventCallback = (...args: any[]) => void;
6
6
  interface EventSubscription {
7
7
  unsubscribe: () => void;
8
8
  }
@@ -1,5 +1,5 @@
1
1
  import { CacheProps } from './type';
2
- export declare type CacheType = 'memory' | 'storage' | 'indexDB';
2
+ export type CacheType = 'memory' | 'storage' | 'indexDB';
3
3
  /**
4
4
  * @title: 设置缓存
5
5
  * @description:
@@ -1,4 +1,4 @@
1
- declare type RequestMethod = any;
1
+ type RequestMethod = any;
2
2
  declare const pisell2Get: RequestMethod;
3
3
  declare const pisell2Post: RequestMethod;
4
4
  declare const pisell2Put: RequestMethod;
@@ -26,7 +26,7 @@ export declare enum RequestModeENUM {
26
26
  REMOTE_LOCAL = "remote_local",
27
27
  OS_SERVER = "os_server"
28
28
  }
29
- export declare type RequestModeType = RequestModeENUM.LOCAL | RequestModeENUM.REMOTE | RequestModeENUM.LOCAL_REMOTE | RequestModeENUM.REMOTE_LOCAL | RequestModeENUM.OS_SERVER;
29
+ export type RequestModeType = RequestModeENUM.LOCAL | RequestModeENUM.REMOTE | RequestModeENUM.LOCAL_REMOTE | RequestModeENUM.REMOTE_LOCAL | RequestModeENUM.OS_SERVER;
30
30
  export interface CacheProps {
31
31
  key?: string;
32
32
  type?: CacheType;
@@ -20,9 +20,9 @@ export declare class RouterManager {
20
20
  get(name: string): RouteType;
21
21
  has(name: string): boolean;
22
22
  remove(name: string): void;
23
- renderComponent(item: RouteType, children?: React.ReactNode): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
23
+ renderComponent(item: RouteType, children?: React.ReactNode): string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined;
24
24
  getPageByRoute(route: string): ApplicationInterface | undefined;
25
25
  getRouterComponent({ fallback }: {
26
26
  fallback?: React.ReactNode;
27
- }): JSX.Element[];
27
+ }): React.JSX.Element[];
28
28
  }
@@ -332,6 +332,7 @@ export var SocketMonitor = /*#__PURE__*/function () {
332
332
  id: message.id || "out_".concat(Date.now()),
333
333
  timestamp: Date.now(),
334
334
  direction: 'out',
335
+ //@ts-ignore
335
336
  message: this.options.recordMessageContent ? message : {
336
337
  event: message.event
337
338
  },
@@ -363,6 +364,7 @@ export var SocketMonitor = /*#__PURE__*/function () {
363
364
  id: message.id || "in_".concat(Date.now()),
364
365
  timestamp: Date.now(),
365
366
  direction: 'in',
367
+ //@ts-ignore
366
368
  message: this.options.recordMessageContent ? message : {
367
369
  event: message.event
368
370
  },
@@ -38,13 +38,14 @@ export declare enum SocketStatus {
38
38
  /**
39
39
  * Socket消息格式
40
40
  */
41
- export interface SocketMessage<T = any> {
41
+ export interface SocketMessage {
42
42
  /** 事件类型 */
43
43
  type: string;
44
44
  /** 消息数据 */
45
- data?: T;
45
+ data?: any;
46
46
  /** 消息ID */
47
47
  id?: string;
48
+ event?: any;
48
49
  }
49
50
  /**
50
51
  * 心跳配置选项
@@ -75,7 +76,7 @@ export interface ReconnectOptions {
75
76
  /**
76
77
  * 事件处理函数类型
77
78
  */
78
- export declare type EventHandler = (...args: any[]) => void;
79
+ export type EventHandler = (...args: any[]) => void;
79
80
  /**
80
81
  * 事件处理函数映射
81
82
  */
@@ -34,7 +34,6 @@ export declare class TasksManager {
34
34
  private runTask;
35
35
  /**
36
36
  * @title: 清除任务定时器
37
- * @param {NodeJS.Timeout} timerId
38
37
  */
39
38
  private clearTaskTimer;
40
39
  /**
package/es/tasks/index.js CHANGED
@@ -208,7 +208,6 @@ export var TasksManager = /*#__PURE__*/function () {
208
208
  }());
209
209
  /**
210
210
  * @title: 清除任务定时器
211
- * @param {NodeJS.Timeout} timerId
212
211
  */
213
212
  _defineProperty(this, "clearTaskTimer", function (params) {
214
213
  var timerId = params.timerId,
@@ -1,4 +1,4 @@
1
- export declare type TaskRunStatus = "pending" | "in-progress" | "success" | "failure";
1
+ export type TaskRunStatus = "pending" | "in-progress" | "success" | "failure";
2
2
  export interface Task {
3
3
  id?: string;
4
4
  type?: "local" | "cloud";
@@ -37,9 +37,9 @@ export interface Task {
37
37
  export interface TaskConfig {
38
38
  tasks: Task[];
39
39
  }
40
- declare type TaskModuleName = string;
41
- declare type TaskQueueName = string;
42
- declare type TaskStatus = "uncompleted" | "completed";
40
+ type TaskModuleName = string;
41
+ type TaskQueueName = string;
42
+ type TaskStatus = "uncompleted" | "completed";
43
43
  export interface TaskQueue {
44
44
  status: TaskStatus;
45
45
  tasks: Task[];
@@ -1,6 +1,6 @@
1
- export declare type VariableMap = Record<string, string>;
1
+ export type VariableMap = Record<string, string>;
2
2
  declare const _default: {
3
- setConfig: (newConfig: Partial<import("./type").VariablesConfig>) => void;
4
- getConfig: () => import("./type").VariablesConfig;
3
+ setConfig: (newConfig: Partial<import("@").VariablesConfig>) => void;
4
+ getConfig: () => import("@").VariablesConfig;
5
5
  };
6
6
  export default _default;
package/lib/app/app.d.ts CHANGED
@@ -42,13 +42,13 @@ declare class App {
42
42
  setConfig: (models: any[]) => void;
43
43
  };
44
44
  request: {
45
- get: (url: string, data: any, config: import("../request").RequestSetting | undefined) => Promise<any>;
46
- post: (url: string, data: any, config: import("../request").RequestSetting | undefined) => Promise<any>;
47
- put: (url: string, data: any, config: import("../request").RequestSetting | undefined) => Promise<any>;
48
- remove: (url: string, data: any, config: import("../request").RequestSetting | undefined) => Promise<any>;
49
- custom: (url: string, config: import("../request").RequestSetting | undefined) => any;
50
- setConfig: (newConfig: Partial<import("../request").RequestConfig>) => void;
51
- getConfig: () => import("../request").RequestConfig;
45
+ get: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
46
+ post: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
47
+ put: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
48
+ remove: (url: string, data: any, config: import("@").RequestSetting | undefined) => Promise<any>;
49
+ custom: (url: string, config: import("@").RequestSetting | undefined) => any;
50
+ setConfig: (newConfig: Partial<import("@").RequestConfig>) => void;
51
+ getConfig: () => import("@").RequestConfig;
52
52
  };
53
53
  storage: Storage;
54
54
  menuManager: MenuManager;
package/lib/app/app.js CHANGED
@@ -51,54 +51,24 @@ var import_pubsub = __toESM(require("../pubsub"));
51
51
  var import_const = require("./const");
52
52
  var import_cmd = __toESM(require("../cmd"));
53
53
  var import_aws = __toESM(require("../aws"));
54
- var App = class _App {
55
- // 实例
56
- static instance;
57
- // 插件管理
58
- plugins;
59
- // 全局数据
60
- globalData;
61
- // 路由管理
62
- router;
63
- // 应用管理
64
- applicationManager;
65
- // History
66
- history;
67
- // 数据存储
68
- data;
69
- // hooks
70
- hooks = import_hooks.default;
71
- // 多语言
72
- locales;
73
- // dva
74
- models = import_models.default;
75
- // 请求
76
- request = import_request.default;
77
- // 存储
78
- storage;
79
- // 菜单管理
80
- menuManager;
81
- // cookie
82
- cookie = import_cookie.default;
83
- // 网站信息
84
- website = import_website.default;
85
- // 日志
86
- logger;
87
- // 发布订阅
88
- pubsub = import_pubsub.default;
89
- // cmd
90
- cmd;
91
- // aws
92
- aws;
93
- // 任务管理
94
- tasksManager;
95
- // getPisellos
96
- getPisellos;
97
- dbManager = null;
98
- constants = {
99
- channel: ""
100
- };
54
+ var App = class {
101
55
  constructor(options) {
56
+ // hooks
57
+ this.hooks = import_hooks.default;
58
+ // dva
59
+ this.models = import_models.default;
60
+ // 请求
61
+ this.request = import_request.default;
62
+ // cookie
63
+ this.cookie = import_cookie.default;
64
+ // 网站信息
65
+ this.website = import_website.default;
66
+ // 发布订阅
67
+ this.pubsub = import_pubsub.default;
68
+ this.dbManager = null;
69
+ this.constants = {
70
+ channel: ""
71
+ };
102
72
  this.plugins = /* @__PURE__ */ new Map();
103
73
  this.globalData = {};
104
74
  this.router = new import_routes.RouterManager({}, this);
@@ -122,11 +92,11 @@ var App = class _App {
122
92
  }
123
93
  // 单例模式
124
94
  static getInstance(options) {
125
- if (!_App.instance) {
126
- _App.instance = new _App(options);
127
- window.app = _App.instance;
95
+ if (!App.instance) {
96
+ App.instance = new App(options);
97
+ window.app = App.instance;
128
98
  }
129
- return _App.instance;
99
+ return App.instance;
130
100
  }
131
101
  // 初始化配置
132
102
  setGlobalData(globalData) {
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import App, { AppOptions } from "./app";
3
- declare type AppContextType = {
3
+ type AppContextType = {
4
4
  globalData: any;
5
5
  setGlobalData: React.Dispatch<React.SetStateAction<any>>;
6
6
  app: App;
@@ -5,7 +5,7 @@ import { MenuItem } from '../menuManager/index';
5
5
  * 应用接口类型定义
6
6
  * @description 描述应用中单个页面、组件或功能的接口结构
7
7
  */
8
- export declare type ApplicationInterface = {
8
+ export type ApplicationInterface = {
9
9
  /** 页面类型:低代码或普通代码 */
10
10
  page_type: 'low_code' | 'code';
11
11
  /** 页面唯一标识 */
@@ -34,7 +34,7 @@ export declare type ApplicationInterface = {
34
34
  * 应用数据类型定义
35
35
  * @description 描述完整应用的数据结构,包含应用的基本信息、接口、功能等
36
36
  */
37
- export declare type ApplicationData = {
37
+ export type ApplicationData = {
38
38
  /** 应用唯一标识 */
39
39
  app_id: number;
40
40
  /** 应用名称 */
@@ -34,18 +34,6 @@ __export(application_exports, {
34
34
  module.exports = __toCommonJS(application_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var Application = class {
37
- /** 应用配置数据 */
38
- options;
39
- /** 应用名称 */
40
- name;
41
- /** 应用内的页面接口映射表,以页面名称为键 */
42
- interfaces = /* @__PURE__ */ new Map();
43
- /** 应用内的组件映射表,以组件编码为键 */
44
- components = /* @__PURE__ */ new Map();
45
- /** 应用内的功能函数映射表,比如跳转登录页面的方法等 */
46
- functions = /* @__PURE__ */ new Map();
47
- /** 应用实例引用 */
48
- app;
49
37
  /**
50
38
  * 构造函数
51
39
  * @description 初始化应用实例,设置基本属性并初始化接口和功能
@@ -53,6 +41,12 @@ var Application = class {
53
41
  * @param {App} app - 应用实例引用
54
42
  */
55
43
  constructor(options, app) {
44
+ /** 应用内的页面接口映射表,以页面名称为键 */
45
+ this.interfaces = /* @__PURE__ */ new Map();
46
+ /** 应用内的组件映射表,以组件编码为键 */
47
+ this.components = /* @__PURE__ */ new Map();
48
+ /** 应用内的功能函数映射表,比如跳转登录页面的方法等 */
49
+ this.functions = /* @__PURE__ */ new Map();
56
50
  this.options = options;
57
51
  this.name = options.app_name;
58
52
  this.app = app;
@@ -27,12 +27,12 @@ var ApplicationManager = class {
27
27
  constructor(applicationList = [], app) {
28
28
  this.applicationList = applicationList;
29
29
  this.app = app;
30
+ this.applications = /* @__PURE__ */ new Map();
30
31
  this.app = app;
31
32
  if (applicationList == null ? void 0 : applicationList.length) {
32
33
  this.init(applicationList);
33
34
  }
34
35
  }
35
- applications = /* @__PURE__ */ new Map();
36
36
  async init(applicationList) {
37
37
  return new Promise(async (res, req) => {
38
38
  applicationList.forEach(
@@ -74,7 +74,9 @@ var ApplicationManager = class {
74
74
  * @returns
75
75
  */
76
76
  getAllComponents() {
77
- return Array.from(this.applications.values()).flatMap((application) => Array.from(application.components.values())).filter((component) => component.autoRender).map((component) => component.Component);
77
+ return Array.from(this.applications.values()).flatMap(
78
+ (application) => Array.from(application.components.values())
79
+ ).filter((component) => component.autoRender).map((component) => component.Component);
78
80
  }
79
81
  };
80
82
  // Annotate the CommonJS export names for ESM import in node:
package/lib/aws/index.js CHANGED
@@ -32,9 +32,6 @@ var defaultUploadParams = {
32
32
  // 设置ACL权限为公共读取
33
33
  };
34
34
  var AWS = class {
35
- s3Client;
36
- app;
37
- config;
38
35
  constructor(app, options) {
39
36
  this.app = app;
40
37
  if (options) {
@@ -1,9 +1,9 @@
1
1
  export declare enum CMDCoreEnum {
2
- CMD_CONNECT,
3
- CMD_DISCONNECT,
4
- CMD_RECONNECT,
5
- CMD_MESSAGE,
6
- CMD_ERROR
2
+ CMD_CONNECT = "cmd.connect",
3
+ CMD_DISCONNECT = "cmd.disconnect",
4
+ CMD_RECONNECT = "cmd.reconnect",
5
+ CMD_MESSAGE = "cmd.message",
6
+ CMD_ERROR = "cmd.error"
7
7
  }
8
8
  declare const _default: {
9
9
  CMDCoreEnum: typeof CMDCoreEnum;
package/lib/cmd/const.js CHANGED
@@ -25,11 +25,11 @@ __export(const_exports, {
25
25
  module.exports = __toCommonJS(const_exports);
26
26
  var prefix = "cmd";
27
27
  var CMDCoreEnum = ((CMDCoreEnum2) => {
28
- CMDCoreEnum2["CMD_CONNECT"] = `${prefix}.connect`;
29
- CMDCoreEnum2["CMD_DISCONNECT"] = `${prefix}.disconnect`;
30
- CMDCoreEnum2["CMD_RECONNECT"] = `${prefix}.reconnect`;
31
- CMDCoreEnum2["CMD_MESSAGE"] = `${prefix}.message`;
32
- CMDCoreEnum2["CMD_ERROR"] = `${prefix}.error`;
28
+ CMDCoreEnum2[CMDCoreEnum2["CMD_CONNECT"] = `${prefix}.connect`] = "CMD_CONNECT";
29
+ CMDCoreEnum2[CMDCoreEnum2["CMD_DISCONNECT"] = `${prefix}.disconnect`] = "CMD_DISCONNECT";
30
+ CMDCoreEnum2[CMDCoreEnum2["CMD_RECONNECT"] = `${prefix}.reconnect`] = "CMD_RECONNECT";
31
+ CMDCoreEnum2[CMDCoreEnum2["CMD_MESSAGE"] = `${prefix}.message`] = "CMD_MESSAGE";
32
+ CMDCoreEnum2[CMDCoreEnum2["CMD_ERROR"] = `${prefix}.error`] = "CMD_ERROR";
33
33
  return CMDCoreEnum2;
34
34
  })(CMDCoreEnum || {});
35
35
  var const_default = { CMDCoreEnum };
package/lib/cmd/index.js CHANGED
@@ -36,8 +36,6 @@ module.exports = __toCommonJS(cmd_exports);
36
36
  var import_socket = __toESM(require("../socket"));
37
37
  var import_const = require("./const");
38
38
  var CMD = class {
39
- app;
40
- options;
41
39
  constructor(app, options) {
42
40
  this.app = app;
43
41
  this.options = options;
@@ -35,8 +35,10 @@ function getCookie(name) {
35
35
  const ca = document.cookie.split(";");
36
36
  for (let i = 0; i < ca.length; i++) {
37
37
  let c = ca[i];
38
- while (c.charAt(0) === " ") c = c.substring(1, c.length);
39
- if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);
38
+ while (c.charAt(0) === " ")
39
+ c = c.substring(1, c.length);
40
+ if (c.indexOf(nameEQ) === 0)
41
+ return c.substring(nameEQ.length, c.length);
40
42
  }
41
43
  return null;
42
44
  }
package/lib/data/index.js CHANGED
@@ -23,9 +23,6 @@ __export(data_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(data_exports);
25
25
  var Data = class {
26
- app;
27
- storage;
28
- store;
29
26
  constructor(app) {
30
27
  this.app = app;
31
28
  this.storage = app.storage;
@@ -25,34 +25,32 @@ module.exports = __toCommonJS(history_exports);
25
25
  var import_history = require("history");
26
26
  var import_react_router_dom = require("react-router-dom");
27
27
  var History = class {
28
- instance;
29
- useHistory = import_react_router_dom.useHistory;
30
- useLocation = import_react_router_dom.useLocation;
31
- useParams = import_react_router_dom.useParams;
32
- app;
33
28
  constructor(app, options) {
29
+ this.useHistory = import_react_router_dom.useHistory;
30
+ this.useLocation = import_react_router_dom.useLocation;
31
+ this.useParams = import_react_router_dom.useParams;
32
+ this.push = (path, state) => {
33
+ this.instance.push(path, state);
34
+ };
35
+ this.replace = (path, state) => {
36
+ this.instance.replace(path, state);
37
+ };
38
+ this.reload = () => {
39
+ window.location.reload();
40
+ };
41
+ this.reloadTo = (path) => {
42
+ window.location.href = path;
43
+ };
44
+ this.externalPage = (path) => {
45
+ window.open(path);
46
+ };
47
+ this.goLogin = () => {
48
+ var _a, _b;
49
+ return (_b = (_a = this.app.applicationManager.get("login")) == null ? void 0 : _a.runFunction) == null ? void 0 : _b.call(_a, "goLogin");
50
+ };
34
51
  this.app = app;
35
52
  this.instance = (0, import_history.createBrowserHistory)({ basename: (options == null ? void 0 : options.basename) || "/" });
36
53
  }
37
- push = (path, state) => {
38
- this.instance.push(path, state);
39
- };
40
- replace = (path, state) => {
41
- this.instance.replace(path, state);
42
- };
43
- reload = () => {
44
- window.location.reload();
45
- };
46
- reloadTo = (path) => {
47
- window.location.href = path;
48
- };
49
- externalPage = (path) => {
50
- window.open(path);
51
- };
52
- goLogin = () => {
53
- var _a, _b;
54
- return (_b = (_a = this.app.applicationManager.get("login")) == null ? void 0 : _a.runFunction) == null ? void 0 : _b.call(_a, "goLogin");
55
- };
56
54
  };
57
55
  // Annotate the CommonJS export names for ESM import in node:
58
56
  0 && (module.exports = {
@@ -1,6 +1,6 @@
1
1
  import { ModelsState } from "../../models";
2
2
  declare const useStore: <T extends "global", D extends keyof ModelsState[T]>(props: {
3
3
  models: T;
4
- key?: D | undefined;
4
+ key?: D;
5
5
  }) => D extends undefined ? ModelsState[T] : ModelsState[T][D];
6
6
  export default useStore;
@@ -2,7 +2,7 @@ import App from "../app";
2
2
  /**
3
3
  * IndexDB 管理器模块
4
4
  *
5
- * 这个模块提供了对浏览器 IndexedDB 的简单封装,并在不支持 IndexedDB 的环境中
5
+ * 这个模块使用 Dexie.js 提供了对浏览器 IndexedDB 的简单封装,并在不支持 IndexedDB 的环境中
6
6
  * 自动降级使用内存存储作为备选存储方案。
7
7
  */
8
8
  /**
@@ -34,7 +34,7 @@ export interface DBOptions {
34
34
  }
35
35
  /**
36
36
  * IndexDB 管理器类
37
- * 提供对 IndexedDB 的简单封装,支持自动降级到内存存储
37
+ * 使用 Dexie.js 提供对 IndexedDB 的封装,支持自动降级到内存存储
38
38
  * @class IndexDBManager
39
39
  */
40
40
  declare class IndexDBManager {