@v1nt1248/3nclient-lib 0.0.16 → 0.0.18

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 (68) hide show
  1. package/README.md +44 -4
  2. package/package.json +24 -7
  3. package/src/components/ui3n-button.vue +20 -4
  4. package/src/components/ui3n-drop-files.vue +34 -11
  5. package/src/components/ui3n-emoji.vue +34 -14
  6. package/src/components/ui3n-input.vue +3 -2
  7. package/src/components/ui3n-list.vue +1 -1
  8. package/dist/components/index.d.ts +0 -26
  9. package/dist/components/ui3n-button.vue.d.ts +0 -82
  10. package/dist/components/ui3n-dialog.vue.d.ts +0 -73
  11. package/dist/components/ui3n-drop-files.vue.d.ts +0 -41
  12. package/dist/components/ui3n-emoji.vue.d.ts +0 -36
  13. package/dist/components/ui3n-icon.vue.d.ts +0 -92
  14. package/dist/components/ui3n-input.vue.d.ts +0 -96
  15. package/dist/components/ui3n-list.vue.d.ts +0 -45
  16. package/dist/components/ui3n-menu.vue.d.ts +0 -85
  17. package/dist/components/ui3n-notification.vue.d.ts +0 -72
  18. package/dist/components/ui3n-table-sort-icon.vue.d.ts +0 -29
  19. package/dist/components/ui3n-table.vue.d.ts +0 -42
  20. package/dist/components/ui3n-text.vue.d.ts +0 -79
  21. package/dist/components/ui3n-virtual-scroll.vue.d.ts +0 -34
  22. package/dist/constants/emoticons.d.ts +0 -649
  23. package/dist/constants/general.d.ts +0 -2
  24. package/dist/constants/index.d.ts +0 -3
  25. package/dist/constants/types.d.ts +0 -31
  26. package/dist/directives/index.d.ts +0 -2
  27. package/dist/directives/ui3n-click-outside.d.ts +0 -10
  28. package/dist/directives/ui3n-html.d.ts +0 -6
  29. package/dist/index.d.ts +0 -37
  30. package/dist/libs/index.d.ts +0 -3
  31. package/dist/libs/ipc-service-caller.d.ts +0 -12
  32. package/dist/libs/ipc-service.d.ts +0 -60
  33. package/dist/libs/serialization-for-ipc/copy-json.d.ts +0 -8
  34. package/dist/libs/serialization-for-ipc/json-n-binary.d.ts +0 -5
  35. package/dist/libs/serialization-for-ipc/protobuf-type.d.ts +0 -10
  36. package/dist/libs/sqlite-on-3nstorage/deferred.d.ts +0 -6
  37. package/dist/libs/sqlite-on-3nstorage/index.d.ts +0 -49
  38. package/dist/libs/sqlite-on-3nstorage/synced.d.ts +0 -73
  39. package/dist/libs/sqlite-on-3nstorage/types.d.ts +0 -243
  40. package/dist/plugins/dialogs.d.ts +0 -17
  41. package/dist/plugins/i18n.d.ts +0 -20
  42. package/dist/plugins/icons.d.ts +0 -2
  43. package/dist/plugins/index.d.ts +0 -14
  44. package/dist/plugins/notifications.d.ts +0 -13
  45. package/dist/plugins/store-dialogs.d.ts +0 -4
  46. package/dist/plugins/store-i18n.d.ts +0 -7
  47. package/dist/plugins/store-notifications.d.ts +0 -4
  48. package/dist/plugins/store-vue-bus.d.ts +0 -4
  49. package/dist/plugins/vue-bus.d.ts +0 -19
  50. package/dist/style.css +0 -1
  51. package/dist/tools/common.helpers.d.ts +0 -3
  52. package/dist/tools/index.d.ts +0 -3
  53. package/dist/tools/textarea-max-rows.d.ts +0 -3
  54. package/dist/tools/ui.helpers.d.ts +0 -13
  55. package/dist/ui-3n-lib.js +0 -16529
  56. package/src/libs/index.ts +0 -11
  57. package/src/libs/ipc-service-caller.ts +0 -121
  58. package/src/libs/ipc-service.ts +0 -422
  59. package/src/libs/serialization-for-ipc/copy-json.ts +0 -55
  60. package/src/libs/serialization-for-ipc/json-ipc.proto.d.ts +0 -432
  61. package/src/libs/serialization-for-ipc/json-ipc.proto.js +0 -1093
  62. package/src/libs/serialization-for-ipc/json-n-binary.ts +0 -275
  63. package/src/libs/serialization-for-ipc/protobuf-type.ts +0 -61
  64. package/src/libs/sqlite-on-3nstorage/deferred.ts +0 -32
  65. package/src/libs/sqlite-on-3nstorage/index.ts +0 -292
  66. package/src/libs/sqlite-on-3nstorage/sqljs.js +0 -225
  67. package/src/libs/sqlite-on-3nstorage/synced.ts +0 -194
  68. package/src/libs/sqlite-on-3nstorage/types.ts +0 -279
package/dist/index.d.ts DELETED
@@ -1,37 +0,0 @@
1
- import type { CbFunction, Ui3nNotificationProps, VueEventBus } from './constants';
2
- import type { Ui3nDialogComponentProps } from './components/ui3n-dialog.vue';
3
- import type { DialogInstance } from './plugins/dialogs';
4
- export * from './constants';
5
- export * from './tools';
6
- export * from './libs';
7
- export * from './plugins';
8
- export * from './directives';
9
- export * from './components';
10
- declare module 'vue' {
11
- interface ComponentCustomProperties {
12
- $openDialog: (params: Ui3nDialogComponentProps) => DialogInstance | undefined;
13
- $createNotice: (params: Ui3nNotificationProps) => void;
14
- $locale: string;
15
- $tr: (key: string, placeholders?: Record<string, string>) => string;
16
- $changeLocale: (lang: string) => void;
17
- $emitter: VueEventBus;
18
- }
19
- }
20
- declare module 'pinia' {
21
- interface PiniaCustomProperties {
22
- $openDialog: (params: Ui3nDialogComponentProps) => DialogInstance | undefined;
23
- $createNotice: (params: Ui3nNotificationProps) => void;
24
- $emitter: {
25
- on: (type: string | symbol, handler: CbFunction) => void;
26
- off: (type: string | symbol, handler?: CbFunction) => void;
27
- emit: (type: string | symbol, arguments?: any) => void;
28
- once: (type: string | symbol, handler: CbFunction) => void;
29
- clear: () => void;
30
- };
31
- $i18n: {
32
- locale: string;
33
- changeLocale: (lang: string) => void;
34
- tr: (key: string, placeholders?: Record<string, string>) => string;
35
- };
36
- }
37
- }
@@ -1,3 +0,0 @@
1
- export * from './sqlite-on-3nstorage';
2
- export { makeObservableMethodCaller, makeReqRepMethodCaller, makeServiceCaller, } from './ipc-service-caller';
3
- export { SingleConnectionIPCWrap, MultiConnectionIPCWrap, IPCWrap, } from './ipc-service';
@@ -1,12 +0,0 @@
1
- type RPCConnection = web3n.rpc.client.RPCConnection;
2
- type PassedDatum = web3n.rpc.PassedDatum;
3
- export interface TransformOpts {
4
- unpackReply?: ((reply: PassedDatum | undefined) => any) | 'noop';
5
- packRequest?: ((args: any[]) => PassedDatum | undefined) | 'noop';
6
- }
7
- export declare function makeReqRepMethodCaller<F extends Function>(connection: RPCConnection, method: string, transforms?: TransformOpts): F;
8
- export declare function makeObservableMethodCaller<F extends Function>(connection: RPCConnection, method: string, transforms?: TransformOpts): F;
9
- export declare function makeServiceCaller<T>(connection: RPCConnection, reqRepMethods?: (keyof T)[], obsMethods?: (keyof T)[], transforms?: {
10
- [method in keyof T]: TransformOpts;
11
- }): Partial<T>;
12
- export {};
@@ -1,60 +0,0 @@
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>;
6
- export interface TransformOpts {
7
- unpackRequest?: ((req: PassedDatum | undefined) => any[]) | 'noop';
8
- packReply?: ((reply: any) => PassedDatum | undefined) | 'noop';
9
- }
10
- declare class ConnectionState {
11
- private readonly disconnect;
12
- private readonly calls;
13
- private isRunning;
14
- constructor(disconnect: () => void);
15
- acceptsMsgs(): boolean;
16
- stop(): void;
17
- hasCall(callNum: number): boolean;
18
- cancelCall(callNum: number): void;
19
- completeCall(callNum: number): void;
20
- registerReqReplyCall(callNum: number): void;
21
- registerObservableCall(callNum: number, cancel: () => void): void;
22
- }
23
- export declare abstract class IPCWrap {
24
- readonly srvName: string;
25
- protected readonly connections: Map<web3n.rpc.service.IncomingConnection, ConnectionState>;
26
- private readonly methods;
27
- constructor(srvName: string);
28
- addReqReplyMethod(method: string, srv: object | undefined, func: HandleReqReplyCall, transforms?: TransformOpts): void;
29
- exposeReqReplyMethods<T extends object>(srv: T, methods: (keyof T)[], transforms?: {
30
- [method in keyof T]: TransformOpts;
31
- }): void;
32
- addObservableMethod(method: string, srv: object | undefined, func: HandleObservingCall, transforms?: TransformOpts): void;
33
- exposeObservableMethods<T extends object>(srv: T, methods: (keyof T)[], transforms?: {
34
- [method in keyof T]: TransformOpts;
35
- }): void;
36
- private onMsg;
37
- private callReqReplyHandler;
38
- private callObsHandler;
39
- startIPC(): () => void;
40
- stopIPC(): void;
41
- protected onConnection(connection: IncomingConnection): Promise<void>;
42
- protected onConnectionCompletion(connection: IncomingConnection, connectionState: ConnectionState): Promise<void>;
43
- protected onConnectionError(connection: IncomingConnection, connectionState: ConnectionState, err: any): Promise<void>;
44
- protected abstract onListeningCompletion(): Promise<void>;
45
- protected abstract onListeningError(err: any): Promise<void>;
46
- }
47
- export declare class SingleConnectionIPCWrap extends IPCWrap {
48
- constructor(srvName: string);
49
- protected onListeningCompletion(): Promise<void>;
50
- protected onListeningError(err: any): Promise<void>;
51
- protected onConnectionCompletion(connection: IncomingConnection, connectionState: ConnectionState): Promise<void>;
52
- protected onConnectionError(connection: IncomingConnection, connectionState: ConnectionState, err: any): Promise<void>;
53
- }
54
- export declare class MultiConnectionIPCWrap extends IPCWrap {
55
- constructor(srvName: string);
56
- protected onListeningCompletion(): Promise<void>;
57
- protected onListeningError(err: any): Promise<void>;
58
- protected onConnectionError(connection: IncomingConnection, connectionState: ConnectionState, err: any): Promise<void>;
59
- }
60
- export {};
@@ -1,8 +0,0 @@
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;
@@ -1,5 +0,0 @@
1
- export declare function serializeArgs(args: any[]): {
2
- bytes: Uint8Array;
3
- passedByReference?: any[];
4
- };
5
- export declare function deserializeArgs(bytes: Uint8Array, passedByReference: any[] | undefined): any[];
@@ -1,10 +0,0 @@
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
- }
@@ -1,6 +0,0 @@
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,49 +0,0 @@
1
- import { Database as DBClass, BindParams as QueryParams, QueryExecResult as QueryResult } from './types';
2
- import { SingleProc, Action } from './synced';
3
- export type Database = DBClass;
4
- export type BindParams = QueryParams;
5
- export type QueryExecResult = QueryResult;
6
- type WritableFile = web3n.files.WritableFile;
7
- export interface SaveOpts {
8
- skipUpload?: boolean;
9
- }
10
- export declare abstract class SQLiteOn3NStorage {
11
- protected readonly database: Database;
12
- protected readonly file: WritableFile;
13
- protected readonly syncProc: SingleProc;
14
- protected constructor(database: Database, file: WritableFile);
15
- static makeAndStart(file: WritableFile): Promise<SQLiteOn3NStorage>;
16
- private start;
17
- saveToFile(opts?: SaveOpts): Promise<void>;
18
- get db(): Database;
19
- sync<T>(action: Action<T>): Promise<T>;
20
- listTables(): string[];
21
- }
22
- export declare function objectFromQueryExecResult<T>(sqlResult: QueryExecResult): Array<T>;
23
- export declare class TableColumnsAndParams<ColumnDefs extends object> {
24
- readonly name: string;
25
- private readonly columnDefs;
26
- readonly c: {
27
- [columnName in keyof ColumnDefs]: string;
28
- };
29
- readonly cReversed: {
30
- [snakedColName: string]: keyof ColumnDefs;
31
- };
32
- readonly p: {
33
- [columnName in keyof ColumnDefs]: string;
34
- };
35
- readonly q: {
36
- [columnName in keyof ColumnDefs]: string;
37
- };
38
- constructor(name: string, columnDefs: ColumnDefs);
39
- private toC;
40
- toParams<T extends {
41
- [columnName in keyof ColumnDefs]: any;
42
- }>(value: Partial<T>, throwOnUnknownField?: boolean): any;
43
- getFromQueryExecResult<T>(sqlResult: QueryExecResult): Array<T>;
44
- get insertQuery(): string;
45
- updateQuery(withTabName: boolean, columns?: (keyof ColumnDefs)[] | undefined, skipColumns?: boolean): string;
46
- get columnsCreateSection(): string;
47
- selectQuery(columnsToSelect: (keyof ColumnDefs)[] | string, ...whereAndColEqual: (keyof ColumnDefs)[]): string;
48
- }
49
- export {};
@@ -1,73 +0,0 @@
1
- /**
2
- * This represents a function that will create a promise, potentially starting
3
- * some background process, only when it is called. Such wrap of code is needed
4
- * for scheduling, as very often any start of an action must be postponed till
5
- * later time. Scheduler needs a not-yet-started activity, as scheduler has
6
- * control action's start.
7
- */
8
- export type Action<T> = () => Promise<T>;
9
- /**
10
- * This is a container of processes, labeled by some ids. It allows to track if
11
- * there is a process already in progress with a given id. And, it allows to
12
- * chain process, when needed.
13
- *
14
- * Common use of such class is to reuse getting of some expensive resource(s).
15
- */
16
- export declare class NamedProcs {
17
- private processes;
18
- constructor();
19
- /**
20
- * @param id is a string key of a process
21
- * @return a promise of a process' completion, or undefined, if process with
22
- * given id is unknown.
23
- */
24
- latestTaskAtThisMoment<T>(id: string): Promise<T> | undefined;
25
- isProcessing(id: string): boolean;
26
- /**
27
- * This method will add a promise of an already started process.
28
- * @param id is a string key of a process
29
- * @param promise of an already started process
30
- * @return a promise of a process' completion.
31
- */
32
- addStarted<T>(id: string, promise: Promise<T>): Promise<T>;
33
- /**
34
- * This method will start a given action only, if a process with a given id
35
- * is not running.
36
- * @param id is a string key of a process
37
- * @param action is a function that starts some process
38
- * @return a promise of a process' completion.
39
- */
40
- start<T>(id: string, action: Action<T>): Promise<T>;
41
- /**
42
- * This method will chain a given action to an already running process, or,
43
- * if identified process is not running, this will start given action under
44
- * a given id.
45
- * @param id is a string key of a process
46
- * @param action is a function that starts some process
47
- * @return a promise of a process' completion.
48
- */
49
- startOrChain<T>(id: string, action: Action<T>): Promise<T>;
50
- }
51
- /**
52
- * This is a container of process. It allows to track if a process is already
53
- * in progress. It also allows to chain process, when needed.
54
- *
55
- * Common use of such class is to reuse getting of some expensive resource, or
56
- * do ning something as an exclusive process.
57
- */
58
- export declare class SingleProc {
59
- private onGoingIdle?;
60
- private actions;
61
- private running;
62
- constructor(onGoingIdle?: (() => void) | undefined);
63
- isProcessing(): boolean;
64
- latestTaskAtThisMoment<T>(): Promise<T> | undefined;
65
- addStarted<T>(promise: Promise<T>): Promise<T>;
66
- start<T>(action: Action<T>): Promise<T>;
67
- private runIfIdle;
68
- startOrChain<T>(action: Action<T>): Promise<T>;
69
- }
70
- /**
71
- * This wraps given function/method into syncing wrap.
72
- */
73
- export declare function makeSyncedFunc<T extends Function>(syncProc: SingleProc, thisArg: any, func: T): T;
@@ -1,243 +0,0 @@
1
- export type SqlValue = number | string | Uint8Array | null;
2
- export type ParamsObject = Record<string, SqlValue>;
3
- export type ParamsCallback = (obj: ParamsObject) => void;
4
- export type BindParams = SqlValue[] | ParamsObject | null;
5
- export interface QueryExecResult {
6
- columns: string[];
7
- values: SqlValue[][];
8
- }
9
- export interface StatementIteratorResult {
10
- /** `true` if there are no more available statements */
11
- done: boolean;
12
- /** the next available Statement (as returned by `Database.prepare`) */
13
- value: Statement;
14
- }
15
- export interface SqlJsStatic {
16
- Database: typeof Database;
17
- Statement: typeof Statement;
18
- }
19
- export declare class Database {
20
- /**
21
- * Represents an SQLite database
22
- * @see [https://sql.js.org/documentation/Database.html#Database](https://sql.js.org/documentation/Database.html#Database)
23
- *
24
- * @param data An array of bytes representing an SQLite database file
25
- */
26
- constructor(data?: ArrayLike<number> | null);
27
- /**
28
- * Close the database, and all associated prepared statements. The
29
- * memory associated to the database and all associated statements will
30
- * be freed.
31
- *
32
- * **Warning**: A statement belonging to a database that has been closed
33
- * cannot be used anymore.
34
- *
35
- * Databases must be closed when you're finished with them, or the
36
- * memory consumption will grow forever
37
- * @see [https://sql.js.org/documentation/Database.html#["close"]](https://sql.js.org/documentation/Database.html#%5B%22close%22%5D)
38
- */
39
- close(): void;
40
- /**
41
- * Register a custom function with SQLite
42
- * @see [https://sql.js.org/documentation/Database.html#["create_function"]](https://sql.js.org/documentation/Database.html#%5B%22create_function%22%5D)
43
- *
44
- * @param name the name of the function as referenced in SQL statements.
45
- * @param func the actual function to be executed.
46
- */
47
- create_function(name: string, func: (...args: any[]) => any): Database;
48
- /**
49
- * Execute an sql statement, and call a callback for each row of result.
50
- *
51
- * Currently this method is synchronous, it will not return until the
52
- * callback has been called on every row of the result. But this might
53
- * change.
54
- * @see [https://sql.js.org/documentation/Database.html#["each"]](https://sql.js.org/documentation/Database.html#%5B%22each%22%5D)
55
- *
56
- * @param sql A string of SQL text. Can contain placeholders that will
57
- * be bound to the parameters given as the second argument
58
- * @param params Parameters to bind to the query
59
- * @param callback Function to call on each row of result
60
- * @param done A function that will be called when all rows have been
61
- * retrieved
62
- */
63
- each(sql: string, params: BindParams, callback: ParamsCallback, done: () => void): Database;
64
- each(sql: string, callback: ParamsCallback, done: () => void): Database;
65
- /**
66
- * Execute an SQL query, and returns the result.
67
- *
68
- * This is a wrapper against `Database.prepare`, `Statement.bind`, `Statement.step`, `Statement.get`, and `Statement.free`.
69
- *
70
- * The result is an array of result elements. There are as many result elements as the number of statements in your sql string (statements are separated by a semicolon)
71
- * @see [https://sql.js.org/documentation/Database.html#["exec"]](https://sql.js.org/documentation/Database.html#%5B%22exec%22%5D)
72
- *
73
- * @param sql a string containing some SQL text to execute
74
- * @param params When the SQL statement contains placeholders, you can
75
- * pass them in here. They will be bound to the statement before it is
76
- * executed. If you use the params argument as an array, you **cannot**
77
- * provide an sql string that contains several statements (separated by
78
- * `;`). This limitation does not apply to params as an object.
79
- */
80
- exec(sql: string, params?: BindParams): QueryExecResult[];
81
- /**
82
- * Exports the contents of the database to a binary array
83
- * @see [https://sql.js.org/documentation/Database.html#["export"]](https://sql.js.org/documentation/Database.html#%5B%22export%22%5D)
84
- */
85
- export(): Uint8Array;
86
- /**
87
- * Returns the number of changed rows (modified, inserted or deleted) by
88
- * the latest completed `INSERT`, `UPDATE` or `DELETE` statement on the
89
- * database. Executing any other type of SQL statement does not modify
90
- * the value returned by this function.
91
- * @see [https://sql.js.org/documentation/Database.html#["getRowsModified"]](https://sql.js.org/documentation/Database.html#%5B%22getRowsModified%22%5D)
92
- */
93
- getRowsModified(): number;
94
- /**
95
- * Analyze a result code, return null if no error occured, and throw an
96
- * error with a descriptive message otherwise
97
- * @see [https://sql.js.org/documentation/Database.html#["handleError"]](https://sql.js.org/documentation/Database.html#%5B%22handleError%22%5D)
98
- */
99
- handleError(): null | never;
100
- /**
101
- * Iterate over multiple SQL statements in a SQL string. This function
102
- * returns an iterator over Statement objects. You can use a `for..of`
103
- * loop to execute the returned statements one by one.
104
- * @see [https://sql.js.org/documentation/Database.html#["iterateStatements"]](https://sql.js.org/documentation/Database.html#%5B%22iterateStatements%22%5D)
105
- *
106
- * @param sql a string of SQL that can contain multiple statements
107
- */
108
- iterateStatements(sql: string): StatementIterator;
109
- /**
110
- * Prepare an SQL statement
111
- * @see [https://sql.js.org/documentation/Database.html#["prepare"]](https://sql.js.org/documentation/Database.html#%5B%22prepare%22%5D)
112
- *
113
- * @param sql a string of SQL, that can contain placeholders (`?`, `:VVV`, `:AAA`, `@AAA`)
114
- * @param params values to bind to placeholders
115
- */
116
- prepare(sql: string, params?: BindParams): Statement;
117
- /**
118
- * Execute an SQL query, ignoring the rows it returns.
119
- * @see [https://sql.js.org/documentation/Database.html#["run"]](https://sql.js.org/documentation/Database.html#%5B%22run%22%5D)
120
- *
121
- * @param sql a string containing some SQL text to execute
122
- * @param params When the SQL statement contains placeholders, you can
123
- * pass them in here. They will be bound to the statement before it is
124
- * executed. If you use the params argument as an array, you **cannot**
125
- * provide an sql string that contains several statements (separated by
126
- * `;`). This limitation does not apply to params as an object.
127
- */
128
- run(sql: string, params?: BindParams): Database;
129
- }
130
- export declare class Statement {
131
- /**
132
- * Bind values to the parameters, after having reseted the statement. If
133
- * values is null, do nothing and return true.
134
- *
135
- * SQL statements can have parameters, named '?', '?NNN', ':VVV',
136
- * '@VVV', '$VVV', where NNN is a number and VVV a string. This function
137
- * binds these parameters to the given values.
138
- *
139
- * Warning: ':', '@', and '$' are included in the parameters names
140
- *
141
- * ### Value types
142
- *
143
- * |Javascript type|SQLite type|
144
- * |-|-|
145
- * |number|REAL, INTEGER|
146
- * |boolean|INTEGER|
147
- * |string|TEXT|
148
- * |Array, Uint8Array|BLOB|
149
- * |null|NULL|
150
- * @see [https://sql.js.org/documentation/Statement.html#["bind"]](https://sql.js.org/documentation/Statement.html#%5B%22bind%22%5D)
151
- *
152
- * @param values The values to bind
153
- */
154
- bind(values?: BindParams): boolean;
155
- /**
156
- * Free the memory used by the statement
157
- * @see [https://sql.js.org/documentation/Statement.html#["free"]](https://sql.js.org/documentation/Statement.html#%5B%22free%22%5D)
158
- */
159
- free(): boolean;
160
- /**
161
- * Free the memory allocated during parameter binding
162
- * @see [https://sql.js.org/documentation/Statement.html#["freemem"]](https://sql.js.org/documentation/Statement.html#%5B%22freemem%22%5D)
163
- */
164
- freemem(): void;
165
- /**
166
- * Get one row of results of a statement. If the first parameter is not
167
- * provided, step must have been called before.
168
- * @see [https://sql.js.org/documentation/Statement.html#["get"]](https://sql.js.org/documentation/Statement.html#%5B%22get%22%5D)
169
- *
170
- * @param params If set, the values will be bound to the statement
171
- * before it is executed
172
- */
173
- get(params?: BindParams): SqlValue[];
174
- /**
175
- * Get one row of result as a javascript object, associating column
176
- * names with their value in the current row
177
- * @see [https://sql.js.org/documentation/Statement.html#["getAsObject"]](https://sql.js.org/documentation/Statement.html#%5B%22getAsObject%22%5D)
178
- *
179
- * @param params If set, the values will be bound to the statement, and
180
- * it will be executed
181
- */
182
- getAsObject(params?: BindParams): ParamsObject;
183
- /**
184
- * Get the list of column names of a row of result of a statement.
185
- * @see [https://sql.js.org/documentation/Statement.html#["getColumnNames"]](https://sql.js.org/documentation/Statement.html#%5B%22getColumnNames%22%5D)
186
- */
187
- getColumnNames(): string[];
188
- /**
189
- * Get the SQLite's normalized version of the SQL string used in
190
- * preparing this statement. The meaning of "normalized" is not
191
- * well-defined: see
192
- * [the SQLite documentation](https://sqlite.org/c3ref/expanded_sql.html).
193
- * @see [https://sql.js.org/documentation/Statement.html#["getNormalizedSQL"]](https://sql.js.org/documentation/Statement.html#%5B%22getNormalizedSQL%22%5D)
194
- */
195
- getNormalizedSQL(): string;
196
- /**
197
- * Get the SQL string used in preparing this statement.
198
- * @see [https://sql.js.org/documentation/Statement.html#["getSQL"]](https://sql.js.org/documentation/Statement.html#%5B%22getSQL%22%5D)
199
- */
200
- getSQL(): string;
201
- /**
202
- * Reset a statement, so that it's parameters can be bound to new
203
- * values. It also clears all previous bindings, freeing the memory used
204
- * by bound parameters.
205
- * @see [https://sql.js.org/documentation/Statement.html#["reset"]](https://sql.js.org/documentation/Statement.html#%5B%22reset%22%5D)
206
- */
207
- reset(): void;
208
- /**
209
- * Shorthand for bind + step + reset Bind the values, execute the
210
- * statement, ignoring the rows it returns, and resets it
211
- * @param values Value to bind to the statement
212
- */
213
- run(values?: BindParams): void;
214
- /**
215
- * Execute the statement, fetching the the next line of result, that can
216
- * be retrieved with `Statement.get`.
217
- * @see [https://sql.js.org/documentation/Statement.html#["step"]](https://sql.js.org/documentation/Statement.html#%5B%22step%22%5D)
218
- */
219
- step(): boolean;
220
- }
221
- /**
222
- * An iterator over multiple SQL statements in a string, preparing and
223
- * returning a Statement object for the next SQL statement on each
224
- * iteration.
225
- *
226
- * You can't instantiate this class directly, you have to use a Database
227
- * object in order to create a statement iterator
228
- * @see [https://sql.js.org/documentation/StatementIterator.html#StatementIterator](https://sql.js.org/documentation/StatementIterator.html#StatementIterator)
229
- */
230
- export declare class StatementIterator implements Iterator<Statement>, Iterable<Statement> {
231
- [Symbol.iterator](): Iterator<Statement>;
232
- /**
233
- * Get any un-executed portions remaining of the original SQL string
234
- * @see [https://sql.js.org/documentation/StatementIterator.html#["getRemainingSQL"]](https://sql.js.org/documentation/StatementIterator.html#%5B%22getRemainingSQL%22%5D)
235
- */
236
- getRemainingSql(): string;
237
- /**
238
- * Prepare the next available SQL statement
239
- * @see [https://sql.js.org/documentation/StatementIterator.html#["next"]](https://sql.js.org/documentation/StatementIterator.html#%5B%22next%22%5D)
240
- */
241
- next(): StatementIteratorResult;
242
- }
243
- export default function (keepWasm?: boolean): Promise<SqlJsStatic>;
@@ -1,17 +0,0 @@
1
- import { Plugin } from 'vue';
2
- import type { InjectionKey } from 'vue';
3
- import type { Ui3nDialogComponentProps } from '../components/ui3n-dialog.vue';
4
- export type DialogInstance = {
5
- id: string;
6
- close: () => void;
7
- };
8
- export interface DialogsPlugin {
9
- $openDialog: (params: Ui3nDialogComponentProps) => DialogInstance | undefined;
10
- }
11
- export declare const DIALOGS_KEY: InjectionKey<DialogsPlugin>;
12
- export declare const dialogs: Plugin;
13
- declare module '@vue/runtime-core' {
14
- interface ComponentCustomProperties {
15
- $openDialog: (params: Ui3nDialogComponentProps) => DialogInstance | undefined;
16
- }
17
- }
@@ -1,20 +0,0 @@
1
- import { Plugin } from 'vue';
2
- import type { InjectionKey } from 'vue';
3
- export interface I18nOptions {
4
- lang: string;
5
- messages: Record<string, Record<string, string>>;
6
- }
7
- export interface I18nPlugin {
8
- $locale: string;
9
- $tr: (key: string, placeholders?: Record<string, string>) => string;
10
- $changeLocale: (lang: string) => void;
11
- }
12
- export declare const I18N_KEY: InjectionKey<I18nPlugin>;
13
- export declare const i18n: Plugin;
14
- declare module '@vue/runtime-core' {
15
- interface ComponentCustomProperties {
16
- $locale: string;
17
- $tr: (key: string, placeholders?: Record<string, string>) => string;
18
- $changeLocale: (lang: string) => void;
19
- }
20
- }
@@ -1,2 +0,0 @@
1
- import { Plugin } from 'vue';
2
- export declare const useIcons: Plugin;
@@ -1,14 +0,0 @@
1
- import { i18n, I18N_KEY } from './i18n';
2
- import type { I18nOptions, I18nPlugin } from './i18n';
3
- import { useIcons } from './icons';
4
- import { notifications, NOTIFICATIONS_KEY } from './notifications';
5
- import type { NotificationsPlugin } from './notifications';
6
- import { vueBus, VUEBUS_KEY } from './vue-bus';
7
- import type { VueBusPlugin } from './vue-bus';
8
- import { dialogs, DIALOGS_KEY } from './dialogs';
9
- import type { DialogsPlugin } from './dialogs';
10
- import { storeI18n } from './store-i18n';
11
- import { storeNotifications } from './store-notifications';
12
- import { storeVueBus } from './store-vue-bus';
13
- import { storeDialogs } from './store-dialogs';
14
- export { i18n, I18nOptions, I18nPlugin, I18N_KEY, useIcons, notifications, NotificationsPlugin, NOTIFICATIONS_KEY, vueBus, VueBusPlugin, VUEBUS_KEY, dialogs, DialogsPlugin, DIALOGS_KEY, storeI18n, storeNotifications, storeVueBus, storeDialogs, };
@@ -1,13 +0,0 @@
1
- import { Plugin } from 'vue';
2
- import type { InjectionKey } from 'vue';
3
- import { Ui3nNotificationProps } from '../constants';
4
- export interface NotificationsPlugin {
5
- $createNotice: (params: Ui3nNotificationProps) => void;
6
- }
7
- export declare const NOTIFICATIONS_KEY: InjectionKey<NotificationsPlugin>;
8
- export declare const notifications: Plugin;
9
- declare module '@vue/runtime-core' {
10
- interface ComponentCustomProperties {
11
- $createNotice: (params: Ui3nNotificationProps) => void;
12
- }
13
- }
@@ -1,4 +0,0 @@
1
- import type { Ui3nDialogComponentProps } from '../components/ui3n-dialog.vue';
2
- export declare function storeDialogs(context: any): {
3
- $openDialog: (params: Ui3nDialogComponentProps) => void;
4
- };
@@ -1,7 +0,0 @@
1
- export declare function storeI18n(context: any): {
2
- $i18n: {
3
- locale: string;
4
- changeLocale: (lang: string) => void;
5
- tr: (key: string, placeholders?: Record<string, string>) => string;
6
- };
7
- };
@@ -1,4 +0,0 @@
1
- import type { Ui3nNotificationProps } from '../constants';
2
- export declare function storeNotifications(context: any): {
3
- $createNotice: (params: Ui3nNotificationProps) => void;
4
- };
@@ -1,4 +0,0 @@
1
- import type { VueEventBus } from '../constants';
2
- export declare function storeVueBus(context: any): {
3
- $emitter: VueEventBus;
4
- };
@@ -1,19 +0,0 @@
1
- import { Plugin } from 'vue';
2
- import type { InjectionKey } from 'vue';
3
- import type { CbFunction, VueEventBus } from '../constants';
4
- export interface VueBusPlugin {
5
- $emitter: VueEventBus;
6
- }
7
- export declare const VUEBUS_KEY: InjectionKey<VueBusPlugin>;
8
- export declare const vueBus: Plugin;
9
- declare module '@vue/runtime-core' {
10
- interface ComponentCustomProperties {
11
- $emitter: {
12
- on: (type: string | symbol, handler: CbFunction) => void;
13
- off: (type: string | symbol, handler?: CbFunction) => void;
14
- emit: (type: string | symbol, arg?: any) => void;
15
- once: (type: string | symbol, handler: CbFunction) => void;
16
- clear: () => void;
17
- };
18
- }
19
- }