declare module "rope-sequence" { export default class RopeSequence { public readonly length: number; // Append an array or other rope to this one, returning a new rope. public append(other: ReadonlyArray | RopeSequence): RopeSequence; // Prepend an array or other rope to this one, returning a new rope. public prepend(other: ReadonlyArray | RopeSequence): RopeSequence; // Create a rope repesenting a sub-sequence of this rope. public slice(from?: number = 0, to?: number): RopeSequence; // Retrieve the element at the given position from this rope. public get(i: number): T; // Call the given function for each element between the given // indices. This tends to be more efficient than looping over the // indices and calling `get`, because it doesn't have to descend the // tree for every element. public forEach(f: (element: T, index: number) => boolean | undefined, from?: number, to?: number): void; // Map the given functions over the elements of the rope, producing // a flat array. public map(f: (element: T, index: number) => U, from?: number, to?: number): Array; // Create a rope representing the given array, or return the rope // itself if a rope was given. static from(values: ReadonlyArray | RopeSequence): RopeSequence; // Return the content of this rope as an array. public flatten(): Array; public static empty: RopeSequence; } }