@perspective-dev/viewer 5.9.0 → 5.9.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.
Files changed (35) hide show
  1. package/dist/cdn/perspective-viewer.js +9 -9
  2. package/dist/cdn/perspective-viewer.js.map +4 -4
  3. package/dist/css/blueprint.css +1 -1
  4. package/dist/css/botanical.css +1 -1
  5. package/dist/css/dracula.css +1 -1
  6. package/dist/css/eggplant.css +1 -1
  7. package/dist/css/gruvbox-dark.css +1 -1
  8. package/dist/css/gruvbox.css +1 -1
  9. package/dist/css/ledger.css +1 -1
  10. package/dist/css/monokai.css +1 -1
  11. package/dist/css/nord.css +1 -1
  12. package/dist/css/phosphor.css +1 -1
  13. package/dist/css/pro-dark.css +1 -1
  14. package/dist/css/pro-light.css +1 -0
  15. package/dist/css/pro.css +1 -1
  16. package/dist/css/solarized-dark.css +1 -1
  17. package/dist/css/solarized.css +1 -1
  18. package/dist/css/themes.css +1 -1
  19. package/dist/css/vaporwave.css +1 -1
  20. package/dist/css/velvet.css +1 -1
  21. package/dist/custom-elements.json +147 -73
  22. package/dist/docs/perspective-docs.json +1 -1
  23. package/dist/esm/perspective-viewer.js +123 -120
  24. package/dist/esm/perspective-viewer.js.map +4 -4
  25. package/dist/wasm/perspective-viewer.d.ts +61 -53
  26. package/dist/wasm/perspective-viewer.js +215 -168
  27. package/dist/wasm/perspective-viewer.wasm +0 -0
  28. package/dist/wasm/perspective-viewer.wasm.d.ts +16 -16
  29. package/package.json +6 -6
  30. /package/dist/wasm/snippets/{perspective-viewer-d50f032e5aa67e6f → perspective-viewer-659c02666b5f5853}/inline0.js +0 -0
  31. /package/dist/wasm/snippets/{perspective-viewer-d50f032e5aa67e6f → perspective-viewer-659c02666b5f5853}/inline1.js +0 -0
  32. /package/dist/wasm/snippets/{perspective-viewer-d50f032e5aa67e6f → perspective-viewer-659c02666b5f5853}/inline2.js +0 -0
  33. /package/dist/wasm/snippets/{perspective-viewer-d50f032e5aa67e6f → perspective-viewer-659c02666b5f5853}/inline3.js +0 -0
  34. /package/dist/wasm/snippets/{perspective-viewer-d50f032e5aa67e6f → perspective-viewer-659c02666b5f5853}/inline4.js +0 -0
  35. /package/dist/wasm/snippets/{perspective-viewer-d50f032e5aa67e6f → perspective-viewer-659c02666b5f5853}/inline5.js +0 -0
@@ -192,6 +192,13 @@ export type * from "../ts-rs/DatetimeFormat.d.ts";
192
192
  export type * from "../ts-rs/ConfigDefaultsOptions.d.ts";
193
193
  export type * from "../ts-rs/ColumnConfigDefaultsOptions.d.ts";
194
194
 
195
+ export type ExportData =
196
+ | string
197
+ | ArrayBuffer
198
+ | Blob
199
+ | Record<string, unknown[]>
200
+ | ViewerConfig;
201
+
195
202
  import type {GetTableOptions} from "../ts-rs/GetTableOptions.d.ts";
196
203
  import type {PanelOptions} from "../ts-rs/PanelOptions.d.ts";
197
204
  import type {RestoreOptions} from "../ts-rs/RestoreOptions.d.ts";
@@ -574,9 +581,9 @@ export class GenericSQLVirtualServerModel {
574
581
  export class PerspectiveDebugPluginElement {
575
582
  free(): void;
576
583
  [Symbol.dispose](): void;
577
- clear(): Promise<any>;
584
+ clear(): Promise<void>;
578
585
  connectedCallback(): void;
579
- delete(): Promise<any>;
586
+ delete(): Promise<void>;
580
587
  /**
581
588
  * # Notes
582
589
  *
@@ -584,9 +591,9 @@ export class PerspectiveDebugPluginElement {
584
591
  * move. Ergo, if you replace the `&` in the `view` argument, the JS copy
585
592
  * of the `View` will be invalid
586
593
  */
587
- draw(view: View): Promise<any>;
594
+ draw(view: View): Promise<void>;
588
595
  constructor(elem: HTMLElement);
589
- resize(): Promise<any>;
596
+ resize(): Promise<void>;
590
597
  restore(_config?: any | null): void;
591
598
  restyle(): void;
592
599
  save(): any;
@@ -594,7 +601,7 @@ export class PerspectiveDebugPluginElement {
594
601
  * Delegates to `draw()` VIRTUALLY — through the JS element's `draw`
595
602
  * property, never `self.draw(view)` (Rust static dispatch).
596
603
  */
597
- update(view: View): Promise<any>;
604
+ update(view: View): Promise<void>;
598
605
  readonly config_column_names: any;
599
606
  readonly min_config_columns: any;
600
607
  readonly name: string;
@@ -653,7 +660,7 @@ export class PerspectiveViewerElement {
653
660
  * hosts yet creates the panel empty and pending until the table is
654
661
  * created, instead of the default rejection.
655
662
  */
656
- addPanel(config: ViewerConfigInitial, options?: AddPanelOptions | null): Promise<any>;
663
+ addPanel(config: ViewerConfigInitial, options?: AddPanelOptions | null): Promise<string>;
657
664
  /**
658
665
  * Configure the embedded LLM agent (see `prompt()`), replacing any prior
659
666
  * configuration and conversation.
@@ -753,7 +760,7 @@ export class PerspectiveViewerElement {
753
760
  * })
754
761
  * ```
755
762
  */
756
- copy(options?: ExportOptions | null): Promise<any>;
763
+ copy(options?: ExportOptions | null): Promise<void>;
757
764
  /**
758
765
  * Delete all internal [`View`]s and all associated state, rendering this
759
766
  * `<perspective-viewer>` unusable and freeing all associated resources.
@@ -777,7 +784,7 @@ export class PerspectiveViewerElement {
777
784
  * await viewer.delete();
778
785
  * ```
779
786
  */
780
- delete(): Promise<any>;
787
+ delete(): Promise<void>;
781
788
  /**
782
789
  * Download this viewer's internal [`View`] data via a browser download
783
790
  * event.
@@ -794,7 +801,7 @@ export class PerspectiveViewerElement {
794
801
  * })
795
802
  * ```
796
803
  */
797
- download(options?: ExportOptions | null): Promise<any>;
804
+ download(options?: ExportOptions | null): Promise<void>;
798
805
  /**
799
806
  * Remove a [`Client`] from this `<perspective-viewer>` and dispose every
800
807
  * panel bound to it (each panel's `View` is deleted and its `Table`
@@ -812,7 +819,7 @@ export class PerspectiveViewerElement {
812
819
  * await viewer.eject({client: "remote"});
813
820
  * ```
814
821
  */
815
- eject(options?: ClientOptions | null): Promise<any>;
822
+ eject(options?: ClientOptions | null): Promise<void>;
816
823
  /**
817
824
  * Exports this viewer's internal [`View`] as a JavaSript data, the
818
825
  * exact type of which depends on the `method` but defaults to `String`
@@ -833,7 +840,7 @@ export class PerspectiveViewerElement {
833
840
  * const data = await viewer.export("plugin");
834
841
  * ```
835
842
  */
836
- export(options?: ExportOptions | null): Promise<any>;
843
+ export(options?: ExportOptions | null): Promise<ExportData>;
837
844
  /**
838
845
  * Flush any pending modifications to this `<perspective-viewer>`. Since
839
846
  * `<perspective-viewer>`'s API is almost entirely `async`, it may take
@@ -854,7 +861,7 @@ export class PerspectiveViewerElement {
854
861
  * await viewer.flush();
855
862
  * ```
856
863
  */
857
- flush(): Promise<any>;
864
+ flush(): Promise<void>;
858
865
  /**
859
866
  * The id of the active panel — the one the settings panel and status-bar
860
867
  * toolbar target — or `null` when the element has zero panels.
@@ -883,7 +890,7 @@ export class PerspectiveViewerElement {
883
890
  * const client = await viewer.getClient();
884
891
  * ```
885
892
  */
886
- getClient(options?: GetClientOptions | null): Promise<any>;
893
+ getClient(options?: GetClientOptions | null): Promise<Client>;
887
894
  /**
888
895
  * Get this viewer's edit port for the named panel's [`Table`] (see
889
896
  * [`Table::update`] for details on ports), or the active panel when
@@ -938,8 +945,8 @@ export class PerspectiveViewerElement {
938
945
  * const table = await viewer.getTable();
939
946
  * ```
940
947
  */
941
- getTable(options?: GetTableOptions | null): Promise<any>;
942
- getThemes(): Promise<any>;
948
+ getTable(options?: GetTableOptions | null): Promise<Table>;
949
+ getThemes(): Promise<string[]>;
943
950
  /**
944
951
  * Get a [`View`] for a panel of this viewer, as currently configured by
945
952
  * the user.
@@ -980,7 +987,7 @@ export class PerspectiveViewerElement {
980
987
  * }
981
988
  * ```
982
989
  */
983
- getView(options?: GetViewOptions | null): Promise<any>;
990
+ getView(options?: GetViewOptions | null): Promise<View>;
984
991
  /**
985
992
  * Get a copy of the [`ViewConfig`] for the current [`View`]. This is
986
993
  * non-blocking as it does not need to access the plugin (unlike
@@ -988,7 +995,7 @@ export class PerspectiveViewerElement {
988
995
  * server (unlike [`PerspectiveViewerElement::getView`] followed by
989
996
  * [`View::get_config`])
990
997
  */
991
- getViewConfig(options?: PanelOptions | null): Promise<any>;
998
+ getViewConfig(options?: PanelOptions | null): Promise<ViewConfig>;
992
999
  /**
993
1000
  * Loads a [`Client`], or optionally [`Table`], or optionally a Javascript
994
1001
  * `Promise` which returns a [`Client`] or [`Table`], in this viewer.
@@ -1065,7 +1072,7 @@ export class PerspectiveViewerElement {
1065
1072
  * await viewer.load(table);
1066
1073
  * ```
1067
1074
  */
1068
- load(client: Client | Table | Promise<Client | Table>): Promise<any>;
1075
+ load(client: Client | Table | Promise<Client | Table>): Promise<void>;
1069
1076
  constructor(elem: HTMLElement);
1070
1077
  /**
1071
1078
  * Remove the panel with id `name` from the layout, disposing its engines
@@ -1075,7 +1082,7 @@ export class PerspectiveViewerElement {
1075
1082
  * error — previously fire-and-forget and silently dropped (invariant
1076
1083
  * I6). See also [`Self::addPanel`].
1077
1084
  */
1078
- removePanel(name: string): Promise<any>;
1085
+ removePanel(name: string): Promise<void>;
1079
1086
  /**
1080
1087
  * Reset a panel's `ViewerConfig` to its data-relative default.
1081
1088
  *
@@ -1101,13 +1108,13 @@ export class PerspectiveViewerElement {
1101
1108
  * await viewer.reset(true, {panel: "p1"}); // just "p1", + expressions
1102
1109
  * ```
1103
1110
  */
1104
- reset(reset_all?: boolean | null, options?: PanelOptions | null): Promise<any>;
1111
+ reset(reset_all?: boolean | null, options?: PanelOptions | null): Promise<void>;
1105
1112
  /**
1106
1113
  * If this element is in an _errored_ state, this method will clear it and
1107
1114
  * re-render. Calling this method is equivalent to clicking the error reset
1108
1115
  * button in the UI.
1109
1116
  */
1110
- resetError(): Promise<any>;
1117
+ resetError(): Promise<void>;
1111
1118
  /**
1112
1119
  * Set the available theme names available in the status bar UI.
1113
1120
  *
@@ -1124,7 +1131,7 @@ export class PerspectiveViewerElement {
1124
1131
  * viewer.resetThemes(["Pro Light", "Pro Dark"])
1125
1132
  * ```
1126
1133
  */
1127
- resetThemes(themes?: any[] | null): Promise<any>;
1134
+ resetThemes(themes?: any[] | null): Promise<void>;
1128
1135
  /**
1129
1136
  * Recalculate the viewer's dimensions and redraw.
1130
1137
  *
@@ -1148,7 +1155,7 @@ export class PerspectiveViewerElement {
1148
1155
  * await viewer.resize({dimensions: {width: 800, height: 600}})
1149
1156
  * ```
1150
1157
  */
1151
- resize(options?: any | null): Promise<any>;
1158
+ resize(options?: any | null): Promise<void>;
1152
1159
  /**
1153
1160
  * Restore a single panel from a full/partial
1154
1161
  * [`perspective_js::JsViewConfig`] (its user-configurable state, including
@@ -1242,7 +1249,8 @@ export class PerspectiveViewerElement {
1242
1249
  *
1243
1250
  * [`Self::restyleElement`] _must_ be called for many runtime changes to
1244
1251
  * CSS properties to be reflected in an already-rendered
1245
- * `<perspective-viewer>`.
1252
+ * `<perspective-viewer>`, including a `prefers-color-scheme` change
1253
+ * under a preference-aware theme such as `"Pro"`.
1246
1254
  *
1247
1255
  * </div>
1248
1256
  *
@@ -1253,7 +1261,7 @@ export class PerspectiveViewerElement {
1253
1261
  * await viewer.restyleElement();
1254
1262
  * ```
1255
1263
  */
1256
- restyleElement(): Promise<any>;
1264
+ restyleElement(): Promise<void>;
1257
1265
  /**
1258
1266
  * Save a single panel's user-configurable state as a [`ViewerConfig`], one
1259
1267
  * which can be restored via [`Self::restore`] — the active panel, or a
@@ -1308,7 +1316,7 @@ export class PerspectiveViewerElement {
1308
1316
  * activation-chrome redraws on both sides of the switch have completed
1309
1317
  * (invariant I6).
1310
1318
  */
1311
- setActivePanel(name: string): Promise<any>;
1319
+ setActivePanel(name: string): Promise<void>;
1312
1320
  /**
1313
1321
  * Sets the auto-pause behavior of this component.
1314
1322
  *
@@ -1330,7 +1338,7 @@ export class PerspectiveViewerElement {
1330
1338
  * viewer.setAutoPause(false);
1331
1339
  * ```
1332
1340
  */
1333
- setAutoPause(autopause: boolean): Promise<any>;
1341
+ setAutoPause(autopause: boolean): Promise<void>;
1334
1342
  /**
1335
1343
  * Sets the auto-size behavior of this component.
1336
1344
  *
@@ -1387,7 +1395,7 @@ export class PerspectiveViewerElement {
1387
1395
  * string}`. The CustomEvent is also fired whenever the user toggles the
1388
1396
  * sidebar manually.
1389
1397
  */
1390
- toggleColumnSettings(column_name: string, options?: PanelOptions | null): Promise<any>;
1398
+ toggleColumnSettings(column_name: string, options?: PanelOptions | null): Promise<void>;
1391
1399
  /**
1392
1400
  * Toggle (or force) the config panel open/closed.
1393
1401
  *
@@ -1402,7 +1410,7 @@ export class PerspectiveViewerElement {
1402
1410
  * await viewer.toggleConfig();
1403
1411
  * ```
1404
1412
  */
1405
- toggleConfig(force?: boolean | null): Promise<any>;
1413
+ toggleConfig(force?: boolean | null): Promise<void>;
1406
1414
  }
1407
1415
 
1408
1416
  export class ProxySession {
@@ -1529,7 +1537,7 @@ export class Table {
1529
1537
  * [`Table::on_delete`] resolves when the subscription message is sent, not
1530
1538
  * when the _delete_ event occurs.
1531
1539
  */
1532
- on_delete(on_delete: Function): Promise<any>;
1540
+ on_delete(on_delete: Function): Promise<number>;
1533
1541
  /**
1534
1542
  * Removes rows from this [`Table`] with the `index` column values
1535
1543
  * supplied.
@@ -1552,7 +1560,7 @@ export class Table {
1552
1560
  * Removes a listener with a given ID, as returned by a previous call to
1553
1561
  * [`Table::on_delete`].
1554
1562
  */
1555
- remove_delete(callback_id: number): Promise<any>;
1563
+ remove_delete(callback_id: number): Promise<void>;
1556
1564
  /**
1557
1565
  * Replace all rows in this [`Table`] with the input data, coerced to this
1558
1566
  * [`Table`]'s existing [`perspective_client::Schema`], notifying any
@@ -1620,7 +1628,7 @@ export class Table {
1620
1628
  * await table.update("x,y\n1,2");
1621
1629
  * ```
1622
1630
  */
1623
- update(input: string | ArrayBuffer | Record<string, unknown[]> | Record<string, unknown>[] | Record<string, ColumnType>, options?: UpdateOptions | null): Promise<any>;
1631
+ update(input: string | ArrayBuffer | Record<string, unknown[]> | Record<string, unknown>[] | Record<string, ColumnType>, options?: UpdateOptions | null): Promise<void>;
1624
1632
  /**
1625
1633
  * Validates the given expressions.
1626
1634
  */
@@ -1758,7 +1766,7 @@ export class View {
1758
1766
  * Register a callback with this [`View`]. Whenever the [`View`] is
1759
1767
  * deleted, this callback will be invoked.
1760
1768
  */
1761
- on_delete(on_delete: Function): Promise<any>;
1769
+ on_delete(on_delete: Function): Promise<number>;
1762
1770
  /**
1763
1771
  * Register a callback which is invoked whenever rows leave this
1764
1772
  * [`View`], with an object containing `port_id`, `indices` (their keys
@@ -1782,7 +1790,7 @@ export class View {
1782
1790
  * });
1783
1791
  * ```
1784
1792
  */
1785
- on_remove(on_remove_js: (data: OnRemoveData) => void): Promise<any>;
1793
+ on_remove(on_remove_js: (data: OnRemoveData) => void): Promise<number>;
1786
1794
  /**
1787
1795
  * Register a callback with this [`View`]. Whenever the view's underlying
1788
1796
  * table emits an update, this callback will be invoked with an object
@@ -1809,11 +1817,11 @@ export class View {
1809
1817
  * view.on_update((updated) => console.log(updated.delta), { mode: "row" });
1810
1818
  * ```
1811
1819
  */
1812
- on_update(on_update_js: (data: OnUpdateData) => void, options?: OnUpdateOptions | null): Promise<any>;
1820
+ on_update(on_update_js: (data: OnUpdateData) => void, options?: OnUpdateOptions | null): Promise<number>;
1813
1821
  /**
1814
1822
  * Unregister a previously registered [`View::on_delete`] callback.
1815
1823
  */
1816
- remove_delete(callback_id: number): Promise<any>;
1824
+ remove_delete(callback_id: number): Promise<void>;
1817
1825
  /**
1818
1826
  * Unregister a previously registered [`View::on_remove`] callback.
1819
1827
  *
@@ -1925,7 +1933,7 @@ export class VirtualDataSlice {
1925
1933
  export class VirtualServer {
1926
1934
  free(): void;
1927
1935
  [Symbol.dispose](): void;
1928
- handleRequest(bytes: Uint8Array): Promise<any>;
1936
+ handleRequest(bytes: Uint8Array): Promise<Uint8Array>;
1929
1937
  constructor(handler: VirtualServerHandler);
1930
1938
  }
1931
1939
 
@@ -2173,22 +2181,22 @@ export interface InitOutput {
2173
2181
  readonly virtualdataslice_setStringCol: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
2174
2182
  readonly virtualserver_handleRequest: (a: number, b: number, c: number) => number;
2175
2183
  readonly virtualserver_new: (a: number, b: number) => void;
2176
- readonly __wasm_bindgen_func_elem_20596: (a: number, b: number) => void;
2177
- readonly __wasm_bindgen_func_elem_7550: (a: number, b: number) => void;
2178
- readonly __wasm_bindgen_func_elem_21211: (a: number, b: number) => void;
2179
- readonly __wasm_bindgen_func_elem_22623: (a: number, b: number) => void;
2180
- readonly __wasm_bindgen_func_elem_27298: (a: number, b: number) => void;
2181
- readonly __wasm_bindgen_func_elem_36104: (a: number, b: number, c: number, d: number) => void;
2182
- readonly __wasm_bindgen_func_elem_20619: (a: number, b: number, c: number) => void;
2183
- readonly __wasm_bindgen_func_elem_8627: (a: number, b: number, c: number) => void;
2184
- readonly __wasm_bindgen_func_elem_8628: (a: number, b: number, c: number) => void;
2185
- readonly __wasm_bindgen_func_elem_8629: (a: number, b: number, c: number) => void;
2186
- readonly __wasm_bindgen_func_elem_8625: (a: number, b: number, c: number) => void;
2187
- readonly __wasm_bindgen_func_elem_21215: (a: number, b: number, c: number) => void;
2188
- readonly __wasm_bindgen_func_elem_27300: (a: number, b: number, c: number) => void;
2189
- readonly __wasm_bindgen_func_elem_23270: (a: number, b: number) => number;
2190
- readonly __wasm_bindgen_func_elem_21214: (a: number, b: number) => void;
2191
- readonly __wasm_bindgen_func_elem_23271: (a: number, b: number) => void;
2184
+ readonly __wasm_bindgen_func_elem_7566: (a: number, b: number) => void;
2185
+ readonly __wasm_bindgen_func_elem_20655: (a: number, b: number) => void;
2186
+ readonly __wasm_bindgen_func_elem_21269: (a: number, b: number) => void;
2187
+ readonly __wasm_bindgen_func_elem_22680: (a: number, b: number) => void;
2188
+ readonly __wasm_bindgen_func_elem_27384: (a: number, b: number) => void;
2189
+ readonly __wasm_bindgen_func_elem_36185: (a: number, b: number, c: number, d: number) => void;
2190
+ readonly __wasm_bindgen_func_elem_8643: (a: number, b: number, c: number) => void;
2191
+ readonly __wasm_bindgen_func_elem_8644: (a: number, b: number, c: number) => void;
2192
+ readonly __wasm_bindgen_func_elem_8645: (a: number, b: number, c: number) => void;
2193
+ readonly __wasm_bindgen_func_elem_8641: (a: number, b: number, c: number) => void;
2194
+ readonly __wasm_bindgen_func_elem_20678: (a: number, b: number, c: number) => void;
2195
+ readonly __wasm_bindgen_func_elem_21273: (a: number, b: number, c: number) => void;
2196
+ readonly __wasm_bindgen_func_elem_27386: (a: number, b: number, c: number) => void;
2197
+ readonly __wasm_bindgen_func_elem_23327: (a: number, b: number) => number;
2198
+ readonly __wasm_bindgen_func_elem_21272: (a: number, b: number) => void;
2199
+ readonly __wasm_bindgen_func_elem_23328: (a: number, b: number) => void;
2192
2200
  readonly __wbindgen_export: (a: number, b: number) => number;
2193
2201
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
2194
2202
  readonly __wbindgen_export3: (a: number) => void;