pubky-app-specs 0.4.1 → 0.4.3

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/index.cjs CHANGED
@@ -446,6 +446,32 @@ module.exports.lastReadUriBuilder = function(author_id) {
446
446
  }
447
447
  };
448
448
 
449
+ /**
450
+ * Returns the list of valid MIME types for file attachments.
451
+ *
452
+ * This allows JavaScript consumers to validate file types before submission
453
+ * without having to duplicate the list.
454
+ *
455
+ * # Example (TypeScript)
456
+ *
457
+ * ```typescript
458
+ * import { get_valid_mime_types } from "pubky-app-specs";
459
+ *
460
+ * const validTypes = get_valid_mime_types();
461
+ * const fileType = "image/png";
462
+ * if (validTypes.includes(fileType)) {
463
+ * console.log("Valid file type!");
464
+ * }
465
+ * ```
466
+ * @returns {any[]}
467
+ */
468
+ module.exports.getValidMimeTypes = function() {
469
+ const ret = wasm.getValidMimeTypes();
470
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
471
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
472
+ return v1;
473
+ };
474
+
449
475
  /**
450
476
  * Parses a Pubky URI and returns a strongly typed `ParsedUriResult`.
451
477
  *
@@ -2285,6 +2311,17 @@ class PubkySpecsBuilder {
2285
2311
  PubkySpecsBuilderFinalization.register(this, this.__wbg_ptr, this);
2286
2312
  return this;
2287
2313
  }
2314
+ /**
2315
+ * Returns validation limits as a JSON value for client-side use.
2316
+ * @returns {any}
2317
+ */
2318
+ get validationLimits() {
2319
+ const ret = wasm.pubkyspecsbuilder_validationLimits(this.__wbg_ptr);
2320
+ if (ret[2]) {
2321
+ throw takeFromExternrefTable0(ret[1]);
2322
+ }
2323
+ return takeFromExternrefTable0(ret[0]);
2324
+ }
2288
2325
  /**
2289
2326
  * @param {string} name
2290
2327
  * @param {string | null | undefined} bio
@@ -2591,6 +2628,11 @@ module.exports.__wbg_entries_3265d4158b33e5dc = function(arg0) {
2591
2628
  return ret;
2592
2629
  };
2593
2630
 
2631
+ module.exports.__wbg_fromCodePoint_f37c25c172f2e8b5 = function() { return handleError(function (arg0) {
2632
+ const ret = String.fromCodePoint(arg0 >>> 0);
2633
+ return ret;
2634
+ }, arguments) };
2635
+
2594
2636
  module.exports.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
2595
2637
  const ret = Reflect.get(arg0, arg1);
2596
2638
  return ret;