@oox/client 1.0.0 → 1.0.1
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.
- package/browser.js +1139 -1109
- package/browser.js.map +1 -1
- package/config.js +1 -0
- package/context.js +22 -0
- package/index.js +3 -82
- package/keepalive-connection-sample.js +8 -8
- package/keepalive-connection.js +55 -0
- package/package.json +1 -1
- package/proxy.js +30 -0
- package/types/config.d.ts +1 -0
- package/types/context.d.ts +7 -0
- package/types/index.d.ts +3 -19
- package/types/keepalive-connection-sample.d.ts +1 -1
- package/types/keepalive-connection.d.ts +6 -0
- package/types/proxy.d.ts +1 -0
package/types/index.d.ts
CHANGED
|
@@ -1,23 +1,7 @@
|
|
|
1
|
-
import { Context } from "./context.js";
|
|
2
|
-
import { Config } from './config.js';
|
|
3
|
-
import { KeepAliveConnection, KeepAliveNativeConnection } from "./keepalive-connection.js";
|
|
4
|
-
export declare const config: Config;
|
|
5
|
-
export declare function setGenTraceIdFunction(fn: () => string): void;
|
|
6
|
-
/**
|
|
7
|
-
* 生成随机不重复id
|
|
8
|
-
*/
|
|
9
|
-
export declare function genTraceId(): string;
|
|
10
|
-
export declare function genContext(context?: Context): Context;
|
|
11
|
-
export declare function getContext(): Context;
|
|
12
|
-
export declare function addKeepAliveConnection(connection: KeepAliveConnection<KeepAliveNativeConnection>): void;
|
|
13
|
-
export declare function removeKeepAliveConnection(connection: KeepAliveConnection<KeepAliveNativeConnection>): void;
|
|
14
|
-
export declare function removeKeepAliveConnection(name: string, id: string): void;
|
|
15
|
-
export declare function setLoadBalancePolicy(policy: (name: string) => KeepAliveConnection<KeepAliveNativeConnection>): void;
|
|
16
|
-
export declare function rpc(appName: string, action: string, params: any[], context?: Context): Promise<any>;
|
|
17
|
-
export declare function rpc(connection: KeepAliveConnection<KeepAliveNativeConnection>, action: string, params: any[], context?: Context): Promise<any>;
|
|
18
1
|
export * from './app.js';
|
|
19
|
-
export * from './context.js';
|
|
20
2
|
export * from './config.js';
|
|
21
|
-
export *
|
|
3
|
+
export * from './context.js';
|
|
22
4
|
export * from './keepalive-connection.js';
|
|
23
5
|
export * from './keepalive-connection-sample.js';
|
|
6
|
+
export * as logger from './logger.js';
|
|
7
|
+
export * from './proxy.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ReturnsBody } from './app.js';
|
|
1
2
|
import { Context, KeepAliveRPCContext } from './context.js';
|
|
2
3
|
import { KeepAliveConnection, KeepAliveConnectionData, KeepAliveNativeConnection, KeepAliveConnectionAdapter, KeepAliveSyncConnectionsQuery } from './keepalive-connection.js';
|
|
3
|
-
import { ReturnsBody } from './index.js';
|
|
4
4
|
export interface SampleKeepAliveNativeConnection extends KeepAliveNativeConnection {
|
|
5
5
|
connected: boolean;
|
|
6
6
|
connect?(): void;
|
|
@@ -101,4 +101,10 @@ export declare class KeepAliveConnectionStore<T extends KeepAliveNativeConnectio
|
|
|
101
101
|
export declare const keepAliveConnectionAdapters: Map<string, KeepAliveConnectionAdapter<KeepAliveNativeConnection>>;
|
|
102
102
|
export declare const keepAliveConnections: KeepAliveConnectionStore<KeepAliveNativeConnection>;
|
|
103
103
|
export declare const enabledKeepAliveConnections: KeepAliveConnectionStore<KeepAliveNativeConnection>;
|
|
104
|
+
export declare function addKeepAliveConnection(connection: KeepAliveConnection<KeepAliveNativeConnection>): void;
|
|
105
|
+
export declare function removeKeepAliveConnection(connection: KeepAliveConnection<KeepAliveNativeConnection>): void;
|
|
106
|
+
export declare function removeKeepAliveConnection(name: string, id: string): void;
|
|
107
|
+
export declare function setLoadBalancePolicy(policy: (name: string) => KeepAliveConnection<KeepAliveNativeConnection>): void;
|
|
108
|
+
export declare function rpc(appName: string, action: string, params: any[], context?: Context): Promise<any>;
|
|
109
|
+
export declare function rpc(connection: KeepAliveConnection<KeepAliveNativeConnection>, action: string, params: any[], context?: Context): Promise<any>;
|
|
104
110
|
export {};
|
package/types/proxy.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function proxy(name: string, action?: string): () => void;
|