@beekeeperstudio/plugin 1.4.0 → 1.6.0

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
@@ -19,9 +19,38 @@ interface TableKey {
19
19
  onUpdate?: string;
20
20
  onDelete?: string;
21
21
  }
22
+ type IndexColumn = {
23
+ name: string;
24
+ order?: 'ASC' | 'DESC' | '2d' | '2dsphere' | 'text' | 'geoHaystack' | 'hashed' | number;
25
+ /** MySQL Only */
26
+ prefix?: number | null;
27
+ };
28
+ type PrimaryKey = {
29
+ columnName: string;
30
+ position: number;
31
+ };
32
+ type TableIndex = {
33
+ id: string;
34
+ table: string;
35
+ schema: string;
36
+ name: string;
37
+ columns: IndexColumn[];
38
+ unique: boolean;
39
+ primary: boolean;
40
+ /** for postgres 15 and above https://www.postgresql.org/about/featurematrix/detail/392/ */
41
+ nullsNotDistinct?: boolean;
42
+ };
43
+ type Table = {
44
+ name: string;
45
+ schema?: string;
46
+ };
47
+ type Column = {
48
+ name: string;
49
+ type: string;
50
+ };
22
51
  type WindowEventClass = "MouseEvent" | "KeyboardEvent" | "PointerEvent" | "Event";
23
52
  type WindowEventInits = MouseEventInit | KeyboardEventInit | PointerEventInit;
24
- type TableFilter$1 = {
53
+ type TableFilter = {
25
54
  field: string;
26
55
  type: "=" | "!=" | "like" | "not like" | "<" | "<=" | ">" | ">=" | "in" | "is" | "is not";
27
56
  value?: string | string[];
@@ -80,333 +109,309 @@ type PluginViewContext = {
80
109
  command: string;
81
110
  params?: CellMenuParams | ColumnMenuParams | RowMenuParams | CornerMenuParams;
82
111
  };
112
+ type DatabaseType = 'postgresql' | 'mysql' | 'mariadb' | 'sqlite' | 'sqlserver' | 'oracle' | 'mongodb' | 'cassandra' | 'clickhouse' | 'firebird' | 'bigquery' | 'redshift' | 'duckdb' | 'libsql' | 'redis' | 'surrealdb' | 'trino';
113
+ type ConnectionInfo = {
114
+ /** @alias databaseType */
115
+ connectionType: string;
116
+ /** The ID of the connection */
117
+ id: number;
118
+ /** The name of the connection specified in the connection form */
119
+ workspaceId: number;
120
+ /** The name of the connection specified in the connection form */
121
+ connectionName: string;
122
+ databaseType: DatabaseType;
123
+ /** The name of the database connected to */
124
+ databaseName: string;
125
+ defaultSchema?: string;
126
+ readOnlyMode: boolean;
127
+ };
128
+ type AppInfo = {
129
+ version: string;
130
+ theme: AppTheme;
131
+ };
132
+ type AppTheme = {
133
+ palette: Record<string, string>;
134
+ cssString: string;
135
+ type: ThemeType;
136
+ };
137
+ type RunQueryResult = {
138
+ results: QueryResult[];
139
+ error?: unknown;
140
+ };
141
+ type OpenQueryTabOptions = {
142
+ query?: string;
143
+ };
144
+ type OpenTableTableTabOptions = {
145
+ table: string;
146
+ schema?: string;
147
+ filters?: TableFilter[];
148
+ database?: string;
149
+ };
150
+ type OpenTableStructureTabOptions = {
151
+ table: string;
152
+ schema?: string;
153
+ database?: string;
154
+ };
155
+ type RequestFileSaveOptions = {
156
+ data: string;
157
+ fileName: string;
158
+ /** @default "utf8" */
159
+ encoding?: "utf8" | "base64";
160
+ filters?: {
161
+ name: string;
162
+ extensions: string[];
163
+ }[];
164
+ };
165
+ type PluginErrorObject = {
166
+ name?: string;
167
+ message: string;
168
+ stack?: string;
169
+ };
170
+ type WindowEventObject = {
171
+ eventType: string;
172
+ eventClass: WindowEventClass;
173
+ eventInitOptions: WindowEventInits;
174
+ };
175
+ type ConfirmOptions = {
176
+ confirmLabel?: string;
177
+ cancelLabel?: string;
178
+ };
83
179
 
84
- interface BaseRequest {
85
- id: string;
86
- }
87
- interface GetTablesRequest extends BaseRequest {
88
- name: "getTables";
89
- args: {
90
- schema?: string;
180
+ type RequestMap = {
181
+ getSchemas: {
182
+ args: void;
183
+ return: string[];
91
184
  };
92
- }
93
- interface GetColumnsRequest extends BaseRequest {
94
- name: "getColumns";
95
- args: {
96
- table: string;
97
- schema?: string;
185
+ getTables: {
186
+ args: {
187
+ schema?: string;
188
+ };
189
+ return: Table[];
98
190
  };
99
- }
100
- type GetTableKeysRequest = BaseRequest & {
101
- name: "getTableKeys";
102
- args: {
103
- table: string;
104
- schema?: string;
191
+ getColumns: {
192
+ args: {
193
+ table: string;
194
+ schema?: string;
195
+ };
196
+ return: Column[];
105
197
  };
106
- };
107
- type GetAppInfoRequest = BaseRequest & {
108
- name: "getAppInfo";
109
- args: void;
110
- };
111
- interface GetConnectionInfoRequest extends BaseRequest {
112
- name: "getConnectionInfo";
113
- args: void;
114
- }
115
- interface RunQueryRequest extends BaseRequest {
116
- name: "runQuery";
117
- args: {
118
- query: string;
198
+ getTableKeys: {
199
+ args: {
200
+ table: string;
201
+ schema?: string;
202
+ };
203
+ return: TableKey[];
119
204
  };
120
- }
121
- interface ExpandTableResultRequest extends BaseRequest {
122
- name: "expandTableResult";
123
- args: {
124
- results: QueryResult[];
205
+ getPrimaryKeys: {
206
+ args: {
207
+ table: string;
208
+ schema?: string;
209
+ };
210
+ return: PrimaryKey[];
125
211
  };
126
- }
127
- interface SetTabTitleRequest extends BaseRequest {
128
- name: "setTabTitle";
129
- args: {
130
- title: string;
212
+ getTableIndexes: {
213
+ args: {
214
+ table: string;
215
+ schema?: string;
216
+ };
217
+ return: TableIndex[];
131
218
  };
132
- }
133
- type GetViewContextRequest = BaseRequest & {
134
- name: "getViewContext";
135
- args: void;
136
- };
137
- interface GetViewStateRequest extends BaseRequest {
138
- name: "getViewState";
139
- args: void;
140
- }
141
- interface SetViewStateRequest<T extends unknown> extends BaseRequest {
142
- name: "setViewState";
143
- args: {
144
- state: T;
219
+ getIncomingKeys: {
220
+ args: {
221
+ table: string;
222
+ schema?: string;
223
+ };
224
+ return: TableKey[];
145
225
  };
146
- }
147
- interface OpenExternalRequest extends BaseRequest {
148
- name: "openExternal";
149
- args: {
150
- link: string;
226
+ getOutgoingKeys: {
227
+ args: {
228
+ table: string;
229
+ schema?: string;
230
+ };
231
+ return: TableKey[];
151
232
  };
152
- }
153
- interface SetDataRequest<T extends unknown> extends BaseRequest {
154
- name: "setData";
155
- args: {
156
- key: string;
157
- value: T;
233
+ getConnectionInfo: {
234
+ args: void;
235
+ return: ConnectionInfo;
158
236
  };
159
- }
160
- interface GetDataRequest extends BaseRequest {
161
- name: "getData";
162
- args: {
163
- key: string;
237
+ getAppInfo: {
238
+ args: void;
239
+ return: AppInfo;
164
240
  };
165
- }
166
- interface GetEncryptedDataRequest extends BaseRequest {
167
- name: "getEncryptedData";
168
- args: {
169
- key: string;
241
+ checkForUpdate: {
242
+ args: void;
243
+ return: boolean;
170
244
  };
171
- }
172
- interface SetEncryptedDataRequest<T extends unknown> extends BaseRequest {
173
- name: "setEncryptedData";
174
- args: {
175
- key: string;
176
- value: T;
245
+ runQuery: {
246
+ args: {
247
+ query: string;
248
+ };
249
+ return: RunQueryResult;
177
250
  };
178
- }
179
- interface ClipboardWriteTextRequest extends BaseRequest {
180
- name: "clipboard.writeText";
181
- args: {
182
- text: string;
251
+ expandTableResult: {
252
+ args: {
253
+ results: QueryResult[];
254
+ };
255
+ return: void;
183
256
  };
184
- }
185
- interface ClipboardReadTextRequest extends BaseRequest {
186
- name: "clipboard.readText";
187
- args: void;
188
- }
189
- type OpenQueryTabRequest = BaseRequest & {
190
- name: "openTab";
191
- args: {
192
- type: "query";
193
- query?: string;
194
- };
195
- };
196
- type OpenTableTableTabRequest = BaseRequest & {
197
- name: "openTab";
198
- args: {
199
- type: "tableTable";
200
- table: string;
201
- schema?: string;
202
- filters?: TableFilter$1[];
203
- database?: string;
204
- };
205
- };
206
- type OpenTableStructureTabRequest = BaseRequest & {
207
- name: "openTab";
208
- args: {
209
- type: "tableStructure";
210
- table: string;
211
- schema?: string;
212
- database?: string;
213
- };
214
- };
215
- type CheckForUpdateRequest = BaseRequest & {
216
- name: "checkForUpdate";
217
- args: void;
218
- };
219
- type OpenTabRequest = OpenQueryTabRequest | OpenTableTableTabRequest | OpenTableStructureTabRequest;
220
- type PluginRequestData = GetTablesRequest | GetColumnsRequest | GetTableKeysRequest | GetAppInfoRequest | GetConnectionInfoRequest | RunQueryRequest | ExpandTableResultRequest | SetTabTitleRequest | GetViewContextRequest | GetViewStateRequest | SetViewStateRequest<unknown> | OpenExternalRequest | GetDataRequest | SetDataRequest<unknown> | GetEncryptedDataRequest | SetEncryptedDataRequest<unknown> | ClipboardWriteTextRequest | ClipboardReadTextRequest | OpenTabRequest | CheckForUpdateRequest;
221
- type PluginRequestPayload = PluginRequestData;
222
-
223
- type AppTheme = {
224
- palette: Record<string, string>;
225
- cssString: string;
226
- type: ThemeType;
227
- };
228
- type ThemeChangedNotification = {
229
- name: "themeChanged";
230
- args: AppTheme;
231
- };
232
- type WindowEventNotification = {
233
- name: "windowEvent";
234
- args: {
235
- eventType: string;
236
- eventClass: WindowEventClass;
237
- eventInitOptions: WindowEventInits;
257
+ setTabTitle: {
258
+ args: {
259
+ title: string;
260
+ };
261
+ return: void;
238
262
  };
239
- };
240
- type PluginErrorNotification = {
241
- name: "pluginError";
242
- args: {
243
- name?: string;
244
- message?: string;
245
- stack?: string;
263
+ getViewContext: {
264
+ args: void;
265
+ return: any;
246
266
  };
247
- };
248
- type BroadcastNotification<Message extends JsonValue = JsonValue> = {
249
- name: "broadcast";
250
- args: {
251
- message: Message;
267
+ getViewState: {
268
+ args: void;
269
+ return: any;
252
270
  };
253
- };
254
- type PluginNotificationData = ThemeChangedNotification | WindowEventNotification | PluginErrorNotification | BroadcastNotification;
255
-
256
- type TabType = string;
257
- type TableFilter = any;
258
- type TableOrView = any;
259
- interface BaseResponse {
260
- id: string;
261
- error?: Error;
262
- }
263
- interface GetTablesResponse extends BaseResponse {
264
- result: {
265
- name: string;
266
- schema?: string;
267
- }[];
268
- }
269
- interface GetColumnsResponse extends BaseResponse {
270
- result: {
271
- name: string;
272
- type: string;
273
- }[];
274
- }
275
- type GetTableKeysResponse = BaseResponse & {
276
- result: TableKey[];
277
- };
278
- interface GetConnectionInfoResponse extends BaseResponse {
279
- result: {
280
- /** @deprecated Use `databaseType` instead */
281
- connectionType: string;
282
- /** The ID of the connection */
283
- id: number;
284
- /** The name of the connection specified in the connection form */
285
- workspaceId: number;
286
- /** The name of the connection specified in the connection form */
287
- connectionName: string;
288
- databaseType: 'postgresql' | 'mysql' | 'mariadb' | 'sqlite' | 'sqlserver' | 'oracle' | 'mongodb' | 'cassandra' | 'clickhouse' | 'firebird' | 'bigquery' | 'redshift' | 'duckdb' | 'libsql' | 'redis' | 'surrealdb' | 'trino';
289
- /** The name of the database connected to */
290
- databaseName: string;
291
- defaultSchema?: string;
292
- readOnlyMode: boolean;
271
+ setViewState: {
272
+ args: {
273
+ state: any;
274
+ };
275
+ return: void;
293
276
  };
294
- }
295
- type GetAppInfoResponse = BaseResponse & {
296
- result: {
297
- version: string;
298
- theme: AppTheme;
277
+ openExternal: {
278
+ args: {
279
+ link: string;
280
+ };
281
+ return: void;
299
282
  };
300
- };
301
- interface RunQueryResponse extends BaseResponse {
302
- result: {
303
- results: QueryResult[];
304
- error?: unknown;
283
+ getData: {
284
+ args: {
285
+ key: string;
286
+ };
287
+ return: any;
305
288
  };
306
- }
307
- interface ExpandTableResultResponse extends BaseResponse {
308
- result: void;
309
- }
310
- interface SetTabTitleResponse extends BaseResponse {
311
- result: void;
312
- }
313
- type GetViewContextResponse = BaseResponse & {
314
- result: PluginViewContext;
315
- };
316
- interface GetViewStateResponse<T extends unknown> extends BaseResponse {
317
- result: T;
318
- }
319
- interface SetViewStateResponse extends BaseResponse {
320
- result: void;
321
- }
322
- interface OpenExternalResponse extends BaseResponse {
323
- result: void;
324
- }
325
- interface GetDataResponse<T extends unknown> extends BaseResponse {
326
- result: T;
327
- }
328
- interface SetDataResponse extends BaseResponse {
329
- result: void;
330
- }
331
- interface GetEncryptedDataResponse<T extends unknown> extends BaseResponse {
332
- result: T;
333
- }
334
- interface SetEncryptedDataResponse extends BaseResponse {
335
- result: void;
336
- }
337
- interface ClipboardWriteTextResponse extends BaseResponse {
338
- result: void;
339
- }
340
- interface ClipboardReadTextResponse extends BaseResponse {
341
- result: string;
342
- }
343
- interface OpenTabResponse extends BaseResponse {
344
- result: void;
345
- }
346
- interface CheckForUpdateResponse extends BaseResponse {
347
- result: boolean;
348
- }
349
- type PluginResponseData = GetTablesResponse | GetColumnsResponse | GetTableKeysResponse | GetConnectionInfoResponse | RunQueryResponse | ExpandTableResultResponse | SetTabTitleResponse | GetViewContextResponse | GetViewStateResponse<unknown> | SetViewStateResponse | OpenExternalResponse | GetDataResponse<unknown> | SetDataResponse | GetEncryptedDataResponse<unknown> | SetEncryptedDataResponse | ClipboardWriteTextResponse | ClipboardReadTextResponse | OpenTabResponse | CheckForUpdateResponse;
350
- type PluginResponsePayload = PluginResponseData;
351
- type TabResponse = BaseTabResponse | QueryTabResponse | TableTabResponse;
352
- interface BaseTabResponse {
353
- type: TabType;
354
- id: number;
355
- title: string;
356
- }
357
- interface QueryTabResponse extends BaseTabResponse {
358
- type: "query";
359
- data: {
360
- query: string;
361
- result: unknown;
289
+ setData: {
290
+ args: {
291
+ key: string;
292
+ value: any;
293
+ };
294
+ return: void;
362
295
  };
363
- }
364
- interface TableTabResponse extends BaseTabResponse {
365
- type: "table";
366
- data: {
367
- table: TableOrView;
368
- filters: TableFilter[] | string;
369
- result: unknown;
296
+ getEncryptedData: {
297
+ args: {
298
+ key: string;
299
+ };
300
+ return: any;
370
301
  };
371
- }
372
-
373
- declare global {
374
- interface ImportMeta {
375
- env: {
376
- MODE: string;
302
+ setEncryptedData: {
303
+ args: {
304
+ key: string;
305
+ value: any;
377
306
  };
378
- }
379
- }
380
- declare function setDebugComms(enabled: boolean): void;
381
- declare function request(raw: any): Promise<any>;
382
- declare function notify<Message extends JsonValue = JsonValue>(name: BroadcastNotification["name"], args: BroadcastNotification<Message>["args"]): void;
383
- declare function notify(name: PluginErrorNotification["name"], args: PluginErrorNotification["args"]): void;
384
- declare function notify(name: WindowEventNotification["name"], args: WindowEventNotification["args"]): void;
385
- declare function addNotificationListener<Message extends JsonValue = JsonValue>(name: BroadcastNotification["name"], handler: (args: BroadcastNotification<Message>["args"]) => void): void;
386
- declare function addNotificationListener(name: ThemeChangedNotification["name"], handler: (args: ThemeChangedNotification["args"]) => void): void;
387
- declare function removeNotificationListener(name: string, handler: (args: any) => void): void;
307
+ return: void;
308
+ };
309
+ openTab: {
310
+ args: ({
311
+ type: "query";
312
+ } & OpenQueryTabOptions) | ({
313
+ type: "tableTable";
314
+ } & OpenTableTableTabOptions) | ({
315
+ type: "tableStructure";
316
+ } & OpenTableStructureTabOptions);
317
+ return: void;
318
+ };
319
+ requestFileSave: {
320
+ args: RequestFileSaveOptions;
321
+ return: void;
322
+ };
323
+ toggleStatusBarUI: {
324
+ args: {
325
+ force?: boolean;
326
+ };
327
+ return: void;
328
+ };
329
+ confirm: {
330
+ args: {
331
+ title?: string;
332
+ message?: string;
333
+ options?: {
334
+ confirmLabel?: string;
335
+ cancelLabel?: string;
336
+ };
337
+ };
338
+ return: boolean;
339
+ };
340
+ "clipboard.writeText": {
341
+ args: {
342
+ text: string;
343
+ };
344
+ return: void;
345
+ };
346
+ "clipboard.writeImage": {
347
+ args: {
348
+ data: string;
349
+ };
350
+ return: void;
351
+ };
352
+ "clipboard.readText": {
353
+ args: void;
354
+ return: string;
355
+ };
356
+ "noty.success": {
357
+ args: {
358
+ message: string;
359
+ };
360
+ return: void;
361
+ };
362
+ "noty.error": {
363
+ args: {
364
+ message: string;
365
+ };
366
+ return: void;
367
+ };
368
+ "noty.info": {
369
+ args: {
370
+ message: string;
371
+ };
372
+ return: void;
373
+ };
374
+ "noty.warning": {
375
+ args: {
376
+ message: string;
377
+ };
378
+ return: void;
379
+ };
380
+ };
388
381
 
382
+ /**
383
+ * Get a list of schemas from the current database.
384
+ *
385
+ * @since Beekeeper Studio 5.5.0
386
+ **/
387
+ declare function getSchemas(): Promise<string[]>;
389
388
  /**
390
389
  * Get a list of tables from the current database.
390
+ *
391
391
  * @since Beekeeper Studio 5.3.0
392
392
  **/
393
- declare function getTables(schema?: string): Promise<GetTablesResponse['result']>;
393
+ declare function getTables(schema?: string): Promise<Table[]>;
394
394
  /**
395
395
  * Get a list of columns from a table.
396
396
  *
397
397
  * @since Beekeeper Studio 5.3.0
398
398
  **/
399
- declare function getColumns(table: string, schema?: string): Promise<GetColumnsResponse['result']>;
399
+ declare function getColumns(table: string, schema?: string): Promise<Column[]>;
400
400
  /** @since Beekeeper Studio 5.4.0 */
401
- declare function getTableKeys(table: string, schema?: string): Promise<GetTableKeysResponse['result']>;
401
+ declare function getTableKeys(table: string, schema?: string): Promise<TableKey[]>;
402
+ /** @since Beekeeper Studio 5.5.0 */
403
+ declare function getTableIndexes(table: string, schema?: string): Promise<TableIndex[]>;
404
+ declare function getPrimaryKeys(table: string, schema?: string): Promise<PrimaryKey[]>;
405
+ declare function getIncomingKeys(table: string, schema?: string): Promise<TableKey[]>;
406
+ declare function getOutgoingKeys(table: string, schema?: string): Promise<TableKey[]>;
402
407
  /**
403
408
  * Get information about the current database connection.
404
409
  *
405
410
  * @since Beekeeper Studio 5.3.0
406
411
  **/
407
- declare function getConnectionInfo(): Promise<GetConnectionInfoResponse['result']>;
412
+ declare function getConnectionInfo(): Promise<ConnectionInfo>;
408
413
  /** @since Beekeeper Studio 5.4.0 */
409
- declare function getAppInfo(): Promise<GetAppInfoResponse['result']>;
414
+ declare function getAppInfo(): Promise<AppInfo>;
410
415
  /**
411
416
  * Get the version of Beekeeper Studio
412
417
  * @since Beekeeper Studio 5.3.0
@@ -419,7 +424,7 @@ declare function getAppVersion(): Promise<"5.3" | (string & {
419
424
  *
420
425
  * @since Beekeeper Studio 5.4.0
421
426
  **/
422
- declare function checkForUpdate(): Promise<CheckForUpdateResponse['result']>;
427
+ declare function checkForUpdate(): Promise<boolean>;
423
428
  /**
424
429
  * Execute a SQL query against the current database.
425
430
  *
@@ -429,19 +434,19 @@ declare function checkForUpdate(): Promise<CheckForUpdateResponse['result']>;
429
434
  *
430
435
  * @since Beekeeper Studio 5.3.0
431
436
  **/
432
- declare function runQuery(query: string): Promise<RunQueryResponse['result']>;
437
+ declare function runQuery(query: string): Promise<RunQueryResult>;
433
438
  /**
434
439
  * Display query results in the bottom table panel (shell-type tabs only).
435
440
  *
436
441
  * @since Beekeeper Studio 5.3.0
437
442
  **/
438
- declare function expandTableResult(results: any[]): Promise<ExpandTableResultResponse['result']>;
443
+ declare function expandTableResult(results: QueryResult[]): Promise<void>;
439
444
  /**
440
445
  * Set the title of the current plugin tab.
441
446
  *
442
447
  * @since Beekeeper Studio 5.3.0
443
448
  **/
444
- declare function setTabTitle(title: string): Promise<SetTabTitleResponse['result']>;
449
+ declare function setTabTitle(title: string): Promise<void>;
445
450
  /**
446
451
  * Get the current view context.
447
452
  *
@@ -452,25 +457,25 @@ declare function setTabTitle(title: string): Promise<SetTabTitleResponse['result
452
457
  *
453
458
  * @since Beekeeper Studio 5.4.0
454
459
  **/
455
- declare function getViewContext(): Promise<GetViewContextResponse['result']>;
460
+ declare function getViewContext(): Promise<PluginViewContext>;
456
461
  /**
457
462
  * Get the current state of your view instance.
458
463
  *
459
464
  * @see {@link https://docs.beekeeperstudio.io/plugin_development/plugin-views/#view-state|View State}
460
465
  * @since Beekeeper Studio 5.3.0
461
466
  **/
462
- declare function getViewState<T>(): Promise<GetViewStateResponse<T>['result']>;
467
+ declare function getViewState<T = unknown>(): Promise<T>;
463
468
  /**
464
469
  * Set the state of your view instance.
465
470
  *
466
471
  * @see {@link https://docs.beekeeperstudio.io/plugin_development/plugin-views/#view-state|View State}
467
472
  * @since Beekeeper Studio 5.3.0
468
473
  **/
469
- declare function setViewState<T>(state: T): Promise<SetViewStateResponse['result']>;
474
+ declare function setViewState<T = unknown>(state: T): Promise<void>;
470
475
  /** @since Beekeeper Studio 5.3.0 */
471
- declare function openExternal(link: string): Promise<OpenExternalResponse['result']>;
476
+ declare function openExternal(link: string): Promise<void>;
472
477
  /** @since Beekeeper Studio 5.3.0 */
473
- declare function getData<T>(key?: string): Promise<GetDataResponse<T>['result']>;
478
+ declare function getData<T = unknown>(key?: string): Promise<T>;
474
479
  /**
475
480
  * Store data that can be retrieved later.
476
481
  *
@@ -483,10 +488,10 @@ declare function getData<T>(key?: string): Promise<GetDataResponse<T>['result']>
483
488
  *
484
489
  * @since Beekeeper Studio 5.3.0
485
490
  */
486
- declare function setData<T>(key: string, value: T): Promise<SetDataResponse['result']>;
487
- declare function setData<T>(value: T): Promise<SetDataResponse['result']>;
491
+ declare function setData<T = unknown>(key: string, value: T): Promise<void>;
492
+ declare function setData<T = unknown>(value: T): Promise<void>;
488
493
  /** @since Beekeeper Studio 5.3.0 */
489
- declare function getEncryptedData<T>(key: string): Promise<GetEncryptedDataResponse<T>['result']>;
494
+ declare function getEncryptedData<T>(key: string): Promise<T>;
490
495
  /**
491
496
  * Store encrypted data that can be retrieved later.
492
497
  *
@@ -499,12 +504,19 @@ declare function getEncryptedData<T>(key: string): Promise<GetEncryptedDataRespo
499
504
  *
500
505
  * @since Beekeeper Studio 5.3.0
501
506
  */
502
- declare function setEncryptedData<T>(key: string, value: T): Promise<SetEncryptedDataResponse['result']>;
503
- declare function setEncryptedData<T>(value: T): Promise<SetEncryptedDataResponse['result']>;
507
+ declare function setEncryptedData<T = unknown>(key: string, value: T): Promise<void>;
508
+ declare function setEncryptedData<T = unknown>(value: T): Promise<void>;
504
509
  /** @since Beekeeper Studio 5.4.0 */
505
- declare function openTab(type: "query", args?: Omit<OpenQueryTabRequest['args'], 'type'>): Promise<OpenTabResponse>;
506
- declare function openTab(type: "tableTable", args: Omit<OpenTableTableTabRequest['args'], 'type'>): Promise<OpenTabResponse>;
507
- declare function openTab(type: "tableStructure", args: Omit<OpenTableStructureTabRequest['args'], 'type'>): Promise<OpenTabResponse>;
510
+ declare function openTab(type: "query", options?: OpenQueryTabOptions): Promise<void>;
511
+ declare function openTab(type: "tableTable", options: OpenTableTableTabOptions): Promise<void>;
512
+ declare function openTab(type: "tableStructure", options: OpenTableStructureTabOptions): Promise<void>;
513
+ declare function requestFileSave(options: RequestFileSaveOptions): Promise<void>;
514
+ declare function showStatusBarUI(): Promise<void>;
515
+ declare function hideStatusBarUI(): Promise<void>;
516
+ /** @since Beekeeper Studio 5.5.? */
517
+ declare function toggleStatusBarUI(): Promise<void>;
518
+ /** @since Beekeeper Studio 5.5.? */
519
+ declare function confirm(title?: string, message?: string, options?: ConfirmOptions): Promise<boolean>;
508
520
  /** @since Beekeeper Studio 5.4.0 */
509
521
  declare const broadcast: {
510
522
  post<T extends JsonValue = JsonValue>(message: T): void;
@@ -514,17 +526,43 @@ declare const broadcast: {
514
526
  declare const log: {
515
527
  error(err: string | Error): void;
516
528
  };
517
- /**
518
- * Clipboard interface.
519
- *
520
- * @since Beekeeper Studio 5.3.0
521
- **/
529
+ /** Clipboard interface. */
522
530
  declare const clipboard: {
523
- /** Write text to the Electron clipboard. */
531
+ /** Write text to the Electron clipboard.
532
+ * @since Beekeeper Studio 5.3.0 */
524
533
  writeText(text: string): Promise<void>;
525
- /** Read text from the Electron clipboard. */
534
+ /** Read text from the Electron clipboard.
535
+ * @since Beekeeper Studio 5.3.0 */
526
536
  readText(): Promise<string>;
537
+ /** @param data - Base64 encoded image data.
538
+ * @since Beekeeper Studio 5.5.0 */
539
+ writeImage(data: string): Promise<void>;
527
540
  };
541
+ /** @since Beekeeper Studio 5.5.? */
542
+ declare const noty: {
543
+ success(message: string): Promise<void>;
544
+ info(message: string): Promise<void>;
545
+ warning(message: string): Promise<void>;
546
+ error(message: string): Promise<void>;
547
+ };
548
+ declare function setDebugComms(enabled: boolean): void;
549
+ declare function notify<Message extends JsonValue = JsonValue>(name: "broadcast", args: {
550
+ message: Message;
551
+ }): void;
552
+ declare function notify(name: "pluginError", args: PluginErrorObject): void;
553
+ declare function notify(name: "windowEvent", args: WindowEventObject): void;
554
+ declare function addNotificationListener(name: "tablesChanged", handler: () => void): void;
555
+ declare function addNotificationListener<Message extends JsonValue = JsonValue>(name: "broadcast", handler: (args: {
556
+ message: Message;
557
+ }) => void): void;
558
+ declare function addNotificationListener(name: "themeChanged", handler: (args: AppTheme) => void): void;
559
+ declare function removeNotificationListener(name: "tablesChanged", handler: (args: any) => void): void;
560
+ declare function removeNotificationListener<Message extends JsonValue = JsonValue>(name: "broadcast", handler: (args: any) => void): void;
561
+ declare function removeNotificationListener(name: "themeChanged", handler: (args: any) => void): void;
562
+ declare function request<T extends keyof RequestMap>(raw: {
563
+ name: T;
564
+ args: RequestMap[T]["args"];
565
+ }): Promise<RequestMap[T]["return"]>;
528
566
 
529
- export { addNotificationListener, broadcast, checkForUpdate, clipboard, expandTableResult, getAppInfo, getAppVersion, getColumns, getConnectionInfo, getData, getEncryptedData, getTableKeys, getTables, getViewContext, getViewState, log, notify, openExternal, openTab, removeNotificationListener, request, runQuery, setData, setDebugComms, setEncryptedData, setTabTitle, setViewState };
530
- export type { ActiveRange, AppTheme, BroadcastNotification, CellMenuParams, CellMenuTarget, CheckForUpdateRequest, CheckForUpdateResponse, ClipboardReadTextRequest, ClipboardReadTextResponse, ClipboardWriteTextRequest, ClipboardWriteTextResponse, ColumnMenuParams, ColumnMenuTarget, CornerMenuParams, CornerMenuTarget, ExpandTableResultRequest, ExpandTableResultResponse, GetAppInfoRequest, GetAppInfoResponse, GetColumnsRequest, GetColumnsResponse, GetConnectionInfoRequest, GetConnectionInfoResponse, GetDataRequest, GetDataResponse, GetEncryptedDataRequest, GetEncryptedDataResponse, GetTableKeysRequest, GetTableKeysResponse, GetTablesRequest, GetTablesResponse, GetViewContextRequest, GetViewContextResponse, GetViewStateRequest, GetViewStateResponse, JsonValue, LoadViewParams, OpenExternalRequest, OpenExternalResponse, OpenQueryTabRequest, OpenTabRequest, OpenTabResponse, OpenTableStructureTabRequest, OpenTableTableTabRequest, PluginErrorNotification, PluginNotificationData, PluginRequestData, PluginRequestPayload, PluginResponseData, PluginResponsePayload, PluginViewContext, QueryResult, RowMenuParams, RowMenuTarget, RunQueryRequest, RunQueryResponse, SetDataRequest, SetDataResponse, SetEncryptedDataRequest, SetEncryptedDataResponse, SetTabTitleRequest, SetTabTitleResponse, SetViewStateRequest, SetViewStateResponse, TabResponse, TableFilter$1 as TableFilter, TableKey, ThemeChangedNotification, ThemeType, WindowEventClass, WindowEventInits, WindowEventNotification };
567
+ export { addNotificationListener, broadcast, checkForUpdate, clipboard, confirm, expandTableResult, getAppInfo, getAppVersion, getColumns, getConnectionInfo, getData, getEncryptedData, getIncomingKeys, getOutgoingKeys, getPrimaryKeys, getSchemas, getTableIndexes, getTableKeys, getTables, getViewContext, getViewState, hideStatusBarUI, log, notify, noty, openExternal, openTab, removeNotificationListener, request, requestFileSave, runQuery, setData, setDebugComms, setEncryptedData, setTabTitle, setViewState, showStatusBarUI, toggleStatusBarUI };
568
+ export type { ActiveRange, AppInfo, AppTheme, CellMenuParams, CellMenuTarget, Column, ColumnMenuParams, ColumnMenuTarget, ConfirmOptions, ConnectionInfo, CornerMenuParams, CornerMenuTarget, DatabaseType, IndexColumn, JsonValue, LoadViewParams, OpenQueryTabOptions, OpenTableStructureTabOptions, OpenTableTableTabOptions, PluginErrorObject, PluginViewContext, PrimaryKey, QueryResult, RequestFileSaveOptions, RowMenuParams, RowMenuTarget, RunQueryResult, Table, TableFilter, TableIndex, TableKey, ThemeType, WindowEventClass, WindowEventInits, WindowEventObject };