@perspective-dev/client 5.3.1 → 5.4.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.
@@ -1280,12 +1280,36 @@ var View = class _View {
1280
1280
  const ret = wasm.view_on_delete(this.__wbg_ptr, addHeapObject(on_delete));
1281
1281
  return takeObject(ret);
1282
1282
  }
1283
+ /**
1284
+ * Register a callback which is invoked whenever rows are removed from
1285
+ * this [`View`]'s [`Table`] by [`Table::remove`], with an object
1286
+ * containing `port_id` and `indices`, the removed `index` column
1287
+ * values as an Arrow of one column named after the index.
1288
+ *
1289
+ * [`Table::replace`] reports the keys it does not re-supply and
1290
+ * [`Table::clear`] reports every key. `on_remove` never fires for a
1291
+ * [`Table`] without an `index`.
1292
+ *
1293
+ * # JavaScript Examples
1294
+ *
1295
+ * ```javascript
1296
+ * const id = await view.on_remove(({ indices, port_id }) => {
1297
+ * replica.remove(indices);
1298
+ * });
1299
+ * ```
1300
+ * @param {(data: OnRemoveData) => void} on_remove_js
1301
+ * @returns {Promise<any>}
1302
+ */
1303
+ on_remove(on_remove_js) {
1304
+ const ret = wasm.view_on_remove(this.__wbg_ptr, addHeapObject(on_remove_js));
1305
+ return takeObject(ret);
1306
+ }
1283
1307
  /**
1284
1308
  * Register a callback with this [`View`]. Whenever the view's underlying
1285
1309
  * table emits an update, this callback will be invoked with an object
1286
1310
  * containing `port_id`, indicating which port the update fired on, and
1287
1311
  * optionally `delta`, which is the new data that was updated for each
1288
- * cell or each row.
1312
+ * cell or each row (as an Arrow).
1289
1313
  *
1290
1314
  * # Arguments
1291
1315
  *
@@ -1293,22 +1317,19 @@ var View = class _View {
1293
1317
  * object with two keys: `port_id`, indicating which port the update was
1294
1318
  * triggered on, and `delta`, whose value is dependent on the mode
1295
1319
  * parameter.
1296
- * - `options` - If this is provided as `OnUpdateOptions { mode:
1297
- * Some(OnUpdateMode::Row) }`, then `delta` is an Arrow of the updated
1298
- * rows. Otherwise `delta` will be [`Option::None`].
1320
+ * - `options` - If this is provided as `{mode: "row"}`, then `delta` is an
1321
+ * Arrow of the updated rows. Otherwise `delta` will be `null`.
1299
1322
  *
1300
1323
  * # JavaScript Examples
1301
1324
  *
1302
1325
  * ```javascript
1303
- * // Attach an `on_update` callback
1304
1326
  * view.on_update((updated) => console.log(updated.port_id));
1305
1327
  * ```
1306
1328
  *
1307
1329
  * ```javascript
1308
- * // `on_update` with row deltas
1309
1330
  * view.on_update((updated) => console.log(updated.delta), { mode: "row" });
1310
1331
  * ```
1311
- * @param {Function} on_update_js
1332
+ * @param {(data: OnUpdateData) => void} on_update_js
1312
1333
  * @param {OnUpdateOptions | null} [options]
1313
1334
  * @returns {Promise<any>}
1314
1335
  */
@@ -1325,6 +1346,20 @@ var View = class _View {
1325
1346
  const ret = wasm.view_remove_delete(this.__wbg_ptr, callback_id);
1326
1347
  return takeObject(ret);
1327
1348
  }
1349
+ /**
1350
+ * Unregister a previously registered [`View::on_remove`] callback.
1351
+ *
1352
+ * # Arguments
1353
+ *
1354
+ * - `id` - A callback `id` as returned by a reciprocal call to
1355
+ * [`View::on_remove`].
1356
+ * @param {number} callback_id
1357
+ * @returns {Promise<void>}
1358
+ */
1359
+ remove_remove(callback_id) {
1360
+ const ret = wasm.view_remove_remove(this.__wbg_ptr, callback_id);
1361
+ return takeObject(ret);
1362
+ }
1328
1363
  /**
1329
1364
  * Unregister a previously registered update callback with this [`View`].
1330
1365
  *
@@ -2036,7 +2071,7 @@ function __wbg_get_imports() {
2036
2071
  const a = state0.a;
2037
2072
  state0.a = 0;
2038
2073
  try {
2039
- return __wasm_bindgen_func_elem_12505(a, state0.b, arg02, arg12);
2074
+ return __wasm_bindgen_func_elem_12577(a, state0.b, arg02, arg12);
2040
2075
  } finally {
2041
2076
  state0.a = a;
2042
2077
  }
@@ -2115,7 +2150,7 @@ function __wbg_get_imports() {
2115
2150
  const ret = Promise.resolve(getObject(arg0));
2116
2151
  return addHeapObject(ret);
2117
2152
  },
2118
- __wbg_run_eb9b330adc7bc53c: function() {
2153
+ __wbg_run_a7d22113de2ff7d8: function() {
2119
2154
  return handleError(function(arg0, arg1) {
2120
2155
  const ret = getObject(arg0).run(getObject(arg1));
2121
2156
  return addHeapObject(ret);
@@ -2206,15 +2241,15 @@ function __wbg_get_imports() {
2206
2241
  console.warn(getObject(arg0));
2207
2242
  },
2208
2243
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
2209
- const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1178, __wasm_bindgen_func_elem_1927);
2244
+ const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1222, __wasm_bindgen_func_elem_1955);
2210
2245
  return addHeapObject(ret);
2211
2246
  },
2212
2247
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
2213
- const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1178, __wasm_bindgen_func_elem_1928);
2248
+ const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1222, __wasm_bindgen_func_elem_1956);
2214
2249
  return addHeapObject(ret);
2215
2250
  },
2216
2251
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
2217
- const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4323, __wasm_bindgen_func_elem_4340);
2252
+ const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4376, __wasm_bindgen_func_elem_4393);
2218
2253
  return addHeapObject(ret);
2219
2254
  },
2220
2255
  __wbindgen_cast_0000000000000004: function(arg0) {
@@ -2279,18 +2314,18 @@ function __wbg_get_imports() {
2279
2314
  "./perspective-js.wasm_bg.js": import0
2280
2315
  };
2281
2316
  }
2282
- function __wasm_bindgen_func_elem_1928(arg0, arg1) {
2283
- wasm.__wasm_bindgen_func_elem_1928(arg0, arg1);
2317
+ function __wasm_bindgen_func_elem_1956(arg0, arg1) {
2318
+ wasm.__wasm_bindgen_func_elem_1956(arg0, arg1);
2284
2319
  }
2285
- function __wasm_bindgen_func_elem_1927(arg0, arg1) {
2286
- const ret = wasm.__wasm_bindgen_func_elem_1927(arg0, arg1);
2320
+ function __wasm_bindgen_func_elem_1955(arg0, arg1) {
2321
+ const ret = wasm.__wasm_bindgen_func_elem_1955(arg0, arg1);
2287
2322
  return takeObject(ret);
2288
2323
  }
2289
- function __wasm_bindgen_func_elem_4340(arg0, arg1, arg2) {
2290
- wasm.__wasm_bindgen_func_elem_4340(arg0, arg1, addHeapObject(arg2));
2324
+ function __wasm_bindgen_func_elem_4393(arg0, arg1, arg2) {
2325
+ wasm.__wasm_bindgen_func_elem_4393(arg0, arg1, addHeapObject(arg2));
2291
2326
  }
2292
- function __wasm_bindgen_func_elem_12505(arg0, arg1, arg2, arg3) {
2293
- wasm.__wasm_bindgen_func_elem_12505(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
2327
+ function __wasm_bindgen_func_elem_12577(arg0, arg1, arg2, arg3) {
2328
+ wasm.__wasm_bindgen_func_elem_12577(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
2294
2329
  }
2295
2330
  var ClientFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2296
2331
  }, unregister: () => {