import { MutableSequenceOrArrayLike } from './sequence'; /** * Move an element in a sequence from one index to another. * * @param object - The sequence or array-like object to mutate. * * @param fromIndex - The index of the element to move. * * @param toIndex - The target index of the element. * * #### Complexity * Linear. * * #### Undefined Behavior * A `fromIndex` which is non-integral or out of range. * * A `toIndex` which is non-integral or out of range. * * #### Example * ```typescript * import { move } from 'phosphor/lib/algorithm/mutation'; * * let data = [0, 1, 2, 3, 4]; * move(data, 1, 2); // [0, 2, 1, 3, 4] * move(data, 4, 2); // [0, 2, 4, 1, 3] * ``` */ export declare function move(object: MutableSequenceOrArrayLike, fromIndex: number, toIndex: number): void; /** * Reverse a sequence in-place subject to an optional range. * * @param object - The sequence or array-like object to mutate. * * @param first - The index of the first element of the range. This * should be `<=` the `last` index. The default is `0`. * * @param last - The index of the last element of the range. This * should be `>=` the `first` index. The default is `length - 1`. * * #### Complexity * Linear. * * #### Undefined Behavior * A `first` index which is non-integral or out of range. * * A `last` index which is non-integral or out of range. * * #### Example * ```typescript * import { reverse } from 'phosphor/lib/algorithm/mutation'; * * let data = [0, 1, 2, 3, 4]; * reverse(data, 1, 3); // [0, 3, 2, 1, 4] * reverse(data, 3); // [0, 3, 2, 4, 1] * reverse(data); // [1, 4, 2, 3, 0] * ``` */ export declare function reverse(object: MutableSequenceOrArrayLike, first?: number, last?: number): void; /** * Rotate the elements of a sequence by a positive or negative amount. * * @param object - The sequence or array-like object to mutate. * * @param delta - The amount of rotation to apply to the elements. A * positive value will rotate the elements to the left. A negative * value will rotate the elements to the right. * * #### Complexity * Linear. * * #### Undefined Behavior * A `delta` amount which is non-integral. * * #### Example * ```typescript * import { rotate } from 'phosphor/lib/algorithm/mutation'; * * let data = [0, 1, 2, 3, 4]; * rotate(data, 2); // [2, 3, 4, 0, 1] * rotate(data, -2); // [0, 1, 2, 3, 4] * rotate(data, 10); // [0, 1, 2, 3, 4] * rotate(data, 9); // [4, 0, 1, 2, 3] * ``` */ export declare function rotate(object: MutableSequenceOrArrayLike, delta: number): void;