UNPKG

848 BTypeScriptView Raw
1/**
2 * 复制数组的一部分到同一数组中的另一个位置,数组大小不变
3 * @param array 数组
4 * @param target 从该位置开始替换数据
5 */
6export declare function copyWithin<T>(array: T[], target: number): T[];
7
8/**
9 * 复制数组的一部分到同一数组中的另一个位置,数组大小不变
10 * @param array 数组
11 * @param target 从该位置开始替换数据
12 * @param start 从该位置开始读取数据,默认为 0 。如果为负值,表示倒数
13 * @param end 到该位置前停止读取数据,默认等于数组长度。如果为负值,表示倒数
14 */
15export declare function copyWithin<T>(array: T[], target: number, start: Number, end?: number): T[];
16
17declare module './ctor' {
18 interface XEUtilsMethods {
19 copyWithin: typeof copyWithin;
20 }
21}
22
23export default copyWithin