MCPcopy
hub / github.com/slab/quill / lines

Method lines

packages/quill/src/blots/scroll.ts:234–257  ·  view source on GitHub ↗
(index = 0, length = Number.MAX_VALUE)

Source from the content-addressed store, hash-verified

232 }
233
234 lines(index = 0, length = Number.MAX_VALUE): (Block | BlockEmbed)[] {
235 const getLines = (
236 blot: ParentBlot,
237 blotIndex: number,
238 blotLength: number,
239 ) => {
240 let lines: (Block | BlockEmbed)[] = [];
241 let lengthLeft = blotLength;
242 blot.children.forEachAt(
243 blotIndex,
244 blotLength,
245 (child, childIndex, childLength) => {
246 if (isLine(child)) {
247 lines.push(child);
248 } else if (child instanceof ContainerBlot) {
249 lines = lines.concat(getLines(child, childIndex, lengthLeft));
250 }
251 lengthLeft -= childLength;
252 },
253 );
254 return lines;
255 };
256 return getLines(this, index, length);
257 }
258
259 optimize(context?: { [key: string]: any }): void;
260 optimize(

Callers 4

getLinesMethod · 0.80
formatLineMethod · 0.80
getDeltaMethod · 0.80
getFormatMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected