chat / client / externs.js
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
 * @fileoverview Externs for the :app build under :optimizations :advanced.
 * @externs
 *
 * WHAT IS ACTUALLY AT RISK HERE — and it is the opposite of what you would guess.
 *
 * Closure's advanced mode never renames a string-keyed property access:
 * `(unchecked-get o "ts")` and `(unchecked-set o "ts" v)` emit `o["ts"]`, which
 * is the standard escape hatch. This tree reaches nearly everything that way —
 * ~1100 unchecked-get sites, ~470 unchecked-set — and ardegazu.rooms.js/ordered
 * builds every wire object with sequential unchecked-set calls (`#js {}` is
 * forbidden outright, for key-order reasons). So the whole "untyped ESM
 * interop" surface — libp2p, helia, @orbitdb/core, the two kit dists — is
 * renaming-IMMUNE, and needs no externs at all. Not one name below is a foreign
 * library's.
 *
 * The names below are OURS — ours meaning this app's :app build, whether the
 * definition sits in this repo (lib/media.cljs) or in ardegazu-rooms-kit's
 * sources on our classpath (lib/net.cljs, lib/log.cljs; see client/deps.edn).
 * All three install their prototype methods string-keyed —
 *   (unchecked-set proto "handleFrames" (fn …))
 * — which is likewise never renamed. But the CALL sites are dot-access:
 *   (.handleFrames ^js (unchecked-get opts "net") …)
 * and there the ^js hint sits on a macro form, so shadow's externs inference
 * loses it (dev/docs/CLJS.md) and emits :infer-warning. Advanced then renames
 * the CALL but not the DEFINITION, and the two halves stop meeting: the first
 * :advanced build died at room boot with `a.net.gi is not a function`.
 *
 * So this file is exactly the 21 distinct names from the build's own
 * :infer-warning list — every one an app method whose definition side is a
 * string key. Any dot-access shadow CAN infer (a real ^js binding) is already
 * added to the generated externs and must not be repeated here.
 *
 * MAINTENANCE RULE: the warning list is the source of this file. If a build
 * emits an :infer-warning for a name that is not here, add it — or move the
 * definition to dot-access so inference can do its job. Do not "fix" a warning
 * by moving the hint onto the call; that suppresses inference silently.
 */

var SuetaAppExterns;

/* rooms-kit lib/net.cljs — Net.prototype */
SuetaAppExterns.handleFrames;
SuetaAppExterns.sendTo;
SuetaAppExterns.dropPeer;

/* rooms-kit lib/log.cljs — RoomLog.prototype */
SuetaAppExterns.decodeSealedEntry;
SuetaAppExterns.sealedEntryBytes;
SuetaAppExterns.hasEntry;
SuetaAppExterns.entryMeta;
SuetaAppExterns.ingestEntry;
SuetaAppExterns.emitUnseen;
SuetaAppExterns.myIdentityBlock;
SuetaAppExterns.putEntryBlock;
SuetaAppExterns.putIdentityBlock;
SuetaAppExterns.putRawBlock;
SuetaAppExterns.rawBlock;
SuetaAppExterns.putImage;
SuetaAppExterns.getImage;
SuetaAppExterns.pruneImages;
SuetaAppExterns.pinImageIfLocal;
SuetaAppExterns.imageDagBlocks;

/* lib/media.cljs — MediaManager.prototype */
SuetaAppExterns.attachMedia;
SuetaAppExterns.detachAllMedia;

static mirror of HEAD · about · clone: git clone https://git.ardegazu.ro/chat.git