MCPcopy
hub / github.com/codedogQBY/ReadAny / add

Method add

packages/foliate-js/overlayer.js:24–31  ·  view source on GitHub ↗
(key, range, draw, options)

Source from the content-addressed store, hash-verified

22 return this.#svg;
23 }
24 add(key, range, draw, options) {
25 if (this.#map.has(key)) this.remove(key);
26 const resolvedRange = typeof range === "function" ? range(this.#svg.getRootNode()) : range;
27 const rects = resolvedRange.getClientRects();
28 const element = draw(rects, options);
29 this.#content.append(element);
30 this.#map.set(key, { range: resolvedRange, draw, options, element, rects });
31 }
32 remove(key) {
33 if (!this.#map.has(key)) return;
34 this.#map.get(key).element.remove();

Callers 15

computeTagsFunction · 0.80
_addFetchedChunkMethod · 0.80
_addFetchedChunkMethod · 0.80
StatsScreenFunction · 0.80
LibraryScreenFunction · 0.80
useReaderTTSFunction · 0.80
onMethod · 0.80
createEpubMethod · 0.80
decompressContentFunction · 0.80
splitEditableListFunction · 0.80

Calls 2

removeMethod · 0.95
appendMethod · 0.65

Tested by

no test coverage detected