Typescript.中文.接口声明.lib.es5.d.ts


jcLee95 的个人博客
邮箱 :291148484@163.com
CSDN 主页https://blog.csdn.net/qq_28550263?spm=1001.2101.3001.5343
本文地址https://blog.csdn.net/qq_28550263/article/details/127150519

如果你希望 VSCode 在对JavaScript 的注释中显示为中文的,可以在 VS Code 安装目录下。 resources\app\extension\node_modules\typescript\lib中的声明文件替换成中文。

比如,我的文件位置为:

C:\Users\a2911\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\lib.es5.d.ts

file: lib.es5.d.ts

/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.Translated into Chinese by Jack Lee
Email: 291148484@163.com
***************************************************************************** *//// <reference no-default-lib="true"/>/
/// ECMAScript APIs
/declare var NaN: number;
declare var Infinity: number;/*** 评估 JavaScript 代码并执行它。* @param x 包含有效 JavaScript 代码的字符串值。*/
declare function eval(x: string): any;/*** 将字符串转换为一个 整数.* @param string 要转换为数字的字符串。* @param radix 一个介于2和36之间的值,指定 `string` 中数字的基数。* 如果未提供此参数,前缀为 '0x' 的字符串将被视为十六进制。* 所有其他字符串都被视为十进制。*/
declare function parseInt(string: string, radix?: number): number;/*** 将字符串转换为一个 浮点数.* @param string 包含一个 浮点数 的字符串.*/
declare function parseFloat(string: string): number;/*** 返回一个布尔值,该值指示某个值是否为保留值 NaN(非数字).* @param number 一个数值。*/
declare function isNaN(number: number): boolean;/*** 确定提供的数字是否是有限的。* @param number 任何数值。*/
declare function isFinite(number: number): boolean;/*** 获取编码的统一资源标识符 (URI) 的未编码版本。* @param encodedURI 表示编码 URI 的值。*/
declare function decodeURI(encodedURI: string): string;/*** 获取统一资源标识符 (URI) 的编码部分的未编码版本。* @param encodedURIComponent 表示编码的URI分量的值。*/
declare function decodeURIComponent(encodedURIComponent: string): string;/*** 将文本字符串编码为有效的统一资源标识符 (URI)* @param uri 表示未编码 URI 的值。*/
declare function encodeURI(uri: string): string;/*** 将文本字符串编码为统一资源标识符 (URI) 的有效组成部分。* @param uriComponent 表示未编码的 URI 组件的值。*/
declare function encodeURIComponent(uriComponent: string | number | boolean): string;/*** 计算一个新字符串,其中的某些字符已被十六进制转义序列替换。* @deprecated 浏览器兼容性的传统功能* @param string 字符串值*/
declare function escape(string: string): string;/*** 计算一个新字符串,其中十六进制转义序列被它所表示的字符替换。* @deprecated 浏览器兼容性的传统功能* @param string 字符串值*/
declare function unescape(string: string): string;interface Symbol {/** 返回对象的字符串表示形式。 */toString(): string;/** 返回指定对象的原始值。 */valueOf(): symbol;
}declare type PropertyKey = string | number | symbol;interface PropertyDescriptor {configurable?: boolean;enumerable?: boolean;value?: any;writable?: boolean;get?(): any;set?(v: any): void;
}interface PropertyDescriptorMap {[key: PropertyKey]: PropertyDescriptor;
}interface Object {/** Object.prototype.constructor 的初始值是标准的内置对象构造函数。 */constructor: Function;/** 返回对象的字符串表示形式。 */toString(): string;/** 返回使用当前区域设置转换为字符串的日期。 */toLocaleString(): string;/** 返回指定对象的原始值。 */valueOf(): Object;/*** 确定对象是否具有指定名称的属性。* @param v 属性名。*/hasOwnProperty(v: PropertyKey): boolean;/*** 确定一个对象是否存在于另一个对象的原型链中。* @param v 要检查其原型链的另一个对象。*/isPrototypeOf(v: Object): boolean;/*** 确定指定的属性是否可枚举。* @param v 属性名。*/propertyIsEnumerable(v: PropertyKey): boolean;
}interface ObjectConstructor {new(value?: any): Object;(): any;(value: any): any;/** 对一类对象的原型的引用。 */readonly prototype: Object;/*** 返回对象的原型。* @param o 引用原型的对象。*/getPrototypeOf(o: any): any;/*** 获取指定对象的自身属性描述符。* 自己的属性描述符是直接在对象上定义的,而不是从对象的原型继承的。* @param o 包含该属性的对象。* @param p 属性的名称。*/getOwnPropertyDescriptor(o: any, p: PropertyKey): PropertyDescriptor | undefined;/*** 返回对象自身属性的名称。* 对象的自身属性是那些直接在该对象上定义的属性,而不是从对象的原型继承的属性。* 对象的属性包括字段(对象)和函数。* @param o 对象,包含自己的属性。*/getOwnPropertyNames(o: any): string[];/*** Creates an object that has the specified prototype or that has null prototype.* @param o 用作原型的对象。可能为 null.*/create(o: object | null): any;/*** 创建一个对象,该对象具有指定的原型,并且可以选择包含指定的属性。* @param o 用作原型的对象。可能为 null* @param properties 包含一个或多个属性描述符的JavaScript对象。*/create(o: object | null, properties: PropertyDescriptorMap & ThisType<any>): any;/*** 向对象添加特性,或修改现有特性的属性。* @param o 要在其上添加或修改属性的对象。这可以是本地JavaScript对象(即用户定义的对象或内置对象)或DOM对象。* @param p 属性名。* @param attributes 属性的描述符。它可以用于数据属性或访问者属性。*/defineProperty<T>(o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType<any>): T;/*** 向对象添加一个或多个属性,和/或 修改现有属性的属性。* @param o 要在其上添加或修改属性的对象。这可以是本地JavaScript对象或DOM对象。* @param properties 包含一个或多个描述符对象的JavaScript对象。每个描述符对象描述一个数据属性或一个访问器属性。*/defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T;/*** 防止修改现有属性的属性,并防止添加新属性。* @param o 要锁定其属性的对象。*/seal<T>(o: T): T;/*** 防止修改现有属性特性和值,并防止添加新属性。* @param a 要锁定其属性的对象。*/freeze<T>(a: T[]): readonly T[];/*** 防止修改现有属性特性和值,并防止添加新属性。* @param f 要锁定其属性的对象。*/freeze<T extends Function>(f: T): T;/*** 防止修改现有属性特性和值,并防止添加新属性。* @param o 要锁定其属性的对象。*/freeze<T extends {[idx: string]: U | null | undefined | object}, U extends string | bigint | number | boolean | symbol>(o: T): Readonly<T>;/*** 防止修改现有属性特性和值,并防止添加新属性。* @param o 要锁定其属性的对象。*/freeze<T>(o: T): Readonly<T>;/*** 防止向对象添加新属性。* @param o 要使其不可扩展的对象。*/preventExtensions<T>(o: T): T;/*** 如果不能在对象中修改现有的属性特性,并且不能向对象中添加新的属性,则返回 true。* @param o 要测试的对象。*/isSealed(o: any): boolean;/*** 如果不能修改对象中的现有属性特性和值,并且不能向对象添加新属性,则返回 true。* @param o 要测试的对象。*/isFrozen(o: any): boolean;/*** 返回一个值,该值指示是否可以向对象添加新属性。* @param o 要测试的对象。*/isExtensible(o: any): boolean;/*** 返回对象的可枚举字符串属性和方法的名称。* @param o 包含属性和方法的对象。这可以是您创建的对象,也可以是现有的文档对象模型(DOM)对象。*/keys(o: object): string[];
}/*** 提供所有 JavaScript 对象共有的功能。*/
declare var Object: ObjectConstructor;/*** 创建一个新函数。*/
interface Function {/*** 调用函数,用指定的对象替换函数的this值,用指定的数组替换函数的参数。* @param thisArg 要用作此对象的对象。* @param argArray 要传递给函数的一组参数。*/apply(this: Function, thisArg: any, argArray?: any): any;/*** 调用对象的方法,用另一个对象替换当前对象。* @param thisArg 要用作当前对象的对象。* @param argArray 要传递给方法的参数列表。*/call(this: Function, thisArg: any, ...argArray: any[]): any;/*** 对于给定的函数,创建一个与原始函数具有相同体的绑定函数。* 绑定函数的this对象与指定的对象相关联,并具有指定的初始参数。* @param thisArg this 关键字可以在新函数中引用的对象。* @param argArray 要传递给新函数的参数列表。*/bind(this: Function, thisArg: any, ...argArray: any[]): any;/** 返回函数的字符串表示形式。 */toString(): string;prototype: any;readonly length: number;// 非标准扩展arguments: any;caller: Function;
}interface FunctionConstructor {/*** 创建一个新函数。* @param args 函数接受的参数列表。*/new(...args: string[]): Function;(...args: string[]): Function;readonly prototype: Function;
}declare var Function: FunctionConstructor;/*** 提取函数类型的“this”参数的类型,如果函数类型没有 `this` 参数,则为 `unknown`。*/
type ThisParameterType<T> = T extends (this: infer U, ...args: never) => any ? U : unknown;/*** 从函数类型中移除 `this` 参数。*/
type OmitThisParameter<T> = unknown extends ThisParameterType<T> ? T : T extends (...args: infer A) => infer R ? (...args: A) => R : T;interface CallableFunction extends Function {/*** 调用函数,将指定的对象作为此值,将指定数组的元素作为参数。* @param thisArg 要用作此对象的对象。* @param args An array of 要传递给函数的参数值。*/apply<T, R>(this: (this: T) => R, thisArg: T): R;apply<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R;/*** 调用函数,将指定的对象作为this值,将指定的rest参数作为参数。* @param thisArg 要用作此对象的对象。* @param args 要传递给函数的参数值。*/call<T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R;/*** 对于给定的函数,创建一个与原始函数具有相同体的绑定函数。* 绑定函数的this对象与指定的对象相关联,并具有指定的初始参数。* @param thisArg 要用作此对象的对象。* @param args 要绑定到函数参数的参数。*/bind<T>(this: T, thisArg: ThisParameterType<T>): OmitThisParameter<T>;bind<T, A0, A extends any[], R>(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R;bind<T, A0, A1, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R;bind<T, A0, A1, A2, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R;bind<T, A0, A1, A2, A3, A extends any[], R>(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R;bind<T, AX, R>(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R;
}interface NewableFunction extends Function {/*** 调用函数,将指定的对象作为此值,将指定数组的元素作为参数。* @param thisArg 要用作此对象的对象。* @param args An array of 要传递给函数的参数值。*/apply<T>(this: new () => T, thisArg: T): void;apply<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, args: A): void;/*** 调用函数,将指定的对象作为this值,将指定的rest参数作为参数。* @param thisArg 要用作此对象的对象。* @param args 要传递给函数的参数值。*/call<T, A extends any[]>(this: new (...args: A) => T, thisArg: T, ...args: A): void;/*** 对于给定的函数,创建一个与原始函数具有相同体的绑定函数。* 绑定函数的this对象与指定的对象相关联,并具有指定的初始参数。* @param thisArg 要用作此对象的对象。* @param args 要绑定到函数参数的参数。*/bind<T>(this: T, thisArg: any): T;bind<A0, A extends any[], R>(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R;bind<A0, A1, A extends any[], R>(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R;bind<A0, A1, A2, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R;bind<A0, A1, A2, A3, A extends any[], R>(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R;bind<AX, R>(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R;
}interface IArguments {[index: number]: any;length: number;callee: Function;
}interface String {/** 返回字符串的字符串表示形式。 */toString(): string;/*** 返回指定索引处的字符。* @param pos 所需字符的从零开始的索引。*/charAt(pos: number): string;/*** 返回指定位置的字符的Unicode值。* @param index 所需字符的从零开始的索引。 如果在指定的索引处没有字符,则返回NaN。*/charCodeAt(index: number): number;/*** 返回包含两个或更多字符串串联的字符串。* @param strings 要追加到字符串末尾的字符串。*/concat(...strings: string[]): string;/*** 返回子字符串第一次出现的位置。* @param searchString 要在字符串中搜索的子字符串* @param position 开始搜索String对象的索引。如果省略,则从字符串的开头开始搜索。*/indexOf(searchString: string, position?: number): number;/*** 返回子字符串在字符串中的最后一个匹配项。* @param searchString 要搜索的子字符串。* @param position 开始搜索的索引。如果省略,则从字符串末尾开始搜索。*/lastIndexOf(searchString: string, position?: number): number;/*** 确定两个字符串在当前区域设置中是否等效。* @param that 要与目标字符串进行比较的字符串*/localeCompare(that: string): number;/*** 用正则表达式匹配字符串,并返回包含搜索结果的数组。* @param regexp 包含正则表达式模式和标志的变量名或字符串文字。*/match(regexp: string | RegExp): RegExpMatchArray | null;/*** 使用正则表达式或搜索字符串替换字符串中的文本。* @param searchValue 要搜索的字符串。* @param replaceValue 一个字符串,包含在此字符串中每次成功匹配searchValue时要替换的文本。*/replace(searchValue: string | RegExp, replaceValue: string): string;/*** 使用正则表达式或搜索字符串替换字符串中的文本。* @param searchValue 要搜索的字符串。* @param replacer 返回替换文本的函数。*/replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;/*** 在正则表达式搜索中查找第一个匹配的子字符串。* @param regexp 正则表达式模式和适用的标志。*/search(regexp: string | RegExp): number;/*** 返回字符串的一部分。* @param start stringObj的指定部分的开头的索引。* @param end stringObj指定部分结尾的索引。子字符串包括字符,但不包括end指示的字符。* 如果未指定该值,子字符串将继续到stringObj的末尾。*/slice(start?: number, end?: number): string;/*** 使用指定的分隔符将字符串拆分成子字符串,并将它们作为数组返回。* @param separator 标识用于分隔字符串的一个或多个字符的字符串。如果省略,则返回包含整个字符串的单元素数组。* @param limit 用于限制数组中返回的元素数量的值。*/split(separator: string | RegExp, limit?: number): string[];/*** 返回string对象中指定位置的子字符串。* @param start 从零开始的索引号,指示子字符串的开头。* @param end 从零开始的索引号,指示子字符串的结尾。子字符串包括字符,但不包括end指示的字符。* 如果省略end,则返回从原始字符串的开头到结尾的字符。*/substring(start: number, end?: number): string;/** 将字符串中的所有字母字符转换为小写。 */toLowerCase(): string;/** 考虑到宿主环境的当前区域设置,将所有字母字符转换为小写。 */toLocaleLowerCase(locales?: string | string[]): string;/** 将字符串中的所有字母字符转换为大写。 */toUpperCase(): string;/** 根据宿主环境的当前区域设置,返回一个字符串,其中所有字母字符都已转换为大写。 */toLocaleUpperCase(locales?: string | string[]): string;/** 从字符串中移除前导空格和尾随空格以及行终止符。 */trim(): string;/** 返回字符串对象的长度。 */readonly length: number;// IE扩展/*** 获取从指定位置开始并具有指定长度的子字符串。* @deprecated 浏览器兼容性的传统功能* @param from 所需子字符串的起始位置。字符串中第一个字符的索引为零。* @param length 返回的子字符串中包含的字符数。*/substr(from: number, length?: number): string;/** 返回指定对象的原始值。 */valueOf(): string;readonly [index: number]: string;
}interface StringConstructor {new(value?: any): String;(value?: any): string;readonly prototype: String;fromCharCode(...codes: number[]): string;
}/*** 允许操作和格式化文本字符串以及确定和定位字符串中的子字符串。*/
declare var String: StringConstructor;interface Boolean {/** 返回指定对象的原始值。 */valueOf(): boolean;
}interface BooleanConstructor {new(value?: any): Boolean;<T>(value?: T): boolean;readonly prototype: Boolean;
}declare var Boolean: BooleanConstructor;interface Number {/*** 返回对象的字符串表示形式。* @param radix 指定用于将数值转换为字符串的基数。该值仅用于数字。*/toString(radix?: number): string;/*** 返回一个以定点表示法表示数字的字符串。* @param fractionDigits 小数点后的位数。必须在0 - 20的范围内,包括0和20。*/toFixed(fractionDigits?: number): string;/*** 返回一个字符串,其中包含用指数表示的数字。* @param fractionDigits 小数点后的位数。必须在0 - 20的范围内,包括0和20。*/toExponential(fractionDigits?: number): string;/*** 返回一个字符串,该字符串包含用指定位数的指数或定点表示法表示的数字。* @param precision 有效位数。必须在1 - 21的范围内,包括1和21。*/toPrecision(precision?: number): string;/** 返回指定对象的原始值。 */valueOf(): number;
}interface NumberConstructor {new(value?: any): Number;(value?: any): number;readonly prototype: Number;/** JavaScript 中可以表示的最大数字。大约等于1.79E+308。 */readonly MAX_VALUE: number;/** JavaScript 中可以表示的最接近零的数字。大约等于5.00E-324。 */readonly MIN_VALUE: number;/*** 不是数字的值。* 在相等比较中,NaN不等于任何值,包括它本身。若要测试某个值是否等效于NaN,请使用isNaN函数。*/readonly NaN: number;/*** 小于 JavaScript 中可以表示的最大负数的值。* JavaScript 将 NEGATIVE_INFINITY 值显示为 -infinity。*/readonly NEGATIVE_INFINITY: number;/*** 大于 JavaScript 中可以表示的最大数字的值。JavaScript将 POSITIVE_INFINITY 显示为无穷大。*/readonly POSITIVE_INFINITY: number;
}/** 表示任何类型的数字的对象。所有的JavaScript数字都是64位的浮点数。 */
declare var Number: NumberConstructor;interface TemplateStringsArray extends ReadonlyArray<string> {readonly raw: readonly string[];
}/*** `import.meta` 的类型。** 如果你需要声明一个给定的属性存在于`import.meta`上,这个类型可以通过接口合并来扩充。*/
interface ImportMeta {}/*** `import()` 的可选第二个参数的类型。** 如果您的主机环境支持附加选项,则可以通过接口合并来增强此类型。*/
interface ImportCallOptions {assert?: ImportAssertions;
}/*** `import()` 的可选第二个参数的 `assert` 属性的类型。*/
interface ImportAssertions {[key: string]: string;
}interface Math {/** 数学常数e。这是欧拉数,自然对数的底。 */readonly E: number;/** 10的自然对数。 */readonly LN10: number;/** 2的自然对数。 */readonly LN2: number;/** e的以2为底的对数。 */readonly LOG2E: number;/** e的以10为底的对数。 */readonly LOG10E: number;/** Pi. 这是一个圆的周长与直径之比。 */readonly PI: number;/** 0.5的平方根,或者相当于1除以2的平方根。 */readonly SQRT1_2: number;/** 2的平方根。 */readonly SQRT2: number;/*** 返回一个数的绝对值(不考虑它是正还是负的值)。* 例如 -5 的绝对值与 5 的绝对值相同。* @param x 需要绝对值的数值表达式。*/abs(x: number): number;/*** 返回一个数的反余弦值。* @param x 数值表达式。*/acos(x: number): number;/*** 返回一个数字的反正弦值。* @param x 数值表达式。*/asin(x: number): number;/*** 返回一个数字的反正切值。* @param x 需要反正切值的数值表达式。*/atan(x: number): number;/*** 返回从X轴到某一点的角度(以弧度为单位)。* @param y 表示笛卡尔y坐标的数值表达式。* @param x 表示笛卡尔x坐标的数值表达式。*/atan2(y: number, x: number): number;/*** 返回大于或等于其数值参数的最小整数。* @param x 数值表达式。*/ceil(x: number): number;/*** 返回数字的余弦值。* @param x 包含以弧度度量的角度的数值表达式。*/cos(x: number): number;/*** 返回e(自然对数的底)的幂。* @param x 表示e的幂的数值表达式。*/exp(x: number): number;/*** 返回小于或等于其数值参数的最大整数。* @param x 数值表达式。*/floor(x: number): number;/*** 返回一个数的自然对数(以e为底)。* @param x 数值表达式。*/log(x: number): number;/*** 返回一组提供的数值表达式中较大的一个。* @param values 要计算的数值表达式。*/max(...values: number[]): number;/*** 返回一组提供的数值表达式中较小的一个。* @param values 要计算的数值表达式。*/min(...values: number[]): number;/*** 返回基表达式的指定幂的值。* @param x 表达式的基值。* @param y 表达式的指数值。*/pow(x: number, y: number): number;/** 返回一个介于0和1之间的伪随机数。 */random(): number;/*** 返回所提供的舍入到最接近整数的数值表达式。* @param x 要舍入到最接近的整数的值。*/round(x: number): number;/*** 返回一个数的正弦值。* @param x 包含以弧度度量的角度的数值表达式。*/sin(x: number): number;/*** 返回一个数的平方根。* @param x 数值表达式。*/sqrt(x: number): number;/*** 返回一个数字的正切值。* @param x 包含以弧度度量的角度的数值表达式。*/tan(x: number): number;
}
/** 提供基本数学功能和常数的内部对象。 */
declare var Math: Math;/** 支持日期和时间的基本存储和检索。 */
interface Date {/** 返回日期的字符串表示形式。字符串的格式取决于区域设置。 */toString(): string;/** Returns a date as 字符串值. */toDateString(): string;/** Returns a time as 字符串值. */toTimeString(): string;/** 返回值为适合宿主环境的当前区域设置的字符串值。 */toLocaleString(): string;/** 以字符串值形式返回日期适合宿主环境的当前区域设置。 */toLocaleDateString(): string;/** 以字符串值形式返回时间适合宿主环境的当前区域设置。 */toLocaleTimeString(): string;/** 返回自UTC 1970年1月1日午夜以来以毫秒为单位的存储时间值。 */valueOf(): number;/** 获取以毫秒为单位的时间值。 */getTime(): number;/** 使用本地时间获取年份。 */getFullYear(): number;/** 使用通用协调时间(UTC)获取年份。 */getUTCFullYear(): number;/** 使用本地时间获取月份。 */getMonth(): number;/** 使用通用协调时间(UTC)获取Date对象的月份。 */getUTCMonth(): number;/** 使用本地时间获取一个月中的某一天。 */getDate(): number;/** 使用通用协调时间(UTC)获取一个月中的某一天。 */getUTCDate(): number;/** 使用本地时间获取星期几。 */getDay(): number;/** 使用通用协调时间(UTC)获取星期几。 */getUTCDay(): number;/** 使用本地时间获取日期中的小时。 */getHours(): number;/** 使用通用协调时间(UTC)获取Date对象中的小时值。 */getUTCHours(): number;/** 使用本地时间获取Date对象的分钟数。 */getMinutes(): number;/** 使用通用协调时间(UTC)获取Date对象的分钟数。 */getUTCMinutes(): number;/** 使用本地时间获取Date对象的秒。 */getSeconds(): number;/** 使用通用协调时间(UTC)获取Date对象的秒。 */getUTCSeconds(): number;/** 使用本地时间获取日期的毫秒数。 */getMilliseconds(): number;/** 使用通用协调时间(UTC)获取Date对象的毫秒数。 */getUTCMilliseconds(): number;/** 获取本地计算机上的时间与通用协调时间(UTC)之间的时差(以分钟为单位)。 */getTimezoneOffset(): number;/*** 设置date对象中的日期和时间值。* @param time 一个数值,表示自1970年1月1日GMT午夜以来经过的毫秒数。*/setTime(time: number): number;/*** 使用本地时间设置Date对象中的毫秒值。* @param ms 一个等于毫秒值的数值。*/setMilliseconds(ms: number): number;/*** 使用通用协调时间(UTC)设置Date对象中的毫秒值。* @param ms 一个等于毫秒值的数值。*/setUTCMilliseconds(ms: number): number;/*** 使用本地时间设置Date对象中的秒值。* @param sec 一个等于秒值的数值。* @param ms 一个等于毫秒值的数值。*/setSeconds(sec: number, ms?: number): number;/*** 使用通用协调时间(UTC)设置Date对象中的秒值。* @param sec 一个等于秒值的数值。* @param ms 一个等于毫秒值的数值。*/setUTCSeconds(sec: number, ms?: number): number;/*** 使用本地时间设置Date对象中的分钟值。* @param min 等于分钟值的数值。* @param sec 一个等于秒值的数值。* @param ms 一个等于毫秒值的数值。*/setMinutes(min: number, sec?: number, ms?: number): number;/*** 使用通用协调时间(UTC)设置Date对象中的分钟值。* @param min 等于分钟值的数值。* @param sec 一个等于秒值的数值。* @param ms 一个等于毫秒值的数值。*/setUTCMinutes(min: number, sec?: number, ms?: number): number;/*** 使用本地时间设置Date对象中的小时值。* @param hours 等于小时值的数值。* @param min 等于分钟值的数值。* @param sec 一个等于秒值的数值。* @param ms 一个等于毫秒值的数值。*/setHours(hours: number, min?: number, sec?: number, ms?: number): number;/*** 使用通用协调时间(UTC)设置Date对象中的小时值。* @param hours 等于小时值的数值。* @param min 等于分钟值的数值。* @param sec 一个等于秒值的数值。* @param ms 一个等于毫秒值的数值。*/setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;/*** 使用本地时间设置Date对象的数值。* @param date 等于一个月中某一天的数值。*/setDate(date: number): number;/*** 使用通用协调时间(UTC)在Date对象中设置一个月中的第几天。* @param date 等于一个月中某一天的数值。*/setUTCDate(date: number): number;/*** 使用本地时间设置Date对象中的月值。* @param month 等于月份的数值。一月的值为0,其他月份的值紧随其后。* @param date 表示一个月中某一天的数值。如果未提供该值,则使用调用getDate方法得到的值。*/setMonth(month: number, date?: number): number;/*** 使用通用协调时间(UTC)设置Date对象中的月份值。* @param month 等于月份的数值。一月的值为0,其他月份的值紧随其后。* @param date 表示一个月中某一天的数值。如果未提供,则使用调用getUTCDate方法得到的值。*/setUTCMonth(month: number, date?: number): number;/*** 使用本地时间设置Date对象的年份。* @param year 年份的数值。* @param month 月份的从零开始的数值(0表示一月,11表示十二月)。如果指定了numDate,则必须指定。* @param date 一个等于一个月中某一天的数值。*/setFullYear(year: number, month?: number, date?: number): number;/*** 使用通用协调时间(UTC)设置Date对象中的年值。* @param year 等于年份的数值。* @param month 等于月份的数值。一月的值为0,其他月份的值紧随其后。 Must be supplied if numDate is supplied.* @param date 等于一个月中某一天的数值。*/setUTCFullYear(year: number, month?: number, date?: number): number;/** 返回使用通用协调时间(UTC)转换为字符串的日期。 */toUTCString(): string;/** 以字符串值形式返回日期ISO格式。 */toISOString(): string;/** 由JSON.stringify方法使用,为JavaScript对象表示法(JSON)序列化启用对象数据的转换。 */toJSON(key?: any): string;
}interface DateConstructor {new(): Date;new(value: number | string): Date;new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;(): string;readonly prototype: Date;/*** 分析包含日期的字符串,并返回该日期与1970年1月1日午夜之间的毫秒数。* @param s 日期字符串*/parse(s: string): number;/*** 返回世界协调时间(UTC)(或GMT)1970年1月1日午夜与指定日期之间的毫秒数。* @param year 为了跨世纪的日期准确性,需要指定完整的年份。如果使用介于0和99之间的年份,则年份被假定为 1900 +year。* @param month 0到11之间的月份(1月到12月)。* @param date 1到31之间的日期。* @param hours 如果提供了分钟,则必须提供。0到23(午夜到晚上11点)之间的数字,用于指定小时。* @param minutes 如果提供了秒,则必须提供。指定分钟的0到59之间的数字。* @param seconds 如果提供了毫秒,则必须提供。指定秒的0到59之间的数字。* @param ms 指定毫秒数的0到999之间的数字。*/UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;now(): number;
}declare var Date: DateConstructor;interface RegExpMatchArray extends Array<string> {/*** 找到结果的搜索的索引。*/index?: number;/*** 搜索字符串的副本。*/input?: string;
}interface RegExpExecArray extends Array<string> {/*** 找到结果的搜索的索引。*/index: number;/*** 搜索字符串的副本。*/input: string;
}interface RegExp {/*** 使用正则表达式模式对字符串执行搜索,并返回包含搜索结果的数组。* @param string 执行搜索的字符串对象或字符串文字。*/exec(string: string): RegExpExecArray | null;/*** 返回一个布尔值,该值指示搜索字符串中是否存在模式。* @param string 执行搜索的字符串。*/test(string: string): boolean;/** 返回正则表达式模式文本的副本。只读。regExp参数是正则表达式对象。它可以是变量名或文字。 */readonly source: string;/** 返回一个布尔值,该值指示正则表达式使用的全局标志(g)的状态。默认值为false。只读。 */readonly global: boolean;/** 返回一个布尔值,该值指示正则表达式使用的ignoreCase标志(I)的状态。默认值为false。只读。 */readonly ignoreCase: boolean;/** 返回一个布尔值,指示用于正则表达式的多行标志(m)的状态。默认值为false。只读。 */readonly multiline: boolean;lastIndex: number;// 非标准扩展/** @deprecated 浏览器兼容性的传统功能 */compile(pattern: string, flags?: string): this;
}interface RegExpConstructor {new(pattern: RegExp | string): RegExp;new(pattern: string, flags?: string): RegExp;(pattern: RegExp | string): RegExp;(pattern: string, flags?: string): RegExp;readonly prototype: RegExp;// 非标准扩展/** @deprecated 浏览器兼容性的传统功能 */$1: string;/** @deprecated 浏览器兼容性的传统功能 */$2: string;/** @deprecated 浏览器兼容性的传统功能 */$3: string;/** @deprecated 浏览器兼容性的传统功能 */$4: string;/** @deprecated 浏览器兼容性的传统功能 */$5: string;/** @deprecated 浏览器兼容性的传统功能 */$6: string;/** @deprecated 浏览器兼容性的传统功能 */$7: string;/** @deprecated 浏览器兼容性的传统功能 */$8: string;/** @deprecated 浏览器兼容性的传统功能 */$9: string;/** @deprecated 浏览器兼容性的传统功能 */input: string;/** @deprecated 浏览器兼容性的传统功能 */$_: string;/** @deprecated 浏览器兼容性的传统功能 */lastMatch: string;/** @deprecated 浏览器兼容性的传统功能 */"$&": string;/** @deprecated 浏览器兼容性的传统功能 */lastParen: string;/** @deprecated 浏览器兼容性的传统功能 */"$+": string;/** @deprecated 浏览器兼容性的传统功能 */leftContext: string;/** @deprecated 浏览器兼容性的传统功能 */"$`": string;/** @deprecated 浏览器兼容性的传统功能 */rightContext: string;/** @deprecated 浏览器兼容性的传统功能 */"$'": string;
}declare var RegExp: RegExpConstructor;interface Error {name: string;message: string;stack?: string;
}interface ErrorConstructor {new(message?: string): Error;(message?: string): Error;readonly prototype: Error;
}declare var Error: ErrorConstructor;interface EvalError extends Error {}interface EvalErrorConstructor extends ErrorConstructor {new(message?: string): EvalError;(message?: string): EvalError;readonly prototype: EvalError;
}declare var EvalError: EvalErrorConstructor;interface RangeError extends Error {}interface RangeErrorConstructor extends ErrorConstructor {new(message?: string): RangeError;(message?: string): RangeError;readonly prototype: RangeError;
}declare var RangeError: RangeErrorConstructor;interface ReferenceError extends Error {}interface ReferenceErrorConstructor extends ErrorConstructor {new(message?: string): ReferenceError;(message?: string): ReferenceError;readonly prototype: ReferenceError;
}declare var ReferenceError: ReferenceErrorConstructor;interface SyntaxError extends Error {}interface SyntaxErrorConstructor extends ErrorConstructor {new(message?: string): SyntaxError;(message?: string): SyntaxError;readonly prototype: SyntaxError;
}declare var SyntaxError: SyntaxErrorConstructor;interface TypeError extends Error {}interface TypeErrorConstructor extends ErrorConstructor {new(message?: string): TypeError;(message?: string): TypeError;readonly prototype: TypeError;
}declare var TypeError: TypeErrorConstructor;interface URIError extends Error {}interface URIErrorConstructor extends ErrorConstructor {new(message?: string): URIError;(message?: string): URIError;readonly prototype: URIError;
}declare var URIError: URIErrorConstructor;interface JSON {/*** 将JavaScript对象表示法(JSON)字符串转换为对象。* @param text 有效的JSON字符串。* @param reviver 转换结果的函数。 为对象的每个成员调用这个函数。* 如果成员包含嵌套对象,则嵌套对象会在父对象转换之前进行转换。*/parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;/*** 将JavaScript值转换为JavaScript对象表示法(JSON)字符串。* @param value 要转换的JavaScript值,通常是对象或数组。* @param replacer 转换结果的函数。* @param space 向返回值JSON文本中添加缩进、空白和换行符,以便于阅读。*/stringify(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;/*** 将JavaScript值转换为JavaScript对象表示法(JSON)字符串。* @param value 要转换的JavaScript值,通常是对象或数组。* @param replacer 字符串和数字的数组,用作选择将被字符串化的对象特性的许可列表。* @param space 向返回值JSON文本中添加缩进、空白和换行符,以便于阅读。*/stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
}/*** 一个内部对象,提供将JavaScript值与JavaScript对象表示法(JSON)格式相互转换的函数。*/
declare var JSON: JSON;/
/// ECMAScript Array API (specially handled by compiler)
/interface ReadonlyArray<T> {/*** Gets 数组的长度。 * 这是一个比数组中定义的最高元素高一的数字。*/readonly length: number;/*** 返回数组的字符串表示形式。*/toString(): string;/*** 返回数组的字符串表示形式。 * 使用它们的 toLocaleString 方法将元素转换为 string。*/toLocaleString(): string;/*** 组合两个或多个数组。* @param items 要添加到数组1末尾的附加项。*/concat(...items: ConcatArray<T>[]): T[];/*** 组合两个或多个数组。* @param items 要添加到数组1末尾的附加项。*/concat(...items: (T | ConcatArray<T>)[]): T[];/*** 添加由指定分隔符字符串分隔的数组的所有元素。* @param separator 用于将数组中的一个元素与结果字符串中的下一个元素分隔开的字符串。如果省略,数组元素用逗号分隔。*/join(separator?: string): string;/*** 返回数组的一部分。* @param start 数组指定部分的开始。* @param end 数组指定部分的结尾。这不包括索引 `end` 处的元素。*/slice(start?: number, end?: number): T[];/*** 返回数组中某个值第一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/indexOf(searchElement: T, fromIndex?: number): number;/*** 返回指定值在数组中最后一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略fromIndex,则从数组中的最后一个索引开始搜索。*/lastIndexOf(searchElement: T, fromIndex?: number): number;/*** 确定数组的所有成员是否满足指定的测试。* @param predicate 最多接受三个参数的函数。 every 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 false 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/every<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): this is readonly S[];/*** 确定数组的所有成员是否满足指定的测试。* @param predicate 最多接受三个参数的函数。 every 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 false 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/every(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;/*** 确定指定的回调函数是否为数组中的任何元素返回 true。* @param predicate 最多接受三个参数的函数。 some 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 true 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/some(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): boolean;/*** 对数组中的每个元素执行指定的操作。* @param callbackfn  最多接受三个参数的函数。 forEach 为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg  this 关键字可以在 callbackfn 函数中引用的对象。 如果省略 thisArg,则使用 undefined 作为 this 值。*/forEach(callbackfn: (value: T, index: number, array: readonly T[]) => void, thisArg?: any): void;/*** 对数组的每个元素调用定义的回调函数,并返回包含结果的数组。* @param callbackfn 最多接受三个参数的函数。 map 方法为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg this 关键字可以在 callbackfn 函数中引用的对象。 如果省略 thisArg,则使用 undefined 作为 this 值。*/map<U>(callbackfn: (value: T, index: number, array: readonly T[]) => U, thisArg?: any): U[];/*** 返回满足回调函数中指定条件的数组元素。* @param predicate 最多接受三个参数的函数。 filter 方法为数组中的每个元素调用一次谓词函数。* @param thisArg this 关键字可以在谓词函数中引用的对象。 如果省略 thisArg,则使用 undefined 作为 this 值。*/filter<S extends T>(predicate: (value: T, index: number, array: readonly T[]) => value is S, thisArg?: any): S[];/*** 返回满足回调函数中指定条件的数组元素。* @param predicate 最多接受三个参数的函数。 filter 方法为数组中的每个元素调用一次谓词函数。* @param thisArg this 关键字可以在谓词函数中引用的对象。 如果省略 thisArg,则使用 undefined 作为 this 值。*/filter(predicate: (value: T, index: number, array: readonly T[]) => unknown, thisArg?: any): T[];/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce 方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce 方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;/*** 按降序为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T): T;reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: readonly T[]) => T, initialValue: T): T;/*** 按降序为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: readonly T[]) => U, initialValue: U): U;readonly [n: number]: T;
}interface ConcatArray<T> {readonly length: number;readonly [n: number]: T;join(separator?: string): string;slice(start?: number, end?: number): T[];
}interface Array<T> {/*** Gets 或者 sets 数组的长度。 这比数组中的最高索引高一个数字。*/length: number;/*** 返回数组的字符串表示形式。*/toString(): string;/*** 返回数组的字符串表示形式。 * 使用它们的 toLocaleString 方法将元素转换为 string。*/toLocaleString(): string;/*** 从数组中移除最后一个元素并返回它。* 如果数组为空,则返回 undefined,并且不修改数组。*/pop(): T | undefined;/*** 向数组末尾追加新元素,并返回数组的新长度。* @param items 要添加到数组的新元素。*/push(...items: T[]): number;/*** 组合两个或多个数组。* 此方法返回一个新数组,而不修改任何现有数组。* @param items 要添加到数组末尾的其他数组 和/或 项目。*/concat(...items: ConcatArray<T>[]): T[];/*** 组合两个或多个数组。* 此方法返回一个新数组,而不修改任何现有数组。* @param items 要添加到数组末尾的其他数组 和/或 项目。*/concat(...items: (T | ConcatArray<T>)[]): T[];/*** 将数组中的所有元素添加到一个字符串中,用指定的分隔符字符串分隔。* @param separator 用于将数组中的一个元素与结果字符串中的下一个元素分隔开的字符串。如果省略,数组元素用逗号分隔。*/join(separator?: string): string;/*** 就地反转数组中的元素。* 此方法使数组变异,并返回对同一数组的引用。*/reverse(): T[];/*** 从数组中移除第一个元素并返回它。* 如果数组为空,则返回 undefined,并且不修改数组。*/shift(): T | undefined;/*** 返回数组的一部分的副本。* 对于start和end,可以使用负索引来指示从数组末尾的偏移量。* 例如,-2表示数组的倒数第二个元素。* @param start 数组指定部分的开始索引。* 如果start未定义,则切片从索引0开始。* @param end 数组指定部分的结束索引。这不包括索引“end”处的元素。* 如果end未定义,则切片扩展到数组的末尾。*/slice(start?: number, end?: number): T[];/*** 就地排序数组。* 此方法使数组变异,并返回对同一数组的引用。* @param compareFn 用于确定元素顺序的函数。如果第一个参数小于第二个参数,它将返回一个负值,如果两个参数相等,则返回零,否则返回正值。如果省略,元素将按ASCII字符升序排序。* ```ts* [11,2,22,1].sort((a, b) => a - b)* ```*/sort(compareFn?: (a: T, b: T) => number): this;/*** 从数组中移除元素,如有必要,在它们的位置插入新元素,返回已删除的元素。* @param start 数组中从零开始移除元素的位置。* @param deleteCount 要移除的元素数量。* @returns 包含已删除元素的数组。*/splice(start: number, deleteCount?: number): T[];/*** 从数组中移除元素,如有必要,在它们的位置插入新元素,返回已删除的元素。* @param start 数组中从零开始移除元素的位置。* @param deleteCount 要移除的元素数量。* @param items 要插入到数组中代替已删除元素的元素。* @returns 包含已删除元素的数组。*/splice(start: number, deleteCount: number, ...items: T[]): T[];/*** 在数组的开头插入新元素,并返回数组的新长度。* @param items 要在数组开头插入的元素。*/unshift(...items: T[]): number;/*** 返回数组中某个值第一次出现的索引,如果不存在,则返回-1。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/indexOf(searchElement: T, fromIndex?: number): number;/*** 返回指定值在数组中最后一次出现的索引,如果不存在,则返回-1。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始向后搜索的数组索引。如果省略 fromIndex,则从数组中的最后一个索引开始搜索。*/lastIndexOf(searchElement: T, fromIndex?: number): number;/*** 确定数组的所有成员是否满足指定的测试。* @param predicate 最多接受三个参数的函数。 every 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 false 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/every<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): this is S[];/*** 确定数组的所有成员是否满足指定的测试。* @param predicate 最多接受三个参数的函数。 every 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 false 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/every(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;/*** 确定指定的回调函数是否为数组中的任何元素返回 true。* @param predicate 最多接受三个参数的函数。 some 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 true 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/some(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): boolean;/*** 对数组中的每个元素执行指定的操作。* @param callbackfn  最多接受三个参数的函数。 forEach 为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg  this 关键字可以在 callbackfn 函数中引用的对象。 如果省略 thisArg,则使用 undefined 作为 this 值。*/forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;/*** 对数组的每个元素调用定义的回调函数,并返回包含结果的数组。* @param callbackfn 最多接受三个参数的函数。 map 方法为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg this 关键字可以在 callbackfn 函数中引用的对象。 如果省略 thisArg,则使用 undefined 作为 this 值。*/map<U>(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];/*** 返回满足回调函数中指定条件的数组元素。* @param predicate 最多接受三个参数的函数。 filter 方法为数组中的每个元素调用一次谓词函数。* @param thisArg this 关键字可以在谓词函数中引用的对象。 如果省略 thisArg,则使用 undefined 作为 this 值。*/filter<S extends T>(predicate: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];/*** 返回满足回调函数中指定条件的数组元素。* @param predicate 最多接受三个参数的函数。 filter 方法为数组中的每个元素调用一次谓词函数。* @param thisArg this 关键字可以在谓词函数中引用的对象。 如果省略 thisArg,则使用 undefined 作为 this 值。*/filter(predicate: (value: T, index: number, array: T[]) => unknown, thisArg?: any): T[];/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce 方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce 方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;/*** 按降序为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;/*** 按降序为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;[n: number]: T;
}interface ArrayConstructor {new(arrayLength?: number): any[];new <T>(arrayLength: number): T[];new <T>(...items: T[]): T[];(arrayLength?: number): any[];<T>(arrayLength: number): T[];<T>(...items: T[]): T[];isArray(arg: any): arg is any[];readonly prototype: any[];
}declare var Array: ArrayConstructor;interface TypedPropertyDescriptor<T> {enumerable?: boolean;configurable?: boolean;writable?: boolean;value?: T;get?: () => T;set?: (value: T) => void;
}declare type ClassDecorator = <TFunction extends Function>(target: TFunction) => TFunction | void;
declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
declare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;declare type PromiseConstructorLike = new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void) => PromiseLike<T>;interface PromiseLike<T> {/*** 为 Promise 的 解决 和/或 拒绝附加回调。* @param onfulfilled 解决承诺时要执行的回调。* @param onrejected 承诺被拒绝时执行的回调。* @returns 一个 Promise,一旦完成,就会执行回调。*/then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): PromiseLike<TResult1 | TResult2>;
}/*** 表示异步操作的完成*/
interface Promise<T> {/*** 为 Promise 的 解决 和/或 拒绝附加回调。* @param onfulfilled 解决承诺时要执行的回调。* @param onrejected 承诺被拒绝时执行的回调。* @returns 一个 Promise,一旦完成,就会执行回调。*/then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;/*** 仅针对承诺的拒绝附加回调。* @param onrejected 承诺被拒绝时执行的回调。* @returns 一个完成 回调 的 Promise。*/catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
}/*** 类型 Awaited 表示递归展开一个类型的“awaited type”。非 Promise 的 Thenable 对象 应该 resolve 为 never。这模拟了await的行为。*/type Awaited<T> =T extends null | undefined ? T : // 不在 `--strictNullChecks` 模式下时 `null | undefined` 的特殊情况T extends object & { then(onfulfilled: infer F): any } ? // `await` 只解包带有可调用 `then` 的对象类型。非对象类型不会被展开F extends ((value: infer V, ...args: any) => any) ? // 如果 `then`的参数是可调用的,则提取第一个参数Awaited<V> : // 递归展开值never : // `then` 这个参数是不可调用的T; // 非 object 或者 非 thenableinterface ArrayLike<T> {readonly length: number;readonly [n: number]: T;
}/*** 使T中的所有属性都可选*/
type Partial<T> = {[P in keyof T]?: T[P];
};/*** 使T中的所有属性成为必需的*/
type Required<T> = {[P in keyof T]-?: T[P];
};/*** 将T中的所有属性设为只读*/
type Readonly<T> = {readonly [P in keyof T]: T[P];
};/*** 从T中,挑选一组其键在联合K中的属性*/
type Pick<T, K extends keyof T> = {[P in K]: T[P];
};/*** 用类型T的一组属性K构造一个类型*/
type Record<K extends keyof any, T> = {[P in K]: T;
};/*** 从 T 中排除那些可赋给 U 的类型*/
type Exclude<T, U> = T extends U ? never : T;/*** 从T中提取那些可以赋给 U 的类型*/
type Extract<T, U> = T extends U ? T : never;/*** 构造一个具有 T 的性质的类型,但类型 K 中的性质除外。*/
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;/*** 从 T 中排除 null 和 undefined*/
type NonNullable<T> = T & {};/*** 获取元组中函数类型的参数*/
type Parameters<T extends (...args: any) => any> = T extends (...args: infer P) => any ? P : never;/*** 获取元组中构造函数类型的参数*/
type ConstructorParameters<T extends abstract new (...args: any) => any> = T extends abstract new (...args: infer P) => any ? P : never;/*** 获取函数类型的返回类型*/
type ReturnType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? R : any;/*** 获取构造函数类型的返回类型*/
type InstanceType<T extends abstract new (...args: any) => any> = T extends abstract new (...args: any) => infer R ? R : any;/*** 将字符串文字类型转换为大写*/
type Uppercase<S extends string> = intrinsic;/*** 将字符串文字类型转换为小写*/
type Lowercase<S extends string> = intrinsic;/*** 将字符串类型的第一个字符转换为大写*/
type Capitalize<S extends string> = intrinsic;/*** 将字符串类型的第一个字符转换为小写*/
type Uncapitalize<S extends string> = intrinsic;/*** 上下文 `this` 类型的标记*/
interface ThisType<T> { }/*** 表示二进制数据的原始缓冲区,* 用于存储不同类型数组的数据。* ArrayBuffers不能直接读取或写入,* 但可以传递给类型化数组或DataView对象,* 以便根据需要解释原始缓冲区。*/
interface ArrayBuffer {/*** 只读。ArrayBuffer 的长度(字节)。*/readonly byteLength: number;/*** 返回 ArrayBuffer 的一部分。*/slice(begin: number, end?: number): ArrayBuffer;
}/*** ArrayBufferView 和相关类型化数组的缓冲区允许的 ArrayBuffer 类型。*/
interface ArrayBufferTypes {ArrayBuffer: ArrayBuffer;
}
type ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];interface ArrayBufferConstructor {readonly prototype: ArrayBuffer;new(byteLength: number): ArrayBuffer;isView(arg: any): arg is ArrayBufferView;
}
declare var ArrayBuffer: ArrayBufferConstructor;interface ArrayBufferView {/*** 数组引用的 ArrayBuffer 实例。*/buffer: ArrayBufferLike;/*** 数组的字节长度。*/byteLength: number;/*** 数组的偏移量,以字节为单位。*/byteOffset: number;
}interface DataView {readonly buffer: ArrayBuffer;readonly byteLength: number;readonly byteOffset: number;/*** Gets the Float32 value at the specified byte offset from the start of the view. There is* no alignment constraint; multi-byte values may be fetched from any offset.* @param byteOffset The place in the buffer at which the value should be retrieved.* @param littleEndian If false or undefined, a big-endian value should be read.*/getFloat32(byteOffset: number, littleEndian?: boolean): number;/*** Gets the Float64 value at the specified byte offset from the start of the view. There is* no alignment constraint; multi-byte values may be fetched from any offset.* @param byteOffset The place in the buffer at which the value should be retrieved.* @param littleEndian If false or undefined, a big-endian value should be read.*/getFloat64(byteOffset: number, littleEndian?: boolean): number;/*** Gets the Int8 value at the specified byte offset from the start of the view. There is* no alignment constraint; multi-byte values may be fetched from any offset.* @param byteOffset The place in the buffer at which the value should be retrieved.*/getInt8(byteOffset: number): number;/*** Gets the Int16 value at the specified byte offset from the start of the view. There is* no alignment constraint; multi-byte values may be fetched from any offset.* @param byteOffset The place in the buffer at which the value should be retrieved.* @param littleEndian If false or undefined, a big-endian value should be read.*/getInt16(byteOffset: number, littleEndian?: boolean): number;/*** Gets the Int32 value at the specified byte offset from the start of the view. There is* no alignment constraint; multi-byte values may be fetched from any offset.* @param byteOffset The place in the buffer at which the value should be retrieved.* @param littleEndian If false or undefined, a big-endian value should be read.*/getInt32(byteOffset: number, littleEndian?: boolean): number;/*** Gets the Uint8 value at the specified byte offset from the start of the view. There is* no alignment constraint; multi-byte values may be fetched from any offset.* @param byteOffset The place in the buffer at which the value should be retrieved.*/getUint8(byteOffset: number): number;/*** Gets the Uint16 value at the specified byte offset from the start of the view. There is* no alignment constraint; multi-byte values may be fetched from any offset.* @param byteOffset The place in the buffer at which the value should be retrieved.* @param littleEndian If false or undefined, a big-endian value should be read.*/getUint16(byteOffset: number, littleEndian?: boolean): number;/*** Gets the Uint32 value at the specified byte offset from the start of the view. There is* no alignment constraint; multi-byte values may be fetched from any offset.* @param byteOffset The place in the buffer at which the value should be retrieved.* @param littleEndian If false or undefined, a big-endian value should be read.*/getUint32(byteOffset: number, littleEndian?: boolean): number;/*** Stores an Float32 value at the specified byte offset from the start of the view.* @param byteOffset The place in the buffer at which the value should be set.* @param value The value to set.* @param littleEndian If false or undefined, a big-endian value should be written.*/setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;/*** Stores an Float64 value at the specified byte offset from the start of the view.* @param byteOffset The place in the buffer at which the value should be set.* @param value The value to set.* @param littleEndian If false or undefined, a big-endian value should be written.*/setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;/*** Stores an Int8 value at the specified byte offset from the start of the view.* @param byteOffset The place in the buffer at which the value should be set.* @param value The value to set.*/setInt8(byteOffset: number, value: number): void;/*** Stores an Int16 value at the specified byte offset from the start of the view.* @param byteOffset The place in the buffer at which the value should be set.* @param value The value to set.* @param littleEndian If false or undefined, a big-endian value should be written.*/setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;/*** Stores an Int32 value at the specified byte offset from the start of the view.* @param byteOffset The place in the buffer at which the value should be set.* @param value The value to set.* @param littleEndian If false or undefined, a big-endian value should be written.*/setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;/*** Stores an Uint8 value at the specified byte offset from the start of the view.* @param byteOffset The place in the buffer at which the value should be set.* @param value The value to set.*/setUint8(byteOffset: number, value: number): void;/*** Stores an Uint16 value at the specified byte offset from the start of the view.* @param byteOffset The place in the buffer at which the value should be set.* @param value The value to set.* @param littleEndian If false or undefined, a big-endian value should be written.*/setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;/*** Stores an Uint32 value at the specified byte offset from the start of the view.* @param byteOffset The place in the buffer at which the value should be set.* @param value The value to set.* @param littleEndian If false or undefined, a big-endian value should be written.*/setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;
}interface DataViewConstructor {readonly prototype: DataView;new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;
}
declare var DataView: DataViewConstructor;/*** 8位整数值的类型化数组。内容被初始化为0。如果无法分配请求的字节数,则会引发异常。*/
interface Int8Array {/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 数组引用的 ArrayBuffer 实例。*/readonly buffer: ArrayBufferLike;/*** 数组的字节长度。*/readonly byteLength: number;/*** 数组的偏移量,以字节为单位。*/readonly byteOffset: number;/*** 在将由 start 和 end 标识的数组的一部分复制到从 position target 开始的同一数组后,返回此对象* @param target 如果target为负,则被视为 length + target,其中 length 是数组的长度。* @param start 如果start为负,则被视为 length + start。如果 end 为负,则被视为 length + end。* @param end 如果未指定,此对象的长度将用作其默认值。*/copyWithin(target: number, start: number, end?: number): this;/*** 确定数组的所有成员是否满足指定的测试。* @param predicate 最多接受三个参数的函数。 every 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 false 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/every(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;/*** 将从 `start` 到 `end` 索引的所有数组元素更改为静态 `value`,并返回修改后的数组* @param value 用于填充数组部分的值* @param start 开始填充数组的索引。如果 start 为负,则被视为 length + start,其中 length 为数组的长度。* @param end 停止填充数组的索引。如果 end 为负,则被视为 length + end。*/fill(value: number, start?: number, end?: number): this;/*** 返回满足回调函数中指定条件的数组元素。* @param predicate 最多接受三个参数的函数。 filter 方法为数组中的每个元素调用一次谓词函数。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/filter(predicate: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;/*** 返回数组中第一个元素的值,其中谓词为真,否则为未定义。* @param predicate find 按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回 true 的元素。如果找到这样的元素,find 会立即返回该元素的值。否则,find 返回 undefined。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;/*** 返回数组中第一个元素的索引,其中谓词为真,否则为-1。* @param predicate find按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回true的元素。如果找到这样的元素,findIndex会立即返回该元素的索引。否则,findIndex返回-1。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;/*** 对数组中的每个元素执行指定的操作。* @param callbackfn  最多接受三个参数的函数。 forEach 为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg  this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;/*** 返回数组中某个值第一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/indexOf(searchElement: number, fromIndex?: number): number;/*** 添加由指定分隔符字符串分隔的数组的所有元素。* @param separator 用于将数组中的一个元素与结果字符串中的下一个元素分隔开的字符串。如果省略,数组元素用逗号分隔。*/join(separator?: string): string;/*** 返回数组中某个值最后一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/lastIndexOf(searchElement: number, fromIndex?: number): number;/*** 数组的长度。*/readonly length: number;/*** 对数组的每个元素调用定义的回调函数,并返回包含结果的数组。* @param callbackfn 最多接受三个参数的函数。 map 方法为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;/*** 为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;/*** 为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。 * @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;/*** 反转数组中的元素。*/reverse(): Int8Array;/*** 设置一个值或一组值。* @param array 要设置的类型化或非类型化的值数组。* @param offset 当前数组中要写入值的索引。*/set(array: ArrayLike<number>, offset?: number): void;/*** 返回数组的一部分。* @param start 数组指定部分的开始。* @param end 数组指定部分的结尾。这不包括索引 `end` 处的元素。*/slice(start?: number, end?: number): Int8Array;/*** 确定指定的回调函数是否为数组中的任何元素返回 true。* @param predicate 最多接受三个参数的函数。 some 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 true 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/some(predicate: (value: number, index: number, array: Int8Array) => unknown, thisArg?: any): boolean;/*** 对数组进行排序。* @param compareFn 用于确定元素顺序的函数。如果第一个参数小于第二个参数,它将返回一个负值,如果它们相等,则返回零,否则返回正值。如果省略,元素将按升序排序。* ```ts* [11,2,22,1].sort((a, b) => a - b)* ```*/sort(compareFn?: (a: number, b: number) => number): this;/*** 获取此数组的 ArrayBuffer 存储区的新 Int8Array 视图,引用begin、inclusive、up to end、exclusive 处的元素。* @param begin 数组开头的索引。* @param end 数组结尾的索引。*/subarray(begin?: number, end?: number): Int8Array;/*** 使用当前区域设置将数字转换为字符串。*/toLocaleString(): string;/*** 返回数组的字符串表示形式。*/toString(): string;/** 返回指定对象的原始值。 */valueOf(): Int8Array;[index: number]: number;
}
interface Int8ArrayConstructor {readonly prototype: Int8Array;new(length: number): Int8Array;new(array: ArrayLike<number> | ArrayBufferLike): Int8Array;new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int8Array;/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 从一组元素中返回一个新数组。* @param items 要包含在新array对象中的一组元素。*/of(...items: number[]): Int8Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。*/from(arrayLike: ArrayLike<number>): Int8Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。* @param mapfn 在数组的每个元素上调用的 mapping 函数。* @param thisArg 用于调用 mapfn 的 `this` 值。*/from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int8Array;}
declare var Int8Array: Int8ArrayConstructor;/*** 8位无符号整数值的类型化数组。内容被初始化为0。如果无法分配请求的字节数,则会引发异常。*/
interface Uint8Array {/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 数组引用的 ArrayBuffer 实例。*/readonly buffer: ArrayBufferLike;/*** 数组的字节长度。*/readonly byteLength: number;/*** 数组的偏移量,以字节为单位。*/readonly byteOffset: number;/*** 在将由 start 和 end 标识的数组的一部分复制到从 position target 开始的同一数组后,返回此对象* @param target 如果target为负,则被视为 length + target,其中 length 是数组的长度。* @param start 如果start为负,则被视为 length + start。如果 end 为负,则被视为 length + end。* @param end 如果未指定,此对象的长度将用作其默认值。*/copyWithin(target: number, start: number, end?: number): this;/*** 确定数组的所有成员是否满足指定的测试。* @param predicate 最多接受三个参数的函数。 every 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 false 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/every(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;/*** 将从 `start` 到 `end` 索引的所有数组元素更改为静态 `value`,并返回修改后的数组* @param value 用于填充数组部分的值* @param start 开始填充数组的索引。如果 start 为负,则被视为 length + start,其中 length 为数组的长度。* @param end 停止填充数组的索引。如果 end 为负,则被视为 length + end。*/fill(value: number, start?: number, end?: number): this;/*** 返回满足回调函数中指定条件的数组元素。* @param predicate 最多接受三个参数的函数。 filter 方法为数组中的每个元素调用一次谓词函数。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/filter(predicate: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;/*** 返回数组中第一个元素的值,其中谓词为真,否则为未定义。* @param predicate find 按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回 true 的元素。如果找到这样的元素,find 会立即返回该元素的值。否则,find 返回 undefined。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;/*** 返回数组中第一个元素的索引,其中谓词为真,否则为-1。* @param predicate find按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回true的元素。如果找到这样的元素,findIndex会立即返回该元素的索引。否则,findIndex返回-1。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;/*** 对数组中的每个元素执行指定的操作。* @param callbackfn  最多接受三个参数的函数。 forEach 为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg  this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;/*** 返回数组中某个值第一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/indexOf(searchElement: number, fromIndex?: number): number;/*** 添加由指定分隔符字符串分隔的数组的所有元素。* @param separator 用于将数组中的一个元素与结果字符串中的下一个元素分隔开的字符串。如果省略,数组元素用逗号分隔。*/join(separator?: string): string;/*** 返回数组中某个值最后一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/lastIndexOf(searchElement: number, fromIndex?: number): number;/*** 数组的长度。*/readonly length: number;/*** 对数组的每个元素调用定义的回调函数,并返回包含结果的数组。* @param callbackfn 最多接受三个参数的函数。 map 方法为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;/*** 反转数组中的元素。*/reverse(): Uint8Array;/*** 设置一个值或一组值。* @param array 要设置的类型化或非类型化的值数组。* @param offset 当前数组中要写入值的索引。*/set(array: ArrayLike<number>, offset?: number): void;/*** 返回数组的一部分。* @param start 数组指定部分的开始。* @param end 数组指定部分的结尾。这不包括索引 `end` 处的元素。*/slice(start?: number, end?: number): Uint8Array;/*** 确定指定的回调函数是否为数组中的任何元素返回 true。* @param predicate 最多接受三个参数的函数。 some 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 true 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/some(predicate: (value: number, index: number, array: Uint8Array) => unknown, thisArg?: any): boolean;/*** 对数组进行排序。* @param compareFn 用于确定元素顺序的函数。如果第一个参数小于第二个参数,它将返回一个负值,如果它们相等,则返回零,否则返回正值。如果省略,元素将按升序排序。* ```ts* [11,2,22,1].sort((a, b) => a - b)* ```*/sort(compareFn?: (a: number, b: number) => number): this;/*** 获取此数组的 ArrayBuffer 存储区的新Uint8Array视图,引用元素* 从 begin,包含,到 end,不包含。* @param begin 数组开头的索引。* @param end 数组结尾的索引。*/subarray(begin?: number, end?: number): Uint8Array;/*** 使用当前区域设置将数字转换为字符串。*/toLocaleString(): string;/*** 返回数组的字符串表示形式。*/toString(): string;/** 返回指定对象的原始值。 */valueOf(): Uint8Array;[index: number]: number;
}interface Uint8ArrayConstructor {readonly prototype: Uint8Array;new(length: number): Uint8Array;new(array: ArrayLike<number> | ArrayBufferLike): Uint8Array;new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8Array;/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 从一组元素中返回一个新数组。* @param items 要包含在新array对象中的一组元素。*/of(...items: number[]): Uint8Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。*/from(arrayLike: ArrayLike<number>): Uint8Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。* @param mapfn 在数组的每个元素上调用的 mapping 函数。* @param thisArg 用于调用 mapfn 的 `this` 值。*/from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8Array;}
declare var Uint8Array: Uint8ArrayConstructor;/*** 8位无符号整数值(箝位)的类型化数组。内容被初始化为0。* 如果无法分配请求的字节数,则会引发异常。*/
interface Uint8ClampedArray {/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 数组引用的 ArrayBuffer 实例。*/readonly buffer: ArrayBufferLike;/*** 数组的字节长度。*/readonly byteLength: number;/*** 数组的偏移量,以字节为单位。*/readonly byteOffset: number;/*** 在将由 start 和 end 标识的数组的一部分复制到从 position target 开始的同一数组后,返回此对象* @param target 如果target为负,则被视为 length + target,其中 length 是数组的长度。* @param start 如果start为负,则被视为 length + start。如果 end 为负,则被视为 length + end。* @param end 如果未指定,此对象的长度将用作其默认值。*/copyWithin(target: number, start: number, end?: number): this;/*** 确定数组的所有成员是否满足指定的测试。* @param predicate 最多接受三个参数的函数。 every 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 false 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/every(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;/*** 将从 `start` 到 `end` 索引的所有数组元素更改为静态 `value`,并返回修改后的数组* @param value 用于填充数组部分的值* @param start 开始填充数组的索引。如果 start 为负,则被视为 length + start,其中 length 为数组的长度。* @param end 停止填充数组的索引。如果 end 为负,则被视为 length + end。*/fill(value: number, start?: number, end?: number): this;/*** 返回满足回调函数中指定条件的数组元素。* @param predicate 最多接受三个参数的函数。 filter 方法为数组中的每个元素调用一次谓词函数。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/filter(predicate: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;/*** 返回数组中第一个元素的值,其中谓词为真,否则为未定义。* @param predicate find 按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回 true 的元素。如果找到这样的元素,find 会立即返回该元素的值。否则,find 返回 undefined。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;/*** 返回数组中第一个元素的索引,其中谓词为真,否则为-1。* @param predicate find按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回true的元素。如果找到这样的元素,findIndex会立即返回该元素的索引。否则,findIndex返回-1。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;/*** 对数组中的每个元素执行指定的操作。* @param callbackfn  最多接受三个参数的函数。 forEach 为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg  this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;/*** 返回数组中某个值第一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/indexOf(searchElement: number, fromIndex?: number): number;/*** 添加由指定分隔符字符串分隔的数组的所有元素。* @param separator 用于将数组中的一个元素与结果字符串中的下一个元素分隔开的字符串。如果省略,数组元素用逗号分隔。*/join(separator?: string): string;/*** 返回数组中某个值最后一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/lastIndexOf(searchElement: number, fromIndex?: number): number;/*** 数组的长度。*/readonly length: number;/*** 对数组的每个元素调用定义的回调函数,并返回包含结果的数组。* @param callbackfn 最多接受三个参数的函数。 map 方法为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;/*** 反转数组中的元素。*/reverse(): Uint8ClampedArray;/*** 设置一个值或一组值。* @param array 要设置的类型化或非类型化的值数组。* @param offset 当前数组中要写入值的索引。*/set(array: ArrayLike<number>, offset?: number): void;/*** 返回数组的一部分。* @param start 数组指定部分的开始。* @param end 数组指定部分的结尾。这不包括索引 `end` 处的元素。*/slice(start?: number, end?: number): Uint8ClampedArray;/*** 确定指定的回调函数是否为数组中的任何元素返回 true。* @param predicate 最多接受三个参数的函数。 some 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 true 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/some(predicate: (value: number, index: number, array: Uint8ClampedArray) => unknown, thisArg?: any): boolean;/*** 对数组进行排序。* @param compareFn 用于确定元素顺序的函数。如果第一个参数小于第二个参数,它将返回一个负值,如果它们相等,则返回零,否则返回正值。如果省略,元素将按升序排序。* ```ts* [11,2,22,1].sort((a, b) => a - b)* ```*/sort(compareFn?: (a: number, b: number) => number): this;/*** 获取此数组的 ArrayBuffer 存储区的新 Uint8ClampedArray 视图,引用 begin、inclusive、up to end、exclusive 处的元素。* @param begin 数组开头的索引。* @param end 数组结尾的索引。*/subarray(begin?: number, end?: number): Uint8ClampedArray;/*** 使用当前区域设置将数字转换为字符串。*/toLocaleString(): string;/*** 返回数组的字符串表示形式。*/toString(): string;/** 返回指定对象的原始值。 */valueOf(): Uint8ClampedArray;[index: number]: number;
}interface Uint8ClampedArrayConstructor {readonly prototype: Uint8ClampedArray;new(length: number): Uint8ClampedArray;new(array: ArrayLike<number> | ArrayBufferLike): Uint8ClampedArray;new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint8ClampedArray;/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 从一组元素中返回一个新数组。* @param items 要包含在新array对象中的一组元素。*/of(...items: number[]): Uint8ClampedArray;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。*/from(arrayLike: ArrayLike<number>): Uint8ClampedArray;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。* @param mapfn 在数组的每个元素上调用的 mapping 函数。* @param thisArg 用于调用 mapfn 的 `this` 值。*/from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint8ClampedArray;
}
declare var Uint8ClampedArray: Uint8ClampedArrayConstructor;/*** 16位有符号整数值的类型化数组。内容被初始化为0。如果无法分配请求的字节数,则会引发异常。*/
interface Int16Array {/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 数组引用的 ArrayBuffer 实例。*/readonly buffer: ArrayBufferLike;/*** 数组的字节长度。*/readonly byteLength: number;/*** 数组的偏移量,以字节为单位。*/readonly byteOffset: number;/*** 在将由 start 和 end 标识的数组的一部分复制到从 position target 开始的同一数组后,返回此对象* @param target 如果target为负,则被视为 length + target,其中 length 是数组的长度。* @param start 如果start为负,则被视为 length + start。如果 end 为负,则被视为 length + end。* @param end 如果未指定,此对象的长度将用作其默认值。*/copyWithin(target: number, start: number, end?: number): this;/*** 确定数组的所有成员是否满足指定的测试。* @param predicate 最多接受三个参数的函数。 every 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 false 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/every(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;/*** 将从 `start` 到 `end` 索引的所有数组元素更改为静态 `value`,并返回修改后的数组* @param value 用于填充数组部分的值* @param start 开始填充数组的索引。如果 start 为负,则被视为 length + start,其中 length 为数组的长度。* @param end 停止填充数组的索引。如果 end 为负,则被视为 length + end。*/fill(value: number, start?: number, end?: number): this;/*** 返回满足回调函数中指定条件的数组元素。* @param predicate 最多接受三个参数的函数。 filter 方法为数组中的每个元素调用一次谓词函数。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/filter(predicate: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;/*** 返回数组中第一个元素的值,其中谓词为真,否则为未定义。* @param predicate find 按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回 true 的元素。如果找到这样的元素,find 会立即返回该元素的值。否则,find 返回 undefined。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;/*** 返回数组中第一个元素的索引,其中谓词为真,否则为-1。* @param predicate find按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回true的元素。如果找到这样的元素,findIndex会立即返回该元素的索引。否则,findIndex返回-1。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;/*** 对数组中的每个元素执行指定的操作。* @param callbackfn  最多接受三个参数的函数。 forEach 为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg  this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;/*** 返回数组中某个值第一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/indexOf(searchElement: number, fromIndex?: number): number;/*** 添加由指定分隔符字符串分隔的数组的所有元素。* @param separator 用于将数组中的一个元素与结果字符串中的下一个元素分隔开的字符串。如果省略,数组元素用逗号分隔。*/join(separator?: string): string;/*** 返回数组中某个值最后一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/lastIndexOf(searchElement: number, fromIndex?: number): number;/*** 数组的长度。*/readonly length: number;/*** 对数组的每个元素调用定义的回调函数,并返回包含结果的数组。* @param callbackfn 最多接受三个参数的函数。 map 方法为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;/*** 反转数组中的元素。*/reverse(): Int16Array;/*** 设置一个值或一组值。* @param array 要设置的类型化或非类型化的值数组。* @param offset 当前数组中要写入值的索引。*/set(array: ArrayLike<number>, offset?: number): void;/*** 返回数组的一部分。* @param start 数组指定部分的开始。* @param end 数组指定部分的结尾。这不包括索引 `end` 处的元素。*/slice(start?: number, end?: number): Int16Array;/*** 确定指定的回调函数是否为数组中的任何元素返回 true。* @param predicate 最多接受三个参数的函数。 some 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 true 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/some(predicate: (value: number, index: number, array: Int16Array) => unknown, thisArg?: any): boolean;/*** 对数组进行排序。* @param compareFn 用于确定元素顺序的函数。如果第一个参数小于第二个参数,它将返回一个负值,如果它们相等,则返回零,否则返回正值。如果省略,元素将按升序排序。* ```ts* [11,2,22,1].sort((a, b) => a - b)* ```*/sort(compareFn?: (a: number, b: number) => number): this;/*** 获取此数组的 ArrayBuffer 存储区的新 Int16Array 视图,引用元素* 从 begin,包含,到 end,不包含。* @param begin 数组开头的索引。* @param end 数组结尾的索引。*/subarray(begin?: number, end?: number): Int16Array;/*** 使用当前区域设置将数字转换为字符串。*/toLocaleString(): string;/*** 返回数组的字符串表示形式。*/toString(): string;/** 返回指定对象的原始值。 */valueOf(): Int16Array;[index: number]: number;
}interface Int16ArrayConstructor {readonly prototype: Int16Array;new(length: number): Int16Array;new(array: ArrayLike<number> | ArrayBufferLike): Int16Array;new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int16Array;/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 从一组元素中返回一个新数组。* @param items 要包含在新array对象中的一组元素。*/of(...items: number[]): Int16Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。*/from(arrayLike: ArrayLike<number>): Int16Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。* @param mapfn 在数组的每个元素上调用的 mapping 函数。* @param thisArg 用于调用 mapfn 的 `this` 值。*/from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int16Array;}
declare var Int16Array: Int16ArrayConstructor;/*** 16位无符号整数值的类型化数组。内容被初始化为0。如果无法分配请求的字节数,则会引发异常。*/
interface Uint16Array {/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 数组引用的 ArrayBuffer 实例。*/readonly buffer: ArrayBufferLike;/*** 数组的字节长度。*/readonly byteLength: number;/*** 数组的偏移量,以字节为单位。*/readonly byteOffset: number;/*** 在将由 start 和 end 标识的数组的一部分复制到从 position target 开始的同一数组后,返回此对象* @param target 如果target为负,则被视为 length + target,其中 length 是数组的长度。* @param start 如果start为负,则被视为 length + start。如果 end 为负,则被视为 length + end。* @param end 如果未指定,此对象的长度将用作其默认值。*/copyWithin(target: number, start: number, end?: number): this;/*** 确定数组的所有成员是否满足指定的测试。* @param predicate 最多接受三个参数的函数。 every 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 false 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/every(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;/*** 将从 `start` 到 `end` 索引的所有数组元素更改为静态 `value`,并返回修改后的数组* @param value 用于填充数组部分的值* @param start 开始填充数组的索引。如果 start 为负,则被视为 length + start,其中 length 为数组的长度。* @param end 停止填充数组的索引。如果 end 为负,则被视为 length + end。*/fill(value: number, start?: number, end?: number): this;/*** 返回满足回调函数中指定条件的数组元素。* @param predicate 最多接受三个参数的函数。 filter 方法为数组中的每个元素调用一次谓词函数。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/filter(predicate: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;/*** 返回数组中第一个元素的值,其中谓词为真,否则为未定义。* @param predicate find 按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回 true 的元素。如果找到这样的元素,find 会立即返回该元素的值。否则,find 返回 undefined。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;/*** 返回数组中第一个元素的索引,其中谓词为真,否则为-1。* @param predicate find按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回true的元素。如果找到这样的元素,findIndex会立即返回该元素的索引。否则,findIndex返回-1。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;/*** 对数组中的每个元素执行指定的操作。* @param callbackfn  最多接受三个参数的函数。 forEach 为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg  this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;/*** 返回数组中某个值第一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/indexOf(searchElement: number, fromIndex?: number): number;/*** 添加由指定分隔符字符串分隔的数组的所有元素。* @param separator 用于将数组中的一个元素与结果字符串中的下一个元素分隔开的字符串。如果省略,数组元素用逗号分隔。*/join(separator?: string): string;/*** 返回数组中某个值最后一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/lastIndexOf(searchElement: number, fromIndex?: number): number;/*** 数组的长度。*/readonly length: number;/*** 对数组的每个元素调用定义的回调函数,并返回包含结果的数组。* @param callbackfn 最多接受三个参数的函数。 map 方法为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;/*** 反转数组中的元素。*/reverse(): Uint16Array;/*** 设置一个值或一组值。* @param array 要设置的类型化或非类型化的值数组。* @param offset 当前数组中要写入值的索引。*/set(array: ArrayLike<number>, offset?: number): void;/*** 返回数组的一部分。* @param start 数组指定部分的开始。* @param end 数组指定部分的结尾。这不包括索引 `end` 处的元素。*/slice(start?: number, end?: number): Uint16Array;/*** 确定指定的回调函数是否为数组中的任何元素返回 true。* @param predicate 最多接受三个参数的函数。 some 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 true 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/some(predicate: (value: number, index: number, array: Uint16Array) => unknown, thisArg?: any): boolean;/*** 对数组进行排序。* @param compareFn 用于确定元素顺序的函数。如果第一个参数小于第二个参数,它将返回一个负值,如果它们相等,则返回零,否则返回正值。如果省略,元素将按升序排序。* ```ts* [11,2,22,1].sort((a, b) => a - b)* ```*/sort(compareFn?: (a: number, b: number) => number): this;/*** 获取此数组的 ArrayBuffer 存储区的新Uint16Array视图,引用元素* 从 begin,包含,到 end,不包含。* @param begin 数组开头的索引。* @param end 数组结尾的索引。*/subarray(begin?: number, end?: number): Uint16Array;/*** 使用当前区域设置将数字转换为字符串。*/toLocaleString(): string;/*** 返回数组的字符串表示形式。*/toString(): string;/** 返回指定对象的原始值。 */valueOf(): Uint16Array;[index: number]: number;
}interface Uint16ArrayConstructor {readonly prototype: Uint16Array;new(length: number): Uint16Array;new(array: ArrayLike<number> | ArrayBufferLike): Uint16Array;new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint16Array;/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 从一组元素中返回一个新数组。* @param items 要包含在新array对象中的一组元素。*/of(...items: number[]): Uint16Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。*/from(arrayLike: ArrayLike<number>): Uint16Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。* @param mapfn 在数组的每个元素上调用的 mapping 函数。* @param thisArg 用于调用 mapfn 的 `this` 值。*/from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint16Array;}
declare var Uint16Array: Uint16ArrayConstructor;
/*** 32位有符号整数值的类型化数组。内容被初始化为0。如果无法分配请求的字节数,则会引发异常。*/
interface Int32Array {/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 数组引用的 ArrayBuffer 实例。*/readonly buffer: ArrayBufferLike;/*** 数组的字节长度。*/readonly byteLength: number;/*** 数组的偏移量,以字节为单位。*/readonly byteOffset: number;/*** 在将由 start 和 end 标识的数组的一部分复制到从 position target 开始的同一数组后,返回此对象* @param target 如果target为负,则被视为 length + target,其中 length 是数组的长度。* @param start 如果start为负,则被视为 length + start。如果 end 为负,则被视为 length + end。* @param end 如果未指定,此对象的长度将用作其默认值。*/copyWithin(target: number, start: number, end?: number): this;/*** 确定数组的所有成员是否满足指定的测试。* @param predicate 最多接受三个参数的函数。 every 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 false 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/every(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;/*** 将从 `start` 到 `end` 索引的所有数组元素更改为静态 `value`,并返回修改后的数组* @param value 用于填充数组部分的值* @param start 开始填充数组的索引。如果 start 为负,则被视为 length + start,其中 length 为数组的长度。* @param end 停止填充数组的索引。如果 end 为负,则被视为 length + end。*/fill(value: number, start?: number, end?: number): this;/*** 返回满足回调函数中指定条件的数组元素。* @param predicate 最多接受三个参数的函数。 filter 方法为数组中的每个元素调用一次谓词函数。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/filter(predicate: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;/*** 返回数组中第一个元素的值,其中谓词为真,否则为未定义。* @param predicate find 按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回 true 的元素。如果找到这样的元素,find 会立即返回该元素的值。否则,find 返回 undefined。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;/*** 返回数组中第一个元素的索引,其中谓词为真,否则为-1。* @param predicate find按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回true的元素。如果找到这样的元素,findIndex会立即返回该元素的索引。否则,findIndex返回-1。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;/*** 对数组中的每个元素执行指定的操作。* @param callbackfn  最多接受三个参数的函数。 forEach 为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg  this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;/*** 返回数组中某个值第一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/indexOf(searchElement: number, fromIndex?: number): number;/*** 添加由指定分隔符字符串分隔的数组的所有元素。* @param separator 用于将数组中的一个元素与结果字符串中的下一个元素分隔开的字符串。如果省略,数组元素用逗号分隔。*/join(separator?: string): string;/*** 返回数组中某个值最后一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/lastIndexOf(searchElement: number, fromIndex?: number): number;/*** 数组的长度。*/readonly length: number;/*** 对数组的每个元素调用定义的回调函数,并返回包含结果的数组。* @param callbackfn 最多接受三个参数的函数。 map 方法为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;/*** 反转数组中的元素。*/reverse(): Int32Array;/*** 设置一个值或一组值。* @param array 要设置的类型化或非类型化的值数组。* @param offset 当前数组中要写入值的索引。*/set(array: ArrayLike<number>, offset?: number): void;/*** 返回数组的一部分。* @param start 数组指定部分的开始。* @param end 数组指定部分的结尾。这不包括索引 `end` 处的元素。*/slice(start?: number, end?: number): Int32Array;/*** 确定指定的回调函数是否为数组中的任何元素返回 true。* @param predicate 最多接受三个参数的函数。 some 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 true 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/some(predicate: (value: number, index: number, array: Int32Array) => unknown, thisArg?: any): boolean;/*** 对数组进行排序。* @param compareFn 用于确定元素顺序的函数。如果第一个参数小于第二个参数,它将返回一个负值,如果它们相等,则返回零,否则返回正值。如果省略,元素将按升序排序。* ```ts* [11,2,22,1].sort((a, b) => a - b)* ```*/sort(compareFn?: (a: number, b: number) => number): this;/*** 获取此数组的 ArrayBuffer 存储区的新Int32Array视图,引用元素* 从 begin,包含,到 end,不包含。* @param begin 数组开头的索引。* @param end 数组结尾的索引。*/subarray(begin?: number, end?: number): Int32Array;/*** 使用当前区域设置将数字转换为字符串。*/toLocaleString(): string;/*** 返回数组的字符串表示形式。*/toString(): string;/** 返回指定对象的原始值。 */valueOf(): Int32Array;[index: number]: number;
}interface Int32ArrayConstructor {readonly prototype: Int32Array;new(length: number): Int32Array;new(array: ArrayLike<number> | ArrayBufferLike): Int32Array;new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Int32Array;/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 从一组元素中返回一个新数组。* @param items 要包含在新array对象中的一组元素。*/of(...items: number[]): Int32Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。*/from(arrayLike: ArrayLike<number>): Int32Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。* @param mapfn 在数组的每个元素上调用的 mapping 函数。* @param thisArg 用于调用 mapfn 的 `this` 值。*/from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Int32Array;}
declare var Int32Array: Int32ArrayConstructor;/*** 32位无符号整数值的类型化数组。内容被初始化为0。如果无法分配请求的字节数,则会引发异常。*/
interface Uint32Array {/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 数组引用的 ArrayBuffer 实例。*/readonly buffer: ArrayBufferLike;/*** 数组的字节长度。*/readonly byteLength: number;/*** 数组的偏移量,以字节为单位。*/readonly byteOffset: number;/*** 在将由 start 和 end 标识的数组的一部分复制到从 position target 开始的同一数组后,返回此对象* @param target 如果target为负,则被视为 length + target,其中 length 是数组的长度。* @param start 如果start为负,则被视为 length + start。如果 end 为负,则被视为 length + end。* @param end 如果未指定,此对象的长度将用作其默认值。*/copyWithin(target: number, start: number, end?: number): this;/*** 确定数组的所有成员是否满足指定的测试。* @param predicate 最多接受三个参数的函数。 every 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 false 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/every(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;/*** 将从 `start` 到 `end` 索引的所有数组元素更改为静态 `value`,并返回修改后的数组* @param value 用于填充数组部分的值* @param start 开始填充数组的索引。如果 start 为负,则被视为 length + start,其中 length 为数组的长度。* @param end 停止填充数组的索引。如果 end 为负,则被视为 length + end。*/fill(value: number, start?: number, end?: number): this;/*** 返回满足回调函数中指定条件的数组元素。* @param predicate 最多接受三个参数的函数。 filter 方法为数组中的每个元素调用一次谓词函数。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/filter(predicate: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;/*** 返回数组中第一个元素的值,其中谓词为真,否则为未定义。* @param predicate find 按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回 true 的元素。如果找到这样的元素,find 会立即返回该元素的值。否则,find 返回 undefined。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;/*** 返回数组中第一个元素的索引,其中谓词为真,否则为-1。* @param predicate find按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回true的元素。如果找到这样的元素,findIndex会立即返回该元素的索引。否则,findIndex返回-1。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;/*** 对数组中的每个元素执行指定的操作。* @param callbackfn  最多接受三个参数的函数。 * forEach 为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg  this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;/*** 返回数组中某个值第一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/indexOf(searchElement: number, fromIndex?: number): number;/*** 添加由指定分隔符字符串分隔的数组的所有元素。* @param separator 用于将数组中的一个元素与结果字符串中的下一个元素分隔开的字符串。如果省略,数组元素用逗号分隔。*/join(separator?: string): string;/*** 返回数组中某个值最后一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/lastIndexOf(searchElement: number, fromIndex?: number): number;/*** 数组的长度。*/readonly length: number;/*** 对数组的每个元素调用定义的回调函数,并返回包含结果的数组。* @param callbackfn 最多接受三个参数的函数。 * map 方法为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;/*** 反转数组中的元素。*/reverse(): Uint32Array;/*** 设置一个值或一组值。* @param array 要设置的类型化或非类型化的值数组。* @param offset 当前数组中要写入值的索引。*/set(array: ArrayLike<number>, offset?: number): void;/*** 返回数组的一部分。* @param start 数组指定部分的开始。* @param end 数组指定部分的结尾。这不包括索引 `end` 处的元素。*/slice(start?: number, end?: number): Uint32Array;/*** 确定指定的回调函数是否为数组中的任何元素返回 true。* @param predicate 最多接受三个参数的函数。 some 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 true 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/some(predicate: (value: number, index: number, array: Uint32Array) => unknown, thisArg?: any): boolean;/*** 对数组进行排序。* @param compareFn 用于确定元素顺序的函数。如果第一个参数小于第二个参数,它将返回一个负值,如果它们相等,则返回零,否则返回正值。如果省略,元素将按升序排序。* ```ts* [11,2,22,1].sort((a, b) => a - b)* ```*/sort(compareFn?: (a: number, b: number) => number): this;/*** 获取此数组的 ArrayBuffer 存储区的新Uint32Array视图,引用元素* 从 begin,包含,到 end,不包含。* @param begin 数组开头的索引。* @param end 数组结尾的索引。*/subarray(begin?: number, end?: number): Uint32Array;/*** 使用当前区域设置将数字转换为字符串。*/toLocaleString(): string;/*** 返回数组的字符串表示形式。*/toString(): string;/** 返回指定对象的原始值。 */valueOf(): Uint32Array;[index: number]: number;
}interface Uint32ArrayConstructor {readonly prototype: Uint32Array;new(length: number): Uint32Array;new(array: ArrayLike<number> | ArrayBufferLike): Uint32Array;new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Uint32Array;/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 从一组元素中返回一个新数组。* @param items 要包含在新array对象中的一组元素。*/of(...items: number[]): Uint32Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。*/from(arrayLike: ArrayLike<number>): Uint32Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。* @param mapfn 在数组的每个元素上调用的 mapping 函数。* @param thisArg 用于调用 mapfn 的 `this` 值。*/from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Uint32Array;}
declare var Uint32Array: Uint32ArrayConstructor;/*** 32位浮点值的类型化数组。内容被初始化为0。如果无法分配请求的字节数,则会引发异常。*/
interface Float32Array {/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 数组引用的 ArrayBuffer 实例。*/readonly buffer: ArrayBufferLike;/*** 数组的字节长度。*/readonly byteLength: number;/*** 数组的偏移量,以字节为单位。*/readonly byteOffset: number;/*** 在将由 start 和 end 标识的数组的一部分复制到从 position target 开始的同一数组后,返回此对象* @param target 如果target为负,则被视为 length + target,其中 length 是数组的长度。* @param start 如果start为负,则被视为 length + start。如果 end 为负,则被视为 length + end。* @param end 如果未指定,此对象的长度将用作其默认值。*/copyWithin(target: number, start: number, end?: number): this;/*** 确定数组的所有成员是否满足指定的测试。* @param predicate 最多接受三个参数的函数。 every 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 false 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/every(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;/*** 将从 `start` 到 `end` 索引的所有数组元素更改为静态 `value`,并返回修改后的数组* @param value 用于填充数组部分的值* @param start 开始填充数组的索引。如果 start 为负,则被视为 length + start,其中 length 为数组的长度。* @param end 停止填充数组的索引。如果 end 为负,则被视为 length + end。*/fill(value: number, start?: number, end?: number): this;/*** 返回满足回调函数中指定条件的数组元素。* @param predicate 最多接受三个参数的函数。 filter 方法为数组中的每个元素调用一次谓词函数。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/filter(predicate: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;/*** 返回数组中第一个元素的值,其中谓词为真,否则为未定义。* @param predicate find 按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回 true 的元素。如果找到这样的元素,find 会立即返回该元素的值。否则,find 返回 undefined。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;/*** 返回数组中第一个元素的索引,其中谓词为真,否则为-1。* @param predicate find按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回true的元素。如果找到这样的元素,findIndex会立即返回该元素的索引。否则,findIndex返回-1。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;/*** 对数组中的每个元素执行指定的操作。* @param callbackfn  最多接受三个参数的函数。 forEach 为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg  this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;/*** 返回数组中某个值第一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/indexOf(searchElement: number, fromIndex?: number): number;/*** 添加由指定分隔符字符串分隔的数组的所有元素。* @param separator 用于将数组中的一个元素与结果字符串中的下一个元素分隔开的字符串。如果省略,数组元素用逗号分隔。*/join(separator?: string): string;/*** 返回数组中某个值最后一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/lastIndexOf(searchElement: number, fromIndex?: number): number;/*** 数组的长度。*/readonly length: number;/*** 对数组的每个元素调用定义的回调函数,并返回包含结果的数组。* @param callbackfn 最多接受三个参数的函数。 map 方法为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;/*** 反转数组中的元素。*/reverse(): Float32Array;/*** 设置一个值或一组值。* @param array 要设置的类型化或非类型化的值数组。* @param offset 当前数组中要写入值的索引。*/set(array: ArrayLike<number>, offset?: number): void;/*** 返回数组的一部分。* @param start 数组指定部分的开始。* @param end 数组指定部分的结尾。这不包括索引 `end` 处的元素。*/slice(start?: number, end?: number): Float32Array;/*** 确定指定的回调函数是否为数组中的任何元素返回 true。* @param predicate 最多接受三个参数的函数。 some 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 true 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/some(predicate: (value: number, index: number, array: Float32Array) => unknown, thisArg?: any): boolean;/*** 对数组进行排序。* @param compareFn 用于确定元素顺序的函数。如果第一个参数小于第二个参数,它将返回一个负值,如果它们相等,则返回零,否则返回正值。如果省略,元素将按升序排序。* ```ts* [11,2,22,1].sort((a, b) => a - b)* ```*/sort(compareFn?: (a: number, b: number) => number): this;/*** 获取此数组的 ArrayBuffer 存储区的新 Float32Array 视图,引用 begin、inclusive、up to end、exclusive 处的元素。* @param begin 数组开头的索引。* @param end 数组结尾的索引。*/subarray(begin?: number, end?: number): Float32Array;/*** 使用当前区域设置将数字转换为字符串。*/toLocaleString(): string;/*** 返回数组的字符串表示形式。*/toString(): string;/** 返回指定对象的原始值。 */valueOf(): Float32Array;[index: number]: number;
}interface Float32ArrayConstructor {readonly prototype: Float32Array;new(length: number): Float32Array;new(array: ArrayLike<number> | ArrayBufferLike): Float32Array;new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float32Array;/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 从一组元素中返回一个新数组。* @param items 要包含在新array对象中的一组元素。*/of(...items: number[]): Float32Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。*/from(arrayLike: ArrayLike<number>): Float32Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。* @param mapfn 在数组的每个元素上调用的 mapping 函数。* @param thisArg 用于调用 mapfn 的 `this` 值。*/from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float32Array;}
declare var Float32Array: Float32ArrayConstructor;/*** 64位浮点值的类型化数组。内容被初始化为0。* 如果无法分配请求的字节数,则会引发异常。*/
interface Float64Array {/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 数组引用的 ArrayBuffer 实例。*/readonly buffer: ArrayBufferLike;/*** 数组的字节长度。*/readonly byteLength: number;/*** 数组的偏移量,以字节为单位。*/readonly byteOffset: number;/*** 在将由 start 和 end 标识的数组的一部分复制到从 position target 开始的同一数组后,返回此对象* @param target 如果target为负,则被视为 length + target,其中 length 是数组的长度。* @param start 如果start为负,则被视为 length + start。如果 end 为负,则被视为 length + end。* @param end 如果未指定,此对象的长度将用作其默认值。*/copyWithin(target: number, start: number, end?: number): this;/*** 确定数组的所有成员是否满足指定的测试。* @param predicate 最多接受三个参数的函数。 every 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 false 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/every(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;/*** 将从 `start` 到 `end` 索引的所有数组元素更改为静态 `value`,并返回修改后的数组* @param value 用于填充数组部分的值* @param start 开始填充数组的索引。如果 start 为负,则被视为 length + start,其中 length 为数组的长度。* @param end 停止填充数组的索引。如果 end 为负,则被视为 length + end。*/fill(value: number, start?: number, end?: number): this;/*** 返回满足回调函数中指定条件的数组元素。* @param predicate 最多接受三个参数的函数。 filter 方法为数组中的每个元素调用一次谓词函数。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/filter(predicate: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;/*** 返回数组中第一个元素的值,其中谓词为真,否则为未定义。* @param predicate find 按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回 true 的元素。如果找到这样的元素,find 会立即返回该元素的值。否则,find 返回 undefined。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;/*** 返回数组中第一个元素的索引,其中谓词为真,否则为-1。* @param predicate find按升序对数组的每个元素调用一次谓词,直到找到一个谓词返回true的元素。如果找到这样的元素,findIndex会立即返回该元素的索引。否则,findIndex返回-1。* @param thisArg 如果提供的话,它将被用作每次谓词调用的 this 值。如果没有提供,则使用 undefined。*/findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;/*** 对数组中的每个元素执行指定的操作。* @param callbackfn  最多接受三个参数的函数。 forEach 为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg  this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;/*** 返回数组中某个值第一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/indexOf(searchElement: number, fromIndex?: number): number;/*** 添加由指定分隔符字符串分隔的数组的所有元素。* @param separator 用于将数组中的一个元素与结果字符串中的下一个元素分隔开的字符串。如果省略,数组元素用逗号分隔。*/join(separator?: string): string;/*** 返回数组中某个值最后一次出现的索引。* @param searchElement 要在数组中定位的值。* @param fromIndex 开始搜索的数组索引。如果省略 fromIndex,则从索引0开始搜索。*/lastIndexOf(searchElement: number, fromIndex?: number): number;/*** 数组的长度。*/readonly length: number;/*** 对数组的每个元素调用定义的回调函数,并返回包含结果的数组。* @param callbackfn 最多接受三个参数的函数。 map 方法为数组中的每个元素调用一次 callbackfn 函数。* @param thisArg this 关键字可以在 callbackfn 函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;/*** 为数组中的所有元素调用指定的回调函数。回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduce方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduce<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;/*** 按降序为数组中的所有元素调用指定的回调函数。* 回调函数的返回值是累加的结果,并在下次调用回调函数时作为参数提供。* @param callbackfn 最多接受四个参数的函数。reduceRight方法为数组中的每个元素调用一次 callbackfn 函数。* @param initialValue 如果指定了initialValue,它将用作开始累加的初始值。对 callbackfn 函数的第一次调用将此值作为参数而不是数组值提供。*/reduceRight<U>(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;/*** 反转数组中的元素。*/reverse(): Float64Array;/*** 设置一个值或一组值。* @param array 要设置的类型化或非类型化的值数组。* @param offset 当前数组中要写入值的索引。*/set(array: ArrayLike<number>, offset?: number): void;/*** 返回数组的一部分。* @param start 数组指定部分的开始。* @param end 数组指定部分的结尾。这不包括索引 `end` 处的元素。*/slice(start?: number, end?: number): Float64Array;/*** 确定指定的回调函数是否为数组中的任何元素返回 true。* @param predicate 最多接受三个参数的函数。 some 方法为数组中的每个元素调用谓词函数,直到谓词返回一个可强制为布尔值 true 的值,或者直到数组结束。* @param thisArg this 关键字可以在谓词函数中引用的对象。* 如果省略 thisArg,则使用 undefined 作为 this 值。*/some(predicate: (value: number, index: number, array: Float64Array) => unknown, thisArg?: any): boolean;/*** 对数组进行排序。* @param compareFn 用于确定元素顺序的函数。如果第一个参数小于第二个参数,它将返回一个负值,如果它们相等,则返回零,否则返回正值。如果省略,元素将按升序排序。* ```ts* [11,2,22,1].sort((a, b) => a - b)* ```*/sort(compareFn?: (a: number, b: number) => number): this;/*** 从 begin,包含,到 end,不包含。* @param begin 数组开头的索引。* @param end 数组结尾的索引。*/subarray(begin?: number, end?: number): Float64Array;toString(): string;/** 返回指定对象的原始值。 */valueOf(): Float64Array;[index: number]: number;
}interface Float64ArrayConstructor {readonly prototype: Float64Array;new(length: number): Float64Array;new(array: ArrayLike<number> | ArrayBufferLike): Float64Array;new(buffer: ArrayBufferLike, byteOffset?: number, length?: number): Float64Array;/*** 数组中每个元素的字节大小。*/readonly BYTES_PER_ELEMENT: number;/*** 从一组元素中返回一个新数组。* @param items 要包含在新array对象中的一组元素。*/of(...items: number[]): Float64Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。*/from(arrayLike: ArrayLike<number>): Float64Array;/*** 从 array-like 或可迭代的对象创建数组。* @param arrayLike 要转换为数组的 array-like 或可迭代对象。* @param mapfn 在数组的每个元素上调用的 mapping 函数。* @param thisArg 用于调用 mapfn 的 `this` 值。*/from<T>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => number, thisArg?: any): Float64Array;}
declare var Float64Array: Float64ArrayConstructor;/
/// ECMAScript Internationalization API
/declare namespace Intl {interface CollatorOptions {usage?: string | undefined;localeMatcher?: string | undefined;numeric?: boolean | undefined;caseFirst?: string | undefined;sensitivity?: string | undefined;ignorePunctuation?: boolean | undefined;}interface ResolvedCollatorOptions {locale: string;usage: string;sensitivity: string;ignorePunctuation: boolean;collation: string;caseFirst: string;numeric: boolean;}interface Collator {compare(x: string, y: string): number;resolvedOptions(): ResolvedCollatorOptions;}var Collator: {new(locales?: string | string[], options?: CollatorOptions): Collator;(locales?: string | string[], options?: CollatorOptions): Collator;supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];};interface NumberFormatOptions {localeMatcher?: string | undefined;style?: string | undefined;currency?: string | undefined;currencySign?: string | undefined;useGrouping?: boolean | undefined;minimumIntegerDigits?: number | undefined;minimumFractionDigits?: number | undefined;maximumFractionDigits?: number | undefined;minimumSignificantDigits?: number | undefined;maximumSignificantDigits?: number | undefined;}interface ResolvedNumberFormatOptions {locale: string;numberingSystem: string;style: string;currency?: string;minimumIntegerDigits: number;minimumFractionDigits: number;maximumFractionDigits: number;minimumSignificantDigits?: number;maximumSignificantDigits?: number;useGrouping: boolean;}interface NumberFormat {format(value: number): string;resolvedOptions(): ResolvedNumberFormatOptions;}var NumberFormat: {new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];readonly prototype: NumberFormat;};interface DateTimeFormatOptions {localeMatcher?: "best fit" | "lookup" | undefined;weekday?: "long" | "short" | "narrow" | undefined;era?: "long" | "short" | "narrow" | undefined;year?: "numeric" | "2-digit" | undefined;month?: "numeric" | "2-digit" | "long" | "short" | "narrow" | undefined;day?: "numeric" | "2-digit" | undefined;hour?: "numeric" | "2-digit" | undefined;minute?: "numeric" | "2-digit" | undefined;second?: "numeric" | "2-digit" | undefined;timeZoneName?: "short" | "long" | "shortOffset" | "longOffset" | "shortGeneric" | "longGeneric" | undefined;formatMatcher?: "best fit" | "basic" | undefined;hour12?: boolean | undefined;timeZone?: string | undefined;}interface ResolvedDateTimeFormatOptions {locale: string;calendar: string;numberingSystem: string;timeZone: string;hour12?: boolean;weekday?: string;era?: string;year?: string;month?: string;day?: string;hour?: string;minute?: string;second?: string;timeZoneName?: string;}interface DateTimeFormat {format(date?: Date | number): string;resolvedOptions(): ResolvedDateTimeFormatOptions;}var DateTimeFormat: {new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];readonly prototype: DateTimeFormat;};
}interface String {/*** 确定两个字符串在当前或指定的区域设置中是否等效。* @param that 要与目标字符串进行比较的字符串* @param locales 包含一个或多个语言或区域设置标记的区域设置字符串或区域设置字符串数组。如果包含多个区域设置字符串,请按优先级降序列出它们,以便第一个条目是首选区域设置。如果省略此参数,将使用 JavaScript 运行时的默认语言环境。该参数必须符合BCP 47标准;请参见 Intl。Collator 对象以获取详细信息。* @param options 包含一个或多个指定比较选项的属性的对象。请参见Intl。Collator对象以获取详细信息。*/localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number;
}interface Number {/*** 使用当前或指定的区域设置将数字转换为字符串。* @param locales 包含一个或多个语言或区域设置标记的区域设置字符串或区域设置字符串数组。如果包含多个区域设置字符串,请按优先级降序列出它们,以便第一个条目是首选区域设置。如果省略此参数,将使用JavaScript运行时的默认语言环境。* @param options 包含一个或多个指定比较选项的属性的对象。*/toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;
}interface Date {/*** 使用当前或指定的区域设置将日期和时间转换为字符串。* @param locales 包含一个或多个语言或区域设置标记的区域设置字符串或区域设置字符串数组。如果包含多个区域设置字符串,请按优先级降序列出它们,以便第一个条目是首选区域设置。如果省略此参数,将使用JavaScript运行时的默认语言环境。* @param options 包含一个或多个指定比较选项的属性的对象。*/toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;/*** 使用当前或指定的区域设置将日期转换为字符串。* @param locales 包含一个或多个语言或区域设置标记的区域设置字符串或区域设置字符串数组。如果包含多个区域设置字符串,请按优先级降序列出它们,以便第一个条目是首选区域设置。如果省略此参数,将使用JavaScript运行时的默认语言环境。* @param options 包含一个或多个指定比较选项的属性的对象。*/toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;/*** 使用当前或指定的区域设置将时间转换为字符串。* @param locales 包含一个或多个语言或区域设置标记的区域设置字符串或区域设置字符串数组。如果包含多个区域设置字符串,请按优先级降序列出它们,以便第一个条目是首选区域设置。如果省略此参数,将使用JavaScript运行时的默认语言环境。* @param options 包含一个或多个指定比较选项的属性的对象。*/toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;
}

Typescript.中文.接口声明.lib.es5.d.ts相关推荐

  1. typescript利用接口类型声明变量_TypeScript入门指南(基础篇)

       戳蓝字「前端技术优选」关注我们哦! 作者:慕晨同学 原文地址:https://github.com/USTB-musion/fee-skills/issues/19 写在前面 ts是拥有类型系统 ...

  2. 【TS】TypeScript声明文件(.d.ts)的使用

    前言 当我们在TS文件中需要引入外部库时,编译时是无法判断传入参数的类型的,所以我们需要在引入前加入一个声明文件来帮助ts判断类型. 当然现在大部分库都自带有自己的声明文件,一般在@types目录下. ...

  3. TypeScript入门指南:从JS到TS的转变

    文章目录 引言 为什么需要使用 TypeScript? 简单认识一下 TypeScript 的基础语法 1. 类型注解 2. 接口 3. 类 4. 泛型 5. 枚举 从JS到TS的转变策略 总结 引言 ...

  4. Typescript前端接口联调自动化的探究与实践

    源宝导读:Web应用程序一般都是前后端分离的基本架构,而前后端很可能分别是两拨人分别开发,前后端的接口连调成为高频沟通的对象,开发内耗最大的也在这个环节.本文将分享如何基于OpenAPI将前后端接口协 ...

  5. 使用Webpack打包Typescript ES6项目(转ES5)

    前言 目前,ES6标准逐渐成为主流,然而一些旧的浏览器,对于ES6的支持并不十分完善,这时候就需要将ES6转为ES5,以兼容旧的浏览器. Webpack是一个现代 JavaScript 应用程序的静态 ...

  6. 初学TypeScript之接口定义

    TypeScript入门(2) 前面讲了如何使用TypeScript和TypeScript的数据类型有哪些,这一章就讲解TypeScript的接口. 如果不知道如何写TypeScript的朋友或者不知 ...

  7. Go 学习笔记(35)— Go 接口 interface (接口声明、接口初始化、接口方法调用、接口运算、类型断言、类型查询、空接口)

    1. 接口概念 接口是双方约定的一种合作协议.接口实现者不需要关心接口会被怎样使用,调用者也不需要关心接口的实现细节.接口是一种类型,也是一种抽象结构,不会暴露所含数据的格式.类型及结构. 接口内部存 ...

  8. 【Kotlin】接口 ( 声明 | 实现 | 接口方法 | 接口属性 | 接口覆盖冲突 | 接口继承 )

    文章目录 I . 接口总结 II . 接口声明 III . 接口实现 IV . 接口中的方法 V . 接口中的属性 ( 变量 / 常量 ) VI . 接口中的属性属性覆盖 ( 变量 / 常量 ) VI ...

  9. c++中的异常---2(异常接口声明,异常变量的生命周期,异常的多态使用)

    异常接口声明 为了加强程序的可读性,可以在函数声明中列出可能抛出异常的所有类型,例如:void func() throw(A,B,C);这个函数func能够且只能抛出类型A,B,C及其子类的异常 如果 ...

最新文章

  1. 亚马逊首席科学家李沐「实训营」国内独家直播,马上报名 !
  2. SAP QM 执行事务代码QS23为检验特性分配Selected Set的时候报错 - You cannot use entries from catalogs 1 and 3-
  3. 繁体中文转换为简体中文的PHP类
  4. 面试官:CSS垂直居中还有什么另类方法?求职者:不太了解了
  5. java序列化层数_java序列化详解
  6. 20145326蔡馨熤《计算机病毒》——代码的动静态分析结合
  7. Java 常用排序算法实现--快速排序、插入排序、选择、冒泡
  8. 51nod 1423 最大二“货” 单调栈
  9. Word,PDF,PPT,TXT之间的转换方法(
  10. GBK点阵字库制作工具说明及下载
  11. 用word写接口文档时的常规格式设置
  12. 2021-08-03
  13. Android APK反编译教程(带工具)
  14. mbs单位是什么意思计算机,Mbps,MBs什么不一样
  15. java manager层_在阿里Java大牛们都是这样对Java项目代码分层的
  16. tianchai 12023 水管工游戏(DFS搜索)
  17. 制动电阻 DF8B型机车电阻制动装置-奥创电子
  18. 视频教程-Prometheus+Grafana企业级监控实战(运维篇)2020年视频教程-Linux
  19. STM32移植到GD32的问题---20170923
  20. css img图片按比例缩小,保持图片不失真

热门文章

  1. android layout_gravity gravity
  2. 小白如何在window电脑上安装Linux系统(虚拟机)超详细
  3. 用Arduino读取HX711应变片专用模块
  4. 生物电镜常见问题及解答
  5. 微信小程序登陆凭证校验出现{errcode:40029,errmsg:invalid code, hints: [ req_id: weh8ka0297hc58 ]}
  6. Ajax洗洁精的特性,洗涤剂中常用表面活性剂的特点
  7. 移动数据不如移动计算?
  8. kankan转载:Android实现3d翻转效果
  9. linux下mkdir和windows下mkdir的对比
  10. numpy提取某行(列)或某几行(列)