@pisell/core 1.0.13 → 1.0.15

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 (137) hide show
  1. package/es/app/app.d.ts +87 -0
  2. package/es/app/const.d.ts +4 -0
  3. package/es/app/index.d.ts +14 -0
  4. package/es/applicationManager/application.d.ts +50 -0
  5. package/es/applicationManager/index.d.ts +13 -0
  6. package/es/aws/index.d.ts +16 -0
  7. package/es/cmd/const.d.ts +11 -0
  8. package/es/cmd/index.d.ts +13 -0
  9. package/es/cmd/type.d.ts +5 -0
  10. package/es/config.d.ts +3 -0
  11. package/es/cookie/index.d.ts +13 -0
  12. package/es/data/index.d.ts +8 -0
  13. package/es/history/config.d.ts +24 -0
  14. package/es/history/index.d.ts +20 -0
  15. package/es/history/type.d.ts +2 -0
  16. package/es/hooks/index.d.ts +12 -0
  17. package/es/hooks/useDelayedValue/index.d.ts +2 -0
  18. package/es/hooks/useDispatch/index.d.ts +2 -0
  19. package/es/hooks/useLowCode/index.d.ts +13 -0
  20. package/es/hooks/useStore/index.d.ts +6 -0
  21. package/es/index.d.ts +6 -0
  22. package/es/indexDB/index.d.ts +248 -0
  23. package/es/indexDB/index.js +453 -70
  24. package/es/locales/en.d.ts +3 -0
  25. package/es/locales/index.d.ts +39 -0
  26. package/es/locales/original.d.ts +3 -0
  27. package/es/locales/type.d.ts +19 -0
  28. package/es/locales/zh-CN.d.ts +3 -0
  29. package/es/locales/zh-HK.d.ts +3 -0
  30. package/es/logger/feishu.d.ts +11 -0
  31. package/es/menuManager/hooks.d.ts +17 -0
  32. package/es/menuManager/index.d.ts +28 -0
  33. package/es/models/global.d.ts +32 -0
  34. package/es/models/index.d.ts +45 -0
  35. package/es/models/type.d.ts +2 -0
  36. package/es/plugin/index.d.ts +0 -0
  37. package/es/pubsub/example.d.ts +5 -0
  38. package/es/pubsub/index.d.ts +63 -0
  39. package/es/request/cache.d.ts +46 -0
  40. package/es/request/cancelToken.d.ts +38 -0
  41. package/es/request/config.d.ts +3 -0
  42. package/es/request/constants.d.ts +2 -0
  43. package/es/request/index.d.ts +24 -0
  44. package/es/request/pisell2Request.d.ts +6 -0
  45. package/es/request/type.d.ts +41 -0
  46. package/es/request/utils.d.ts +46 -0
  47. package/es/routes/config.d.ts +7 -0
  48. package/es/routes/index.d.ts +28 -0
  49. package/es/socket/components/SocketMonitorPage.d.ts +6 -0
  50. package/es/socket/components/index.d.ts +2 -0
  51. package/es/socket/constants.d.ts +33 -0
  52. package/es/socket/events.d.ts +31 -0
  53. package/es/socket/heartbeat.d.ts +66 -0
  54. package/es/socket/index.d.ts +61 -0
  55. package/es/socket/monitor.d.ts +169 -0
  56. package/es/socket/reconnect.d.ts +61 -0
  57. package/es/socket/socket.d.ts +130 -0
  58. package/es/socket/types.d.ts +84 -0
  59. package/es/storage/index.d.ts +17 -0
  60. package/es/tasks/index.d.ts +83 -0
  61. package/es/tasks/type.d.ts +62 -0
  62. package/es/tasks/useTasks.d.ts +5 -0
  63. package/es/type.d.ts +2 -0
  64. package/es/variables/VariablesProvider.d.ts +7 -0
  65. package/es/variables/config.d.ts +3 -0
  66. package/es/variables/index.d.ts +6 -0
  67. package/es/variables/type.d.ts +2 -0
  68. package/es/website/index.d.ts +6 -0
  69. package/lib/app/app.d.ts +87 -0
  70. package/lib/app/const.d.ts +4 -0
  71. package/lib/app/index.d.ts +14 -0
  72. package/lib/applicationManager/application.d.ts +50 -0
  73. package/lib/applicationManager/index.d.ts +13 -0
  74. package/lib/aws/index.d.ts +16 -0
  75. package/lib/cmd/const.d.ts +11 -0
  76. package/lib/cmd/index.d.ts +13 -0
  77. package/lib/cmd/type.d.ts +5 -0
  78. package/lib/config.d.ts +3 -0
  79. package/lib/cookie/index.d.ts +13 -0
  80. package/lib/data/index.d.ts +8 -0
  81. package/lib/history/config.d.ts +24 -0
  82. package/lib/history/index.d.ts +20 -0
  83. package/lib/history/type.d.ts +2 -0
  84. package/lib/hooks/index.d.ts +12 -0
  85. package/lib/hooks/useDelayedValue/index.d.ts +2 -0
  86. package/lib/hooks/useDispatch/index.d.ts +2 -0
  87. package/lib/hooks/useLowCode/index.d.ts +13 -0
  88. package/lib/hooks/useStore/index.d.ts +6 -0
  89. package/lib/index.d.ts +6 -0
  90. package/lib/indexDB/index.d.ts +248 -0
  91. package/lib/indexDB/index.js +159 -0
  92. package/lib/locales/en.d.ts +3 -0
  93. package/lib/locales/index.d.ts +39 -0
  94. package/lib/locales/original.d.ts +3 -0
  95. package/lib/locales/type.d.ts +19 -0
  96. package/lib/locales/zh-CN.d.ts +3 -0
  97. package/lib/locales/zh-HK.d.ts +3 -0
  98. package/lib/logger/feishu.d.ts +11 -0
  99. package/lib/menuManager/hooks.d.ts +17 -0
  100. package/lib/menuManager/index.d.ts +28 -0
  101. package/lib/models/global.d.ts +32 -0
  102. package/lib/models/index.d.ts +45 -0
  103. package/lib/models/type.d.ts +2 -0
  104. package/lib/plugin/index.d.ts +0 -0
  105. package/lib/pubsub/example.d.ts +5 -0
  106. package/lib/pubsub/index.d.ts +63 -0
  107. package/lib/request/cache.d.ts +46 -0
  108. package/lib/request/cancelToken.d.ts +38 -0
  109. package/lib/request/config.d.ts +3 -0
  110. package/lib/request/constants.d.ts +2 -0
  111. package/lib/request/index.d.ts +24 -0
  112. package/lib/request/pisell2Request.d.ts +6 -0
  113. package/lib/request/type.d.ts +41 -0
  114. package/lib/request/utils.d.ts +46 -0
  115. package/lib/routes/config.d.ts +7 -0
  116. package/lib/routes/index.d.ts +28 -0
  117. package/lib/socket/components/SocketMonitorPage.d.ts +6 -0
  118. package/lib/socket/components/index.d.ts +2 -0
  119. package/lib/socket/constants.d.ts +33 -0
  120. package/lib/socket/events.d.ts +31 -0
  121. package/lib/socket/heartbeat.d.ts +66 -0
  122. package/lib/socket/index.d.ts +61 -0
  123. package/lib/socket/monitor.d.ts +169 -0
  124. package/lib/socket/reconnect.d.ts +61 -0
  125. package/lib/socket/socket.d.ts +130 -0
  126. package/lib/socket/types.d.ts +84 -0
  127. package/lib/storage/index.d.ts +17 -0
  128. package/lib/tasks/index.d.ts +83 -0
  129. package/lib/tasks/type.d.ts +62 -0
  130. package/lib/tasks/useTasks.d.ts +5 -0
  131. package/lib/type.d.ts +2 -0
  132. package/lib/variables/VariablesProvider.d.ts +7 -0
  133. package/lib/variables/config.d.ts +3 -0
  134. package/lib/variables/index.d.ts +6 -0
  135. package/lib/variables/type.d.ts +2 -0
  136. package/lib/website/index.d.ts +6 -0
  137. package/package.json +8 -8
@@ -0,0 +1,62 @@
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
+ manual?: boolean;
22
+ destroy?: boolean;
23
+ [key: string]: any;
24
+ }
25
+ export interface TaskConfig {
26
+ tasks: Task[];
27
+ }
28
+ declare type TaskModuleName = string;
29
+ declare type TaskQueueName = string;
30
+ declare type TaskStatus = "uncompleted" | "completed";
31
+ export interface TaskQueue {
32
+ status: TaskStatus;
33
+ tasks: Task[];
34
+ }
35
+ export interface RunTaskParams {
36
+ module: TaskModuleName;
37
+ queueId: TaskQueueName;
38
+ callback?: () => void;
39
+ }
40
+ export interface DeleteTaskParams {
41
+ module: TaskModuleName;
42
+ queueId: TaskQueueName;
43
+ taskId: string;
44
+ }
45
+ export interface AddTaskParams {
46
+ module: TaskModuleName;
47
+ queueId: TaskQueueName;
48
+ tasks: Task[];
49
+ }
50
+ export interface TaskRunResult {
51
+ status: TaskRunStatus;
52
+ [key: string]: any;
53
+ }
54
+ export interface TasksModule {
55
+ [key: TaskModuleName]: {
56
+ [key: TaskQueueName]: {
57
+ status: TaskStatus;
58
+ tasks: Task[];
59
+ };
60
+ };
61
+ }
62
+ export {};
@@ -0,0 +1,5 @@
1
+ import { TasksModule } from './type';
2
+ declare const useTasks: () => {
3
+ tasks: TasksModule;
4
+ };
5
+ export default useTasks;
package/es/type.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export interface CoreConfig {
2
+ }
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ export declare const useVariablesContext: () => any;
3
+ interface VariablesProviderProps {
4
+ children: React.ReactNode;
5
+ }
6
+ export declare const VariablesProvider: React.FC<VariablesProviderProps>;
7
+ export {};
@@ -0,0 +1,3 @@
1
+ import { VariablesConfig } from './type';
2
+ export declare const setConfig: (newConfig: Partial<VariablesConfig>) => void;
3
+ export declare const getConfig: () => VariablesConfig;
@@ -0,0 +1,6 @@
1
+ export declare type VariableMap = Record<string, string>;
2
+ declare const _default: {
3
+ setConfig: (newConfig: Partial<import("./type").VariablesConfig>) => void;
4
+ getConfig: () => import("./type").VariablesConfig;
5
+ };
6
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export interface VariablesConfig {
2
+ }
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ setTitle: (title: string) => void;
3
+ setIcon: (paramsIcon: string) => void;
4
+ setAppleWebAppTitle: (title: string) => void;
5
+ };
6
+ export default _default;
@@ -0,0 +1,87 @@
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 from "../cmd";
12
+ import AWS from "../aws";
13
+ declare global {
14
+ interface Window {
15
+ app: App;
16
+ }
17
+ }
18
+ export interface AppOptions {
19
+ logger?: LoggerOptions;
20
+ db?: DBOptions;
21
+ constants?: any;
22
+ history?: HistoryOptions;
23
+ storage?: StorageOptions;
24
+ locales?: LocalesOptions;
25
+ }
26
+ declare class App {
27
+ private static instance;
28
+ private plugins;
29
+ globalData: any;
30
+ router: RouterManager;
31
+ applicationManager: ApplicationManager;
32
+ history: History;
33
+ data: Data;
34
+ hooks: import("../hooks").HooksExport;
35
+ locales: Locales;
36
+ models: {
37
+ getStore: () => import("../models").Store;
38
+ StoreProvider: typeof import("react-redux").Provider;
39
+ setConfig: (models: any[]) => void;
40
+ };
41
+ request: {
42
+ get: (url: string, data: any, config: import("../request").RequestSetting | undefined) => Promise<any>;
43
+ post: (url: string, data: any, config: import("../request").RequestSetting | undefined) => Promise<any>;
44
+ put: (url: string, data: any, config: import("../request").RequestSetting | undefined) => Promise<any>;
45
+ remove: (url: string, data: any, config: import("../request").RequestSetting | undefined) => Promise<any>;
46
+ custom: (url: string, config: import("../request").RequestSetting | undefined) => Promise<any>;
47
+ setConfig: (newConfig: Partial<import("../request").RequestConfig>) => void;
48
+ getConfig: () => import("../request").RequestConfig;
49
+ };
50
+ storage: Storage;
51
+ menuManager: MenuManager;
52
+ cookie: {
53
+ setCookie: (name: string, value: string, domain?: string | undefined) => void;
54
+ getCookie: (name: string) => string | null;
55
+ deleteCookie: (name: string, domain?: string | undefined) => void;
56
+ checkCookie: (name: string) => boolean;
57
+ updateCookie: (name: string, value: string, domain?: string | undefined) => void;
58
+ };
59
+ website: {
60
+ setTitle: (title: string) => void;
61
+ setIcon: (paramsIcon: string) => void;
62
+ setAppleWebAppTitle: (title: string) => void;
63
+ };
64
+ logger: LoggerManager;
65
+ pubsub: import("../pubsub").PubSub;
66
+ cmd: CMD;
67
+ aws: AWS;
68
+ tasksManager: TasksManager;
69
+ dbManager: IndexDBManager | null;
70
+ constants: {
71
+ channel: string;
72
+ [key: string]: string;
73
+ };
74
+ private constructor();
75
+ static getInstance(options?: AppOptions): App;
76
+ setGlobalData(globalData: any): void;
77
+ usePlugin(name: string, plugin: any): void;
78
+ usePlugins(plugins: {
79
+ name: string;
80
+ plugin: any;
81
+ }[]): void;
82
+ getPlugin(name: string): any;
83
+ getGlobalData(): any;
84
+ install(): void;
85
+ unInstall(): void;
86
+ }
87
+ export default App;
@@ -0,0 +1,4 @@
1
+ export declare enum APPEvent {
2
+ APP_INSTALL = "app.install",
3
+ APP_UNINSTALL = "app.uninstall"
4
+ }
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import App, { AppOptions } from "./app";
3
+ declare type AppContextType = {
4
+ globalData: any;
5
+ setGlobalData: React.Dispatch<React.SetStateAction<any>>;
6
+ app: App;
7
+ };
8
+ export declare const AppProvider: React.FC<{
9
+ children: React.ReactNode;
10
+ options: AppOptions;
11
+ }>;
12
+ export declare const useApp: () => AppContextType;
13
+ export declare const getApp: typeof App.getInstance;
14
+ export default App;
@@ -0,0 +1,50 @@
1
+ import App from "../app";
2
+ import { LoadLibraryByUrlParams } from "../locales/type";
3
+ import { MenuItem } from "../menuManager/index";
4
+ export declare type ApplicationInterface = {
5
+ page_type: "low_code" | "code";
6
+ page_id: number | string;
7
+ page_code: string;
8
+ page_version?: string;
9
+ page_name: string;
10
+ router: string;
11
+ category: "page" | "component" | "function";
12
+ Component?: any;
13
+ children?: any;
14
+ layout?: string;
15
+ originalUrl?: string;
16
+ };
17
+ export declare type ApplicationData = {
18
+ app_id: number;
19
+ app_name: string;
20
+ app_type: "system" | "custom";
21
+ interfaces: ApplicationInterface[];
22
+ functions?: any[];
23
+ menu?: {
24
+ [key: string]: MenuItem[];
25
+ };
26
+ locales?: LoadLibraryByUrlParams;
27
+ [key: string]: any;
28
+ };
29
+ export declare class Application {
30
+ options: ApplicationData;
31
+ name: ApplicationData["app_name"];
32
+ interfaces: Map<ApplicationInterface["page_name"], ApplicationInterface>;
33
+ components: Map<string, any>;
34
+ functions: Map<string, any>;
35
+ app: App;
36
+ constructor(options: ApplicationData, app: App);
37
+ afterAdd(application: Application): Promise<void>;
38
+ beforeLoad(): Promise<void>;
39
+ load(): Promise<void>;
40
+ initInterfaces(interfaces: ApplicationData["interfaces"]): void;
41
+ initFunctions(functions: ApplicationData["functions"]): void;
42
+ loadInterface(interfaceItem: ApplicationInterface): Promise<ApplicationInterface>;
43
+ setInterface(code: string, interfaceItem: ApplicationInterface): void;
44
+ setComponent(code: string, component: ApplicationInterface): void;
45
+ setFunction(code: string, functionItem: ApplicationInterface): void;
46
+ getInterface(code: string): ApplicationInterface | undefined;
47
+ getComponent(code: string): any;
48
+ getFunction(code: string): any;
49
+ runFunction(code: string, params?: any, ...args: any): any;
50
+ }
@@ -0,0 +1,13 @@
1
+ import APP from "../app";
2
+ import { Application, ApplicationData } from "./application";
3
+ export declare class ApplicationManager {
4
+ applicationList: Application[];
5
+ protected app: APP;
6
+ applications: Map<string, Application>;
7
+ constructor(applicationList: Application[], app: APP);
8
+ init(applicationList: Application[] | ApplicationData[]): Promise<unknown>;
9
+ add(application: Application): Promise<void>;
10
+ get(appName: Application["name"]): Application | undefined;
11
+ remove(appName: Application["name"]): void;
12
+ load(): Promise<void>;
13
+ }
@@ -0,0 +1,16 @@
1
+ import { S3ClientConfig, PutObjectCommandInput } from '@aws-sdk/client-s3';
2
+ import App from '../app';
3
+ export interface AWSOptions extends S3ClientConfig {
4
+ s3Config: S3ClientConfig;
5
+ bucketName?: string;
6
+ }
7
+ export interface UploadParams extends PutObjectCommandInput {
8
+ }
9
+ declare class AWS {
10
+ private s3Client?;
11
+ private app;
12
+ private config?;
13
+ constructor(app: App, options?: AWSOptions);
14
+ upload(params: UploadParams): Promise<import("@aws-sdk/client-s3").PutObjectCommandOutput | undefined>;
15
+ }
16
+ export default AWS;
@@ -0,0 +1,11 @@
1
+ export declare enum CMDCoreEnum {
2
+ CMD_CONNECT,
3
+ CMD_DISCONNECT,
4
+ CMD_RECONNECT,
5
+ CMD_MESSAGE,
6
+ CMD_ERROR
7
+ }
8
+ declare const _default: {
9
+ CMDCoreEnum: typeof CMDCoreEnum;
10
+ };
11
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import App from "../app";
2
+ import { CMDCoreEnum } from "./const";
3
+ export interface CMDOptions {
4
+ socketUrl?: string;
5
+ }
6
+ declare class CMD {
7
+ private app;
8
+ private options?;
9
+ constructor(app: App, options?: CMDOptions);
10
+ init(): void;
11
+ }
12
+ export { CMDCoreEnum };
13
+ export default CMD;
@@ -0,0 +1,5 @@
1
+ export interface CDMItem {
2
+ key: string;
3
+ code: string;
4
+ [key: string]: any;
5
+ }
@@ -0,0 +1,3 @@
1
+ import { CoreConfig } from './type';
2
+ export declare const setConfig: (newConfig: Partial<CoreConfig>) => void;
3
+ export declare const getConfig: () => CoreConfig;
@@ -0,0 +1,13 @@
1
+ declare function setCookie(name: string, value: string, domain?: string): void;
2
+ declare function getCookie(name: string): string | null;
3
+ declare function deleteCookie(name: string, domain?: string): void;
4
+ declare function checkCookie(name: string): boolean;
5
+ declare function updateCookie(name: string, value: string, domain?: string): void;
6
+ declare const _default: {
7
+ setCookie: typeof setCookie;
8
+ getCookie: typeof getCookie;
9
+ deleteCookie: typeof deleteCookie;
10
+ checkCookie: typeof checkCookie;
11
+ updateCookie: typeof updateCookie;
12
+ };
13
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import { Storage } from '../storage';
2
+ import App from '../app';
3
+ export declare class Data {
4
+ private app;
5
+ storage: Storage;
6
+ store: any;
7
+ constructor(app: App);
8
+ }
@@ -0,0 +1,24 @@
1
+ import { HistoryConfig } from './type';
2
+ /**
3
+ * @title: 默认配置
4
+ * @description:
5
+ * @return {*}
6
+ * @Author: zhiwei.Wang
7
+ */
8
+ export declare const defaultConfig: HistoryConfig;
9
+ /**
10
+ * @title: 设置配置
11
+ * @description:
12
+ * @param {Partial} newConfig
13
+ * @return {*}
14
+ * @Author: zhiwei.Wang
15
+ */
16
+ export declare const setConfig: (newConfig: Partial<HistoryConfig>) => HistoryConfig;
17
+ /**
18
+ * @title: 获取配置
19
+ * @description:
20
+ * @param {*} HistoryConfig
21
+ * @return {*}
22
+ * @Author: zhiwei.Wang
23
+ */
24
+ export declare const getConfig: () => HistoryConfig;
@@ -0,0 +1,20 @@
1
+ import type { History as HistoryType } from "history";
2
+ import { useHistory, useLocation, useParams } from "react-router-dom";
3
+ import App from "../app";
4
+ export interface HistoryOptions {
5
+ basename?: string;
6
+ }
7
+ export declare class History {
8
+ instance: HistoryType<unknown>;
9
+ useHistory: typeof useHistory;
10
+ useLocation: typeof useLocation;
11
+ useParams: typeof useParams;
12
+ app: App;
13
+ constructor(app: App, options?: HistoryOptions);
14
+ push: HistoryType["push"];
15
+ replace: HistoryType["replace"];
16
+ reload: () => void;
17
+ reloadTo: (path: string) => void;
18
+ externalPage: (path: string) => void;
19
+ goLogin: () => any;
20
+ }
@@ -0,0 +1,2 @@
1
+ export interface HistoryConfig {
2
+ }
@@ -0,0 +1,12 @@
1
+ import useLowCode from './useLowCode';
2
+ import useDelayedValue from './useDelayedValue';
3
+ import useStore from './useStore';
4
+ import useDispatch from './useDispatch';
5
+ export interface HooksExport {
6
+ useLowCode: typeof useLowCode;
7
+ useDelayedValue: typeof useDelayedValue;
8
+ useStore: typeof useStore;
9
+ useDispatch: typeof useDispatch;
10
+ }
11
+ declare const _default: HooksExport;
12
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare function useDelayedValue<T>(value: T, timeout?: number): T;
2
+ export default useDelayedValue;
@@ -0,0 +1,2 @@
1
+ import { useDispatch } from "react-redux";
2
+ export default useDispatch;
@@ -0,0 +1,13 @@
1
+ export interface useLowCodeProps {
2
+ onChange: (e: any) => void;
3
+ onReady: (e: any) => void;
4
+ }
5
+ export interface useLowCodeResult {
6
+ lowcodeRef: {
7
+ onReady: (e: any) => void;
8
+ onChange: (e: any) => void;
9
+ };
10
+ setState: (values: any, callback?: any) => any;
11
+ }
12
+ declare const useLowCode: (props: Partial<useLowCodeProps>) => useLowCodeResult;
13
+ export default useLowCode;
@@ -0,0 +1,6 @@
1
+ import { ModelsState } from "../../models";
2
+ declare const useStore: <T extends "global", D extends keyof ModelsState[T]>(props: {
3
+ models: T;
4
+ key?: D | undefined;
5
+ }) => D extends undefined ? ModelsState[T] : ModelsState[T][D];
6
+ export default useStore;
package/lib/index.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export { default as request } from './request';
2
+ export { default as hooks } from './hooks';
3
+ export { default as models } from './models';
4
+ export { default as pubsub } from './pubsub';
5
+ export { default as socket } from './socket';
6
+ export * from './app';