@candypoets/nipworker 0.92.0 → 0.93.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.
@@ -9,18 +9,22 @@ export declare class VideoData implements flatbuffers.IUnpackableObject<VideoDat
9
9
  url(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
10
10
  thumbnail(): string | null;
11
11
  thumbnail(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
12
+ dim(): string | null;
13
+ dim(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
12
14
  static startVideoData(builder: flatbuffers.Builder): void;
13
15
  static addUrl(builder: flatbuffers.Builder, urlOffset: flatbuffers.Offset): void;
14
16
  static addThumbnail(builder: flatbuffers.Builder, thumbnailOffset: flatbuffers.Offset): void;
17
+ static addDim(builder: flatbuffers.Builder, dimOffset: flatbuffers.Offset): void;
15
18
  static endVideoData(builder: flatbuffers.Builder): flatbuffers.Offset;
16
- static createVideoData(builder: flatbuffers.Builder, urlOffset: flatbuffers.Offset, thumbnailOffset: flatbuffers.Offset): flatbuffers.Offset;
19
+ static createVideoData(builder: flatbuffers.Builder, urlOffset: flatbuffers.Offset, thumbnailOffset: flatbuffers.Offset, dimOffset: flatbuffers.Offset): flatbuffers.Offset;
17
20
  unpack(): VideoDataT;
18
21
  unpackTo(_o: VideoDataT): void;
19
22
  }
20
23
  export declare class VideoDataT implements flatbuffers.IGeneratedObject {
21
24
  url: string | Uint8Array | null;
22
25
  thumbnail: string | Uint8Array | null;
23
- constructor(url?: string | Uint8Array | null, thumbnail?: string | Uint8Array | null);
26
+ dim: string | Uint8Array | null;
27
+ constructor(url?: string | Uint8Array | null, thumbnail?: string | Uint8Array | null, dim?: string | Uint8Array | null);
24
28
  pack(builder: flatbuffers.Builder): flatbuffers.Offset;
25
29
  }
26
30
  //# sourceMappingURL=video-data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"video-data.d.ts","sourceRoot":"","sources":["../../../../src/gener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AO,GAAG,WAAW,CAAC,MAAM;CAWpD"}
package/dist/hooks.d.ts CHANGED
@@ -13,6 +13,7 @@ export declare function useSubscription(subId: string, requests: RequestObject[]
13
13
  export declare function usePublish(pubId: string, event: EventTemplate, callback?: (message: WorkerMessage) => void, options?: {
14
14
  trackStatus?: boolean;
15
15
  defaultRelays?: string[];
16
+ subId?: string | string[];
16
17
  }): () => void;
17
18
  export declare function useSignEvent(template: EventTemplate, callback: (event: Event) => void): void;
18
19
  //# sourceMappingURL=hooks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAc,KAAK,kBAAkB,EAAE,MAAM,GAAG,CAAC;AAEvE,OAAO,EACN,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,MAAM,EACN,aAAa,EACb,YAAY,EACZ,MAAM,mBAAmB,CAAC;AAG3B,MAAM,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;AAE5F;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,aAAa,cA4BrD;AAED,wBAAgB,eAAe,CAC9B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,aAAa,EAAE,EACzB,QAAQ,GAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAe,EACrD,OAAO,GAAE,kBAA2C,GAClD,MAAM,IAAI,CAqEZ;AAED,wBAAgB,UAAU,CACzB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,aAAa,EACpB,QAAQ,GAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAe,EACrD,OAAO,GAAE;IAAE,WAAW,CAAC,E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8CZ;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,QAIrF"}
package/dist/hooks.js CHANGED
@@ -1,94 +1,94 @@
1
- import { g as t, A as E } from "./index2.js";
2
- import { e as M, d as k, b as w, c as N, a as $, i as q } from "./NarrowTypes.js";
1
+ import { g as r, A as E } from "./index2.js";
2
+ import { e as M, d as k, b as w, c as A, a as N, i as $ } from "./NarrowTypes.js";
3
3
  function S(e) {
4
4
  let n = false;
5
- const v = t().getRelayStatuses();
6
- for (const [s, { status: r }] of v)
7
- e(r, s);
8
- const a = (s) => {
5
+ const f = r().getRelayStatuses();
6
+ for (const [s, { status: a }] of f)
7
+ e(a, s);
8
+ const t = (s) => {
9
9
  if (n) return;
10
- const r = s, { status: u, url: l } = r.detail;
11
- e(u, l);
10
+ const a = s, { status: u, url: c } = a.detail;
11
+ e(u, c);
12
12
  };
13
- return t().addEventListener("relay:status", a), () => {
14
- n = true, t().removeEventListener("relay:status", a);
13
+ return r().addEventListener("relay:status", t), () => {
14
+ n = true, r().removeEventListener("relay:status", t);
15
15
  };
16
16
  }
17
- function p(e, n, v = () => {
18
- }, a = { closeOnEose: false }) {
17
+ function y(e, n, f = () => {
18
+ }, t = { closeOnEose: false }) {
19
19
  if (!e)
20
20
  return () => {
21
21
  };
22
- let s = null, r = 4, u = true, l = false, o = false;
23
- e = t().createShortId(e);
24
- let i = false, c = false;
25
- const h = () => {
22
+ let s = null, a = 4, u = true, c = false, d = false;
23
+ e = r().createShortId(e);
24
+ let l = false, i = false;
25
+ const v = () => {
26
26
  if (!u || !s) {
27
- c = false;
27
+ i = false;
28
28
  return;
29
29
  }
30
- if (!c) {
31
- c = true;
30
+ if (!i) {
31
+ i = true;
32
32
  try {
33
- let f = E.readMessages(s, r);
34
- for (; f.hasNewData && s; ) {
35
- for (const b of f.messages)
36
- v(b);
37
- r = f.newReadPosition, f = E.readMessages(s, r);
33
+ let o = E.readMessages(s, a);
34
+ for (; o.hasNewData && s; ) {
35
+ for (const g of o.messages)
36
+ f(g);
37
+ a = o.newReadPosition, o = E.readMessages(s, a);
38
38
  }
39
- } catch (f) {
40
- console.error("[useSubscription processEvents] error:", f);
39
+ } catch (o) {
40
+ console.error("[useSubscription processEvents] error:", o);
41
41
  } finally {
42
- c = false;
42
+ i = false;
43
43
  }
44
44
  }
45
- }, d = () => {
46
- u && (i || (i = true, queueMicrotask(() => {
47
- i = false, h();
45
+ }, b = () => {
46
+ u && (l || (l = true, queueMicrotask(() => {
47
+ l = false, v();
48
48
  })));
49
- }, g = () => {
50
- l || (u = false, o && (t().removeEventListener(`subscription:${e}`, d), t().unsubscribe(e), l = true), Promise.resolve().then(() => {
51
- s = null, r = 4;
49
+ }, h = () => {
50
+ c || (u = false, d && (r().removeEventListener(`subscription:${e}`, b), r().unsubscribe(e), c = true), Promise.resolve().then(() => {
51
+ s = null, a = 4;
52
52
  }));
53
53
  };
54
- return s = t().subscribe(e, n, a), o = true, t().addEventListener(`subscription:${e}`, d), d(), g;
54
+ return s = r().subscribe(e, n, t), d = true, r().addEventListener(`subscription:${e}`, b), b(), h;
55
55
  }
56
- function y(e, n, v = () => {
57
- }, a = {
56
+ function P(e, n, f = () => {
57
+ }, t = {
58
58
  trackStatus: true,
59
59
  defaultRelays: []
60
60
  }) {
61
61
  if (!e)
62
62
  return () => {
63
63
  };
64
- a = { trackStatus: true, ...a };
65
- let s = null, r = 4, u = true;
64
+ t = { trackStatus: true, ...t };
65
+ let s = null, a = 4, u = true;
66
+ const c = () => {
67
+ u = false, r().removeEventListener(`publish:${e}`, l);
68
+ }, d = t.subId ? Array.isArray(t.subId) ? t.subId : [t.subId] : void 0;
69
+ s = r().publish(e, n, t.defaultRelays, d);
66
70
  const l = () => {
67
- u = false, t().removeEventListener(`publish:${e}`, o);
68
- };
69
- s = t().publish(e, n, a.defaultRelays);
70
- const o = () => {
71
71
  if (!u || !s)
72
72
  return;
73
- const i = E.readMessages(s, r);
74
- i.hasNewData && (i.messages.forEach((c) => {
75
- v(c);
76
- }), r = i.newReadPosition);
73
+ const i = E.readMessages(s, a);
74
+ i.hasNewData && (i.messages.forEach((v) => {
75
+ f(v);
76
+ }), a = i.newReadPosition);
77
77
  };
78
- return a.trackStatus && (t().addEventListener(`publish:${e}`, o), queueMicrotask(o)), l;
78
+ return t.trackStatus && (r().addEventListener(`publish:${e}`, l), queueMicrotask(l)), c;
79
79
  }
80
- function P(e, n) {
81
- t().signEvent(e, n);
80
+ function R(e, n) {
81
+ r().signEvent(e, n);
82
82
  }
83
83
  export {
84
84
  M as asNostrEvent,
85
85
  k as asParsedEvent,
86
86
  w as isConnectionStatus,
87
- N as isEoce,
88
- $ as isNostrEvent,
89
- q as isParsedEvent,
90
- y as usePublish,
87
+ A as isEoce,
88
+ N as isNostrEvent,
89
+ $ as isParsedEvent,
90
+ P as usePublish,
91
91
  S as useRelayStatus,
92
- P as useSignEvent,
93
- p as useSubscription
92
+ R as useSignEvent,
93
+ y as useSubscription
94
94
  };