pubky-app-specs 0.3.0-rc.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/LICENSE +21 -0
- package/README.md +167 -0
- package/package.json +25 -0
- package/pubky_app_specs.d.ts +527 -0
- package/pubky_app_specs.js +2365 -0
- package/pubky_app_specs_bg.wasm +0 -0
|
@@ -0,0 +1,2365 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
let WASM_VECTOR_LEN = 0;
|
|
4
|
+
|
|
5
|
+
let cachedUint8ArrayMemory0 = null;
|
|
6
|
+
|
|
7
|
+
function getUint8ArrayMemory0() {
|
|
8
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
9
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
10
|
+
}
|
|
11
|
+
return cachedUint8ArrayMemory0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
15
|
+
|
|
16
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
17
|
+
? function (arg, view) {
|
|
18
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
19
|
+
}
|
|
20
|
+
: function (arg, view) {
|
|
21
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
22
|
+
view.set(buf);
|
|
23
|
+
return {
|
|
24
|
+
read: arg.length,
|
|
25
|
+
written: buf.length
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
30
|
+
|
|
31
|
+
if (realloc === undefined) {
|
|
32
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
33
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
34
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
35
|
+
WASM_VECTOR_LEN = buf.length;
|
|
36
|
+
return ptr;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let len = arg.length;
|
|
40
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
41
|
+
|
|
42
|
+
const mem = getUint8ArrayMemory0();
|
|
43
|
+
|
|
44
|
+
let offset = 0;
|
|
45
|
+
|
|
46
|
+
for (; offset < len; offset++) {
|
|
47
|
+
const code = arg.charCodeAt(offset);
|
|
48
|
+
if (code > 0x7F) break;
|
|
49
|
+
mem[ptr + offset] = code;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (offset !== len) {
|
|
53
|
+
if (offset !== 0) {
|
|
54
|
+
arg = arg.slice(offset);
|
|
55
|
+
}
|
|
56
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
57
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
58
|
+
const ret = encodeString(arg, view);
|
|
59
|
+
|
|
60
|
+
offset += ret.written;
|
|
61
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
WASM_VECTOR_LEN = offset;
|
|
65
|
+
return ptr;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let cachedDataViewMemory0 = null;
|
|
69
|
+
|
|
70
|
+
function getDataViewMemory0() {
|
|
71
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
72
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
73
|
+
}
|
|
74
|
+
return cachedDataViewMemory0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function addToExternrefTable0(obj) {
|
|
78
|
+
const idx = wasm.__externref_table_alloc();
|
|
79
|
+
wasm.__wbindgen_export_4.set(idx, obj);
|
|
80
|
+
return idx;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function handleError(f, args) {
|
|
84
|
+
try {
|
|
85
|
+
return f.apply(this, args);
|
|
86
|
+
} catch (e) {
|
|
87
|
+
const idx = addToExternrefTable0(e);
|
|
88
|
+
wasm.__wbindgen_exn_store(idx);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function debugString(val) {
|
|
93
|
+
// primitive types
|
|
94
|
+
const type = typeof val;
|
|
95
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
96
|
+
return `${val}`;
|
|
97
|
+
}
|
|
98
|
+
if (type == 'string') {
|
|
99
|
+
return `"${val}"`;
|
|
100
|
+
}
|
|
101
|
+
if (type == 'symbol') {
|
|
102
|
+
const description = val.description;
|
|
103
|
+
if (description == null) {
|
|
104
|
+
return 'Symbol';
|
|
105
|
+
} else {
|
|
106
|
+
return `Symbol(${description})`;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
if (type == 'function') {
|
|
110
|
+
const name = val.name;
|
|
111
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
112
|
+
return `Function(${name})`;
|
|
113
|
+
} else {
|
|
114
|
+
return 'Function';
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// objects
|
|
118
|
+
if (Array.isArray(val)) {
|
|
119
|
+
const length = val.length;
|
|
120
|
+
let debug = '[';
|
|
121
|
+
if (length > 0) {
|
|
122
|
+
debug += debugString(val[0]);
|
|
123
|
+
}
|
|
124
|
+
for(let i = 1; i < length; i++) {
|
|
125
|
+
debug += ', ' + debugString(val[i]);
|
|
126
|
+
}
|
|
127
|
+
debug += ']';
|
|
128
|
+
return debug;
|
|
129
|
+
}
|
|
130
|
+
// Test for built-in
|
|
131
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
132
|
+
let className;
|
|
133
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
134
|
+
className = builtInMatches[1];
|
|
135
|
+
} else {
|
|
136
|
+
// Failed to match the standard '[object ClassName]'
|
|
137
|
+
return toString.call(val);
|
|
138
|
+
}
|
|
139
|
+
if (className == 'Object') {
|
|
140
|
+
// we're a user defined class or Object
|
|
141
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
142
|
+
// easier than looping through ownProperties of `val`.
|
|
143
|
+
try {
|
|
144
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
145
|
+
} catch (_) {
|
|
146
|
+
return 'Object';
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// errors
|
|
150
|
+
if (val instanceof Error) {
|
|
151
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
152
|
+
}
|
|
153
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
154
|
+
return className;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
158
|
+
|
|
159
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
160
|
+
|
|
161
|
+
function getStringFromWasm0(ptr, len) {
|
|
162
|
+
ptr = ptr >>> 0;
|
|
163
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function isLikeNone(x) {
|
|
167
|
+
return x === undefined || x === null;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function takeFromExternrefTable0(idx) {
|
|
171
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
172
|
+
wasm.__externref_table_dealloc(idx);
|
|
173
|
+
return value;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
177
|
+
ptr = ptr >>> 0;
|
|
178
|
+
const mem = getDataViewMemory0();
|
|
179
|
+
const result = [];
|
|
180
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
181
|
+
result.push(wasm.__wbindgen_export_4.get(mem.getUint32(i, true)));
|
|
182
|
+
}
|
|
183
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
184
|
+
return result;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function _assertClass(instance, klass) {
|
|
188
|
+
if (!(instance instanceof klass)) {
|
|
189
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
194
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
195
|
+
for (let i = 0; i < array.length; i++) {
|
|
196
|
+
const add = addToExternrefTable0(array[i]);
|
|
197
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
198
|
+
}
|
|
199
|
+
WASM_VECTOR_LEN = array.length;
|
|
200
|
+
return ptr;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* @param {string} user_id
|
|
204
|
+
* @returns {string}
|
|
205
|
+
*/
|
|
206
|
+
export function baseUriBuilder(user_id) {
|
|
207
|
+
let deferred2_0;
|
|
208
|
+
let deferred2_1;
|
|
209
|
+
try {
|
|
210
|
+
const ptr0 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
211
|
+
const len0 = WASM_VECTOR_LEN;
|
|
212
|
+
const ret = wasm.baseUriBuilder(ptr0, len0);
|
|
213
|
+
deferred2_0 = ret[0];
|
|
214
|
+
deferred2_1 = ret[1];
|
|
215
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
216
|
+
} finally {
|
|
217
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @param {string} user_id
|
|
223
|
+
* @returns {string}
|
|
224
|
+
*/
|
|
225
|
+
export function userUriBuilder(user_id) {
|
|
226
|
+
let deferred2_0;
|
|
227
|
+
let deferred2_1;
|
|
228
|
+
try {
|
|
229
|
+
const ptr0 = passStringToWasm0(user_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
230
|
+
const len0 = WASM_VECTOR_LEN;
|
|
231
|
+
const ret = wasm.userUriBuilder(ptr0, len0);
|
|
232
|
+
deferred2_0 = ret[0];
|
|
233
|
+
deferred2_1 = ret[1];
|
|
234
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
235
|
+
} finally {
|
|
236
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* @param {string} author_id
|
|
242
|
+
* @param {string} post_id
|
|
243
|
+
* @returns {string}
|
|
244
|
+
*/
|
|
245
|
+
export function postUriBuilder(author_id, post_id) {
|
|
246
|
+
let deferred3_0;
|
|
247
|
+
let deferred3_1;
|
|
248
|
+
try {
|
|
249
|
+
const ptr0 = passStringToWasm0(author_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
250
|
+
const len0 = WASM_VECTOR_LEN;
|
|
251
|
+
const ptr1 = passStringToWasm0(post_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
252
|
+
const len1 = WASM_VECTOR_LEN;
|
|
253
|
+
const ret = wasm.postUriBuilder(ptr0, len0, ptr1, len1);
|
|
254
|
+
deferred3_0 = ret[0];
|
|
255
|
+
deferred3_1 = ret[1];
|
|
256
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
257
|
+
} finally {
|
|
258
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Enum representing the layout of the feed.
|
|
264
|
+
* @enum {0 | 1 | 2}
|
|
265
|
+
*/
|
|
266
|
+
export const PubkyAppFeedLayout = Object.freeze({
|
|
267
|
+
Columns: 0, "0": "Columns",
|
|
268
|
+
Wide: 1, "1": "Wide",
|
|
269
|
+
Visual: 2, "2": "Visual",
|
|
270
|
+
});
|
|
271
|
+
/**
|
|
272
|
+
* Enum representing the reach of the feed.
|
|
273
|
+
* @enum {0 | 1 | 2 | 3}
|
|
274
|
+
*/
|
|
275
|
+
export const PubkyAppFeedReach = Object.freeze({
|
|
276
|
+
Following: 0, "0": "Following",
|
|
277
|
+
Followers: 1, "1": "Followers",
|
|
278
|
+
Friends: 2, "2": "Friends",
|
|
279
|
+
All: 3, "3": "All",
|
|
280
|
+
});
|
|
281
|
+
/**
|
|
282
|
+
* Enum representing the sort order of the feed.
|
|
283
|
+
* @enum {0 | 1}
|
|
284
|
+
*/
|
|
285
|
+
export const PubkyAppFeedSort = Object.freeze({
|
|
286
|
+
Recent: 0, "0": "Recent",
|
|
287
|
+
Popularity: 1, "1": "Popularity",
|
|
288
|
+
});
|
|
289
|
+
/**
|
|
290
|
+
* Represents the type of pubky-app posted data
|
|
291
|
+
* Used primarily to best display the content in UI
|
|
292
|
+
* @enum {0 | 1 | 2 | 3 | 4 | 5}
|
|
293
|
+
*/
|
|
294
|
+
export const PubkyAppPostKind = Object.freeze({
|
|
295
|
+
Short: 0, "0": "Short",
|
|
296
|
+
Long: 1, "1": "Long",
|
|
297
|
+
Image: 2, "2": "Image",
|
|
298
|
+
Video: 3, "3": "Video",
|
|
299
|
+
Link: 4, "4": "Link",
|
|
300
|
+
File: 5, "5": "File",
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
const BlobResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
304
|
+
? { register: () => {}, unregister: () => {} }
|
|
305
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_blobresult_free(ptr >>> 0, 1));
|
|
306
|
+
|
|
307
|
+
export class BlobResult {
|
|
308
|
+
|
|
309
|
+
static __wrap(ptr) {
|
|
310
|
+
ptr = ptr >>> 0;
|
|
311
|
+
const obj = Object.create(BlobResult.prototype);
|
|
312
|
+
obj.__wbg_ptr = ptr;
|
|
313
|
+
BlobResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
314
|
+
return obj;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
__destroy_into_raw() {
|
|
318
|
+
const ptr = this.__wbg_ptr;
|
|
319
|
+
this.__wbg_ptr = 0;
|
|
320
|
+
BlobResultFinalization.unregister(this);
|
|
321
|
+
return ptr;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
free() {
|
|
325
|
+
const ptr = this.__destroy_into_raw();
|
|
326
|
+
wasm.__wbg_blobresult_free(ptr, 0);
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* @returns {PubkyAppBlob}
|
|
330
|
+
*/
|
|
331
|
+
get blob() {
|
|
332
|
+
const ret = wasm.blobresult_blob(this.__wbg_ptr);
|
|
333
|
+
return PubkyAppBlob.__wrap(ret);
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* @returns {Meta}
|
|
337
|
+
*/
|
|
338
|
+
get meta() {
|
|
339
|
+
const ret = wasm.blobresult_meta(this.__wbg_ptr);
|
|
340
|
+
return Meta.__wrap(ret);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const BookmarkResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
345
|
+
? { register: () => {}, unregister: () => {} }
|
|
346
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_bookmarkresult_free(ptr >>> 0, 1));
|
|
347
|
+
|
|
348
|
+
export class BookmarkResult {
|
|
349
|
+
|
|
350
|
+
static __wrap(ptr) {
|
|
351
|
+
ptr = ptr >>> 0;
|
|
352
|
+
const obj = Object.create(BookmarkResult.prototype);
|
|
353
|
+
obj.__wbg_ptr = ptr;
|
|
354
|
+
BookmarkResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
355
|
+
return obj;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
__destroy_into_raw() {
|
|
359
|
+
const ptr = this.__wbg_ptr;
|
|
360
|
+
this.__wbg_ptr = 0;
|
|
361
|
+
BookmarkResultFinalization.unregister(this);
|
|
362
|
+
return ptr;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
free() {
|
|
366
|
+
const ptr = this.__destroy_into_raw();
|
|
367
|
+
wasm.__wbg_bookmarkresult_free(ptr, 0);
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* @returns {PubkyAppBookmark}
|
|
371
|
+
*/
|
|
372
|
+
get bookmark() {
|
|
373
|
+
const ret = wasm.bookmarkresult_bookmark(this.__wbg_ptr);
|
|
374
|
+
return PubkyAppBookmark.__wrap(ret);
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* @returns {Meta}
|
|
378
|
+
*/
|
|
379
|
+
get meta() {
|
|
380
|
+
const ret = wasm.bookmarkresult_meta(this.__wbg_ptr);
|
|
381
|
+
return Meta.__wrap(ret);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const FeedResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
386
|
+
? { register: () => {}, unregister: () => {} }
|
|
387
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_feedresult_free(ptr >>> 0, 1));
|
|
388
|
+
|
|
389
|
+
export class FeedResult {
|
|
390
|
+
|
|
391
|
+
static __wrap(ptr) {
|
|
392
|
+
ptr = ptr >>> 0;
|
|
393
|
+
const obj = Object.create(FeedResult.prototype);
|
|
394
|
+
obj.__wbg_ptr = ptr;
|
|
395
|
+
FeedResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
396
|
+
return obj;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
__destroy_into_raw() {
|
|
400
|
+
const ptr = this.__wbg_ptr;
|
|
401
|
+
this.__wbg_ptr = 0;
|
|
402
|
+
FeedResultFinalization.unregister(this);
|
|
403
|
+
return ptr;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
free() {
|
|
407
|
+
const ptr = this.__destroy_into_raw();
|
|
408
|
+
wasm.__wbg_feedresult_free(ptr, 0);
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* @returns {PubkyAppFeed}
|
|
412
|
+
*/
|
|
413
|
+
get feed() {
|
|
414
|
+
const ret = wasm.feedresult_feed(this.__wbg_ptr);
|
|
415
|
+
return PubkyAppFeed.__wrap(ret);
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* @returns {Meta}
|
|
419
|
+
*/
|
|
420
|
+
get meta() {
|
|
421
|
+
const ret = wasm.feedresult_meta(this.__wbg_ptr);
|
|
422
|
+
return Meta.__wrap(ret);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
const FileResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
427
|
+
? { register: () => {}, unregister: () => {} }
|
|
428
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_fileresult_free(ptr >>> 0, 1));
|
|
429
|
+
|
|
430
|
+
export class FileResult {
|
|
431
|
+
|
|
432
|
+
static __wrap(ptr) {
|
|
433
|
+
ptr = ptr >>> 0;
|
|
434
|
+
const obj = Object.create(FileResult.prototype);
|
|
435
|
+
obj.__wbg_ptr = ptr;
|
|
436
|
+
FileResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
437
|
+
return obj;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
__destroy_into_raw() {
|
|
441
|
+
const ptr = this.__wbg_ptr;
|
|
442
|
+
this.__wbg_ptr = 0;
|
|
443
|
+
FileResultFinalization.unregister(this);
|
|
444
|
+
return ptr;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
free() {
|
|
448
|
+
const ptr = this.__destroy_into_raw();
|
|
449
|
+
wasm.__wbg_fileresult_free(ptr, 0);
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* @returns {PubkyAppFile}
|
|
453
|
+
*/
|
|
454
|
+
get file() {
|
|
455
|
+
const ret = wasm.fileresult_file(this.__wbg_ptr);
|
|
456
|
+
return PubkyAppFile.__wrap(ret);
|
|
457
|
+
}
|
|
458
|
+
/**
|
|
459
|
+
* @returns {Meta}
|
|
460
|
+
*/
|
|
461
|
+
get meta() {
|
|
462
|
+
const ret = wasm.fileresult_meta(this.__wbg_ptr);
|
|
463
|
+
return Meta.__wrap(ret);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
const FollowResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
468
|
+
? { register: () => {}, unregister: () => {} }
|
|
469
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_followresult_free(ptr >>> 0, 1));
|
|
470
|
+
|
|
471
|
+
export class FollowResult {
|
|
472
|
+
|
|
473
|
+
static __wrap(ptr) {
|
|
474
|
+
ptr = ptr >>> 0;
|
|
475
|
+
const obj = Object.create(FollowResult.prototype);
|
|
476
|
+
obj.__wbg_ptr = ptr;
|
|
477
|
+
FollowResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
478
|
+
return obj;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
__destroy_into_raw() {
|
|
482
|
+
const ptr = this.__wbg_ptr;
|
|
483
|
+
this.__wbg_ptr = 0;
|
|
484
|
+
FollowResultFinalization.unregister(this);
|
|
485
|
+
return ptr;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
free() {
|
|
489
|
+
const ptr = this.__destroy_into_raw();
|
|
490
|
+
wasm.__wbg_followresult_free(ptr, 0);
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* @returns {PubkyAppFollow}
|
|
494
|
+
*/
|
|
495
|
+
get follow() {
|
|
496
|
+
const ret = wasm.followresult_follow(this.__wbg_ptr);
|
|
497
|
+
return PubkyAppFollow.__wrap(ret);
|
|
498
|
+
}
|
|
499
|
+
/**
|
|
500
|
+
* @returns {Meta}
|
|
501
|
+
*/
|
|
502
|
+
get meta() {
|
|
503
|
+
const ret = wasm.followresult_meta(this.__wbg_ptr);
|
|
504
|
+
return Meta.__wrap(ret);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
const LastReadResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
509
|
+
? { register: () => {}, unregister: () => {} }
|
|
510
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_lastreadresult_free(ptr >>> 0, 1));
|
|
511
|
+
|
|
512
|
+
export class LastReadResult {
|
|
513
|
+
|
|
514
|
+
static __wrap(ptr) {
|
|
515
|
+
ptr = ptr >>> 0;
|
|
516
|
+
const obj = Object.create(LastReadResult.prototype);
|
|
517
|
+
obj.__wbg_ptr = ptr;
|
|
518
|
+
LastReadResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
519
|
+
return obj;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
__destroy_into_raw() {
|
|
523
|
+
const ptr = this.__wbg_ptr;
|
|
524
|
+
this.__wbg_ptr = 0;
|
|
525
|
+
LastReadResultFinalization.unregister(this);
|
|
526
|
+
return ptr;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
free() {
|
|
530
|
+
const ptr = this.__destroy_into_raw();
|
|
531
|
+
wasm.__wbg_lastreadresult_free(ptr, 0);
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* @returns {PubkyAppLastRead}
|
|
535
|
+
*/
|
|
536
|
+
get last_read() {
|
|
537
|
+
const ret = wasm.followresult_follow(this.__wbg_ptr);
|
|
538
|
+
return PubkyAppLastRead.__wrap(ret);
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* @returns {Meta}
|
|
542
|
+
*/
|
|
543
|
+
get meta() {
|
|
544
|
+
const ret = wasm.followresult_meta(this.__wbg_ptr);
|
|
545
|
+
return Meta.__wrap(ret);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
const MetaFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
550
|
+
? { register: () => {}, unregister: () => {} }
|
|
551
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_meta_free(ptr >>> 0, 1));
|
|
552
|
+
/**
|
|
553
|
+
* Each FFI function:
|
|
554
|
+
* - Accepts minimal fields in a JavaScript-friendly manner (e.g. strings, JSON).
|
|
555
|
+
* - Creates the Rust model, sanitizes, and validates it.
|
|
556
|
+
* - Generates the ID (if applicable).
|
|
557
|
+
* - Generates the path (if applicable).
|
|
558
|
+
* - Returns { json, id, path, url } or a descriptive error.
|
|
559
|
+
*/
|
|
560
|
+
export class Meta {
|
|
561
|
+
|
|
562
|
+
static __wrap(ptr) {
|
|
563
|
+
ptr = ptr >>> 0;
|
|
564
|
+
const obj = Object.create(Meta.prototype);
|
|
565
|
+
obj.__wbg_ptr = ptr;
|
|
566
|
+
MetaFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
567
|
+
return obj;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
__destroy_into_raw() {
|
|
571
|
+
const ptr = this.__wbg_ptr;
|
|
572
|
+
this.__wbg_ptr = 0;
|
|
573
|
+
MetaFinalization.unregister(this);
|
|
574
|
+
return ptr;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
free() {
|
|
578
|
+
const ptr = this.__destroy_into_raw();
|
|
579
|
+
wasm.__wbg_meta_free(ptr, 0);
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* @returns {string}
|
|
583
|
+
*/
|
|
584
|
+
get id() {
|
|
585
|
+
let deferred1_0;
|
|
586
|
+
let deferred1_1;
|
|
587
|
+
try {
|
|
588
|
+
const ret = wasm.meta_id(this.__wbg_ptr);
|
|
589
|
+
deferred1_0 = ret[0];
|
|
590
|
+
deferred1_1 = ret[1];
|
|
591
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
592
|
+
} finally {
|
|
593
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* @returns {string}
|
|
598
|
+
*/
|
|
599
|
+
get path() {
|
|
600
|
+
let deferred1_0;
|
|
601
|
+
let deferred1_1;
|
|
602
|
+
try {
|
|
603
|
+
const ret = wasm.meta_path(this.__wbg_ptr);
|
|
604
|
+
deferred1_0 = ret[0];
|
|
605
|
+
deferred1_1 = ret[1];
|
|
606
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
607
|
+
} finally {
|
|
608
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
/**
|
|
612
|
+
* @returns {string}
|
|
613
|
+
*/
|
|
614
|
+
get url() {
|
|
615
|
+
let deferred1_0;
|
|
616
|
+
let deferred1_1;
|
|
617
|
+
try {
|
|
618
|
+
const ret = wasm.meta_url(this.__wbg_ptr);
|
|
619
|
+
deferred1_0 = ret[0];
|
|
620
|
+
deferred1_1 = ret[1];
|
|
621
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
622
|
+
} finally {
|
|
623
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
const MuteResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
629
|
+
? { register: () => {}, unregister: () => {} }
|
|
630
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_muteresult_free(ptr >>> 0, 1));
|
|
631
|
+
|
|
632
|
+
export class MuteResult {
|
|
633
|
+
|
|
634
|
+
static __wrap(ptr) {
|
|
635
|
+
ptr = ptr >>> 0;
|
|
636
|
+
const obj = Object.create(MuteResult.prototype);
|
|
637
|
+
obj.__wbg_ptr = ptr;
|
|
638
|
+
MuteResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
639
|
+
return obj;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
__destroy_into_raw() {
|
|
643
|
+
const ptr = this.__wbg_ptr;
|
|
644
|
+
this.__wbg_ptr = 0;
|
|
645
|
+
MuteResultFinalization.unregister(this);
|
|
646
|
+
return ptr;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
free() {
|
|
650
|
+
const ptr = this.__destroy_into_raw();
|
|
651
|
+
wasm.__wbg_muteresult_free(ptr, 0);
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* @returns {PubkyAppMute}
|
|
655
|
+
*/
|
|
656
|
+
get mute() {
|
|
657
|
+
const ret = wasm.followresult_follow(this.__wbg_ptr);
|
|
658
|
+
return PubkyAppMute.__wrap(ret);
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* @returns {Meta}
|
|
662
|
+
*/
|
|
663
|
+
get meta() {
|
|
664
|
+
const ret = wasm.followresult_meta(this.__wbg_ptr);
|
|
665
|
+
return Meta.__wrap(ret);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
const PostResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
670
|
+
? { register: () => {}, unregister: () => {} }
|
|
671
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_postresult_free(ptr >>> 0, 1));
|
|
672
|
+
|
|
673
|
+
export class PostResult {
|
|
674
|
+
|
|
675
|
+
static __wrap(ptr) {
|
|
676
|
+
ptr = ptr >>> 0;
|
|
677
|
+
const obj = Object.create(PostResult.prototype);
|
|
678
|
+
obj.__wbg_ptr = ptr;
|
|
679
|
+
PostResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
680
|
+
return obj;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
__destroy_into_raw() {
|
|
684
|
+
const ptr = this.__wbg_ptr;
|
|
685
|
+
this.__wbg_ptr = 0;
|
|
686
|
+
PostResultFinalization.unregister(this);
|
|
687
|
+
return ptr;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
free() {
|
|
691
|
+
const ptr = this.__destroy_into_raw();
|
|
692
|
+
wasm.__wbg_postresult_free(ptr, 0);
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* @returns {PubkyAppPost}
|
|
696
|
+
*/
|
|
697
|
+
get post() {
|
|
698
|
+
const ret = wasm.postresult_post(this.__wbg_ptr);
|
|
699
|
+
return PubkyAppPost.__wrap(ret);
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* @returns {Meta}
|
|
703
|
+
*/
|
|
704
|
+
get meta() {
|
|
705
|
+
const ret = wasm.postresult_meta(this.__wbg_ptr);
|
|
706
|
+
return Meta.__wrap(ret);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
const PubkyAppBlobFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
711
|
+
? { register: () => {}, unregister: () => {} }
|
|
712
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyappblob_free(ptr >>> 0, 1));
|
|
713
|
+
/**
|
|
714
|
+
* Represents a file uploaded by the user.
|
|
715
|
+
* URI: /pub/pubky.app/files/:file_id
|
|
716
|
+
*/
|
|
717
|
+
export class PubkyAppBlob {
|
|
718
|
+
|
|
719
|
+
static __wrap(ptr) {
|
|
720
|
+
ptr = ptr >>> 0;
|
|
721
|
+
const obj = Object.create(PubkyAppBlob.prototype);
|
|
722
|
+
obj.__wbg_ptr = ptr;
|
|
723
|
+
PubkyAppBlobFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
724
|
+
return obj;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
__destroy_into_raw() {
|
|
728
|
+
const ptr = this.__wbg_ptr;
|
|
729
|
+
this.__wbg_ptr = 0;
|
|
730
|
+
PubkyAppBlobFinalization.unregister(this);
|
|
731
|
+
return ptr;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
free() {
|
|
735
|
+
const ptr = this.__destroy_into_raw();
|
|
736
|
+
wasm.__wbg_pubkyappblob_free(ptr, 0);
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Serialize to JSON for WASM.
|
|
740
|
+
* @returns {any}
|
|
741
|
+
*/
|
|
742
|
+
toJson() {
|
|
743
|
+
const ret = wasm.pubkyappblob_toJson(this.__wbg_ptr);
|
|
744
|
+
if (ret[2]) {
|
|
745
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
746
|
+
}
|
|
747
|
+
return takeFromExternrefTable0(ret[0]);
|
|
748
|
+
}
|
|
749
|
+
/**
|
|
750
|
+
* Getter for the blob data as a `Uint8Array`.
|
|
751
|
+
* @returns {Uint8Array}
|
|
752
|
+
*/
|
|
753
|
+
get data() {
|
|
754
|
+
const ret = wasm.pubkyappblob_data(this.__wbg_ptr);
|
|
755
|
+
return ret;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
const PubkyAppBookmarkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
760
|
+
? { register: () => {}, unregister: () => {} }
|
|
761
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyappbookmark_free(ptr >>> 0, 1));
|
|
762
|
+
/**
|
|
763
|
+
* Represents raw homeserver bookmark with id
|
|
764
|
+
* URI: /pub/pubky.app/bookmarks/:bookmark_id
|
|
765
|
+
*
|
|
766
|
+
* Example URI:
|
|
767
|
+
*
|
|
768
|
+
* `/pub/pubky.app/bookmarks/AF7KQ6NEV5XV1EG5DVJ2E74JJ4`
|
|
769
|
+
*
|
|
770
|
+
* Where bookmark_id is Crockford-base32(Blake3("{uri_bookmarked}"")[:half])
|
|
771
|
+
*/
|
|
772
|
+
export class PubkyAppBookmark {
|
|
773
|
+
|
|
774
|
+
static __wrap(ptr) {
|
|
775
|
+
ptr = ptr >>> 0;
|
|
776
|
+
const obj = Object.create(PubkyAppBookmark.prototype);
|
|
777
|
+
obj.__wbg_ptr = ptr;
|
|
778
|
+
PubkyAppBookmarkFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
779
|
+
return obj;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
__destroy_into_raw() {
|
|
783
|
+
const ptr = this.__wbg_ptr;
|
|
784
|
+
this.__wbg_ptr = 0;
|
|
785
|
+
PubkyAppBookmarkFinalization.unregister(this);
|
|
786
|
+
return ptr;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
free() {
|
|
790
|
+
const ptr = this.__destroy_into_raw();
|
|
791
|
+
wasm.__wbg_pubkyappbookmark_free(ptr, 0);
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* @returns {bigint}
|
|
795
|
+
*/
|
|
796
|
+
get created_at() {
|
|
797
|
+
const ret = wasm.__wbg_get_pubkyappbookmark_created_at(this.__wbg_ptr);
|
|
798
|
+
return ret;
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* @param {bigint} arg0
|
|
802
|
+
*/
|
|
803
|
+
set created_at(arg0) {
|
|
804
|
+
wasm.__wbg_set_pubkyappbookmark_created_at(this.__wbg_ptr, arg0);
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Serialize to JSON for WASM.
|
|
808
|
+
* @returns {any}
|
|
809
|
+
*/
|
|
810
|
+
toJson() {
|
|
811
|
+
const ret = wasm.pubkyappbookmark_toJson(this.__wbg_ptr);
|
|
812
|
+
if (ret[2]) {
|
|
813
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
814
|
+
}
|
|
815
|
+
return takeFromExternrefTable0(ret[0]);
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* Getter for `uri`.
|
|
819
|
+
* @returns {string}
|
|
820
|
+
*/
|
|
821
|
+
get uri() {
|
|
822
|
+
let deferred1_0;
|
|
823
|
+
let deferred1_1;
|
|
824
|
+
try {
|
|
825
|
+
const ret = wasm.pubkyappbookmark_uri(this.__wbg_ptr);
|
|
826
|
+
deferred1_0 = ret[0];
|
|
827
|
+
deferred1_1 = ret[1];
|
|
828
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
829
|
+
} finally {
|
|
830
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
const PubkyAppFeedFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
836
|
+
? { register: () => {}, unregister: () => {} }
|
|
837
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyappfeed_free(ptr >>> 0, 1));
|
|
838
|
+
/**
|
|
839
|
+
* Represents a feed configuration.
|
|
840
|
+
*/
|
|
841
|
+
export class PubkyAppFeed {
|
|
842
|
+
|
|
843
|
+
static __wrap(ptr) {
|
|
844
|
+
ptr = ptr >>> 0;
|
|
845
|
+
const obj = Object.create(PubkyAppFeed.prototype);
|
|
846
|
+
obj.__wbg_ptr = ptr;
|
|
847
|
+
PubkyAppFeedFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
848
|
+
return obj;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
__destroy_into_raw() {
|
|
852
|
+
const ptr = this.__wbg_ptr;
|
|
853
|
+
this.__wbg_ptr = 0;
|
|
854
|
+
PubkyAppFeedFinalization.unregister(this);
|
|
855
|
+
return ptr;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
free() {
|
|
859
|
+
const ptr = this.__destroy_into_raw();
|
|
860
|
+
wasm.__wbg_pubkyappfeed_free(ptr, 0);
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* @returns {bigint}
|
|
864
|
+
*/
|
|
865
|
+
get created_at() {
|
|
866
|
+
const ret = wasm.__wbg_get_pubkyappfeed_created_at(this.__wbg_ptr);
|
|
867
|
+
return ret;
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* @param {bigint} arg0
|
|
871
|
+
*/
|
|
872
|
+
set created_at(arg0) {
|
|
873
|
+
wasm.__wbg_set_pubkyappfeed_created_at(this.__wbg_ptr, arg0);
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Serialize to JSON for WASM.
|
|
877
|
+
* @returns {any}
|
|
878
|
+
*/
|
|
879
|
+
toJson() {
|
|
880
|
+
const ret = wasm.pubkyappfeed_toJson(this.__wbg_ptr);
|
|
881
|
+
if (ret[2]) {
|
|
882
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
883
|
+
}
|
|
884
|
+
return takeFromExternrefTable0(ret[0]);
|
|
885
|
+
}
|
|
886
|
+
/**
|
|
887
|
+
* Getter for `feed`.
|
|
888
|
+
* @returns {PubkyAppFeedConfig}
|
|
889
|
+
*/
|
|
890
|
+
get feed() {
|
|
891
|
+
const ret = wasm.pubkyappfeed_feed(this.__wbg_ptr);
|
|
892
|
+
return PubkyAppFeedConfig.__wrap(ret);
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Getter for `name`.
|
|
896
|
+
* @returns {string}
|
|
897
|
+
*/
|
|
898
|
+
get name() {
|
|
899
|
+
let deferred1_0;
|
|
900
|
+
let deferred1_1;
|
|
901
|
+
try {
|
|
902
|
+
const ret = wasm.pubkyappfeed_name(this.__wbg_ptr);
|
|
903
|
+
deferred1_0 = ret[0];
|
|
904
|
+
deferred1_1 = ret[1];
|
|
905
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
906
|
+
} finally {
|
|
907
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
const PubkyAppFeedConfigFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
913
|
+
? { register: () => {}, unregister: () => {} }
|
|
914
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyappfeedconfig_free(ptr >>> 0, 1));
|
|
915
|
+
/**
|
|
916
|
+
* Configuration object for the feed.
|
|
917
|
+
*/
|
|
918
|
+
export class PubkyAppFeedConfig {
|
|
919
|
+
|
|
920
|
+
static __wrap(ptr) {
|
|
921
|
+
ptr = ptr >>> 0;
|
|
922
|
+
const obj = Object.create(PubkyAppFeedConfig.prototype);
|
|
923
|
+
obj.__wbg_ptr = ptr;
|
|
924
|
+
PubkyAppFeedConfigFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
925
|
+
return obj;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
__destroy_into_raw() {
|
|
929
|
+
const ptr = this.__wbg_ptr;
|
|
930
|
+
this.__wbg_ptr = 0;
|
|
931
|
+
PubkyAppFeedConfigFinalization.unregister(this);
|
|
932
|
+
return ptr;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
free() {
|
|
936
|
+
const ptr = this.__destroy_into_raw();
|
|
937
|
+
wasm.__wbg_pubkyappfeedconfig_free(ptr, 0);
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* Serialize to JSON for WASM.
|
|
941
|
+
* @returns {any}
|
|
942
|
+
*/
|
|
943
|
+
toJson() {
|
|
944
|
+
const ret = wasm.pubkyappfeedconfig_toJson(this.__wbg_ptr);
|
|
945
|
+
if (ret[2]) {
|
|
946
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
947
|
+
}
|
|
948
|
+
return takeFromExternrefTable0(ret[0]);
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* Getter for `tags`.
|
|
952
|
+
* @returns {string[] | undefined}
|
|
953
|
+
*/
|
|
954
|
+
get tags() {
|
|
955
|
+
const ret = wasm.pubkyappfeedconfig_tags(this.__wbg_ptr);
|
|
956
|
+
let v1;
|
|
957
|
+
if (ret[0] !== 0) {
|
|
958
|
+
v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
959
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
960
|
+
}
|
|
961
|
+
return v1;
|
|
962
|
+
}
|
|
963
|
+
/**
|
|
964
|
+
* Getter for `name`.
|
|
965
|
+
* @returns {PubkyAppFeedReach}
|
|
966
|
+
*/
|
|
967
|
+
get reach() {
|
|
968
|
+
const ret = wasm.pubkyappfeedconfig_reach(this.__wbg_ptr);
|
|
969
|
+
return ret;
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Getter for `layout`.
|
|
973
|
+
* @returns {PubkyAppFeedLayout}
|
|
974
|
+
*/
|
|
975
|
+
get layout() {
|
|
976
|
+
const ret = wasm.pubkyappfeedconfig_layout(this.__wbg_ptr);
|
|
977
|
+
return ret;
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* Getter for `sort`.
|
|
981
|
+
* @returns {PubkyAppFeedSort}
|
|
982
|
+
*/
|
|
983
|
+
get sort() {
|
|
984
|
+
const ret = wasm.pubkyappfeedconfig_sort(this.__wbg_ptr);
|
|
985
|
+
return ret;
|
|
986
|
+
}
|
|
987
|
+
/**
|
|
988
|
+
* Getter for `content`.
|
|
989
|
+
* @returns {PubkyAppPostKind | undefined}
|
|
990
|
+
*/
|
|
991
|
+
get content() {
|
|
992
|
+
const ret = wasm.pubkyappfeedconfig_content(this.__wbg_ptr);
|
|
993
|
+
return ret === 6 ? undefined : ret;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
const PubkyAppFileFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
998
|
+
? { register: () => {}, unregister: () => {} }
|
|
999
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyappfile_free(ptr >>> 0, 1));
|
|
1000
|
+
/**
|
|
1001
|
+
* Represents a file uploaded by the user.
|
|
1002
|
+
* URI: /pub/pubky.app/files/:file_id
|
|
1003
|
+
*/
|
|
1004
|
+
export class PubkyAppFile {
|
|
1005
|
+
|
|
1006
|
+
static __wrap(ptr) {
|
|
1007
|
+
ptr = ptr >>> 0;
|
|
1008
|
+
const obj = Object.create(PubkyAppFile.prototype);
|
|
1009
|
+
obj.__wbg_ptr = ptr;
|
|
1010
|
+
PubkyAppFileFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1011
|
+
return obj;
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
__destroy_into_raw() {
|
|
1015
|
+
const ptr = this.__wbg_ptr;
|
|
1016
|
+
this.__wbg_ptr = 0;
|
|
1017
|
+
PubkyAppFileFinalization.unregister(this);
|
|
1018
|
+
return ptr;
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
free() {
|
|
1022
|
+
const ptr = this.__destroy_into_raw();
|
|
1023
|
+
wasm.__wbg_pubkyappfile_free(ptr, 0);
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* @returns {bigint}
|
|
1027
|
+
*/
|
|
1028
|
+
get created_at() {
|
|
1029
|
+
const ret = wasm.__wbg_get_pubkyappbookmark_created_at(this.__wbg_ptr);
|
|
1030
|
+
return ret;
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* @param {bigint} arg0
|
|
1034
|
+
*/
|
|
1035
|
+
set created_at(arg0) {
|
|
1036
|
+
wasm.__wbg_set_pubkyappbookmark_created_at(this.__wbg_ptr, arg0);
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* @returns {bigint}
|
|
1040
|
+
*/
|
|
1041
|
+
get size() {
|
|
1042
|
+
const ret = wasm.__wbg_get_pubkyappfile_size(this.__wbg_ptr);
|
|
1043
|
+
return ret;
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* @param {bigint} arg0
|
|
1047
|
+
*/
|
|
1048
|
+
set size(arg0) {
|
|
1049
|
+
wasm.__wbg_set_pubkyappfile_size(this.__wbg_ptr, arg0);
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* @returns {string}
|
|
1053
|
+
*/
|
|
1054
|
+
get name() {
|
|
1055
|
+
let deferred1_0;
|
|
1056
|
+
let deferred1_1;
|
|
1057
|
+
try {
|
|
1058
|
+
const ret = wasm.pubkyappfile_name(this.__wbg_ptr);
|
|
1059
|
+
deferred1_0 = ret[0];
|
|
1060
|
+
deferred1_1 = ret[1];
|
|
1061
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1062
|
+
} finally {
|
|
1063
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* @returns {string}
|
|
1068
|
+
*/
|
|
1069
|
+
get src() {
|
|
1070
|
+
let deferred1_0;
|
|
1071
|
+
let deferred1_1;
|
|
1072
|
+
try {
|
|
1073
|
+
const ret = wasm.pubkyappfile_src(this.__wbg_ptr);
|
|
1074
|
+
deferred1_0 = ret[0];
|
|
1075
|
+
deferred1_1 = ret[1];
|
|
1076
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1077
|
+
} finally {
|
|
1078
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* @returns {string}
|
|
1083
|
+
*/
|
|
1084
|
+
get content_type() {
|
|
1085
|
+
let deferred1_0;
|
|
1086
|
+
let deferred1_1;
|
|
1087
|
+
try {
|
|
1088
|
+
const ret = wasm.pubkyappfile_content_type(this.__wbg_ptr);
|
|
1089
|
+
deferred1_0 = ret[0];
|
|
1090
|
+
deferred1_1 = ret[1];
|
|
1091
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1092
|
+
} finally {
|
|
1093
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* @returns {any}
|
|
1098
|
+
*/
|
|
1099
|
+
toJson() {
|
|
1100
|
+
const ret = wasm.pubkyappfile_toJson(this.__wbg_ptr);
|
|
1101
|
+
if (ret[2]) {
|
|
1102
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1103
|
+
}
|
|
1104
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
const PubkyAppFollowFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1109
|
+
? { register: () => {}, unregister: () => {} }
|
|
1110
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyappfollow_free(ptr >>> 0, 1));
|
|
1111
|
+
/**
|
|
1112
|
+
* Represents raw homeserver follow object with timestamp
|
|
1113
|
+
*
|
|
1114
|
+
* On follow objects, the main data is encoded in the path
|
|
1115
|
+
*
|
|
1116
|
+
* URI: /pub/pubky.app/follows/:user_id
|
|
1117
|
+
*
|
|
1118
|
+
* Example URI:
|
|
1119
|
+
*
|
|
1120
|
+
* `/pub/pubky.app/follows/pxnu33x7jtpx9ar1ytsi4yxbp6a5o36gwhffs8zoxmbuptici1jy`
|
|
1121
|
+
*/
|
|
1122
|
+
export class PubkyAppFollow {
|
|
1123
|
+
|
|
1124
|
+
static __wrap(ptr) {
|
|
1125
|
+
ptr = ptr >>> 0;
|
|
1126
|
+
const obj = Object.create(PubkyAppFollow.prototype);
|
|
1127
|
+
obj.__wbg_ptr = ptr;
|
|
1128
|
+
PubkyAppFollowFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1129
|
+
return obj;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
__destroy_into_raw() {
|
|
1133
|
+
const ptr = this.__wbg_ptr;
|
|
1134
|
+
this.__wbg_ptr = 0;
|
|
1135
|
+
PubkyAppFollowFinalization.unregister(this);
|
|
1136
|
+
return ptr;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
free() {
|
|
1140
|
+
const ptr = this.__destroy_into_raw();
|
|
1141
|
+
wasm.__wbg_pubkyappfollow_free(ptr, 0);
|
|
1142
|
+
}
|
|
1143
|
+
/**
|
|
1144
|
+
* @returns {bigint}
|
|
1145
|
+
*/
|
|
1146
|
+
get created_at() {
|
|
1147
|
+
const ret = wasm.__wbg_get_pubkyappbookmark_created_at(this.__wbg_ptr);
|
|
1148
|
+
return ret;
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* @param {bigint} arg0
|
|
1152
|
+
*/
|
|
1153
|
+
set created_at(arg0) {
|
|
1154
|
+
wasm.__wbg_set_pubkyappbookmark_created_at(this.__wbg_ptr, arg0);
|
|
1155
|
+
}
|
|
1156
|
+
/**
|
|
1157
|
+
* @returns {any}
|
|
1158
|
+
*/
|
|
1159
|
+
toJson() {
|
|
1160
|
+
const ret = wasm.pubkyappfollow_toJson(this.__wbg_ptr);
|
|
1161
|
+
if (ret[2]) {
|
|
1162
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1163
|
+
}
|
|
1164
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
const PubkyAppLastReadFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1169
|
+
? { register: () => {}, unregister: () => {} }
|
|
1170
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyapplastread_free(ptr >>> 0, 1));
|
|
1171
|
+
/**
|
|
1172
|
+
* Represents the last read timestamp for notifications.
|
|
1173
|
+
* URI: /pub/pubky.app/last_read
|
|
1174
|
+
*/
|
|
1175
|
+
export class PubkyAppLastRead {
|
|
1176
|
+
|
|
1177
|
+
static __wrap(ptr) {
|
|
1178
|
+
ptr = ptr >>> 0;
|
|
1179
|
+
const obj = Object.create(PubkyAppLastRead.prototype);
|
|
1180
|
+
obj.__wbg_ptr = ptr;
|
|
1181
|
+
PubkyAppLastReadFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1182
|
+
return obj;
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
__destroy_into_raw() {
|
|
1186
|
+
const ptr = this.__wbg_ptr;
|
|
1187
|
+
this.__wbg_ptr = 0;
|
|
1188
|
+
PubkyAppLastReadFinalization.unregister(this);
|
|
1189
|
+
return ptr;
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
free() {
|
|
1193
|
+
const ptr = this.__destroy_into_raw();
|
|
1194
|
+
wasm.__wbg_pubkyapplastread_free(ptr, 0);
|
|
1195
|
+
}
|
|
1196
|
+
/**
|
|
1197
|
+
* @returns {bigint}
|
|
1198
|
+
*/
|
|
1199
|
+
get timestamp() {
|
|
1200
|
+
const ret = wasm.__wbg_get_pubkyappbookmark_created_at(this.__wbg_ptr);
|
|
1201
|
+
return ret;
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* @param {bigint} arg0
|
|
1205
|
+
*/
|
|
1206
|
+
set timestamp(arg0) {
|
|
1207
|
+
wasm.__wbg_set_pubkyappbookmark_created_at(this.__wbg_ptr, arg0);
|
|
1208
|
+
}
|
|
1209
|
+
/**
|
|
1210
|
+
* Serialize to JSON for WASM.
|
|
1211
|
+
* @returns {any}
|
|
1212
|
+
*/
|
|
1213
|
+
toJson() {
|
|
1214
|
+
const ret = wasm.pubkyapplastread_toJson(this.__wbg_ptr);
|
|
1215
|
+
if (ret[2]) {
|
|
1216
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1217
|
+
}
|
|
1218
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
|
|
1222
|
+
const PubkyAppMuteFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1223
|
+
? { register: () => {}, unregister: () => {} }
|
|
1224
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyappmute_free(ptr >>> 0, 1));
|
|
1225
|
+
/**
|
|
1226
|
+
* Represents raw homeserver Mute object with timestamp
|
|
1227
|
+
* URI: /pub/pubky.app/mutes/:user_id
|
|
1228
|
+
*
|
|
1229
|
+
* Example URI:
|
|
1230
|
+
*
|
|
1231
|
+
* `/pub/pubky.app/mutes/pxnu33x7jtpx9ar1ytsi4yxbp6a5o36gwhffs8zoxmbuptici1jy`
|
|
1232
|
+
*/
|
|
1233
|
+
export class PubkyAppMute {
|
|
1234
|
+
|
|
1235
|
+
static __wrap(ptr) {
|
|
1236
|
+
ptr = ptr >>> 0;
|
|
1237
|
+
const obj = Object.create(PubkyAppMute.prototype);
|
|
1238
|
+
obj.__wbg_ptr = ptr;
|
|
1239
|
+
PubkyAppMuteFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1240
|
+
return obj;
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
__destroy_into_raw() {
|
|
1244
|
+
const ptr = this.__wbg_ptr;
|
|
1245
|
+
this.__wbg_ptr = 0;
|
|
1246
|
+
PubkyAppMuteFinalization.unregister(this);
|
|
1247
|
+
return ptr;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
free() {
|
|
1251
|
+
const ptr = this.__destroy_into_raw();
|
|
1252
|
+
wasm.__wbg_pubkyappmute_free(ptr, 0);
|
|
1253
|
+
}
|
|
1254
|
+
/**
|
|
1255
|
+
* @returns {bigint}
|
|
1256
|
+
*/
|
|
1257
|
+
get created_at() {
|
|
1258
|
+
const ret = wasm.__wbg_get_pubkyappbookmark_created_at(this.__wbg_ptr);
|
|
1259
|
+
return ret;
|
|
1260
|
+
}
|
|
1261
|
+
/**
|
|
1262
|
+
* @param {bigint} arg0
|
|
1263
|
+
*/
|
|
1264
|
+
set created_at(arg0) {
|
|
1265
|
+
wasm.__wbg_set_pubkyappbookmark_created_at(this.__wbg_ptr, arg0);
|
|
1266
|
+
}
|
|
1267
|
+
/**
|
|
1268
|
+
* @returns {any}
|
|
1269
|
+
*/
|
|
1270
|
+
toJson() {
|
|
1271
|
+
const ret = wasm.pubkyappmute_toJson(this.__wbg_ptr);
|
|
1272
|
+
if (ret[2]) {
|
|
1273
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1274
|
+
}
|
|
1275
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
const PubkyAppPostFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1280
|
+
? { register: () => {}, unregister: () => {} }
|
|
1281
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyapppost_free(ptr >>> 0, 1));
|
|
1282
|
+
/**
|
|
1283
|
+
* Represents raw post in homeserver with content and kind
|
|
1284
|
+
* URI: /pub/pubky.app/posts/:post_id
|
|
1285
|
+
* Where post_id is CrockfordBase32 encoding of timestamp
|
|
1286
|
+
*
|
|
1287
|
+
* Example URI:
|
|
1288
|
+
*
|
|
1289
|
+
* `/pub/pubky.app/posts/00321FCW75ZFY`
|
|
1290
|
+
*/
|
|
1291
|
+
export class PubkyAppPost {
|
|
1292
|
+
|
|
1293
|
+
static __wrap(ptr) {
|
|
1294
|
+
ptr = ptr >>> 0;
|
|
1295
|
+
const obj = Object.create(PubkyAppPost.prototype);
|
|
1296
|
+
obj.__wbg_ptr = ptr;
|
|
1297
|
+
PubkyAppPostFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1298
|
+
return obj;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
__destroy_into_raw() {
|
|
1302
|
+
const ptr = this.__wbg_ptr;
|
|
1303
|
+
this.__wbg_ptr = 0;
|
|
1304
|
+
PubkyAppPostFinalization.unregister(this);
|
|
1305
|
+
return ptr;
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
free() {
|
|
1309
|
+
const ptr = this.__destroy_into_raw();
|
|
1310
|
+
wasm.__wbg_pubkyapppost_free(ptr, 0);
|
|
1311
|
+
}
|
|
1312
|
+
/**
|
|
1313
|
+
* @returns {string}
|
|
1314
|
+
*/
|
|
1315
|
+
get content() {
|
|
1316
|
+
let deferred1_0;
|
|
1317
|
+
let deferred1_1;
|
|
1318
|
+
try {
|
|
1319
|
+
const ret = wasm.pubkyapppost_content(this.__wbg_ptr);
|
|
1320
|
+
deferred1_0 = ret[0];
|
|
1321
|
+
deferred1_1 = ret[1];
|
|
1322
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1323
|
+
} finally {
|
|
1324
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
/**
|
|
1328
|
+
* @returns {PubkyAppPostKind}
|
|
1329
|
+
*/
|
|
1330
|
+
get kind() {
|
|
1331
|
+
const ret = wasm.pubkyapppost_kind(this.__wbg_ptr);
|
|
1332
|
+
return ret;
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* @returns {string | undefined}
|
|
1336
|
+
*/
|
|
1337
|
+
get parent() {
|
|
1338
|
+
const ret = wasm.pubkyapppost_parent(this.__wbg_ptr);
|
|
1339
|
+
let v1;
|
|
1340
|
+
if (ret[0] !== 0) {
|
|
1341
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
1342
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1343
|
+
}
|
|
1344
|
+
return v1;
|
|
1345
|
+
}
|
|
1346
|
+
/**
|
|
1347
|
+
* @returns {PubkyAppPostEmbed | undefined}
|
|
1348
|
+
*/
|
|
1349
|
+
get embed() {
|
|
1350
|
+
const ret = wasm.pubkyapppost_embed(this.__wbg_ptr);
|
|
1351
|
+
return ret === 0 ? undefined : PubkyAppPostEmbed.__wrap(ret);
|
|
1352
|
+
}
|
|
1353
|
+
/**
|
|
1354
|
+
* @returns {string[] | undefined}
|
|
1355
|
+
*/
|
|
1356
|
+
get attachments() {
|
|
1357
|
+
const ret = wasm.pubkyapppost_attachments(this.__wbg_ptr);
|
|
1358
|
+
let v1;
|
|
1359
|
+
if (ret[0] !== 0) {
|
|
1360
|
+
v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1361
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1362
|
+
}
|
|
1363
|
+
return v1;
|
|
1364
|
+
}
|
|
1365
|
+
/**
|
|
1366
|
+
* @returns {any}
|
|
1367
|
+
*/
|
|
1368
|
+
toJson() {
|
|
1369
|
+
const ret = wasm.pubkyapppost_toJson(this.__wbg_ptr);
|
|
1370
|
+
if (ret[2]) {
|
|
1371
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1372
|
+
}
|
|
1373
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1376
|
+
* Creates a new `PubkyAppPost` instance and sanitizes it.
|
|
1377
|
+
* @param {string} content
|
|
1378
|
+
* @param {PubkyAppPostKind} kind
|
|
1379
|
+
* @param {string | null} [parent]
|
|
1380
|
+
* @param {PubkyAppPostEmbed | null} [embed]
|
|
1381
|
+
* @param {string[] | null} [attachments]
|
|
1382
|
+
*/
|
|
1383
|
+
constructor(content, kind, parent, embed, attachments) {
|
|
1384
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1385
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1386
|
+
var ptr1 = isLikeNone(parent) ? 0 : passStringToWasm0(parent, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1387
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1388
|
+
let ptr2 = 0;
|
|
1389
|
+
if (!isLikeNone(embed)) {
|
|
1390
|
+
_assertClass(embed, PubkyAppPostEmbed);
|
|
1391
|
+
ptr2 = embed.__destroy_into_raw();
|
|
1392
|
+
}
|
|
1393
|
+
var ptr3 = isLikeNone(attachments) ? 0 : passArrayJsValueToWasm0(attachments, wasm.__wbindgen_malloc);
|
|
1394
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1395
|
+
const ret = wasm.pubkyapppost_new(ptr0, len0, kind, ptr1, len1, ptr2, ptr3, len3);
|
|
1396
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1397
|
+
PubkyAppPostFinalization.register(this, this.__wbg_ptr, this);
|
|
1398
|
+
return this;
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
const PubkyAppPostEmbedFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1403
|
+
? { register: () => {}, unregister: () => {} }
|
|
1404
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyapppostembed_free(ptr >>> 0, 1));
|
|
1405
|
+
/**
|
|
1406
|
+
* Represents embedded content within a post
|
|
1407
|
+
*/
|
|
1408
|
+
export class PubkyAppPostEmbed {
|
|
1409
|
+
|
|
1410
|
+
static __wrap(ptr) {
|
|
1411
|
+
ptr = ptr >>> 0;
|
|
1412
|
+
const obj = Object.create(PubkyAppPostEmbed.prototype);
|
|
1413
|
+
obj.__wbg_ptr = ptr;
|
|
1414
|
+
PubkyAppPostEmbedFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1415
|
+
return obj;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
__destroy_into_raw() {
|
|
1419
|
+
const ptr = this.__wbg_ptr;
|
|
1420
|
+
this.__wbg_ptr = 0;
|
|
1421
|
+
PubkyAppPostEmbedFinalization.unregister(this);
|
|
1422
|
+
return ptr;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
free() {
|
|
1426
|
+
const ptr = this.__destroy_into_raw();
|
|
1427
|
+
wasm.__wbg_pubkyapppostembed_free(ptr, 0);
|
|
1428
|
+
}
|
|
1429
|
+
/**
|
|
1430
|
+
* @param {string} uri
|
|
1431
|
+
* @param {PubkyAppPostKind} kind
|
|
1432
|
+
*/
|
|
1433
|
+
constructor(uri, kind) {
|
|
1434
|
+
const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1435
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1436
|
+
const ret = wasm.pubkyapppostembed_new(ptr0, len0, kind);
|
|
1437
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1438
|
+
PubkyAppPostEmbedFinalization.register(this, this.__wbg_ptr, this);
|
|
1439
|
+
return this;
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* @returns {PubkyAppPostKind}
|
|
1443
|
+
*/
|
|
1444
|
+
get kind() {
|
|
1445
|
+
const ret = wasm.pubkyapppostembed_kind(this.__wbg_ptr);
|
|
1446
|
+
return ret;
|
|
1447
|
+
}
|
|
1448
|
+
/**
|
|
1449
|
+
* @returns {string}
|
|
1450
|
+
*/
|
|
1451
|
+
get uri() {
|
|
1452
|
+
let deferred1_0;
|
|
1453
|
+
let deferred1_1;
|
|
1454
|
+
try {
|
|
1455
|
+
const ret = wasm.pubkyapppostembed_uri(this.__wbg_ptr);
|
|
1456
|
+
deferred1_0 = ret[0];
|
|
1457
|
+
deferred1_1 = ret[1];
|
|
1458
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1459
|
+
} finally {
|
|
1460
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
const PubkyAppTagFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1466
|
+
? { register: () => {}, unregister: () => {} }
|
|
1467
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyapptag_free(ptr >>> 0, 1));
|
|
1468
|
+
/**
|
|
1469
|
+
* Represents raw homeserver tag with id
|
|
1470
|
+
* URI: /pub/pubky.app/tags/:tag_id
|
|
1471
|
+
*
|
|
1472
|
+
* Example URI:
|
|
1473
|
+
*
|
|
1474
|
+
* `/pub/pubky.app/tags/FPB0AM9S93Q3M1GFY1KV09GMQM`
|
|
1475
|
+
*
|
|
1476
|
+
* Where tag_id is Crockford-base32(Blake3("{uri_tagged}:{label}")[:half])
|
|
1477
|
+
*/
|
|
1478
|
+
export class PubkyAppTag {
|
|
1479
|
+
|
|
1480
|
+
static __wrap(ptr) {
|
|
1481
|
+
ptr = ptr >>> 0;
|
|
1482
|
+
const obj = Object.create(PubkyAppTag.prototype);
|
|
1483
|
+
obj.__wbg_ptr = ptr;
|
|
1484
|
+
PubkyAppTagFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1485
|
+
return obj;
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
__destroy_into_raw() {
|
|
1489
|
+
const ptr = this.__wbg_ptr;
|
|
1490
|
+
this.__wbg_ptr = 0;
|
|
1491
|
+
PubkyAppTagFinalization.unregister(this);
|
|
1492
|
+
return ptr;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
free() {
|
|
1496
|
+
const ptr = this.__destroy_into_raw();
|
|
1497
|
+
wasm.__wbg_pubkyapptag_free(ptr, 0);
|
|
1498
|
+
}
|
|
1499
|
+
/**
|
|
1500
|
+
* @returns {bigint}
|
|
1501
|
+
*/
|
|
1502
|
+
get created_at() {
|
|
1503
|
+
const ret = wasm.__wbg_get_pubkyappbookmark_created_at(this.__wbg_ptr);
|
|
1504
|
+
return ret;
|
|
1505
|
+
}
|
|
1506
|
+
/**
|
|
1507
|
+
* @param {bigint} arg0
|
|
1508
|
+
*/
|
|
1509
|
+
set created_at(arg0) {
|
|
1510
|
+
wasm.__wbg_set_pubkyappbookmark_created_at(this.__wbg_ptr, arg0);
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* Serialize to JSON for WASM.
|
|
1514
|
+
* @returns {any}
|
|
1515
|
+
*/
|
|
1516
|
+
toJson() {
|
|
1517
|
+
const ret = wasm.pubkyapptag_toJson(this.__wbg_ptr);
|
|
1518
|
+
if (ret[2]) {
|
|
1519
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1520
|
+
}
|
|
1521
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* Getter for `uri`.
|
|
1525
|
+
* @returns {string}
|
|
1526
|
+
*/
|
|
1527
|
+
get uri() {
|
|
1528
|
+
let deferred1_0;
|
|
1529
|
+
let deferred1_1;
|
|
1530
|
+
try {
|
|
1531
|
+
const ret = wasm.pubkyapptag_uri(this.__wbg_ptr);
|
|
1532
|
+
deferred1_0 = ret[0];
|
|
1533
|
+
deferred1_1 = ret[1];
|
|
1534
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1535
|
+
} finally {
|
|
1536
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
/**
|
|
1540
|
+
* Getter for `label`.
|
|
1541
|
+
* @returns {string}
|
|
1542
|
+
*/
|
|
1543
|
+
get label() {
|
|
1544
|
+
let deferred1_0;
|
|
1545
|
+
let deferred1_1;
|
|
1546
|
+
try {
|
|
1547
|
+
const ret = wasm.pubkyapptag_label(this.__wbg_ptr);
|
|
1548
|
+
deferred1_0 = ret[0];
|
|
1549
|
+
deferred1_1 = ret[1];
|
|
1550
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1551
|
+
} finally {
|
|
1552
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
const PubkyAppUserFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1558
|
+
? { register: () => {}, unregister: () => {} }
|
|
1559
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyappuser_free(ptr >>> 0, 1));
|
|
1560
|
+
/**
|
|
1561
|
+
* URI: /pub/pubky.app/profile.json
|
|
1562
|
+
*/
|
|
1563
|
+
export class PubkyAppUser {
|
|
1564
|
+
|
|
1565
|
+
static __wrap(ptr) {
|
|
1566
|
+
ptr = ptr >>> 0;
|
|
1567
|
+
const obj = Object.create(PubkyAppUser.prototype);
|
|
1568
|
+
obj.__wbg_ptr = ptr;
|
|
1569
|
+
PubkyAppUserFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1570
|
+
return obj;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
__destroy_into_raw() {
|
|
1574
|
+
const ptr = this.__wbg_ptr;
|
|
1575
|
+
this.__wbg_ptr = 0;
|
|
1576
|
+
PubkyAppUserFinalization.unregister(this);
|
|
1577
|
+
return ptr;
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
free() {
|
|
1581
|
+
const ptr = this.__destroy_into_raw();
|
|
1582
|
+
wasm.__wbg_pubkyappuser_free(ptr, 0);
|
|
1583
|
+
}
|
|
1584
|
+
/**
|
|
1585
|
+
* @returns {string}
|
|
1586
|
+
*/
|
|
1587
|
+
get name() {
|
|
1588
|
+
let deferred1_0;
|
|
1589
|
+
let deferred1_1;
|
|
1590
|
+
try {
|
|
1591
|
+
const ret = wasm.pubkyappuser_name(this.__wbg_ptr);
|
|
1592
|
+
deferred1_0 = ret[0];
|
|
1593
|
+
deferred1_1 = ret[1];
|
|
1594
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1595
|
+
} finally {
|
|
1596
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
/**
|
|
1600
|
+
* @returns {string | undefined}
|
|
1601
|
+
*/
|
|
1602
|
+
get bio() {
|
|
1603
|
+
const ret = wasm.pubkyappuser_bio(this.__wbg_ptr);
|
|
1604
|
+
let v1;
|
|
1605
|
+
if (ret[0] !== 0) {
|
|
1606
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
1607
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1608
|
+
}
|
|
1609
|
+
return v1;
|
|
1610
|
+
}
|
|
1611
|
+
/**
|
|
1612
|
+
* @returns {string | undefined}
|
|
1613
|
+
*/
|
|
1614
|
+
get image() {
|
|
1615
|
+
const ret = wasm.pubkyappuser_image(this.__wbg_ptr);
|
|
1616
|
+
let v1;
|
|
1617
|
+
if (ret[0] !== 0) {
|
|
1618
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
1619
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1620
|
+
}
|
|
1621
|
+
return v1;
|
|
1622
|
+
}
|
|
1623
|
+
/**
|
|
1624
|
+
* @returns {PubkyAppUserLink[] | undefined}
|
|
1625
|
+
*/
|
|
1626
|
+
get links() {
|
|
1627
|
+
const ret = wasm.pubkyappuser_links(this.__wbg_ptr);
|
|
1628
|
+
let v1;
|
|
1629
|
+
if (ret[0] !== 0) {
|
|
1630
|
+
v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
1631
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
1632
|
+
}
|
|
1633
|
+
return v1;
|
|
1634
|
+
}
|
|
1635
|
+
/**
|
|
1636
|
+
* @returns {string | undefined}
|
|
1637
|
+
*/
|
|
1638
|
+
get status() {
|
|
1639
|
+
const ret = wasm.pubkyappuser_status(this.__wbg_ptr);
|
|
1640
|
+
let v1;
|
|
1641
|
+
if (ret[0] !== 0) {
|
|
1642
|
+
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
1643
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1644
|
+
}
|
|
1645
|
+
return v1;
|
|
1646
|
+
}
|
|
1647
|
+
/**
|
|
1648
|
+
* @returns {any}
|
|
1649
|
+
*/
|
|
1650
|
+
toJson() {
|
|
1651
|
+
const ret = wasm.pubkyappuser_toJson(this.__wbg_ptr);
|
|
1652
|
+
if (ret[2]) {
|
|
1653
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1654
|
+
}
|
|
1655
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1656
|
+
}
|
|
1657
|
+
/**
|
|
1658
|
+
* Creates a new `PubkyAppUser` instance and sanitizes it.
|
|
1659
|
+
* @param {string} name
|
|
1660
|
+
* @param {string | null} [bio]
|
|
1661
|
+
* @param {string | null} [image]
|
|
1662
|
+
* @param {PubkyAppUserLink[] | null} [links]
|
|
1663
|
+
* @param {string | null} [status]
|
|
1664
|
+
*/
|
|
1665
|
+
constructor(name, bio, image, links, status) {
|
|
1666
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1667
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1668
|
+
var ptr1 = isLikeNone(bio) ? 0 : passStringToWasm0(bio, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1669
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1670
|
+
var ptr2 = isLikeNone(image) ? 0 : passStringToWasm0(image, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1671
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1672
|
+
var ptr3 = isLikeNone(links) ? 0 : passArrayJsValueToWasm0(links, wasm.__wbindgen_malloc);
|
|
1673
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1674
|
+
var ptr4 = isLikeNone(status) ? 0 : passStringToWasm0(status, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1675
|
+
var len4 = WASM_VECTOR_LEN;
|
|
1676
|
+
const ret = wasm.pubkyappuser_new(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
1677
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1678
|
+
PubkyAppUserFinalization.register(this, this.__wbg_ptr, this);
|
|
1679
|
+
return this;
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
const PubkyAppUserLinkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1684
|
+
? { register: () => {}, unregister: () => {} }
|
|
1685
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyappuserlink_free(ptr >>> 0, 1));
|
|
1686
|
+
/**
|
|
1687
|
+
* Represents a user's single link with a title and URL.
|
|
1688
|
+
*/
|
|
1689
|
+
export class PubkyAppUserLink {
|
|
1690
|
+
|
|
1691
|
+
static __wrap(ptr) {
|
|
1692
|
+
ptr = ptr >>> 0;
|
|
1693
|
+
const obj = Object.create(PubkyAppUserLink.prototype);
|
|
1694
|
+
obj.__wbg_ptr = ptr;
|
|
1695
|
+
PubkyAppUserLinkFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1696
|
+
return obj;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
static __unwrap(jsValue) {
|
|
1700
|
+
if (!(jsValue instanceof PubkyAppUserLink)) {
|
|
1701
|
+
return 0;
|
|
1702
|
+
}
|
|
1703
|
+
return jsValue.__destroy_into_raw();
|
|
1704
|
+
}
|
|
1705
|
+
|
|
1706
|
+
__destroy_into_raw() {
|
|
1707
|
+
const ptr = this.__wbg_ptr;
|
|
1708
|
+
this.__wbg_ptr = 0;
|
|
1709
|
+
PubkyAppUserLinkFinalization.unregister(this);
|
|
1710
|
+
return ptr;
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
free() {
|
|
1714
|
+
const ptr = this.__destroy_into_raw();
|
|
1715
|
+
wasm.__wbg_pubkyappuserlink_free(ptr, 0);
|
|
1716
|
+
}
|
|
1717
|
+
/**
|
|
1718
|
+
* @returns {string}
|
|
1719
|
+
*/
|
|
1720
|
+
get title() {
|
|
1721
|
+
let deferred1_0;
|
|
1722
|
+
let deferred1_1;
|
|
1723
|
+
try {
|
|
1724
|
+
const ret = wasm.pubkyappuserlink_title(this.__wbg_ptr);
|
|
1725
|
+
deferred1_0 = ret[0];
|
|
1726
|
+
deferred1_1 = ret[1];
|
|
1727
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1728
|
+
} finally {
|
|
1729
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
/**
|
|
1733
|
+
* @returns {string}
|
|
1734
|
+
*/
|
|
1735
|
+
get url() {
|
|
1736
|
+
let deferred1_0;
|
|
1737
|
+
let deferred1_1;
|
|
1738
|
+
try {
|
|
1739
|
+
const ret = wasm.pubkyappuserlink_url(this.__wbg_ptr);
|
|
1740
|
+
deferred1_0 = ret[0];
|
|
1741
|
+
deferred1_1 = ret[1];
|
|
1742
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1743
|
+
} finally {
|
|
1744
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
1747
|
+
/**
|
|
1748
|
+
* Creates a new `PubkyAppUserLink` instance and sanitizes it.
|
|
1749
|
+
* @param {string} title
|
|
1750
|
+
* @param {string} url
|
|
1751
|
+
*/
|
|
1752
|
+
constructor(title, url) {
|
|
1753
|
+
const ptr0 = passStringToWasm0(title, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1754
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1755
|
+
const ptr1 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1756
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1757
|
+
const ret = wasm.pubkyappuserlink_new(ptr0, len0, ptr1, len1);
|
|
1758
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1759
|
+
PubkyAppUserLinkFinalization.register(this, this.__wbg_ptr, this);
|
|
1760
|
+
return this;
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
const PubkySpecsBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1765
|
+
? { register: () => {}, unregister: () => {} }
|
|
1766
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_pubkyspecsbuilder_free(ptr >>> 0, 1));
|
|
1767
|
+
/**
|
|
1768
|
+
* Represents a user's single link with a title and URL.
|
|
1769
|
+
*/
|
|
1770
|
+
export class PubkySpecsBuilder {
|
|
1771
|
+
|
|
1772
|
+
__destroy_into_raw() {
|
|
1773
|
+
const ptr = this.__wbg_ptr;
|
|
1774
|
+
this.__wbg_ptr = 0;
|
|
1775
|
+
PubkySpecsBuilderFinalization.unregister(this);
|
|
1776
|
+
return ptr;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
free() {
|
|
1780
|
+
const ptr = this.__destroy_into_raw();
|
|
1781
|
+
wasm.__wbg_pubkyspecsbuilder_free(ptr, 0);
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Creates a new `PubkyAppBuilder` instance.
|
|
1785
|
+
* @param {string} pubky_id
|
|
1786
|
+
*/
|
|
1787
|
+
constructor(pubky_id) {
|
|
1788
|
+
const ptr0 = passStringToWasm0(pubky_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1789
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1790
|
+
const ret = wasm.pubkyspecsbuilder_new(ptr0, len0);
|
|
1791
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1792
|
+
PubkySpecsBuilderFinalization.register(this, this.__wbg_ptr, this);
|
|
1793
|
+
return this;
|
|
1794
|
+
}
|
|
1795
|
+
/**
|
|
1796
|
+
* @param {string} name
|
|
1797
|
+
* @param {string | null | undefined} bio
|
|
1798
|
+
* @param {string | null | undefined} image
|
|
1799
|
+
* @param {any} links
|
|
1800
|
+
* @param {string | null} [status]
|
|
1801
|
+
* @returns {UserResult}
|
|
1802
|
+
*/
|
|
1803
|
+
createUser(name, bio, image, links, status) {
|
|
1804
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1805
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1806
|
+
var ptr1 = isLikeNone(bio) ? 0 : passStringToWasm0(bio, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1807
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1808
|
+
var ptr2 = isLikeNone(image) ? 0 : passStringToWasm0(image, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1809
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1810
|
+
var ptr3 = isLikeNone(status) ? 0 : passStringToWasm0(status, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1811
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1812
|
+
const ret = wasm.pubkyspecsbuilder_createUser(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, links, ptr3, len3);
|
|
1813
|
+
if (ret[2]) {
|
|
1814
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1815
|
+
}
|
|
1816
|
+
return UserResult.__wrap(ret[0]);
|
|
1817
|
+
}
|
|
1818
|
+
/**
|
|
1819
|
+
* @param {any} tags
|
|
1820
|
+
* @param {string} reach
|
|
1821
|
+
* @param {string} layout
|
|
1822
|
+
* @param {string} sort
|
|
1823
|
+
* @param {string | null | undefined} content
|
|
1824
|
+
* @param {string} name
|
|
1825
|
+
* @returns {FeedResult}
|
|
1826
|
+
*/
|
|
1827
|
+
createFeed(tags, reach, layout, sort, content, name) {
|
|
1828
|
+
const ptr0 = passStringToWasm0(reach, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1829
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1830
|
+
const ptr1 = passStringToWasm0(layout, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1831
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1832
|
+
const ptr2 = passStringToWasm0(sort, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1833
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1834
|
+
var ptr3 = isLikeNone(content) ? 0 : passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1835
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1836
|
+
const ptr4 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1837
|
+
const len4 = WASM_VECTOR_LEN;
|
|
1838
|
+
const ret = wasm.pubkyspecsbuilder_createFeed(this.__wbg_ptr, tags, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
1839
|
+
if (ret[2]) {
|
|
1840
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1841
|
+
}
|
|
1842
|
+
return FeedResult.__wrap(ret[0]);
|
|
1843
|
+
}
|
|
1844
|
+
/**
|
|
1845
|
+
* @param {string} name
|
|
1846
|
+
* @param {string} src
|
|
1847
|
+
* @param {string} content_type
|
|
1848
|
+
* @param {bigint} size
|
|
1849
|
+
* @returns {FileResult}
|
|
1850
|
+
*/
|
|
1851
|
+
createFile(name, src, content_type, size) {
|
|
1852
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1853
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1854
|
+
const ptr1 = passStringToWasm0(src, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1855
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1856
|
+
const ptr2 = passStringToWasm0(content_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1857
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1858
|
+
const ret = wasm.pubkyspecsbuilder_createFile(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, size);
|
|
1859
|
+
if (ret[2]) {
|
|
1860
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1861
|
+
}
|
|
1862
|
+
return FileResult.__wrap(ret[0]);
|
|
1863
|
+
}
|
|
1864
|
+
/**
|
|
1865
|
+
* @param {string} content
|
|
1866
|
+
* @param {PubkyAppPostKind} kind
|
|
1867
|
+
* @param {string | null} [parent]
|
|
1868
|
+
* @param {PubkyAppPostEmbed | null} [embed]
|
|
1869
|
+
* @param {string[] | null} [attachments]
|
|
1870
|
+
* @returns {PostResult}
|
|
1871
|
+
*/
|
|
1872
|
+
createPost(content, kind, parent, embed, attachments) {
|
|
1873
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1874
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1875
|
+
var ptr1 = isLikeNone(parent) ? 0 : passStringToWasm0(parent, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1876
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1877
|
+
let ptr2 = 0;
|
|
1878
|
+
if (!isLikeNone(embed)) {
|
|
1879
|
+
_assertClass(embed, PubkyAppPostEmbed);
|
|
1880
|
+
ptr2 = embed.__destroy_into_raw();
|
|
1881
|
+
}
|
|
1882
|
+
var ptr3 = isLikeNone(attachments) ? 0 : passArrayJsValueToWasm0(attachments, wasm.__wbindgen_malloc);
|
|
1883
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1884
|
+
const ret = wasm.pubkyspecsbuilder_createPost(this.__wbg_ptr, ptr0, len0, kind, ptr1, len1, ptr2, ptr3, len3);
|
|
1885
|
+
if (ret[2]) {
|
|
1886
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1887
|
+
}
|
|
1888
|
+
return PostResult.__wrap(ret[0]);
|
|
1889
|
+
}
|
|
1890
|
+
/**
|
|
1891
|
+
* @param {string} uri
|
|
1892
|
+
* @param {string} label
|
|
1893
|
+
* @returns {TagResult}
|
|
1894
|
+
*/
|
|
1895
|
+
createTag(uri, label) {
|
|
1896
|
+
const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1897
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1898
|
+
const ptr1 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1899
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1900
|
+
const ret = wasm.pubkyspecsbuilder_createTag(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1901
|
+
if (ret[2]) {
|
|
1902
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1903
|
+
}
|
|
1904
|
+
return TagResult.__wrap(ret[0]);
|
|
1905
|
+
}
|
|
1906
|
+
/**
|
|
1907
|
+
* @param {string} uri
|
|
1908
|
+
* @returns {BookmarkResult}
|
|
1909
|
+
*/
|
|
1910
|
+
createBookmark(uri) {
|
|
1911
|
+
const ptr0 = passStringToWasm0(uri, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1912
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1913
|
+
const ret = wasm.pubkyspecsbuilder_createBookmark(this.__wbg_ptr, ptr0, len0);
|
|
1914
|
+
if (ret[2]) {
|
|
1915
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1916
|
+
}
|
|
1917
|
+
return BookmarkResult.__wrap(ret[0]);
|
|
1918
|
+
}
|
|
1919
|
+
/**
|
|
1920
|
+
* @param {string} followee_id
|
|
1921
|
+
* @returns {FollowResult}
|
|
1922
|
+
*/
|
|
1923
|
+
createFollow(followee_id) {
|
|
1924
|
+
const ptr0 = passStringToWasm0(followee_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1925
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1926
|
+
const ret = wasm.pubkyspecsbuilder_createFollow(this.__wbg_ptr, ptr0, len0);
|
|
1927
|
+
if (ret[2]) {
|
|
1928
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1929
|
+
}
|
|
1930
|
+
return FollowResult.__wrap(ret[0]);
|
|
1931
|
+
}
|
|
1932
|
+
/**
|
|
1933
|
+
* @param {string} mutee_id
|
|
1934
|
+
* @returns {MuteResult}
|
|
1935
|
+
*/
|
|
1936
|
+
createMute(mutee_id) {
|
|
1937
|
+
const ptr0 = passStringToWasm0(mutee_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1938
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1939
|
+
const ret = wasm.pubkyspecsbuilder_createMute(this.__wbg_ptr, ptr0, len0);
|
|
1940
|
+
if (ret[2]) {
|
|
1941
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1942
|
+
}
|
|
1943
|
+
return MuteResult.__wrap(ret[0]);
|
|
1944
|
+
}
|
|
1945
|
+
/**
|
|
1946
|
+
* @returns {LastReadResult}
|
|
1947
|
+
*/
|
|
1948
|
+
createLastRead() {
|
|
1949
|
+
const ret = wasm.pubkyspecsbuilder_createLastRead(this.__wbg_ptr);
|
|
1950
|
+
if (ret[2]) {
|
|
1951
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1952
|
+
}
|
|
1953
|
+
return LastReadResult.__wrap(ret[0]);
|
|
1954
|
+
}
|
|
1955
|
+
/**
|
|
1956
|
+
* @param {any} blob_data
|
|
1957
|
+
* @returns {BlobResult}
|
|
1958
|
+
*/
|
|
1959
|
+
createBlob(blob_data) {
|
|
1960
|
+
const ret = wasm.pubkyspecsbuilder_createBlob(this.__wbg_ptr, blob_data);
|
|
1961
|
+
if (ret[2]) {
|
|
1962
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1963
|
+
}
|
|
1964
|
+
return BlobResult.__wrap(ret[0]);
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
const TagResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1969
|
+
? { register: () => {}, unregister: () => {} }
|
|
1970
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_tagresult_free(ptr >>> 0, 1));
|
|
1971
|
+
|
|
1972
|
+
export class TagResult {
|
|
1973
|
+
|
|
1974
|
+
static __wrap(ptr) {
|
|
1975
|
+
ptr = ptr >>> 0;
|
|
1976
|
+
const obj = Object.create(TagResult.prototype);
|
|
1977
|
+
obj.__wbg_ptr = ptr;
|
|
1978
|
+
TagResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1979
|
+
return obj;
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
__destroy_into_raw() {
|
|
1983
|
+
const ptr = this.__wbg_ptr;
|
|
1984
|
+
this.__wbg_ptr = 0;
|
|
1985
|
+
TagResultFinalization.unregister(this);
|
|
1986
|
+
return ptr;
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
free() {
|
|
1990
|
+
const ptr = this.__destroy_into_raw();
|
|
1991
|
+
wasm.__wbg_tagresult_free(ptr, 0);
|
|
1992
|
+
}
|
|
1993
|
+
/**
|
|
1994
|
+
* @returns {PubkyAppTag}
|
|
1995
|
+
*/
|
|
1996
|
+
get tag() {
|
|
1997
|
+
const ret = wasm.tagresult_tag(this.__wbg_ptr);
|
|
1998
|
+
return PubkyAppTag.__wrap(ret);
|
|
1999
|
+
}
|
|
2000
|
+
/**
|
|
2001
|
+
* @returns {Meta}
|
|
2002
|
+
*/
|
|
2003
|
+
get meta() {
|
|
2004
|
+
const ret = wasm.tagresult_meta(this.__wbg_ptr);
|
|
2005
|
+
return Meta.__wrap(ret);
|
|
2006
|
+
}
|
|
2007
|
+
}
|
|
2008
|
+
|
|
2009
|
+
const UserResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2010
|
+
? { register: () => {}, unregister: () => {} }
|
|
2011
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_userresult_free(ptr >>> 0, 1));
|
|
2012
|
+
|
|
2013
|
+
export class UserResult {
|
|
2014
|
+
|
|
2015
|
+
static __wrap(ptr) {
|
|
2016
|
+
ptr = ptr >>> 0;
|
|
2017
|
+
const obj = Object.create(UserResult.prototype);
|
|
2018
|
+
obj.__wbg_ptr = ptr;
|
|
2019
|
+
UserResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2020
|
+
return obj;
|
|
2021
|
+
}
|
|
2022
|
+
|
|
2023
|
+
__destroy_into_raw() {
|
|
2024
|
+
const ptr = this.__wbg_ptr;
|
|
2025
|
+
this.__wbg_ptr = 0;
|
|
2026
|
+
UserResultFinalization.unregister(this);
|
|
2027
|
+
return ptr;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
free() {
|
|
2031
|
+
const ptr = this.__destroy_into_raw();
|
|
2032
|
+
wasm.__wbg_userresult_free(ptr, 0);
|
|
2033
|
+
}
|
|
2034
|
+
/**
|
|
2035
|
+
* @returns {PubkyAppUser}
|
|
2036
|
+
*/
|
|
2037
|
+
get user() {
|
|
2038
|
+
const ret = wasm.userresult_user(this.__wbg_ptr);
|
|
2039
|
+
return PubkyAppUser.__wrap(ret);
|
|
2040
|
+
}
|
|
2041
|
+
/**
|
|
2042
|
+
* @returns {Meta}
|
|
2043
|
+
*/
|
|
2044
|
+
get meta() {
|
|
2045
|
+
const ret = wasm.userresult_meta(this.__wbg_ptr);
|
|
2046
|
+
return Meta.__wrap(ret);
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
|
|
2050
|
+
async function __wbg_load(module, imports) {
|
|
2051
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
2052
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
2053
|
+
try {
|
|
2054
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
2055
|
+
|
|
2056
|
+
} catch (e) {
|
|
2057
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
2058
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
2059
|
+
|
|
2060
|
+
} else {
|
|
2061
|
+
throw e;
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
|
|
2066
|
+
const bytes = await module.arrayBuffer();
|
|
2067
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
2068
|
+
|
|
2069
|
+
} else {
|
|
2070
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
2071
|
+
|
|
2072
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
2073
|
+
return { instance, module };
|
|
2074
|
+
|
|
2075
|
+
} else {
|
|
2076
|
+
return instance;
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
function __wbg_get_imports() {
|
|
2082
|
+
const imports = {};
|
|
2083
|
+
imports.wbg = {};
|
|
2084
|
+
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
2085
|
+
const ret = String(arg1);
|
|
2086
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2087
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2088
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2089
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2090
|
+
};
|
|
2091
|
+
imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
2092
|
+
const ret = arg0.buffer;
|
|
2093
|
+
return ret;
|
|
2094
|
+
};
|
|
2095
|
+
imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
2096
|
+
const ret = arg0.call(arg1);
|
|
2097
|
+
return ret;
|
|
2098
|
+
}, arguments) };
|
|
2099
|
+
imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
|
|
2100
|
+
const ret = arg0.done;
|
|
2101
|
+
return ret;
|
|
2102
|
+
};
|
|
2103
|
+
imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
|
|
2104
|
+
const ret = Reflect.get(arg0, arg1);
|
|
2105
|
+
return ret;
|
|
2106
|
+
}, arguments) };
|
|
2107
|
+
imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
|
|
2108
|
+
const ret = arg0[arg1 >>> 0];
|
|
2109
|
+
return ret;
|
|
2110
|
+
};
|
|
2111
|
+
imports.wbg.__wbg_getwithrefkey_1dc361bd10053bfe = function(arg0, arg1) {
|
|
2112
|
+
const ret = arg0[arg1];
|
|
2113
|
+
return ret;
|
|
2114
|
+
};
|
|
2115
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
|
|
2116
|
+
let result;
|
|
2117
|
+
try {
|
|
2118
|
+
result = arg0 instanceof ArrayBuffer;
|
|
2119
|
+
} catch (_) {
|
|
2120
|
+
result = false;
|
|
2121
|
+
}
|
|
2122
|
+
const ret = result;
|
|
2123
|
+
return ret;
|
|
2124
|
+
};
|
|
2125
|
+
imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
|
2126
|
+
let result;
|
|
2127
|
+
try {
|
|
2128
|
+
result = arg0 instanceof Uint8Array;
|
|
2129
|
+
} catch (_) {
|
|
2130
|
+
result = false;
|
|
2131
|
+
}
|
|
2132
|
+
const ret = result;
|
|
2133
|
+
return ret;
|
|
2134
|
+
};
|
|
2135
|
+
imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
|
|
2136
|
+
const ret = Array.isArray(arg0);
|
|
2137
|
+
return ret;
|
|
2138
|
+
};
|
|
2139
|
+
imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
|
|
2140
|
+
const ret = Number.isSafeInteger(arg0);
|
|
2141
|
+
return ret;
|
|
2142
|
+
};
|
|
2143
|
+
imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
|
|
2144
|
+
const ret = Symbol.iterator;
|
|
2145
|
+
return ret;
|
|
2146
|
+
};
|
|
2147
|
+
imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
2148
|
+
const ret = arg0.length;
|
|
2149
|
+
return ret;
|
|
2150
|
+
};
|
|
2151
|
+
imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
|
|
2152
|
+
const ret = arg0.length;
|
|
2153
|
+
return ret;
|
|
2154
|
+
};
|
|
2155
|
+
imports.wbg.__wbg_new_405e22f390576ce2 = function() {
|
|
2156
|
+
const ret = new Object();
|
|
2157
|
+
return ret;
|
|
2158
|
+
};
|
|
2159
|
+
imports.wbg.__wbg_new_78feb108b6472713 = function() {
|
|
2160
|
+
const ret = new Array();
|
|
2161
|
+
return ret;
|
|
2162
|
+
};
|
|
2163
|
+
imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
2164
|
+
const ret = new Uint8Array(arg0);
|
|
2165
|
+
return ret;
|
|
2166
|
+
};
|
|
2167
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
|
|
2168
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
2169
|
+
return ret;
|
|
2170
|
+
};
|
|
2171
|
+
imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
|
|
2172
|
+
const ret = arg0.next;
|
|
2173
|
+
return ret;
|
|
2174
|
+
};
|
|
2175
|
+
imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
|
|
2176
|
+
const ret = arg0.next();
|
|
2177
|
+
return ret;
|
|
2178
|
+
}, arguments) };
|
|
2179
|
+
imports.wbg.__wbg_now_807e54c39636c349 = function() {
|
|
2180
|
+
const ret = Date.now();
|
|
2181
|
+
return ret;
|
|
2182
|
+
};
|
|
2183
|
+
imports.wbg.__wbg_pubkyappuserlink_new = function(arg0) {
|
|
2184
|
+
const ret = PubkyAppUserLink.__wrap(arg0);
|
|
2185
|
+
return ret;
|
|
2186
|
+
};
|
|
2187
|
+
imports.wbg.__wbg_pubkyappuserlink_unwrap = function(arg0) {
|
|
2188
|
+
const ret = PubkyAppUserLink.__unwrap(arg0);
|
|
2189
|
+
return ret;
|
|
2190
|
+
};
|
|
2191
|
+
imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
|
|
2192
|
+
arg0[arg1 >>> 0] = arg2;
|
|
2193
|
+
};
|
|
2194
|
+
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
2195
|
+
arg0[arg1] = arg2;
|
|
2196
|
+
};
|
|
2197
|
+
imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
2198
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
2199
|
+
};
|
|
2200
|
+
imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
|
2201
|
+
const ret = arg0.value;
|
|
2202
|
+
return ret;
|
|
2203
|
+
};
|
|
2204
|
+
imports.wbg.__wbindgen_as_number = function(arg0) {
|
|
2205
|
+
const ret = +arg0;
|
|
2206
|
+
return ret;
|
|
2207
|
+
};
|
|
2208
|
+
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
2209
|
+
const ret = arg0;
|
|
2210
|
+
return ret;
|
|
2211
|
+
};
|
|
2212
|
+
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
2213
|
+
const v = arg0;
|
|
2214
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
2215
|
+
return ret;
|
|
2216
|
+
};
|
|
2217
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
2218
|
+
const ret = debugString(arg1);
|
|
2219
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2220
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2221
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2222
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2223
|
+
};
|
|
2224
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
2225
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
2226
|
+
return ret;
|
|
2227
|
+
};
|
|
2228
|
+
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
2229
|
+
const ret = arg0 in arg1;
|
|
2230
|
+
return ret;
|
|
2231
|
+
};
|
|
2232
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
2233
|
+
const table = wasm.__wbindgen_export_4;
|
|
2234
|
+
const offset = table.grow(4);
|
|
2235
|
+
table.set(0, undefined);
|
|
2236
|
+
table.set(offset + 0, undefined);
|
|
2237
|
+
table.set(offset + 1, null);
|
|
2238
|
+
table.set(offset + 2, true);
|
|
2239
|
+
table.set(offset + 3, false);
|
|
2240
|
+
;
|
|
2241
|
+
};
|
|
2242
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
2243
|
+
const ret = typeof(arg0) === 'function';
|
|
2244
|
+
return ret;
|
|
2245
|
+
};
|
|
2246
|
+
imports.wbg.__wbindgen_is_null = function(arg0) {
|
|
2247
|
+
const ret = arg0 === null;
|
|
2248
|
+
return ret;
|
|
2249
|
+
};
|
|
2250
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
2251
|
+
const val = arg0;
|
|
2252
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
2253
|
+
return ret;
|
|
2254
|
+
};
|
|
2255
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
2256
|
+
const ret = arg0 === undefined;
|
|
2257
|
+
return ret;
|
|
2258
|
+
};
|
|
2259
|
+
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
2260
|
+
const ret = arg0 == arg1;
|
|
2261
|
+
return ret;
|
|
2262
|
+
};
|
|
2263
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
2264
|
+
const ret = wasm.memory;
|
|
2265
|
+
return ret;
|
|
2266
|
+
};
|
|
2267
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
2268
|
+
const obj = arg1;
|
|
2269
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
2270
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
2271
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
2272
|
+
};
|
|
2273
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
2274
|
+
const ret = arg0;
|
|
2275
|
+
return ret;
|
|
2276
|
+
};
|
|
2277
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
2278
|
+
const obj = arg1;
|
|
2279
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
2280
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2281
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2282
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2283
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2284
|
+
};
|
|
2285
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
2286
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
2287
|
+
return ret;
|
|
2288
|
+
};
|
|
2289
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
2290
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
2291
|
+
};
|
|
2292
|
+
|
|
2293
|
+
return imports;
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
function __wbg_init_memory(imports, memory) {
|
|
2297
|
+
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
function __wbg_finalize_init(instance, module) {
|
|
2301
|
+
wasm = instance.exports;
|
|
2302
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
2303
|
+
cachedDataViewMemory0 = null;
|
|
2304
|
+
cachedUint8ArrayMemory0 = null;
|
|
2305
|
+
|
|
2306
|
+
|
|
2307
|
+
wasm.__wbindgen_start();
|
|
2308
|
+
return wasm;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
function initSync(module) {
|
|
2312
|
+
if (wasm !== undefined) return wasm;
|
|
2313
|
+
|
|
2314
|
+
|
|
2315
|
+
if (typeof module !== 'undefined') {
|
|
2316
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
2317
|
+
({module} = module)
|
|
2318
|
+
} else {
|
|
2319
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
2320
|
+
}
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
const imports = __wbg_get_imports();
|
|
2324
|
+
|
|
2325
|
+
__wbg_init_memory(imports);
|
|
2326
|
+
|
|
2327
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
2328
|
+
module = new WebAssembly.Module(module);
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
2332
|
+
|
|
2333
|
+
return __wbg_finalize_init(instance, module);
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
async function __wbg_init(module_or_path) {
|
|
2337
|
+
if (wasm !== undefined) return wasm;
|
|
2338
|
+
|
|
2339
|
+
|
|
2340
|
+
if (typeof module_or_path !== 'undefined') {
|
|
2341
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
2342
|
+
({module_or_path} = module_or_path)
|
|
2343
|
+
} else {
|
|
2344
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
2345
|
+
}
|
|
2346
|
+
}
|
|
2347
|
+
|
|
2348
|
+
if (typeof module_or_path === 'undefined') {
|
|
2349
|
+
module_or_path = new URL('pubky_app_specs_bg.wasm', import.meta.url);
|
|
2350
|
+
}
|
|
2351
|
+
const imports = __wbg_get_imports();
|
|
2352
|
+
|
|
2353
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
2354
|
+
module_or_path = fetch(module_or_path);
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
__wbg_init_memory(imports);
|
|
2358
|
+
|
|
2359
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
2360
|
+
|
|
2361
|
+
return __wbg_finalize_init(instance, module);
|
|
2362
|
+
}
|
|
2363
|
+
|
|
2364
|
+
export { initSync };
|
|
2365
|
+
export default __wbg_init;
|