@nocobase/client-v2 2.0.22 → 2.1.0-alpha.10

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.
@@ -0,0 +1,124 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { FlowEngine, FlowEngineContext, FlowModel } from '@nocobase/flow-engine';
10
+ import { APIClient, type APIClientOptions } from '@nocobase/sdk';
11
+ import { type i18n as i18next } from 'i18next';
12
+ import React, { ComponentType, ReactElement, ReactNode } from 'react';
13
+ import type { Plugin } from './Plugin';
14
+ import { PluginManager, type PluginType } from './PluginManager';
15
+ import { type PluginSettingOptions, PluginSettingsManager } from './PluginSettingsManager';
16
+ import { type ComponentTypeAndString, RouterManager, type RouterOptions } from './RouterManager';
17
+ import { WebSocketClient, type WebSocketClientOptions } from './WebSocketClient';
18
+ import type { RequireJS } from './utils/requirejs';
19
+ declare global {
20
+ interface Window {
21
+ define: RequireJS['define'];
22
+ }
23
+ }
24
+ export type DevDynamicImport = (packageName: string) => Promise<{
25
+ default: typeof Plugin;
26
+ }>;
27
+ export type ComponentAndProps<T = any> = [ComponentType, T];
28
+ export interface ApplicationOptions {
29
+ name?: string;
30
+ publicPath?: string;
31
+ apiClient?: APIClientOptions;
32
+ ws?: WebSocketClientOptions | boolean;
33
+ i18n?: i18next;
34
+ providers?: (ComponentType | ComponentAndProps)[];
35
+ plugins?: PluginType[];
36
+ components?: Record<string, ComponentType>;
37
+ scopes?: Record<string, any>;
38
+ router?: RouterOptions;
39
+ pluginSettings?: Record<string, PluginSettingOptions>;
40
+ designable?: boolean;
41
+ loadRemotePlugins?: boolean;
42
+ devDynamicImport?: DevDynamicImport;
43
+ disableAcl?: boolean;
44
+ }
45
+ export declare class Application {
46
+ protected options: ApplicationOptions;
47
+ eventBus: EventTarget;
48
+ providers: ComponentAndProps[];
49
+ router: RouterManager;
50
+ scopes: Record<string, any>;
51
+ i18n: i18next;
52
+ ws: WebSocketClient;
53
+ apiClient: APIClient;
54
+ components: Record<string, ComponentType<any> | any>;
55
+ pluginManager: PluginManager;
56
+ pluginSettingsManager: PluginSettingsManager;
57
+ devDynamicImport: DevDynamicImport;
58
+ requirejs: RequireJS;
59
+ name: string;
60
+ favicon: string;
61
+ flowEngine: FlowEngine;
62
+ context: FlowEngineContext & {
63
+ pluginSettingsRouter: PluginSettingsManager;
64
+ pluginManager: PluginManager;
65
+ };
66
+ maintained: boolean;
67
+ maintaining: boolean;
68
+ error: any;
69
+ model: ApplicationModel;
70
+ private wsAuthorized;
71
+ apps: {
72
+ Component?: ComponentType;
73
+ };
74
+ get pm(): PluginManager;
75
+ get disableAcl(): boolean;
76
+ get isWsAuthorized(): boolean;
77
+ updateFavicon(favicon?: string): void;
78
+ setWsAuthorized(authorized: boolean): void;
79
+ constructor(options?: ApplicationOptions);
80
+ private initListeners;
81
+ protected setTokenInWebSocket(options: {
82
+ token: string;
83
+ authenticator: string;
84
+ }): void;
85
+ setMaintaining(maintaining: boolean): void;
86
+ private initRequireJs;
87
+ private addDefaultProviders;
88
+ private addReactRouterComponents;
89
+ private addRoutes;
90
+ getOptions(): ApplicationOptions;
91
+ getName(): string;
92
+ getPublicPath(): string;
93
+ getApiUrl(pathname?: string): string;
94
+ getRouteUrl(pathname: string): string;
95
+ getHref(pathname: string): string;
96
+ /**
97
+ * @internal
98
+ */
99
+ getComposeProviders(): React.FC;
100
+ use<T = any>(component: ComponentType, props?: T): number;
101
+ addProvider<T = any>(component: ComponentType, props?: T): number;
102
+ addProviders(providers: (ComponentType | [ComponentType, any])[]): void;
103
+ load(): Promise<void>;
104
+ loadWebSocket(): Promise<void>;
105
+ getComponent<T = any>(Component: ComponentTypeAndString<T>, isShowError?: boolean): ComponentType<T> | undefined;
106
+ renderComponent<T extends {}>(Component: ComponentTypeAndString, props?: T, children?: ReactNode): ReactElement;
107
+ private addComponent;
108
+ addComponents(components: Record<string, ComponentType>): void;
109
+ getRootComponent(): React.FC<{
110
+ children?: React.ReactNode;
111
+ }>;
112
+ mount(containerOrSelector: Element | ShadowRoot | string): import("react-dom/client").Root;
113
+ }
114
+ declare class ApplicationModel extends FlowModel {
115
+ #private;
116
+ get app(): Application;
117
+ getProviders(): React.FunctionComponent<{}>;
118
+ getRouter(): any;
119
+ render(): React.JSX.Element;
120
+ renderMaintaining(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
121
+ renderError(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
122
+ renderContent(): React.JSX.Element;
123
+ }
124
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import MockAdapter from 'axios-mock-adapter';
10
+ import { Application, type ApplicationOptions } from './Application';
11
+ declare class MockApplication extends Application {
12
+ apiMock: MockAdapter;
13
+ constructor(options?: ApplicationOptions);
14
+ }
15
+ export declare function createMockClient(options?: ApplicationOptions): MockApplication;
16
+ export {};
package/es/Plugin.d.ts ADDED
@@ -0,0 +1,33 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { TFuncKey, TOptions } from 'i18next';
10
+ import type { Application } from './Application';
11
+ export declare class Plugin<T = any> {
12
+ options: T;
13
+ protected app: Application;
14
+ constructor(options: T, app: Application);
15
+ get pluginManager(): import("./PluginManager").PluginManager;
16
+ get context(): import("@nocobase/flow-engine").FlowEngineContext & {
17
+ pluginSettingsRouter: import("./PluginSettingsManager").PluginSettingsManager;
18
+ pluginManager: import("./PluginManager").PluginManager;
19
+ };
20
+ get flowEngine(): import("@nocobase/flow-engine").FlowEngine;
21
+ get engine(): import("@nocobase/flow-engine").FlowEngine;
22
+ get pm(): import("./PluginManager").PluginManager;
23
+ get router(): import("./RouterManager").RouterManager;
24
+ get pluginSettingsManager(): import("./PluginSettingsManager").PluginSettingsManager;
25
+ get pluginSettingsRouter(): import("./PluginSettingsManager").PluginSettingsManager;
26
+ get schemaInitializerManager(): any;
27
+ get schemaSettingsManager(): any;
28
+ get dataSourceManager(): any;
29
+ afterAdd(): Promise<void>;
30
+ beforeLoad(): Promise<void>;
31
+ load(): Promise<void>;
32
+ t(text: TFuncKey | TFuncKey[], options?: TOptions): import("i18next").TFunctionDetailedResult<object>;
33
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { Application } from './Application';
10
+ import type { Plugin } from './Plugin';
11
+ export type PluginOptions<T = any> = {
12
+ name?: string;
13
+ packageName?: string;
14
+ config?: T;
15
+ };
16
+ export type PluginType<Opts = any> = typeof Plugin | [typeof Plugin<Opts>, PluginOptions<Opts>];
17
+ export type PluginData = {
18
+ name: string;
19
+ packageName: string;
20
+ version: string;
21
+ url: string;
22
+ type: 'local' | 'upload' | 'npm';
23
+ };
24
+ export declare class PluginManager {
25
+ protected _plugins: PluginType[];
26
+ protected loadRemotePlugins: boolean;
27
+ protected app: Application;
28
+ protected pluginInstances: Map<typeof Plugin, Plugin>;
29
+ protected pluginsAliases: Record<string, Plugin>;
30
+ private initPlugins;
31
+ constructor(_plugins: PluginType[], loadRemotePlugins: boolean, app: Application);
32
+ /**
33
+ * @internal
34
+ */
35
+ init(_plugins: PluginType[]): Promise<void>;
36
+ private initStaticPlugins;
37
+ private initRemotePlugins;
38
+ add<T = any>(plugin: typeof Plugin, opts?: PluginOptions<T>): Promise<void>;
39
+ get<T extends typeof Plugin>(PluginClass: T): InstanceType<T>;
40
+ get<T extends {}>(name: string): T;
41
+ private getInstance;
42
+ /**
43
+ * @internal
44
+ */
45
+ load(): Promise<void>;
46
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ import type { Application } from './Application';
11
+ import type { RouteType } from './RouterManager';
12
+ export declare const ADMIN_SETTINGS_KEY = "admin.settings.";
13
+ export declare const ADMIN_SETTINGS_PATH = "/admin/settings/";
14
+ export declare const SNIPPET_PREFIX = "pm.";
15
+ export interface PluginSettingOptions {
16
+ title: any;
17
+ /**
18
+ * @default Outlet
19
+ */
20
+ Component?: RouteType['Component'];
21
+ componentLoader?: RouteType['componentLoader'];
22
+ icon?: string;
23
+ /**
24
+ * sort, the smaller the number, the higher the priority
25
+ * @default 0
26
+ */
27
+ sort?: number;
28
+ aclSnippet?: string;
29
+ link?: string;
30
+ isTopLevel?: boolean;
31
+ isPinned?: boolean;
32
+ [index: string]: any;
33
+ }
34
+ export interface PluginSettingsPageType {
35
+ label?: string | React.ReactElement;
36
+ title: string | React.ReactElement;
37
+ link?: string;
38
+ key: string;
39
+ icon: any;
40
+ path: string;
41
+ sort?: number;
42
+ name?: string;
43
+ isAllow?: boolean;
44
+ topLevelName?: string;
45
+ aclSnippet: string;
46
+ children?: PluginSettingsPageType[];
47
+ [index: string]: any;
48
+ }
49
+ export declare class PluginSettingsManager {
50
+ protected settings: Record<string, PluginSettingOptions>;
51
+ protected aclSnippets: string[];
52
+ app: Application;
53
+ private cachedList;
54
+ constructor(_pluginSettings: Record<string, PluginSettingOptions>, app: Application);
55
+ clearCache(): void;
56
+ setAclSnippets(aclSnippets: string[]): void;
57
+ getAclSnippet(name: string): string;
58
+ getRouteName(name: string): string;
59
+ getRoutePath(name: string): string;
60
+ add(name: string, options: PluginSettingOptions): void;
61
+ remove(name: string): void;
62
+ hasAuth(name: string): boolean;
63
+ getSetting(name: string): PluginSettingOptions;
64
+ has(name: string): boolean;
65
+ get(name: string, filterAuth?: boolean): PluginSettingsPageType;
66
+ getList(filterAuth?: boolean): PluginSettingsPageType[];
67
+ getAclSnippets(): string[];
68
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React, { ComponentType } from 'react';
10
+ import { type BrowserRouterProps, type HashRouterProps, type MemoryRouterProps, type RouteObject } from 'react-router-dom';
11
+ import { Application } from './Application';
12
+ export interface BrowserRouterOptions extends Omit<BrowserRouterProps, 'children'> {
13
+ type?: 'browser';
14
+ }
15
+ export interface HashRouterOptions extends Omit<HashRouterProps, 'children'> {
16
+ type?: 'hash';
17
+ }
18
+ export interface MemoryRouterOptions extends Omit<MemoryRouterProps, 'children'> {
19
+ type?: 'memory';
20
+ }
21
+ export type RouterOptions = (HashRouterOptions | BrowserRouterOptions | MemoryRouterOptions) & {
22
+ renderComponent?: RenderComponentType;
23
+ routes?: Record<string, RouteType>;
24
+ };
25
+ export type ComponentTypeAndString<T = any> = ComponentType<T> | string;
26
+ export type ComponentLoaderResult = {
27
+ default?: ComponentTypeAndString;
28
+ Component?: ComponentTypeAndString;
29
+ } | ComponentTypeAndString;
30
+ export type ComponentLoader = () => Promise<ComponentLoaderResult>;
31
+ export interface RouteType extends Omit<RouteObject, 'children' | 'Component'> {
32
+ Component?: ComponentTypeAndString;
33
+ componentLoader?: ComponentLoader;
34
+ skipAuthCheck?: boolean;
35
+ }
36
+ export type RenderComponentType = (Component: ComponentTypeAndString, props?: any) => React.ReactNode;
37
+ export declare class RouterManager {
38
+ protected routes: Record<string, RouteType>;
39
+ protected options: RouterOptions;
40
+ app: Application;
41
+ router: any;
42
+ get basename(): any;
43
+ get state(): any;
44
+ get navigate(): any;
45
+ constructor(options: RouterOptions, app: Application);
46
+ protected resolveLoadedComponent(moduleOrComponent: ComponentLoaderResult): ComponentTypeAndString | undefined;
47
+ protected createRouteLazyComponent(componentLoader: ComponentLoader): ComponentType;
48
+ /**
49
+ * @internal
50
+ */
51
+ getRoutesTree(): RouteObject[];
52
+ getRoutes(): Record<string, RouteType>;
53
+ setType(type: RouterOptions['type']): void;
54
+ getBasename(): string;
55
+ setBasename(basename: string): void;
56
+ matchRoutes(pathname: string): import("@remix-run/router").AgnosticRouteMatch<string, RouteType>[];
57
+ isSkippedAuthCheckRoute(pathname: string): boolean;
58
+ /**
59
+ * @internal
60
+ */
61
+ getRouterComponent(children?: React.ReactNode): React.FC<{
62
+ BaseLayout?: ComponentType;
63
+ }>;
64
+ add(name: string, route: RouteType): void;
65
+ get(name: string): RouteType;
66
+ has(name: string): boolean;
67
+ remove(name: string): void;
68
+ }
69
+ export declare function createRouterManager(options?: RouterOptions, app?: Application): RouterManager;
@@ -0,0 +1,45 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { Application } from './Application';
10
+ export type WebSocketClientOptions = {
11
+ reconnectInterval?: number;
12
+ reconnectAttempts?: number;
13
+ pingInterval?: number;
14
+ url?: string;
15
+ basename?: string;
16
+ protocols?: string | string[];
17
+ onServerDown?: any;
18
+ };
19
+ export declare class WebSocketClient {
20
+ protected _ws: WebSocket;
21
+ protected _reconnectTimes: number;
22
+ protected events: any[];
23
+ protected options: WebSocketClientOptions;
24
+ app: Application;
25
+ enabled: boolean;
26
+ connected: boolean;
27
+ serverDown: boolean;
28
+ lastMessage: {};
29
+ constructor(options: WebSocketClientOptions | boolean);
30
+ getSubAppName: (app: Application) => string;
31
+ getURL(): string;
32
+ get reconnectAttempts(): number;
33
+ get reconnectInterval(): number;
34
+ get pingInterval(): number;
35
+ get readyState(): number;
36
+ createWebSocket(): WebSocket;
37
+ connect(): void;
38
+ reconnect(): void;
39
+ close(): void;
40
+ send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
41
+ on(type: string, listener: any, options?: boolean | AddEventListenerOptions): void;
42
+ emit(type: string, args: any): void;
43
+ off(type: string, listener: any, options?: boolean | EventListenerOptions): void;
44
+ removeAllListeners(): void;
45
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { FC, ReactNode } from 'react';
10
+ export declare const BlankComponent: FC<{
11
+ children?: ReactNode;
12
+ }>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React from 'react';
10
+ export declare const MainComponent: React.NamedExoticComponent<object>;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { Application } from '../Application';
10
+ export declare function useRouterSync(app: Application): void;
11
+ export declare function RouterBridge({ app }: {
12
+ app: any;
13
+ }): any;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { FC, ReactNode } from 'react';
10
+ export declare const RouterContextCleaner: FC<{
11
+ children?: ReactNode;
12
+ }>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export * from './BlankComponent';
10
+ export * from './RouterContextCleaner';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ /// <reference types="react" />
10
+ import type { Application } from './Application';
11
+ export declare const ApplicationContext: import("react").Context<Application>;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export * from './useApp';
10
+ export * from './usePlugin';
11
+ export * from './useRouter';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { Application } from '../Application';
10
+ export declare const useApp: () => Application;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { Plugin } from '../Plugin';
10
+ export declare function usePlugin<T extends typeof Plugin = any>(plugin: T): InstanceType<T>;
11
+ export declare function usePlugin<T extends {}>(name: string): T;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const useRouter: () => import("../RouterManager").RouterManager;
package/es/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export * from './Application';
10
+ export * from './components';
11
+ export * from './context';
12
+ export * from './MockApplication';
13
+ export * from './Plugin';
14
+ export * from './WebSocketClient';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import React, { ComponentType } from 'react';
10
+ export declare function normalizeContainer(container: Element | ShadowRoot | string): Element | null;
11
+ export declare const compose: (...components: [ComponentType, any][]) => (LastChild?: ComponentType) => React.FC;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { DevDynamicImport } from '../Application';
10
+ import type { Plugin } from '../Plugin';
11
+ import type { PluginData } from '../PluginManager';
12
+ import type { RequireJS } from './requirejs';
13
+ /**
14
+ * @internal
15
+ */
16
+ export declare function defineDevPlugins(plugins: Record<string, typeof Plugin>): void;
17
+ /**
18
+ * @internal
19
+ */
20
+ export declare function definePluginClient(packageName: string): void;
21
+ /**
22
+ * @internal
23
+ */
24
+ export declare function configRequirejs(requirejs: any, pluginData: PluginData[]): void;
25
+ /**
26
+ * @internal
27
+ */
28
+ export declare function processRemotePlugins(pluginData: PluginData[], resolve: (plugins: [string, typeof Plugin][]) => void): (...pluginModules: (typeof Plugin & {
29
+ default?: typeof Plugin;
30
+ })[]) => void;
31
+ /**
32
+ * @internal
33
+ */
34
+ export declare function getRemotePlugins(requirejs: any, pluginData?: PluginData[]): Promise<Array<[string, typeof Plugin]>>;
35
+ interface GetPluginsOption {
36
+ requirejs: RequireJS;
37
+ pluginData: PluginData[];
38
+ devDynamicImport?: DevDynamicImport;
39
+ }
40
+ /**
41
+ * @internal
42
+ */
43
+ export declare function getPlugins(options: GetPluginsOption): Promise<Array<[string, typeof Plugin]>>;
44
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import type { Require, RequireDefine } from './types';
10
+ export interface RequireJS {
11
+ require: Require;
12
+ requirejs: Require;
13
+ define: RequireDefine;
14
+ }
15
+ /**
16
+ * @internal
17
+ */
18
+ export declare function getRequireJs(): RequireJS;