@v1nt1248/3nclient-lib 0.0.13 → 0.0.14

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/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import type { Ui3nDialogComponentProps } from './components/ui3n-dialog.vue';
3
3
  import type { DialogInstance } from './plugins/dialogs';
4
4
  export * from './constants';
5
5
  export * from './tools';
6
+ export * from './libs';
6
7
  export * from './plugins';
7
8
  export * from './directives';
8
9
  export * from './components';
@@ -1,4 +1,3 @@
1
- export * from './ipc-service'
2
- export * from './ipc-service-caller'
3
- export * from './serialization-for-ipc/json-n-binary'
4
- export * from './sqlite-on-3nstorage/index'
1
+ export * from './sqlite-on-3nstorage';
2
+ export { makeObservableMethodCaller, makeReqRepMethodCaller, makeServiceCaller, } from './ipc-service-caller';
3
+ export { SingleConnectionIPCWrap, MultiConnectionIPCWrap, IPCWrap, } from './ipc-service';
@@ -1,6 +1,5 @@
1
- /// <reference path="../@types/platform-defs/w3n.d.ts" />
2
- declare type RPCConnection = web3n.rpc.client.RPCConnection;
3
- declare type PassedDatum = web3n.rpc.PassedDatum;
1
+ type RPCConnection = web3n.rpc.client.RPCConnection;
2
+ type PassedDatum = web3n.rpc.PassedDatum;
4
3
  export interface TransformOpts {
5
4
  unpackReply?: ((reply: PassedDatum | undefined) => any) | 'noop';
6
5
  packRequest?: ((args: any[]) => PassedDatum | undefined) | 'noop';
@@ -1,9 +1,8 @@
1
- /// <reference path="../@types/platform-defs/w3n.d.ts" />
2
- declare type IncomingConnection = web3n.rpc.service.IncomingConnection;
3
- declare type PassedDatum = web3n.rpc.PassedDatum;
4
- declare type Observer<T> = web3n.Observer<T>;
5
- export declare type HandleObservingCall = (obs: Observer<any>, ...requestArgs: any[]) => (() => void);
6
- export declare type HandleReqReplyCall = (...requestArgs: any[]) => Promise<any>;
1
+ type IncomingConnection = web3n.rpc.service.IncomingConnection;
2
+ type PassedDatum = web3n.rpc.PassedDatum;
3
+ type Observer<T> = web3n.Observer<T>;
4
+ export type HandleObservingCall = (obs: Observer<any>, ...requestArgs: any[]) => (() => void);
5
+ export type HandleReqReplyCall = (...requestArgs: any[]) => Promise<any>;
7
6
  export interface TransformOpts {
8
7
  unpackRequest?: ((req: PassedDatum | undefined) => any[]) | 'noop';
9
8
  packReply?: ((reply: any) => PassedDatum | undefined) | 'noop';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This function creates a copy of json entity with a caveat that Buffer and
3
+ * byte arrays are shared between original and a copy.
4
+ * @param orig is an object, which copy is created. Buffer and byte arrays
5
+ * passed through like primitives.
6
+ * @param excludeTopFields is an optional list of fields to exclude from copy.
7
+ */
8
+ export declare function copyJSON<T>(orig: T, excludeTopFields?: string[]): T;
@@ -0,0 +1,10 @@
1
+ /// <reference types="@types/node" />
2
+ export declare class ProtoType<T extends object> {
3
+ private readonly type;
4
+ private constructor();
5
+ static for<T extends object>(type: any): ProtoType<T>;
6
+ pack(msg: T): Buffer;
7
+ unpack(bytes: Buffer | void): T;
8
+ packToBase64(msg: T): string;
9
+ unpackFromBase64(str: string): T;
10
+ }
@@ -0,0 +1,6 @@
1
+ export interface Deferred<T> {
2
+ promise: Promise<T>;
3
+ resolve: (result?: T | PromiseLike<T>) => void;
4
+ reject: (err: any) => void;
5
+ }
6
+ export declare function defer<T>(): Deferred<T>;
@@ -1,9 +1,9 @@
1
- import { Database as DBClass, BindParams as QueryParams, QueryExecResult as QueryResult } from './sqljs';
2
- import { SingleProc, Action } from './synced';
3
- export declare type Database = DBClass;
4
- export declare type BindParams = QueryParams;
5
- export declare type QueryExecResult = QueryResult;
6
- declare type WritableFile = web3n.files.WritableFile;
1
+ import { Database as DBClass, BindParams as QueryParams, QueryExecResult as QueryResult } from './sqljs.js';
2
+ import { SingleProc, Action } from './synced.js';
3
+ export type Database = DBClass;
4
+ export type BindParams = QueryParams;
5
+ export type QueryExecResult = QueryResult;
6
+ type WritableFile = web3n.files.WritableFile;
7
7
  export interface SaveOpts {
8
8
  skipUpload?: boolean;
9
9
  }
@@ -5,7 +5,7 @@
5
5
  * later time. Scheduler needs a not-yet-started activity, as scheduler has
6
6
  * control action's start.
7
7
  */
8
- export declare type Action<T> = () => Promise<T>;
8
+ export type Action<T> = () => Promise<T>;
9
9
  /**
10
10
  * This is a container of processes, labeled by some ids. It allows to track if
11
11
  * there is a process already in progress with a given id. And, it allows to