mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
feat: TypeScript 5.6 and npm:@types/node@22
(#25614)
This commit is contained in:
parent
2c0bf6fd65
commit
af2d992ecd
52 changed files with 6145 additions and 4998 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1375,9 +1375,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "deno_config"
|
||||
version = "0.34.0"
|
||||
version = "0.34.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "353595ebd9d19602f4cc0bb5613ae8bf036fb23ce1e6638eec594a63b1f8d48a"
|
||||
checksum = "764368ba1424ea74f9a28d8e2e7633f57d008e73f76b12bc272f6d5903ca1e08"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"deno_package_json",
|
||||
|
|
|
@ -65,7 +65,7 @@ winres.workspace = true
|
|||
[dependencies]
|
||||
deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] }
|
||||
deno_cache_dir = { workspace = true }
|
||||
deno_config = { version = "=0.34.0", features = ["workspace", "sync"] }
|
||||
deno_config = { version = "=0.34.2", features = ["workspace", "sync"] }
|
||||
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
|
||||
deno_doc = { version = "0.148.0", features = ["html", "syntect"] }
|
||||
deno_graph = { version = "=0.82.1" }
|
||||
|
|
10
cli/build.rs
10
cli/build.rs
|
@ -13,7 +13,6 @@ mod ts {
|
|||
use deno_core::error::AnyError;
|
||||
use deno_core::op2;
|
||||
use deno_core::OpState;
|
||||
use deno_runtime::deno_node::SUPPORTED_BUILTIN_NODE_MODULES;
|
||||
use serde::Serialize;
|
||||
use std::collections::HashMap;
|
||||
use std::io::Write;
|
||||
|
@ -25,7 +24,6 @@ mod ts {
|
|||
struct BuildInfoResponse {
|
||||
build_specifier: String,
|
||||
libs: Vec<String>,
|
||||
node_built_in_module_names: Vec<String>,
|
||||
}
|
||||
|
||||
#[op2]
|
||||
|
@ -37,14 +35,9 @@ mod ts {
|
|||
.iter()
|
||||
.map(|s| s.to_string())
|
||||
.collect();
|
||||
let node_built_in_module_names = SUPPORTED_BUILTIN_NODE_MODULES
|
||||
.iter()
|
||||
.map(|s| s.to_string())
|
||||
.collect();
|
||||
BuildInfoResponse {
|
||||
build_specifier,
|
||||
libs: build_libs,
|
||||
node_built_in_module_names,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -243,6 +236,7 @@ mod ts {
|
|||
"esnext.decorators",
|
||||
"esnext.disposable",
|
||||
"esnext.intl",
|
||||
"esnext.iterator",
|
||||
"esnext.object",
|
||||
"esnext.promise",
|
||||
"esnext.regexp",
|
||||
|
@ -446,7 +440,7 @@ fn main() {
|
|||
);
|
||||
|
||||
let ts_version = ts::version();
|
||||
debug_assert_eq!(ts_version, "5.5.2"); // bump this assertion when it changes
|
||||
debug_assert_eq!(ts_version, "5.6.2"); // bump this assertion when it changes
|
||||
println!("cargo:rustc-env=TS_VERSION={}", ts_version);
|
||||
println!("cargo:rerun-if-env-changed=TS_VERSION");
|
||||
|
||||
|
|
|
@ -5475,7 +5475,6 @@ mod tests {
|
|||
let (temp_dir, ts_server, snapshot, _) = setup(
|
||||
json!({
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"noEmit": true,
|
||||
"lib": [],
|
||||
}),
|
||||
|
@ -5521,7 +5520,6 @@ mod tests {
|
|||
let (temp_dir, ts_server, snapshot, _) = setup(
|
||||
json!({
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"jsx": "react",
|
||||
"lib": ["esnext", "dom", "deno.ns"],
|
||||
"noEmit": true,
|
||||
|
@ -5547,7 +5545,6 @@ mod tests {
|
|||
let (temp_dir, ts_server, snapshot, _) = setup(
|
||||
json!({
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"lib": ["deno.ns", "deno.window"],
|
||||
"noEmit": true,
|
||||
}),
|
||||
|
@ -5578,7 +5575,6 @@ mod tests {
|
|||
let (temp_dir, ts_server, snapshot, _) = setup(
|
||||
json!({
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"lib": ["deno.ns", "deno.window"],
|
||||
"noEmit": true,
|
||||
}),
|
||||
|
@ -5624,7 +5620,6 @@ mod tests {
|
|||
let (temp_dir, ts_server, snapshot, _) = setup(
|
||||
json!({
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"lib": ["deno.ns", "deno.window"],
|
||||
"noEmit": true,
|
||||
}),
|
||||
|
@ -5655,7 +5650,6 @@ mod tests {
|
|||
let (temp_dir, ts_server, snapshot, _) = setup(
|
||||
json!({
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"lib": ["deno.ns", "deno.window"],
|
||||
"noEmit": true,
|
||||
}),
|
||||
|
@ -5722,7 +5716,6 @@ mod tests {
|
|||
let (temp_dir, ts_server, snapshot, _) = setup(
|
||||
json!({
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"lib": ["deno.ns", "deno.window"],
|
||||
"noEmit": true,
|
||||
}),
|
||||
|
@ -5800,7 +5793,6 @@ mod tests {
|
|||
let (temp_dir, ts_server, snapshot, cache) = setup(
|
||||
json!({
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"lib": ["deno.ns", "deno.window"],
|
||||
"noEmit": true,
|
||||
}),
|
||||
|
@ -5942,7 +5934,6 @@ mod tests {
|
|||
let (temp_dir, ts_server, snapshot, _) = setup(
|
||||
json!({
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"lib": ["deno.ns", "deno.window"],
|
||||
"noEmit": true,
|
||||
}),
|
||||
|
@ -6093,7 +6084,6 @@ mod tests {
|
|||
let (temp_dir, ts_server, snapshot, _) = setup(
|
||||
json!({
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"lib": ["deno.ns", "deno.window"],
|
||||
"noEmit": true,
|
||||
}),
|
||||
|
@ -6202,7 +6192,6 @@ mod tests {
|
|||
let (temp_dir, ts_server, snapshot, _) = setup(
|
||||
json!({
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"lib": ["deno.ns", "deno.window"],
|
||||
"noEmit": true,
|
||||
}),
|
||||
|
@ -6273,7 +6262,6 @@ mod tests {
|
|||
let (temp_dir, _, snapshot, _) = setup(
|
||||
json!({
|
||||
"target": "esnext",
|
||||
"module": "esnext",
|
||||
"lib": ["deno.ns", "deno.window"],
|
||||
"noEmit": true,
|
||||
}),
|
||||
|
|
|
@ -318,7 +318,7 @@ fn get_npm_pending_resolver(
|
|||
// WARNING: When bumping this version, check if anything needs to be
|
||||
// updated in the `setNodeOnlyGlobalNames` call in 99_main_compiler.js
|
||||
types_node_version_req: Some(
|
||||
VersionReq::parse_from_npm("18.0.0 - 18.16.19").unwrap(),
|
||||
VersionReq::parse_from_npm("22.0.0 - 22.5.4").unwrap(),
|
||||
),
|
||||
},
|
||||
)
|
||||
|
|
|
@ -84,7 +84,9 @@ impl TypeChecker {
|
|||
graph: ModuleGraph,
|
||||
options: CheckOptions,
|
||||
) -> Result<Arc<ModuleGraph>, AnyError> {
|
||||
let (graph, diagnostics) = self.check_diagnostics(graph, options).await?;
|
||||
let (graph, mut diagnostics) =
|
||||
self.check_diagnostics(graph, options).await?;
|
||||
diagnostics.emit_warnings();
|
||||
if diagnostics.is_empty() {
|
||||
Ok(graph)
|
||||
} else {
|
||||
|
|
8153
cli/tsc/00_typescript.js
vendored
8153
cli/tsc/00_typescript.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -462,6 +462,8 @@ delete Object.prototype.__proto__;
|
|||
// TS2792: Cannot find module. Did you mean to set the 'moduleResolution'
|
||||
// option to 'node', or to add aliases to the 'paths' option?
|
||||
2792,
|
||||
// TS2307: Cannot find module '{0}' or its corresponding type declarations.
|
||||
2307,
|
||||
// TS5009: Cannot find the common subdirectory path for the input files.
|
||||
5009,
|
||||
// TS5055: Cannot write file
|
||||
|
@ -942,6 +944,8 @@ delete Object.prototype.__proto__;
|
|||
Object.assign(options, {
|
||||
allowNonTsExtensions: true,
|
||||
allowImportingTsExtensions: true,
|
||||
module: ts.ModuleKind.NodeNext,
|
||||
moduleResolution: ts.ModuleResolutionKind.NodeNext,
|
||||
});
|
||||
if (errors.length > 0 && logDebug) {
|
||||
debug(ts.formatDiagnostics(errors, host));
|
||||
|
@ -1021,7 +1025,7 @@ delete Object.prototype.__proto__;
|
|||
: ts.sortAndDeduplicateDiagnostics(
|
||||
checkFiles.map((s) => program.getSemanticDiagnostics(s)).flat(),
|
||||
)),
|
||||
].filter((diagnostic) => !IGNORED_DIAGNOSTICS.includes(diagnostic.code));
|
||||
].filter(filterMapDiagnostic);
|
||||
|
||||
// emit the tsbuildinfo file
|
||||
// @ts-ignore: emitBuildInfo is not exposed (https://github.com/microsoft/TypeScript/issues/49871)
|
||||
|
@ -1036,6 +1040,27 @@ delete Object.prototype.__proto__;
|
|||
debug("<<< exec stop");
|
||||
}
|
||||
|
||||
/** @param {ts.Diagnostic} diagnostic */
|
||||
function filterMapDiagnostic(diagnostic) {
|
||||
if (IGNORED_DIAGNOSTICS.includes(diagnostic.code)) {
|
||||
return false;
|
||||
}
|
||||
// make the diagnostic for using an `export =` in an es module a warning
|
||||
if (diagnostic.code === 1203) {
|
||||
diagnostic.category = ts.DiagnosticCategory.Warning;
|
||||
if (typeof diagnostic.messageText === "string") {
|
||||
const message =
|
||||
" This will start erroring in a future version of Deno 2 " +
|
||||
"in order to align with TypeScript.";
|
||||
// seems typescript shares objects, so check if it's already been set
|
||||
if (!diagnostic.messageText.endsWith(message)) {
|
||||
diagnostic.messageText += message;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {any} e
|
||||
* @returns {e is (OperationCanceledError | ts.OperationCanceledException)}
|
||||
|
@ -1107,7 +1132,8 @@ delete Object.prototype.__proto__;
|
|||
"experimentalDecorators": false,
|
||||
"isolatedModules": true,
|
||||
"lib": ["deno.ns", "deno.window", "deno.unstable"],
|
||||
"module": "esnext",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"moduleDetection": "force",
|
||||
"noEmit": true,
|
||||
"resolveJsonModule": true,
|
||||
|
@ -1249,7 +1275,7 @@ delete Object.prototype.__proto__;
|
|||
...ls.getSemanticDiagnostics(specifier),
|
||||
...ls.getSuggestionDiagnostics(specifier),
|
||||
...ls.getSyntacticDiagnostics(specifier),
|
||||
].filter(({ code }) => !IGNORED_DIAGNOSTICS.includes(code)));
|
||||
].filter(filterMapDiagnostic));
|
||||
}
|
||||
return respond(id, diagnosticMap);
|
||||
} catch (e) {
|
||||
|
@ -1295,48 +1321,38 @@ delete Object.prototype.__proto__;
|
|||
// A build time only op that provides some setup information that is used to
|
||||
// ensure the snapshot is setup properly.
|
||||
/** @type {{ buildSpecifier: string; libs: string[]; nodeBuiltInModuleNames: string[] }} */
|
||||
const { buildSpecifier, libs, nodeBuiltInModuleNames } = ops.op_build_info();
|
||||
|
||||
ts.deno.setNodeBuiltInModuleNames(nodeBuiltInModuleNames);
|
||||
const { buildSpecifier, libs } = ops.op_build_info();
|
||||
|
||||
// list of globals that should be kept in Node's globalThis
|
||||
ts.deno.setNodeOnlyGlobalNames([
|
||||
// when bumping the @types/node version we should check if
|
||||
// anything needs to be updated here
|
||||
"NodeRequire",
|
||||
"RequireResolve",
|
||||
"RequireResolve",
|
||||
"process",
|
||||
"console",
|
||||
"__filename",
|
||||
"__dirname",
|
||||
"require",
|
||||
"module",
|
||||
"__filename",
|
||||
"Buffer",
|
||||
"BufferConstructor",
|
||||
"BufferEncoding",
|
||||
"clearImmediate",
|
||||
"clearInterval",
|
||||
"clearTimeout",
|
||||
"console",
|
||||
"Console",
|
||||
"ErrorConstructor",
|
||||
"exports",
|
||||
"gc",
|
||||
"BufferEncoding",
|
||||
"BufferConstructor",
|
||||
"WithImplicitCoercion",
|
||||
"Buffer",
|
||||
"Console",
|
||||
"ImportMeta",
|
||||
"setTimeout",
|
||||
"setInterval",
|
||||
"setImmediate",
|
||||
"Global",
|
||||
"AbortController",
|
||||
"AbortSignal",
|
||||
"Blob",
|
||||
"BroadcastChannel",
|
||||
"MessageChannel",
|
||||
"MessagePort",
|
||||
"Event",
|
||||
"EventTarget",
|
||||
"performance",
|
||||
"TextDecoder",
|
||||
"TextEncoder",
|
||||
"URL",
|
||||
"URLSearchParams",
|
||||
"ImportMeta",
|
||||
"localStorage",
|
||||
"module",
|
||||
"NodeModule",
|
||||
"NodeRequire",
|
||||
"process",
|
||||
"queueMicrotask",
|
||||
"RequestInit",
|
||||
"require",
|
||||
"ResponseInit",
|
||||
"sessionStorage",
|
||||
"setImmediate",
|
||||
"setInterval",
|
||||
"setTimeout",
|
||||
]);
|
||||
|
||||
for (const lib of libs) {
|
||||
|
|
64
cli/tsc/_analyze_types_node.ts
Executable file
64
cli/tsc/_analyze_types_node.ts
Executable file
|
@ -0,0 +1,64 @@
|
|||
#!/usr/bin/env -S deno run --allow-env --allow-read --allow-write=.
|
||||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||
import {
|
||||
ModuleDeclarationKind,
|
||||
Node,
|
||||
Project,
|
||||
ts,
|
||||
} from "jsr:@ts-morph/ts-morph@23";
|
||||
import { Path } from "jsr:@david/path@0.2";
|
||||
|
||||
const dir = new Path(import.meta.dirname!);
|
||||
const typesNodeDir = dir.join("../../../DefinitelyTyped/types/node");
|
||||
|
||||
const project = new Project({
|
||||
tsConfigFilePath: typesNodeDir.join("tsconfig.json").toString(),
|
||||
});
|
||||
const names = new Set<string>();
|
||||
const ignoredNames = new Set<string>([
|
||||
"Array",
|
||||
"BigInt64Array",
|
||||
"BigUint64Array",
|
||||
"Float32Array",
|
||||
"Float64Array",
|
||||
"Int16Array",
|
||||
"Int32Array",
|
||||
"Int8Array",
|
||||
"NodeJS",
|
||||
"ReadonlyArray",
|
||||
"RelativeIndexable",
|
||||
"RequireResolve",
|
||||
"String",
|
||||
"SymbolConstructor",
|
||||
"Uint16Array",
|
||||
"Uint32Array",
|
||||
"Uint8Array",
|
||||
"Uint8ClampedArray",
|
||||
"WithImplicitCoercion",
|
||||
]);
|
||||
|
||||
for (const file of project.getSourceFiles()) {
|
||||
for (
|
||||
const mod of file.getDescendantsOfKind(ts.SyntaxKind.ModuleDeclaration)
|
||||
) {
|
||||
if (mod.getDeclarationKind() !== ModuleDeclarationKind.Global) continue;
|
||||
|
||||
for (const statement of mod.getStatements()) {
|
||||
if (Node.isVariableStatement(statement)) {
|
||||
for (const decl of statement.getDeclarations()) {
|
||||
if (ignoredNames.has(decl.getName())) continue;
|
||||
names.add(decl.getName());
|
||||
}
|
||||
} else if (Node.hasName(statement)) {
|
||||
if (ignoredNames.has(statement.getName())) continue;
|
||||
names.add(statement.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// deno-lint-ignore no-console
|
||||
console.log(
|
||||
"Globals: ",
|
||||
Array.from(names).sort(),
|
||||
);
|
|
@ -280,6 +280,17 @@ impl Diagnostics {
|
|||
Diagnostics(diagnostics)
|
||||
}
|
||||
|
||||
pub fn emit_warnings(&mut self) {
|
||||
self.0.retain(|d| {
|
||||
if d.category == DiagnosticCategory::Warning {
|
||||
log::warn!("{}\n", d);
|
||||
false
|
||||
} else {
|
||||
true
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// Return a set of diagnostics where only the values where the predicate
|
||||
/// returns `true` are included.
|
||||
pub fn filter<P>(self, predicate: P) -> Self
|
||||
|
|
20
cli/tsc/dts/lib.dom.asynciterable.d.ts
vendored
20
cli/tsc/dts/lib.dom.asynciterable.d.ts
vendored
|
@ -20,14 +20,22 @@ and limitations under the License.
|
|||
/// Window Async Iterable APIs
|
||||
/////////////////////////////
|
||||
|
||||
interface FileSystemDirectoryHandleAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<T>;
|
||||
}
|
||||
|
||||
interface FileSystemDirectoryHandle {
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<[string, FileSystemHandle]>;
|
||||
entries(): AsyncIterableIterator<[string, FileSystemHandle]>;
|
||||
keys(): AsyncIterableIterator<string>;
|
||||
values(): AsyncIterableIterator<FileSystemHandle>;
|
||||
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
|
||||
entries(): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
|
||||
keys(): FileSystemDirectoryHandleAsyncIterator<string>;
|
||||
values(): FileSystemDirectoryHandleAsyncIterator<FileSystemHandle>;
|
||||
}
|
||||
|
||||
interface ReadableStreamAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
|
||||
}
|
||||
|
||||
interface ReadableStream<R = any> {
|
||||
[Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): AsyncIterableIterator<R>;
|
||||
values(options?: ReadableStreamIteratorOptions): AsyncIterableIterator<R>;
|
||||
[Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
|
||||
values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
|
||||
}
|
||||
|
|
1228
cli/tsc/dts/lib.dom.d.ts
vendored
1228
cli/tsc/dts/lib.dom.d.ts
vendored
File diff suppressed because it is too large
Load diff
174
cli/tsc/dts/lib.dom.iterable.d.ts
vendored
174
cli/tsc/dts/lib.dom.iterable.d.ts
vendored
|
@ -41,36 +41,36 @@ interface BaseAudioContext {
|
|||
}
|
||||
|
||||
interface CSSKeyframesRule {
|
||||
[Symbol.iterator](): IterableIterator<CSSKeyframeRule>;
|
||||
[Symbol.iterator](): ArrayIterator<CSSKeyframeRule>;
|
||||
}
|
||||
|
||||
interface CSSNumericArray {
|
||||
[Symbol.iterator](): IterableIterator<CSSNumericValue>;
|
||||
entries(): IterableIterator<[number, CSSNumericValue]>;
|
||||
keys(): IterableIterator<number>;
|
||||
values(): IterableIterator<CSSNumericValue>;
|
||||
[Symbol.iterator](): ArrayIterator<CSSNumericValue>;
|
||||
entries(): ArrayIterator<[number, CSSNumericValue]>;
|
||||
keys(): ArrayIterator<number>;
|
||||
values(): ArrayIterator<CSSNumericValue>;
|
||||
}
|
||||
|
||||
interface CSSRuleList {
|
||||
[Symbol.iterator](): IterableIterator<CSSRule>;
|
||||
[Symbol.iterator](): ArrayIterator<CSSRule>;
|
||||
}
|
||||
|
||||
interface CSSStyleDeclaration {
|
||||
[Symbol.iterator](): IterableIterator<string>;
|
||||
[Symbol.iterator](): ArrayIterator<string>;
|
||||
}
|
||||
|
||||
interface CSSTransformValue {
|
||||
[Symbol.iterator](): IterableIterator<CSSTransformComponent>;
|
||||
entries(): IterableIterator<[number, CSSTransformComponent]>;
|
||||
keys(): IterableIterator<number>;
|
||||
values(): IterableIterator<CSSTransformComponent>;
|
||||
[Symbol.iterator](): ArrayIterator<CSSTransformComponent>;
|
||||
entries(): ArrayIterator<[number, CSSTransformComponent]>;
|
||||
keys(): ArrayIterator<number>;
|
||||
values(): ArrayIterator<CSSTransformComponent>;
|
||||
}
|
||||
|
||||
interface CSSUnparsedValue {
|
||||
[Symbol.iterator](): IterableIterator<CSSUnparsedSegment>;
|
||||
entries(): IterableIterator<[number, CSSUnparsedSegment]>;
|
||||
keys(): IterableIterator<number>;
|
||||
values(): IterableIterator<CSSUnparsedSegment>;
|
||||
[Symbol.iterator](): ArrayIterator<CSSUnparsedSegment>;
|
||||
entries(): ArrayIterator<[number, CSSUnparsedSegment]>;
|
||||
keys(): ArrayIterator<number>;
|
||||
values(): ArrayIterator<CSSUnparsedSegment>;
|
||||
}
|
||||
|
||||
interface Cache {
|
||||
|
@ -92,72 +92,80 @@ interface CustomStateSet extends Set<string> {
|
|||
}
|
||||
|
||||
interface DOMRectList {
|
||||
[Symbol.iterator](): IterableIterator<DOMRect>;
|
||||
[Symbol.iterator](): ArrayIterator<DOMRect>;
|
||||
}
|
||||
|
||||
interface DOMStringList {
|
||||
[Symbol.iterator](): IterableIterator<string>;
|
||||
[Symbol.iterator](): ArrayIterator<string>;
|
||||
}
|
||||
|
||||
interface DOMTokenList {
|
||||
[Symbol.iterator](): IterableIterator<string>;
|
||||
entries(): IterableIterator<[number, string]>;
|
||||
keys(): IterableIterator<number>;
|
||||
values(): IterableIterator<string>;
|
||||
[Symbol.iterator](): ArrayIterator<string>;
|
||||
entries(): ArrayIterator<[number, string]>;
|
||||
keys(): ArrayIterator<number>;
|
||||
values(): ArrayIterator<string>;
|
||||
}
|
||||
|
||||
interface DataTransferItemList {
|
||||
[Symbol.iterator](): IterableIterator<DataTransferItem>;
|
||||
[Symbol.iterator](): ArrayIterator<DataTransferItem>;
|
||||
}
|
||||
|
||||
interface EventCounts extends ReadonlyMap<string, number> {
|
||||
}
|
||||
|
||||
interface FileList {
|
||||
[Symbol.iterator](): IterableIterator<File>;
|
||||
[Symbol.iterator](): ArrayIterator<File>;
|
||||
}
|
||||
|
||||
interface FontFaceSet extends Set<FontFace> {
|
||||
}
|
||||
|
||||
interface FormDataIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): FormDataIterator<T>;
|
||||
}
|
||||
|
||||
interface FormData {
|
||||
[Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
|
||||
[Symbol.iterator](): FormDataIterator<[string, FormDataEntryValue]>;
|
||||
/** Returns an array of key, value pairs for every entry in the list. */
|
||||
entries(): IterableIterator<[string, FormDataEntryValue]>;
|
||||
entries(): FormDataIterator<[string, FormDataEntryValue]>;
|
||||
/** Returns a list of keys in the list. */
|
||||
keys(): IterableIterator<string>;
|
||||
keys(): FormDataIterator<string>;
|
||||
/** Returns a list of values in the list. */
|
||||
values(): IterableIterator<FormDataEntryValue>;
|
||||
values(): FormDataIterator<FormDataEntryValue>;
|
||||
}
|
||||
|
||||
interface HTMLAllCollection {
|
||||
[Symbol.iterator](): IterableIterator<Element>;
|
||||
[Symbol.iterator](): ArrayIterator<Element>;
|
||||
}
|
||||
|
||||
interface HTMLCollectionBase {
|
||||
[Symbol.iterator](): IterableIterator<Element>;
|
||||
[Symbol.iterator](): ArrayIterator<Element>;
|
||||
}
|
||||
|
||||
interface HTMLCollectionOf<T extends Element> {
|
||||
[Symbol.iterator](): IterableIterator<T>;
|
||||
[Symbol.iterator](): ArrayIterator<T>;
|
||||
}
|
||||
|
||||
interface HTMLFormElement {
|
||||
[Symbol.iterator](): IterableIterator<Element>;
|
||||
[Symbol.iterator](): ArrayIterator<Element>;
|
||||
}
|
||||
|
||||
interface HTMLSelectElement {
|
||||
[Symbol.iterator](): IterableIterator<HTMLOptionElement>;
|
||||
[Symbol.iterator](): ArrayIterator<HTMLOptionElement>;
|
||||
}
|
||||
|
||||
interface HeadersIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): HeadersIterator<T>;
|
||||
}
|
||||
|
||||
interface Headers {
|
||||
[Symbol.iterator](): IterableIterator<[string, string]>;
|
||||
[Symbol.iterator](): HeadersIterator<[string, string]>;
|
||||
/** Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
||||
entries(): IterableIterator<[string, string]>;
|
||||
entries(): HeadersIterator<[string, string]>;
|
||||
/** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
||||
keys(): IterableIterator<string>;
|
||||
keys(): HeadersIterator<string>;
|
||||
/** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
||||
values(): IterableIterator<string>;
|
||||
values(): HeadersIterator<string>;
|
||||
}
|
||||
|
||||
interface Highlight extends Set<AbstractRange> {
|
||||
|
@ -197,32 +205,32 @@ interface MIDIOutput {
|
|||
interface MIDIOutputMap extends ReadonlyMap<string, MIDIOutput> {
|
||||
}
|
||||
|
||||
interface MediaKeyStatusMapIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): MediaKeyStatusMapIterator<T>;
|
||||
}
|
||||
|
||||
interface MediaKeyStatusMap {
|
||||
[Symbol.iterator](): IterableIterator<[BufferSource, MediaKeyStatus]>;
|
||||
entries(): IterableIterator<[BufferSource, MediaKeyStatus]>;
|
||||
keys(): IterableIterator<BufferSource>;
|
||||
values(): IterableIterator<MediaKeyStatus>;
|
||||
[Symbol.iterator](): MediaKeyStatusMapIterator<[BufferSource, MediaKeyStatus]>;
|
||||
entries(): MediaKeyStatusMapIterator<[BufferSource, MediaKeyStatus]>;
|
||||
keys(): MediaKeyStatusMapIterator<BufferSource>;
|
||||
values(): MediaKeyStatusMapIterator<MediaKeyStatus>;
|
||||
}
|
||||
|
||||
interface MediaList {
|
||||
[Symbol.iterator](): IterableIterator<string>;
|
||||
[Symbol.iterator](): ArrayIterator<string>;
|
||||
}
|
||||
|
||||
interface MessageEvent<T = any> {
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/initMessageEvent)
|
||||
*/
|
||||
/** @deprecated */
|
||||
initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
|
||||
}
|
||||
|
||||
interface MimeTypeArray {
|
||||
[Symbol.iterator](): IterableIterator<MimeType>;
|
||||
[Symbol.iterator](): ArrayIterator<MimeType>;
|
||||
}
|
||||
|
||||
interface NamedNodeMap {
|
||||
[Symbol.iterator](): IterableIterator<Attr>;
|
||||
[Symbol.iterator](): ArrayIterator<Attr>;
|
||||
}
|
||||
|
||||
interface Navigator {
|
||||
|
@ -237,82 +245,86 @@ interface Navigator {
|
|||
}
|
||||
|
||||
interface NodeList {
|
||||
[Symbol.iterator](): IterableIterator<Node>;
|
||||
[Symbol.iterator](): ArrayIterator<Node>;
|
||||
/** Returns an array of key, value pairs for every entry in the list. */
|
||||
entries(): IterableIterator<[number, Node]>;
|
||||
entries(): ArrayIterator<[number, Node]>;
|
||||
/** Returns an list of keys in the list. */
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
/** Returns an list of values in the list. */
|
||||
values(): IterableIterator<Node>;
|
||||
values(): ArrayIterator<Node>;
|
||||
}
|
||||
|
||||
interface NodeListOf<TNode extends Node> {
|
||||
[Symbol.iterator](): IterableIterator<TNode>;
|
||||
[Symbol.iterator](): ArrayIterator<TNode>;
|
||||
/** Returns an array of key, value pairs for every entry in the list. */
|
||||
entries(): IterableIterator<[number, TNode]>;
|
||||
entries(): ArrayIterator<[number, TNode]>;
|
||||
/** Returns an list of keys in the list. */
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
/** Returns an list of values in the list. */
|
||||
values(): IterableIterator<TNode>;
|
||||
values(): ArrayIterator<TNode>;
|
||||
}
|
||||
|
||||
interface Plugin {
|
||||
[Symbol.iterator](): IterableIterator<MimeType>;
|
||||
[Symbol.iterator](): ArrayIterator<MimeType>;
|
||||
}
|
||||
|
||||
interface PluginArray {
|
||||
[Symbol.iterator](): IterableIterator<Plugin>;
|
||||
[Symbol.iterator](): ArrayIterator<Plugin>;
|
||||
}
|
||||
|
||||
interface RTCRtpTransceiver {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/RTCRtpTransceiver/setCodecPreferences) */
|
||||
setCodecPreferences(codecs: Iterable<RTCRtpCodecCapability>): void;
|
||||
setCodecPreferences(codecs: Iterable<RTCRtpCodec>): void;
|
||||
}
|
||||
|
||||
interface RTCStatsReport extends ReadonlyMap<string, any> {
|
||||
}
|
||||
|
||||
interface SVGLengthList {
|
||||
[Symbol.iterator](): IterableIterator<SVGLength>;
|
||||
[Symbol.iterator](): ArrayIterator<SVGLength>;
|
||||
}
|
||||
|
||||
interface SVGNumberList {
|
||||
[Symbol.iterator](): IterableIterator<SVGNumber>;
|
||||
[Symbol.iterator](): ArrayIterator<SVGNumber>;
|
||||
}
|
||||
|
||||
interface SVGPointList {
|
||||
[Symbol.iterator](): IterableIterator<DOMPoint>;
|
||||
[Symbol.iterator](): ArrayIterator<DOMPoint>;
|
||||
}
|
||||
|
||||
interface SVGStringList {
|
||||
[Symbol.iterator](): IterableIterator<string>;
|
||||
[Symbol.iterator](): ArrayIterator<string>;
|
||||
}
|
||||
|
||||
interface SVGTransformList {
|
||||
[Symbol.iterator](): IterableIterator<SVGTransform>;
|
||||
[Symbol.iterator](): ArrayIterator<SVGTransform>;
|
||||
}
|
||||
|
||||
interface SourceBufferList {
|
||||
[Symbol.iterator](): IterableIterator<SourceBuffer>;
|
||||
[Symbol.iterator](): ArrayIterator<SourceBuffer>;
|
||||
}
|
||||
|
||||
interface SpeechRecognitionResult {
|
||||
[Symbol.iterator](): IterableIterator<SpeechRecognitionAlternative>;
|
||||
[Symbol.iterator](): ArrayIterator<SpeechRecognitionAlternative>;
|
||||
}
|
||||
|
||||
interface SpeechRecognitionResultList {
|
||||
[Symbol.iterator](): IterableIterator<SpeechRecognitionResult>;
|
||||
[Symbol.iterator](): ArrayIterator<SpeechRecognitionResult>;
|
||||
}
|
||||
|
||||
interface StylePropertyMapReadOnlyIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): StylePropertyMapReadOnlyIterator<T>;
|
||||
}
|
||||
|
||||
interface StylePropertyMapReadOnly {
|
||||
[Symbol.iterator](): IterableIterator<[string, Iterable<CSSStyleValue>]>;
|
||||
entries(): IterableIterator<[string, Iterable<CSSStyleValue>]>;
|
||||
keys(): IterableIterator<string>;
|
||||
values(): IterableIterator<Iterable<CSSStyleValue>>;
|
||||
[Symbol.iterator](): StylePropertyMapReadOnlyIterator<[string, Iterable<CSSStyleValue>]>;
|
||||
entries(): StylePropertyMapReadOnlyIterator<[string, Iterable<CSSStyleValue>]>;
|
||||
keys(): StylePropertyMapReadOnlyIterator<string>;
|
||||
values(): StylePropertyMapReadOnlyIterator<Iterable<CSSStyleValue>>;
|
||||
}
|
||||
|
||||
interface StyleSheetList {
|
||||
[Symbol.iterator](): IterableIterator<CSSStyleSheet>;
|
||||
[Symbol.iterator](): ArrayIterator<CSSStyleSheet>;
|
||||
}
|
||||
|
||||
interface SubtleCrypto {
|
||||
|
@ -331,25 +343,29 @@ interface SubtleCrypto {
|
|||
}
|
||||
|
||||
interface TextTrackCueList {
|
||||
[Symbol.iterator](): IterableIterator<TextTrackCue>;
|
||||
[Symbol.iterator](): ArrayIterator<TextTrackCue>;
|
||||
}
|
||||
|
||||
interface TextTrackList {
|
||||
[Symbol.iterator](): IterableIterator<TextTrack>;
|
||||
[Symbol.iterator](): ArrayIterator<TextTrack>;
|
||||
}
|
||||
|
||||
interface TouchList {
|
||||
[Symbol.iterator](): IterableIterator<Touch>;
|
||||
[Symbol.iterator](): ArrayIterator<Touch>;
|
||||
}
|
||||
|
||||
interface URLSearchParamsIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): URLSearchParamsIterator<T>;
|
||||
}
|
||||
|
||||
interface URLSearchParams {
|
||||
[Symbol.iterator](): IterableIterator<[string, string]>;
|
||||
[Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
|
||||
/** Returns an array of key, value pairs for every entry in the search params. */
|
||||
entries(): IterableIterator<[string, string]>;
|
||||
entries(): URLSearchParamsIterator<[string, string]>;
|
||||
/** Returns a list of keys in the search params. */
|
||||
keys(): IterableIterator<string>;
|
||||
keys(): URLSearchParamsIterator<string>;
|
||||
/** Returns a list of values in the search params. */
|
||||
values(): IterableIterator<string>;
|
||||
values(): URLSearchParamsIterator<string>;
|
||||
}
|
||||
|
||||
interface WEBGL_draw_buffers {
|
||||
|
|
4
cli/tsc/dts/lib.es2015.generator.d.ts
vendored
4
cli/tsc/dts/lib.es2015.generator.d.ts
vendored
|
@ -18,9 +18,9 @@ and limitations under the License.
|
|||
|
||||
/// <reference lib="es2015.iterable" />
|
||||
|
||||
interface Generator<T = unknown, TReturn = any, TNext = unknown> extends Iterator<T, TReturn, TNext> {
|
||||
interface Generator<T = unknown, TReturn = any, TNext = any> extends IteratorObject<T, TReturn, TNext> {
|
||||
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
|
||||
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
|
||||
next(...[value]: [] | [TNext]): IteratorResult<T, TReturn>;
|
||||
return(value: TReturn): IteratorResult<T, TReturn>;
|
||||
throw(e: any): IteratorResult<T, TReturn>;
|
||||
[Symbol.iterator](): Generator<T, TReturn, TNext>;
|
||||
|
|
168
cli/tsc/dts/lib.es2015.iterable.d.ts
vendored
168
cli/tsc/dts/lib.es2015.iterable.d.ts
vendored
|
@ -38,39 +38,59 @@ interface IteratorReturnResult<TReturn> {
|
|||
|
||||
type IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>;
|
||||
|
||||
interface Iterator<T, TReturn = any, TNext = undefined> {
|
||||
interface Iterator<T, TReturn = any, TNext = any> {
|
||||
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
|
||||
next(...args: [] | [TNext]): IteratorResult<T, TReturn>;
|
||||
next(...[value]: [] | [TNext]): IteratorResult<T, TReturn>;
|
||||
return?(value?: TReturn): IteratorResult<T, TReturn>;
|
||||
throw?(e?: any): IteratorResult<T, TReturn>;
|
||||
}
|
||||
|
||||
interface Iterable<T> {
|
||||
[Symbol.iterator](): Iterator<T>;
|
||||
interface Iterable<T, TReturn = any, TNext = any> {
|
||||
[Symbol.iterator](): Iterator<T, TReturn, TNext>;
|
||||
}
|
||||
|
||||
interface IterableIterator<T> extends Iterator<T> {
|
||||
[Symbol.iterator](): IterableIterator<T>;
|
||||
/**
|
||||
* Describes a user-defined {@link Iterator} that is also iterable.
|
||||
*/
|
||||
interface IterableIterator<T, TReturn = any, TNext = any> extends Iterator<T, TReturn, TNext> {
|
||||
[Symbol.iterator](): IterableIterator<T, TReturn, TNext>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes an {@link Iterator} produced by the runtime that inherits from the intrinsic `Iterator.prototype`.
|
||||
*/
|
||||
interface IteratorObject<T, TReturn = unknown, TNext = unknown> extends Iterator<T, TReturn, TNext> {
|
||||
[Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines the `TReturn` type used for built-in iterators produced by `Array`, `Map`, `Set`, and others.
|
||||
* This is `undefined` when `strictBuiltInIteratorReturn` is `true`; otherwise, this is `any`.
|
||||
*/
|
||||
type BuiltinIteratorReturn = intrinsic;
|
||||
|
||||
interface ArrayIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): ArrayIterator<T>;
|
||||
}
|
||||
|
||||
interface Array<T> {
|
||||
/** Iterator */
|
||||
[Symbol.iterator](): IterableIterator<T>;
|
||||
[Symbol.iterator](): ArrayIterator<T>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of key, value pairs for every entry in the array
|
||||
*/
|
||||
entries(): IterableIterator<[number, T]>;
|
||||
entries(): ArrayIterator<[number, T]>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of keys in the array
|
||||
*/
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of values in the array
|
||||
*/
|
||||
values(): IterableIterator<T>;
|
||||
values(): ArrayIterator<T>;
|
||||
}
|
||||
|
||||
interface ArrayConstructor {
|
||||
|
@ -91,67 +111,71 @@ interface ArrayConstructor {
|
|||
|
||||
interface ReadonlyArray<T> {
|
||||
/** Iterator of values in the array. */
|
||||
[Symbol.iterator](): IterableIterator<T>;
|
||||
[Symbol.iterator](): ArrayIterator<T>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of key, value pairs for every entry in the array
|
||||
*/
|
||||
entries(): IterableIterator<[number, T]>;
|
||||
entries(): ArrayIterator<[number, T]>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of keys in the array
|
||||
*/
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of values in the array
|
||||
*/
|
||||
values(): IterableIterator<T>;
|
||||
values(): ArrayIterator<T>;
|
||||
}
|
||||
|
||||
interface IArguments {
|
||||
/** Iterator */
|
||||
[Symbol.iterator](): IterableIterator<any>;
|
||||
[Symbol.iterator](): ArrayIterator<any>;
|
||||
}
|
||||
|
||||
interface MapIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): MapIterator<T>;
|
||||
}
|
||||
|
||||
interface Map<K, V> {
|
||||
/** Returns an iterable of entries in the map. */
|
||||
[Symbol.iterator](): IterableIterator<[K, V]>;
|
||||
[Symbol.iterator](): MapIterator<[K, V]>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of key, value pairs for every entry in the map.
|
||||
*/
|
||||
entries(): IterableIterator<[K, V]>;
|
||||
entries(): MapIterator<[K, V]>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of keys in the map
|
||||
*/
|
||||
keys(): IterableIterator<K>;
|
||||
keys(): MapIterator<K>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of values in the map
|
||||
*/
|
||||
values(): IterableIterator<V>;
|
||||
values(): MapIterator<V>;
|
||||
}
|
||||
|
||||
interface ReadonlyMap<K, V> {
|
||||
/** Returns an iterable of entries in the map. */
|
||||
[Symbol.iterator](): IterableIterator<[K, V]>;
|
||||
[Symbol.iterator](): MapIterator<[K, V]>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of key, value pairs for every entry in the map.
|
||||
*/
|
||||
entries(): IterableIterator<[K, V]>;
|
||||
entries(): MapIterator<[K, V]>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of keys in the map
|
||||
*/
|
||||
keys(): IterableIterator<K>;
|
||||
keys(): MapIterator<K>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of values in the map
|
||||
*/
|
||||
values(): IterableIterator<V>;
|
||||
values(): MapIterator<V>;
|
||||
}
|
||||
|
||||
interface MapConstructor {
|
||||
|
@ -165,42 +189,46 @@ interface WeakMapConstructor {
|
|||
new <K extends WeakKey, V>(iterable: Iterable<readonly [K, V]>): WeakMap<K, V>;
|
||||
}
|
||||
|
||||
interface SetIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): SetIterator<T>;
|
||||
}
|
||||
|
||||
interface Set<T> {
|
||||
/** Iterates over values in the set. */
|
||||
[Symbol.iterator](): IterableIterator<T>;
|
||||
[Symbol.iterator](): SetIterator<T>;
|
||||
/**
|
||||
* Returns an iterable of [v,v] pairs for every value `v` in the set.
|
||||
*/
|
||||
entries(): IterableIterator<[T, T]>;
|
||||
entries(): SetIterator<[T, T]>;
|
||||
/**
|
||||
* Despite its name, returns an iterable of the values in the set.
|
||||
*/
|
||||
keys(): IterableIterator<T>;
|
||||
keys(): SetIterator<T>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of values in the set.
|
||||
*/
|
||||
values(): IterableIterator<T>;
|
||||
values(): SetIterator<T>;
|
||||
}
|
||||
|
||||
interface ReadonlySet<T> {
|
||||
/** Iterates over values in the set. */
|
||||
[Symbol.iterator](): IterableIterator<T>;
|
||||
[Symbol.iterator](): SetIterator<T>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of [v,v] pairs for every value `v` in the set.
|
||||
*/
|
||||
entries(): IterableIterator<[T, T]>;
|
||||
entries(): SetIterator<[T, T]>;
|
||||
|
||||
/**
|
||||
* Despite its name, returns an iterable of the values in the set.
|
||||
*/
|
||||
keys(): IterableIterator<T>;
|
||||
keys(): SetIterator<T>;
|
||||
|
||||
/**
|
||||
* Returns an iterable of values in the set.
|
||||
*/
|
||||
values(): IterableIterator<T>;
|
||||
values(): SetIterator<T>;
|
||||
}
|
||||
|
||||
interface SetConstructor {
|
||||
|
@ -233,25 +261,29 @@ interface PromiseConstructor {
|
|||
race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
|
||||
}
|
||||
|
||||
interface StringIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): StringIterator<T>;
|
||||
}
|
||||
|
||||
interface String {
|
||||
/** Iterator */
|
||||
[Symbol.iterator](): IterableIterator<string>;
|
||||
[Symbol.iterator](): StringIterator<string>;
|
||||
}
|
||||
|
||||
interface Int8Array {
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.iterator](): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the array
|
||||
*/
|
||||
entries(): IterableIterator<[number, number]>;
|
||||
entries(): ArrayIterator<[number, number]>;
|
||||
/**
|
||||
* Returns an list of keys in the array
|
||||
*/
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an list of values in the array
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
values(): ArrayIterator<number>;
|
||||
}
|
||||
|
||||
interface Int8ArrayConstructor {
|
||||
|
@ -267,19 +299,19 @@ interface Int8ArrayConstructor {
|
|||
}
|
||||
|
||||
interface Uint8Array {
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.iterator](): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the array
|
||||
*/
|
||||
entries(): IterableIterator<[number, number]>;
|
||||
entries(): ArrayIterator<[number, number]>;
|
||||
/**
|
||||
* Returns an list of keys in the array
|
||||
*/
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an list of values in the array
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
values(): ArrayIterator<number>;
|
||||
}
|
||||
|
||||
interface Uint8ArrayConstructor {
|
||||
|
@ -295,21 +327,21 @@ interface Uint8ArrayConstructor {
|
|||
}
|
||||
|
||||
interface Uint8ClampedArray {
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.iterator](): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the array
|
||||
*/
|
||||
entries(): IterableIterator<[number, number]>;
|
||||
entries(): ArrayIterator<[number, number]>;
|
||||
|
||||
/**
|
||||
* Returns an list of keys in the array
|
||||
*/
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
|
||||
/**
|
||||
* Returns an list of values in the array
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
values(): ArrayIterator<number>;
|
||||
}
|
||||
|
||||
interface Uint8ClampedArrayConstructor {
|
||||
|
@ -325,21 +357,21 @@ interface Uint8ClampedArrayConstructor {
|
|||
}
|
||||
|
||||
interface Int16Array {
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.iterator](): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the array
|
||||
*/
|
||||
entries(): IterableIterator<[number, number]>;
|
||||
entries(): ArrayIterator<[number, number]>;
|
||||
|
||||
/**
|
||||
* Returns an list of keys in the array
|
||||
*/
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
|
||||
/**
|
||||
* Returns an list of values in the array
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
values(): ArrayIterator<number>;
|
||||
}
|
||||
|
||||
interface Int16ArrayConstructor {
|
||||
|
@ -355,19 +387,19 @@ interface Int16ArrayConstructor {
|
|||
}
|
||||
|
||||
interface Uint16Array {
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.iterator](): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the array
|
||||
*/
|
||||
entries(): IterableIterator<[number, number]>;
|
||||
entries(): ArrayIterator<[number, number]>;
|
||||
/**
|
||||
* Returns an list of keys in the array
|
||||
*/
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an list of values in the array
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
values(): ArrayIterator<number>;
|
||||
}
|
||||
|
||||
interface Uint16ArrayConstructor {
|
||||
|
@ -383,19 +415,19 @@ interface Uint16ArrayConstructor {
|
|||
}
|
||||
|
||||
interface Int32Array {
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.iterator](): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the array
|
||||
*/
|
||||
entries(): IterableIterator<[number, number]>;
|
||||
entries(): ArrayIterator<[number, number]>;
|
||||
/**
|
||||
* Returns an list of keys in the array
|
||||
*/
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an list of values in the array
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
values(): ArrayIterator<number>;
|
||||
}
|
||||
|
||||
interface Int32ArrayConstructor {
|
||||
|
@ -411,19 +443,19 @@ interface Int32ArrayConstructor {
|
|||
}
|
||||
|
||||
interface Uint32Array {
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.iterator](): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the array
|
||||
*/
|
||||
entries(): IterableIterator<[number, number]>;
|
||||
entries(): ArrayIterator<[number, number]>;
|
||||
/**
|
||||
* Returns an list of keys in the array
|
||||
*/
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an list of values in the array
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
values(): ArrayIterator<number>;
|
||||
}
|
||||
|
||||
interface Uint32ArrayConstructor {
|
||||
|
@ -439,19 +471,19 @@ interface Uint32ArrayConstructor {
|
|||
}
|
||||
|
||||
interface Float32Array {
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.iterator](): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the array
|
||||
*/
|
||||
entries(): IterableIterator<[number, number]>;
|
||||
entries(): ArrayIterator<[number, number]>;
|
||||
/**
|
||||
* Returns an list of keys in the array
|
||||
*/
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an list of values in the array
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
values(): ArrayIterator<number>;
|
||||
}
|
||||
|
||||
interface Float32ArrayConstructor {
|
||||
|
@ -467,19 +499,19 @@ interface Float32ArrayConstructor {
|
|||
}
|
||||
|
||||
interface Float64Array {
|
||||
[Symbol.iterator](): IterableIterator<number>;
|
||||
[Symbol.iterator](): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an array of key, value pairs for every entry in the array
|
||||
*/
|
||||
entries(): IterableIterator<[number, number]>;
|
||||
entries(): ArrayIterator<[number, number]>;
|
||||
/**
|
||||
* Returns an list of keys in the array
|
||||
*/
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
/**
|
||||
* Returns an list of values in the array
|
||||
*/
|
||||
values(): IterableIterator<number>;
|
||||
values(): ArrayIterator<number>;
|
||||
}
|
||||
|
||||
interface Float64ArrayConstructor {
|
||||
|
|
8
cli/tsc/dts/lib.es2017.object.d.ts
vendored
8
cli/tsc/dts/lib.es2017.object.d.ts
vendored
|
@ -18,25 +18,25 @@ and limitations under the License.
|
|||
|
||||
interface ObjectConstructor {
|
||||
/**
|
||||
* Returns an array of values of the enumerable properties of an object
|
||||
* Returns an array of values of the enumerable own properties of an object
|
||||
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
|
||||
*/
|
||||
values<T>(o: { [s: string]: T; } | ArrayLike<T>): T[];
|
||||
|
||||
/**
|
||||
* Returns an array of values of the enumerable properties of an object
|
||||
* Returns an array of values of the enumerable own properties of an object
|
||||
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
|
||||
*/
|
||||
values(o: {}): any[];
|
||||
|
||||
/**
|
||||
* Returns an array of key/values of the enumerable properties of an object
|
||||
* Returns an array of key/values of the enumerable own properties of an object
|
||||
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
|
||||
*/
|
||||
entries<T>(o: { [s: string]: T; } | ArrayLike<T>): [string, T][];
|
||||
|
||||
/**
|
||||
* Returns an array of key/values of the enumerable properties of an object
|
||||
* Returns an array of key/values of the enumerable own properties of an object
|
||||
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
|
||||
*/
|
||||
entries(o: {}): [string, any][];
|
||||
|
|
4
cli/tsc/dts/lib.es2018.asyncgenerator.d.ts
vendored
4
cli/tsc/dts/lib.es2018.asyncgenerator.d.ts
vendored
|
@ -18,9 +18,9 @@ and limitations under the License.
|
|||
|
||||
/// <reference lib="es2018.asynciterable" />
|
||||
|
||||
interface AsyncGenerator<T = unknown, TReturn = any, TNext = unknown> extends AsyncIterator<T, TReturn, TNext> {
|
||||
interface AsyncGenerator<T = unknown, TReturn = any, TNext = any> extends AsyncIteratorObject<T, TReturn, TNext> {
|
||||
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
|
||||
next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
|
||||
next(...[value]: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
|
||||
return(value: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
|
||||
throw(e: any): Promise<IteratorResult<T, TReturn>>;
|
||||
[Symbol.asyncIterator](): AsyncGenerator<T, TReturn, TNext>;
|
||||
|
|
22
cli/tsc/dts/lib.es2018.asynciterable.d.ts
vendored
22
cli/tsc/dts/lib.es2018.asynciterable.d.ts
vendored
|
@ -27,17 +27,27 @@ interface SymbolConstructor {
|
|||
readonly asyncIterator: unique symbol;
|
||||
}
|
||||
|
||||
interface AsyncIterator<T, TReturn = any, TNext = undefined> {
|
||||
interface AsyncIterator<T, TReturn = any, TNext = any> {
|
||||
// NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places.
|
||||
next(...args: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
|
||||
next(...[value]: [] | [TNext]): Promise<IteratorResult<T, TReturn>>;
|
||||
return?(value?: TReturn | PromiseLike<TReturn>): Promise<IteratorResult<T, TReturn>>;
|
||||
throw?(e?: any): Promise<IteratorResult<T, TReturn>>;
|
||||
}
|
||||
|
||||
interface AsyncIterable<T> {
|
||||
[Symbol.asyncIterator](): AsyncIterator<T>;
|
||||
interface AsyncIterable<T, TReturn = any, TNext = any> {
|
||||
[Symbol.asyncIterator](): AsyncIterator<T, TReturn, TNext>;
|
||||
}
|
||||
|
||||
interface AsyncIterableIterator<T> extends AsyncIterator<T> {
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<T>;
|
||||
/**
|
||||
* Describes a user-defined {@link AsyncIterator} that is also async iterable.
|
||||
*/
|
||||
interface AsyncIterableIterator<T, TReturn = any, TNext = any> extends AsyncIterator<T, TReturn, TNext> {
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<T, TReturn, TNext>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Describes an {@link AsyncIterator} produced by the runtime that inherits from the intrinsic `AsyncIterator.prototype`.
|
||||
*/
|
||||
interface AsyncIteratorObject<T, TReturn = unknown, TNext = unknown> extends AsyncIterator<T, TReturn, TNext> {
|
||||
[Symbol.asyncIterator](): AsyncIteratorObject<T, TReturn, TNext>;
|
||||
}
|
||||
|
|
16
cli/tsc/dts/lib.es2020.bigint.d.ts
vendored
16
cli/tsc/dts/lib.es2020.bigint.d.ts
vendored
|
@ -171,7 +171,7 @@ interface BigInt64Array {
|
|||
copyWithin(target: number, start: number, end?: number): this;
|
||||
|
||||
/** Yields index, value pairs for every entry in the array. */
|
||||
entries(): IterableIterator<[number, bigint]>;
|
||||
entries(): ArrayIterator<[number, bigint]>;
|
||||
|
||||
/**
|
||||
* Determines whether all the members of an array satisfy the specified test.
|
||||
|
@ -256,7 +256,7 @@ interface BigInt64Array {
|
|||
join(separator?: string): string;
|
||||
|
||||
/** Yields each index in the array. */
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
|
||||
/**
|
||||
* Returns the index of the last occurrence of a value in an array.
|
||||
|
@ -378,9 +378,9 @@ interface BigInt64Array {
|
|||
valueOf(): BigInt64Array;
|
||||
|
||||
/** Yields each value in the array. */
|
||||
values(): IterableIterator<bigint>;
|
||||
values(): ArrayIterator<bigint>;
|
||||
|
||||
[Symbol.iterator](): IterableIterator<bigint>;
|
||||
[Symbol.iterator](): ArrayIterator<bigint>;
|
||||
|
||||
readonly [Symbol.toStringTag]: "BigInt64Array";
|
||||
|
||||
|
@ -443,7 +443,7 @@ interface BigUint64Array {
|
|||
copyWithin(target: number, start: number, end?: number): this;
|
||||
|
||||
/** Yields index, value pairs for every entry in the array. */
|
||||
entries(): IterableIterator<[number, bigint]>;
|
||||
entries(): ArrayIterator<[number, bigint]>;
|
||||
|
||||
/**
|
||||
* Determines whether all the members of an array satisfy the specified test.
|
||||
|
@ -528,7 +528,7 @@ interface BigUint64Array {
|
|||
join(separator?: string): string;
|
||||
|
||||
/** Yields each index in the array. */
|
||||
keys(): IterableIterator<number>;
|
||||
keys(): ArrayIterator<number>;
|
||||
|
||||
/**
|
||||
* Returns the index of the last occurrence of a value in an array.
|
||||
|
@ -650,9 +650,9 @@ interface BigUint64Array {
|
|||
valueOf(): BigUint64Array;
|
||||
|
||||
/** Yields each value in the array. */
|
||||
values(): IterableIterator<bigint>;
|
||||
values(): ArrayIterator<bigint>;
|
||||
|
||||
[Symbol.iterator](): IterableIterator<bigint>;
|
||||
[Symbol.iterator](): ArrayIterator<bigint>;
|
||||
|
||||
readonly [Symbol.toStringTag]: "BigUint64Array";
|
||||
|
||||
|
|
4
cli/tsc/dts/lib.es2020.string.d.ts
vendored
4
cli/tsc/dts/lib.es2020.string.d.ts
vendored
|
@ -16,7 +16,7 @@ and limitations under the License.
|
|||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
/// <reference lib="es2015.iterable" />
|
||||
/// <reference lib="es2020.symbol.wellknown" />
|
||||
|
||||
interface String {
|
||||
/**
|
||||
|
@ -24,7 +24,7 @@ interface String {
|
|||
* containing the results of that search.
|
||||
* @param regexp A variable name or string literal containing the regular expression pattern and flags.
|
||||
*/
|
||||
matchAll(regexp: RegExp): IterableIterator<RegExpExecArray>;
|
||||
matchAll(regexp: RegExp): RegExpStringIterator<RegExpExecArray>;
|
||||
|
||||
/** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */
|
||||
toLocaleLowerCase(locales?: Intl.LocalesArgument): string;
|
||||
|
|
6
cli/tsc/dts/lib.es2020.symbol.wellknown.d.ts
vendored
6
cli/tsc/dts/lib.es2020.symbol.wellknown.d.ts
vendored
|
@ -27,11 +27,15 @@ interface SymbolConstructor {
|
|||
readonly matchAll: unique symbol;
|
||||
}
|
||||
|
||||
interface RegExpStringIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): RegExpStringIterator<T>;
|
||||
}
|
||||
|
||||
interface RegExp {
|
||||
/**
|
||||
* Matches a string with this regular expression, and returns an iterable of matches
|
||||
* containing the results of that search.
|
||||
* @param string A string to search within.
|
||||
*/
|
||||
[Symbol.matchAll](str: string): IterableIterator<RegExpMatchArray>;
|
||||
[Symbol.matchAll](str: string): RegExpStringIterator<RegExpMatchArray>;
|
||||
}
|
||||
|
|
6
cli/tsc/dts/lib.es2022.intl.d.ts
vendored
6
cli/tsc/dts/lib.es2022.intl.d.ts
vendored
|
@ -46,6 +46,10 @@ declare namespace Intl {
|
|||
granularity: "grapheme" | "word" | "sentence";
|
||||
}
|
||||
|
||||
interface SegmentIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): SegmentIterator<T>;
|
||||
}
|
||||
|
||||
interface Segments {
|
||||
/**
|
||||
* Returns an object describing the segment in the original string that includes the code unit at a specified index.
|
||||
|
@ -55,7 +59,7 @@ declare namespace Intl {
|
|||
containing(codeUnitIndex?: number): SegmentData;
|
||||
|
||||
/** Returns an iterator to iterate over the segments. */
|
||||
[Symbol.iterator](): IterableIterator<SegmentData>;
|
||||
[Symbol.iterator](): SegmentIterator<SegmentData>;
|
||||
}
|
||||
|
||||
interface SegmentData {
|
||||
|
|
10
cli/tsc/dts/lib.es2023.array.d.ts
vendored
10
cli/tsc/dts/lib.es2023.array.d.ts
vendored
|
@ -203,7 +203,7 @@ interface Int8Array {
|
|||
/**
|
||||
* Copies the array and returns the copy with the elements in reverse order.
|
||||
*/
|
||||
toReversed(): Uint8Array;
|
||||
toReversed(): Int8Array;
|
||||
|
||||
/**
|
||||
* Copies and sorts the array.
|
||||
|
@ -211,11 +211,11 @@ interface Int8Array {
|
|||
* a negative value if the first argument is less than the second argument, zero if they're equal, and a positive
|
||||
* value otherwise. If omitted, the elements are sorted in ascending order.
|
||||
* ```ts
|
||||
* const myNums = Uint8Array.from([11, 2, 22, 1]);
|
||||
* myNums.toSorted((a, b) => a - b) // Uint8Array(4) [1, 2, 11, 22]
|
||||
* const myNums = Int8Array.from([11, 2, 22, 1]);
|
||||
* myNums.toSorted((a, b) => a - b) // Int8Array(4) [1, 2, 11, 22]
|
||||
* ```
|
||||
*/
|
||||
toSorted(compareFn?: (a: number, b: number) => number): Uint8Array;
|
||||
toSorted(compareFn?: (a: number, b: number) => number): Int8Array;
|
||||
|
||||
/**
|
||||
* Copies the array and inserts the given number at the provided index.
|
||||
|
@ -224,7 +224,7 @@ interface Int8Array {
|
|||
* @param value The value to insert into the copied array.
|
||||
* @returns A copy of the original array with the inserted value.
|
||||
*/
|
||||
with(index: number, value: number): Uint8Array;
|
||||
with(index: number, value: number): Int8Array;
|
||||
}
|
||||
|
||||
interface Uint8Array {
|
||||
|
|
1
cli/tsc/dts/lib.esnext.d.ts
vendored
1
cli/tsc/dts/lib.esnext.d.ts
vendored
|
@ -26,3 +26,4 @@ and limitations under the License.
|
|||
/// <reference lib="esnext.array" />
|
||||
/// <reference lib="esnext.regexp" />
|
||||
/// <reference lib="esnext.string" />
|
||||
/// <reference lib="esnext.iterator" />
|
||||
|
|
8
cli/tsc/dts/lib.esnext.disposable.d.ts
vendored
8
cli/tsc/dts/lib.esnext.disposable.d.ts
vendored
|
@ -17,6 +17,8 @@ and limitations under the License.
|
|||
/// <reference no-default-lib="true"/>
|
||||
|
||||
/// <reference lib="es2015.symbol" />
|
||||
/// <reference lib="es2015.iterable" />
|
||||
/// <reference lib="es2018.asynciterable" />
|
||||
|
||||
interface SymbolConstructor {
|
||||
/**
|
||||
|
@ -183,3 +185,9 @@ interface AsyncDisposableStackConstructor {
|
|||
readonly prototype: AsyncDisposableStack;
|
||||
}
|
||||
declare var AsyncDisposableStack: AsyncDisposableStackConstructor;
|
||||
|
||||
interface IteratorObject<T, TReturn, TNext> extends Disposable {
|
||||
}
|
||||
|
||||
interface AsyncIteratorObject<T, TReturn, TNext> extends AsyncDisposable {
|
||||
}
|
||||
|
|
148
cli/tsc/dts/lib.esnext.iterator.d.ts
vendored
Normal file
148
cli/tsc/dts/lib.esnext.iterator.d.ts
vendored
Normal file
|
@ -0,0 +1,148 @@
|
|||
/*! *****************************************************************************
|
||||
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.0
|
||||
|
||||
THIS 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.
|
||||
***************************************************************************** */
|
||||
|
||||
|
||||
/// <reference no-default-lib="true"/>
|
||||
|
||||
/// <reference lib="es2015.iterable" />
|
||||
|
||||
// NOTE: This is specified as what is essentially an unreachable module. All actual global declarations can be found
|
||||
// in the `declare global` section, below. This is necessary as there is currently no way to declare an `abstract`
|
||||
// member without declaring a `class`, but declaring `class Iterator<T>` globally would conflict with TypeScript's
|
||||
// general purpose `Iterator<T>` interface.
|
||||
export {};
|
||||
|
||||
// Abstract type that allows us to mark `next` as `abstract`
|
||||
declare abstract class Iterator<T, TResult = undefined, TNext = unknown> { // eslint-disable-line @typescript-eslint/no-unsafe-declaration-merging
|
||||
abstract next(value?: TNext): IteratorResult<T, TResult>;
|
||||
}
|
||||
|
||||
// Merge all members of `IteratorObject<T>` into `Iterator<T>`
|
||||
interface Iterator<T, TResult, TNext> extends globalThis.IteratorObject<T, TResult, TNext> {}
|
||||
|
||||
// Capture the `Iterator` constructor in a type we can use in the `extends` clause of `IteratorConstructor`.
|
||||
type IteratorObjectConstructor = typeof Iterator;
|
||||
|
||||
declare global {
|
||||
// Global `IteratorObject<T, TReturn, TNext>` interface that can be augmented by polyfills
|
||||
interface IteratorObject<T, TReturn, TNext> {
|
||||
/**
|
||||
* Returns this iterator.
|
||||
*/
|
||||
[Symbol.iterator](): IteratorObject<T, TReturn, TNext>;
|
||||
|
||||
/**
|
||||
* Creates an iterator whose values are the result of applying the callback to the values from this iterator.
|
||||
* @param callbackfn A function that accepts up to two arguments to be used to transform values from the underlying iterator.
|
||||
*/
|
||||
map<U>(callbackfn: (value: T, index: number) => U): IteratorObject<U, undefined, unknown>;
|
||||
|
||||
/**
|
||||
* Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
|
||||
* @param predicate A function that accepts up to two arguments to be used to test values from the underlying iterator.
|
||||
*/
|
||||
filter<S extends T>(predicate: (value: T, index: number) => value is S): IteratorObject<S, undefined, unknown>;
|
||||
|
||||
/**
|
||||
* Creates an iterator whose values are those from this iterator for which the provided predicate returns true.
|
||||
* @param predicate A function that accepts up to two arguments to be used to test values from the underlying iterator.
|
||||
*/
|
||||
filter(predicate: (value: T, index: number) => unknown): IteratorObject<T, undefined, unknown>;
|
||||
|
||||
/**
|
||||
* Creates an iterator whose values are the values from this iterator, stopping once the provided limit is reached.
|
||||
* @param limit The maximum number of values to yield.
|
||||
*/
|
||||
take(limit: number): IteratorObject<T, undefined, unknown>;
|
||||
|
||||
/**
|
||||
* Creates an iterator whose values are the values from this iterator after skipping the provided count.
|
||||
* @param count The number of values to drop.
|
||||
*/
|
||||
drop(count: number): IteratorObject<T, undefined, unknown>;
|
||||
|
||||
/**
|
||||
* Creates an iterator whose values are the result of applying the callback to the values from this iterator and then flattening the resulting iterators or iterables.
|
||||
* @param callback A function that accepts up to two arguments to be used to transform values from the underlying iterator into new iterators or iterables to be flattened into the result.
|
||||
*/
|
||||
flatMap<U>(callback: (value: T, index: number) => Iterator<U, unknown, undefined> | Iterable<U, unknown, undefined>): IteratorObject<U, undefined, unknown>;
|
||||
|
||||
/**
|
||||
* Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
|
||||
* @param callbackfn A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the iterator.
|
||||
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of a value from the iterator.
|
||||
*/
|
||||
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T): T;
|
||||
reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number) => T, initialValue: T): T;
|
||||
|
||||
/**
|
||||
* Calls the specified callback function for all the elements in this iterator. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
|
||||
* @param callbackfn A function that accepts up to three arguments. The reduce method calls the callbackfn function one time for each element in the iterator.
|
||||
* @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of a value from the iterator.
|
||||
*/
|
||||
reduce<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number) => U, initialValue: U): U;
|
||||
|
||||
/**
|
||||
* Creates a new array from the values yielded by this iterator.
|
||||
*/
|
||||
toArray(): T[];
|
||||
|
||||
/**
|
||||
* Performs the specified action for each element in the iterator.
|
||||
* @param callbackfn A function that accepts up to two arguments. forEach calls the callbackfn function one time for each element in the iterator.
|
||||
*/
|
||||
forEach(callbackfn: (value: T, index: number) => void): void;
|
||||
|
||||
/**
|
||||
* Determines whether the specified callback function returns true for any element of this iterator.
|
||||
* @param predicate A function that accepts up to two arguments. The some method calls
|
||||
* the predicate function for each element in this iterator until the predicate returns a value
|
||||
* true, or until the end of the iterator.
|
||||
*/
|
||||
some(predicate: (value: T, index: number) => unknown): boolean;
|
||||
|
||||
/**
|
||||
* Determines whether all the members of this iterator satisfy the specified test.
|
||||
* @param predicate A function that accepts up to two arguments. The every method calls
|
||||
* the predicate function for each element in this iterator until the predicate returns
|
||||
* false, or until the end of this iterator.
|
||||
*/
|
||||
every(predicate: (value: T, index: number) => unknown): boolean;
|
||||
|
||||
/**
|
||||
* Returns the value of the first element in this iterator where predicate is true, and undefined
|
||||
* otherwise.
|
||||
* @param predicate find calls predicate once for each element of this iterator, in
|
||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
||||
* immediately returns that element value. Otherwise, find returns undefined.
|
||||
*/
|
||||
find<S extends T>(predicate: (value: T, index: number) => value is S): S | undefined;
|
||||
find(predicate: (value: T, index: number) => unknown): T | undefined;
|
||||
|
||||
readonly [Symbol.toStringTag]: string;
|
||||
}
|
||||
|
||||
// Global `IteratorConstructor` interface that can be augmented by polyfills
|
||||
interface IteratorConstructor extends IteratorObjectConstructor {
|
||||
/**
|
||||
* Creates a native iterator from an iterator or iterable object.
|
||||
* Returns its input if the input already inherits from the built-in Iterator class.
|
||||
* @param value An iterator or iterable object to convert a native iterator.
|
||||
*/
|
||||
from<T>(value: Iterator<T, unknown, undefined> | Iterable<T, unknown, undefined>): IteratorObject<T, undefined, unknown>;
|
||||
}
|
||||
|
||||
var Iterator: IteratorConstructor;
|
||||
}
|
20
cli/tsc/dts/lib.webworker.asynciterable.d.ts
vendored
20
cli/tsc/dts/lib.webworker.asynciterable.d.ts
vendored
|
@ -20,14 +20,22 @@ and limitations under the License.
|
|||
/// Worker Async Iterable APIs
|
||||
/////////////////////////////
|
||||
|
||||
interface FileSystemDirectoryHandleAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<T>;
|
||||
}
|
||||
|
||||
interface FileSystemDirectoryHandle {
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<[string, FileSystemHandle]>;
|
||||
entries(): AsyncIterableIterator<[string, FileSystemHandle]>;
|
||||
keys(): AsyncIterableIterator<string>;
|
||||
values(): AsyncIterableIterator<FileSystemHandle>;
|
||||
[Symbol.asyncIterator](): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
|
||||
entries(): FileSystemDirectoryHandleAsyncIterator<[string, FileSystemHandle]>;
|
||||
keys(): FileSystemDirectoryHandleAsyncIterator<string>;
|
||||
values(): FileSystemDirectoryHandleAsyncIterator<FileSystemHandle>;
|
||||
}
|
||||
|
||||
interface ReadableStreamAsyncIterator<T> extends AsyncIteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.asyncIterator](): ReadableStreamAsyncIterator<T>;
|
||||
}
|
||||
|
||||
interface ReadableStream<R = any> {
|
||||
[Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): AsyncIterableIterator<R>;
|
||||
values(options?: ReadableStreamIteratorOptions): AsyncIterableIterator<R>;
|
||||
[Symbol.asyncIterator](options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
|
||||
values(options?: ReadableStreamIteratorOptions): ReadableStreamAsyncIterator<R>;
|
||||
}
|
||||
|
|
197
cli/tsc/dts/lib.webworker.d.ts
vendored
197
cli/tsc/dts/lib.webworker.d.ts
vendored
|
@ -340,10 +340,6 @@ interface ImageEncodeOptions {
|
|||
type?: string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
url: string;
|
||||
}
|
||||
|
||||
interface JsonWebKey {
|
||||
alg?: string;
|
||||
crv?: string;
|
||||
|
@ -414,6 +410,10 @@ interface MediaEncodingConfiguration extends MediaConfiguration {
|
|||
type: MediaEncodingType;
|
||||
}
|
||||
|
||||
interface MediaStreamTrackProcessorInit {
|
||||
maxBufferSize?: number;
|
||||
}
|
||||
|
||||
interface MessageEventInit<T = any> extends EventInit {
|
||||
data?: T;
|
||||
lastEventId?: string;
|
||||
|
@ -717,16 +717,11 @@ interface TextEncoderEncodeIntoResult {
|
|||
written: number;
|
||||
}
|
||||
|
||||
interface TransformerCancelCallback {
|
||||
(reason: any): void | PromiseLike<void>;
|
||||
}
|
||||
|
||||
interface Transformer<I = any, O = any> {
|
||||
flush?: TransformerFlushCallback<O>;
|
||||
readableType?: undefined;
|
||||
start?: TransformerStartCallback<O>;
|
||||
transform?: TransformerTransformCallback<I, O>;
|
||||
cancel?: TransformerCancelCallback;
|
||||
writableType?: undefined;
|
||||
}
|
||||
|
||||
|
@ -1676,6 +1671,8 @@ interface CanvasShadowStyles {
|
|||
}
|
||||
|
||||
interface CanvasState {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/isContextLost) */
|
||||
isContextLost(): boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/reset) */
|
||||
reset(): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/restore) */
|
||||
|
@ -1812,8 +1809,6 @@ declare var CloseEvent: {
|
|||
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream) */
|
||||
interface CompressionStream extends GenericTransformStream {
|
||||
readonly readable: ReadableStream<Uint8Array>;
|
||||
readonly writable: WritableStream<BufferSource>;
|
||||
}
|
||||
|
||||
declare var CompressionStream: {
|
||||
|
@ -2011,9 +2006,7 @@ interface DOMMatrix extends DOMMatrixReadOnly {
|
|||
rotateAxisAngleSelf(x?: number, y?: number, z?: number, angle?: number): DOMMatrix;
|
||||
rotateFromVectorSelf(x?: number, y?: number): DOMMatrix;
|
||||
rotateSelf(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrix/scale3dSelf) */
|
||||
scale3dSelf(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrix/scaleSelf) */
|
||||
scaleSelf(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
|
||||
skewXSelf(sx?: number): DOMMatrix;
|
||||
skewYSelf(sy?: number): DOMMatrix;
|
||||
|
@ -2030,88 +2023,48 @@ declare var DOMMatrix: {
|
|||
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly) */
|
||||
interface DOMMatrixReadOnly {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/a) */
|
||||
readonly a: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/b) */
|
||||
readonly b: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/c) */
|
||||
readonly c: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/d) */
|
||||
readonly d: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/e) */
|
||||
readonly e: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/f) */
|
||||
readonly f: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/is2D) */
|
||||
readonly is2D: boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/isIdentity) */
|
||||
readonly isIdentity: boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m11) */
|
||||
readonly m11: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m12) */
|
||||
readonly m12: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m13) */
|
||||
readonly m13: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m14) */
|
||||
readonly m14: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m21) */
|
||||
readonly m21: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m22) */
|
||||
readonly m22: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m23) */
|
||||
readonly m23: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m24) */
|
||||
readonly m24: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m31) */
|
||||
readonly m31: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m32) */
|
||||
readonly m32: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m33) */
|
||||
readonly m33: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m34) */
|
||||
readonly m34: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m41) */
|
||||
readonly m41: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m42) */
|
||||
readonly m42: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m43) */
|
||||
readonly m43: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/m44) */
|
||||
readonly m44: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/flipX) */
|
||||
flipX(): DOMMatrix;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/flipY) */
|
||||
flipY(): DOMMatrix;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/inverse) */
|
||||
inverse(): DOMMatrix;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/multiply) */
|
||||
multiply(other?: DOMMatrixInit): DOMMatrix;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/rotate) */
|
||||
rotate(rotX?: number, rotY?: number, rotZ?: number): DOMMatrix;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/rotateAxisAngle) */
|
||||
rotateAxisAngle(x?: number, y?: number, z?: number, angle?: number): DOMMatrix;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/rotateFromVector) */
|
||||
rotateFromVector(x?: number, y?: number): DOMMatrix;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/scale) */
|
||||
scale(scaleX?: number, scaleY?: number, scaleZ?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/scale3d) */
|
||||
scale3d(scale?: number, originX?: number, originY?: number, originZ?: number): DOMMatrix;
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/scaleNonUniform)
|
||||
*/
|
||||
/** @deprecated */
|
||||
scaleNonUniform(scaleX?: number, scaleY?: number): DOMMatrix;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/skewX) */
|
||||
skewX(sx?: number): DOMMatrix;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/skewY) */
|
||||
skewY(sy?: number): DOMMatrix;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/toFloat32Array) */
|
||||
toFloat32Array(): Float32Array;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/toFloat64Array) */
|
||||
toFloat64Array(): Float64Array;
|
||||
toJSON(): any;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/transformPoint) */
|
||||
transformPoint(point?: DOMPointInit): DOMPoint;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/translate) */
|
||||
translate(tx?: number, ty?: number, tz?: number): DOMMatrix;
|
||||
|
@ -2154,7 +2107,6 @@ interface DOMPointReadOnly {
|
|||
readonly y: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/z) */
|
||||
readonly z: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/matrixTransform) */
|
||||
matrixTransform(matrix?: DOMMatrixInit): DOMPoint;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMPointReadOnly/toJSON) */
|
||||
toJSON(): any;
|
||||
|
@ -2169,15 +2121,10 @@ declare var DOMPointReadOnly: {
|
|||
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad) */
|
||||
interface DOMQuad {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/p1) */
|
||||
readonly p1: DOMPoint;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/p2) */
|
||||
readonly p2: DOMPoint;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/p3) */
|
||||
readonly p3: DOMPoint;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/p4) */
|
||||
readonly p4: DOMPoint;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMQuad/getBounds) */
|
||||
getBounds(): DOMRect;
|
||||
toJSON(): any;
|
||||
}
|
||||
|
@ -2200,6 +2147,7 @@ interface DOMRect extends DOMRectReadOnly {
|
|||
declare var DOMRect: {
|
||||
prototype: DOMRect;
|
||||
new(x?: number, y?: number, width?: number, height?: number): DOMRect;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRect/fromRect_static) */
|
||||
fromRect(other?: DOMRectInit): DOMRect;
|
||||
};
|
||||
|
||||
|
@ -2265,8 +2213,6 @@ declare var DOMStringList: {
|
|||
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/DecompressionStream) */
|
||||
interface DecompressionStream extends GenericTransformStream {
|
||||
readonly readable: ReadableStream<Uint8Array>;
|
||||
readonly writable: WritableStream<BufferSource>;
|
||||
}
|
||||
|
||||
declare var DecompressionStream: {
|
||||
|
@ -2427,15 +2373,10 @@ declare var EncodedVideoChunk: {
|
|||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent)
|
||||
*/
|
||||
interface ErrorEvent extends Event {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/colno) */
|
||||
readonly colno: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/error) */
|
||||
readonly error: any;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/filename) */
|
||||
readonly filename: string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/lineno) */
|
||||
readonly lineno: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ErrorEvent/message) */
|
||||
readonly message: string;
|
||||
}
|
||||
|
||||
|
@ -3091,7 +3032,9 @@ declare var FormData: {
|
|||
};
|
||||
|
||||
interface GenericTransformStream {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream/readable) */
|
||||
readonly readable: ReadableStream;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/CompressionStream/writable) */
|
||||
readonly writable: WritableStream;
|
||||
}
|
||||
|
||||
|
@ -3750,7 +3693,7 @@ interface IDBTransaction extends EventTarget {
|
|||
/**
|
||||
* Returns a list of the names of object stores in the transaction's scope. For an upgrade transaction this is all object stores in the database.
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBTransaction/objectStoreNames)
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBTransaction/ObjectStoreNames)
|
||||
*/
|
||||
readonly objectStoreNames: DOMStringList;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/IDBTransaction/abort_event) */
|
||||
|
@ -3877,6 +3820,11 @@ declare var ImageData: {
|
|||
new(data: Uint8ClampedArray, sw: number, sh?: number, settings?: ImageDataSettings): ImageData;
|
||||
};
|
||||
|
||||
interface ImportMeta {
|
||||
url: string;
|
||||
resolve(specifier: string): string;
|
||||
}
|
||||
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/KHR_parallel_shader_compile) */
|
||||
interface KHR_parallel_shader_compile {
|
||||
readonly COMPLETION_STATUS_KHR: 0x91B1;
|
||||
|
@ -3930,6 +3878,26 @@ declare var MediaCapabilities: {
|
|||
new(): MediaCapabilities;
|
||||
};
|
||||
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaSourceHandle) */
|
||||
interface MediaSourceHandle {
|
||||
}
|
||||
|
||||
declare var MediaSourceHandle: {
|
||||
prototype: MediaSourceHandle;
|
||||
new(): MediaSourceHandle;
|
||||
};
|
||||
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaStreamTrackProcessor) */
|
||||
interface MediaStreamTrackProcessor {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/MediaStreamTrackProcessor/readable) */
|
||||
readonly readable: ReadableStream;
|
||||
}
|
||||
|
||||
declare var MediaStreamTrackProcessor: {
|
||||
prototype: MediaStreamTrackProcessor;
|
||||
new(init: MediaStreamTrackProcessorInit): MediaStreamTrackProcessor;
|
||||
};
|
||||
|
||||
/**
|
||||
* This Channel Messaging API interface allows us to create a new message channel and send data through it via its two MessagePort properties.
|
||||
*
|
||||
|
@ -3991,11 +3959,7 @@ interface MessageEvent<T = any> extends Event {
|
|||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/source)
|
||||
*/
|
||||
readonly source: MessageEventSource | null;
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/initMessageEvent)
|
||||
*/
|
||||
/** @deprecated */
|
||||
initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: MessagePort[]): void;
|
||||
}
|
||||
|
||||
|
@ -4327,7 +4291,9 @@ interface OffscreenCanvas extends EventTarget {
|
|||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas/height)
|
||||
*/
|
||||
height: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas/contextlost_event) */
|
||||
oncontextlost: ((this: OffscreenCanvas, ev: Event) => any) | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/OffscreenCanvas/contextrestored_event) */
|
||||
oncontextrestored: ((this: OffscreenCanvas, ev: Event) => any) | null;
|
||||
/**
|
||||
* These attributes return the dimensions of the OffscreenCanvas object's bitmap.
|
||||
|
@ -4379,8 +4345,6 @@ declare var OffscreenCanvas: {
|
|||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/OffscreenCanvasRenderingContext2D) */
|
||||
interface OffscreenCanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform {
|
||||
readonly canvas: OffscreenCanvas;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/OffscreenCanvasRenderingContext2D/commit) */
|
||||
commit(): void;
|
||||
}
|
||||
|
||||
declare var OffscreenCanvasRenderingContext2D: {
|
||||
|
@ -4885,24 +4849,19 @@ declare var ReadableStream: {
|
|||
new(underlyingSource: UnderlyingByteSource, strategy?: { highWaterMark?: number }): ReadableStream<Uint8Array>;
|
||||
new<R = any>(underlyingSource: UnderlyingDefaultSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
|
||||
new<R = any>(underlyingSource?: UnderlyingSource<R>, strategy?: QueuingStrategy<R>): ReadableStream<R>;
|
||||
from<R>(asyncIterable: AsyncIterable<R> | Iterable<R | PromiseLike<R>>): ReadableStream<R>;
|
||||
};
|
||||
|
||||
interface ReadableStreamBYOBReaderReadOptions {
|
||||
min?: number;
|
||||
}
|
||||
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader) */
|
||||
interface ReadableStreamBYOBReader extends ReadableStreamGenericReader {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/read) */
|
||||
read<T extends ArrayBufferView>(view: T, options?: ReadableStreamBYOBReaderReadOptions): Promise<ReadableStreamReadResult<T>>;
|
||||
read<T extends ArrayBufferView>(view: T): Promise<ReadableStreamReadResult<T>>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBReader/releaseLock) */
|
||||
releaseLock(): void;
|
||||
}
|
||||
|
||||
declare var ReadableStreamBYOBReader: {
|
||||
prototype: ReadableStreamBYOBReader;
|
||||
new(stream: ReadableStream<Uint8Array>): ReadableStreamBYOBReader;
|
||||
new(stream: ReadableStream): ReadableStreamBYOBReader;
|
||||
};
|
||||
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReadableStreamBYOBRequest) */
|
||||
|
@ -4975,6 +4934,7 @@ declare var Report: {
|
|||
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReportBody) */
|
||||
interface ReportBody {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/ReportBody/toJSON) */
|
||||
toJSON(): any;
|
||||
}
|
||||
|
||||
|
@ -5034,11 +4994,7 @@ interface Request extends Body {
|
|||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/integrity)
|
||||
*/
|
||||
readonly integrity: string;
|
||||
/**
|
||||
* Returns a boolean indicating whether or not request can outlive the global in which it was created.
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/keepalive)
|
||||
*/
|
||||
/** Returns a boolean indicating whether or not request can outlive the global in which it was created. */
|
||||
readonly keepalive: boolean;
|
||||
/**
|
||||
* Returns request's HTTP method, which is "GET" by default.
|
||||
|
@ -5802,6 +5758,7 @@ interface VideoDecoderEventMap {
|
|||
interface VideoDecoder extends EventTarget {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoDecoder/decodeQueueSize) */
|
||||
readonly decodeQueueSize: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoDecoder/dequeue_event) */
|
||||
ondequeue: ((this: VideoDecoder, ev: Event) => any) | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoDecoder/state) */
|
||||
readonly state: CodecState;
|
||||
|
@ -5824,6 +5781,7 @@ interface VideoDecoder extends EventTarget {
|
|||
declare var VideoDecoder: {
|
||||
prototype: VideoDecoder;
|
||||
new(init: VideoDecoderInit): VideoDecoder;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoDecoder/isConfigSupported_static) */
|
||||
isConfigSupported(config: VideoDecoderConfig): Promise<VideoDecoderSupport>;
|
||||
};
|
||||
|
||||
|
@ -5839,6 +5797,7 @@ interface VideoEncoderEventMap {
|
|||
interface VideoEncoder extends EventTarget {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoEncoder/encodeQueueSize) */
|
||||
readonly encodeQueueSize: number;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoEncoder/dequeue_event) */
|
||||
ondequeue: ((this: VideoEncoder, ev: Event) => any) | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoEncoder/state) */
|
||||
readonly state: CodecState;
|
||||
|
@ -5848,6 +5807,7 @@ interface VideoEncoder extends EventTarget {
|
|||
configure(config: VideoEncoderConfig): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoEncoder/encode) */
|
||||
encode(frame: VideoFrame, options?: VideoEncoderEncodeOptions): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoEncoder/flush) */
|
||||
flush(): Promise<void>;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoEncoder/reset) */
|
||||
reset(): void;
|
||||
|
@ -5860,6 +5820,7 @@ interface VideoEncoder extends EventTarget {
|
|||
declare var VideoEncoder: {
|
||||
prototype: VideoEncoder;
|
||||
new(init: VideoEncoderInit): VideoEncoder;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoEncoder/isConfigSupported_static) */
|
||||
isConfigSupported(config: VideoEncoderConfig): Promise<VideoEncoderSupport>;
|
||||
};
|
||||
|
||||
|
@ -5891,6 +5852,7 @@ interface VideoFrame {
|
|||
clone(): VideoFrame;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoFrame/close) */
|
||||
close(): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/VideoFrame/copyTo) */
|
||||
copyTo(destination: AllowSharedBufferSource, options?: VideoFrameCopyToOptions): Promise<PlaneLayout[]>;
|
||||
}
|
||||
|
||||
|
@ -6668,7 +6630,7 @@ interface WebGL2RenderingContextBase {
|
|||
clearBufferuiv(buffer: GLenum, drawbuffer: GLint, values: Uint32List, srcOffset?: number): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/clientWaitSync) */
|
||||
clientWaitSync(sync: WebGLSync, flags: GLbitfield, timeout: GLuint64): GLenum;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/compressedTexImage3D) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/compressedTexImage2D) */
|
||||
compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, imageSize: GLsizei, offset: GLintptr): void;
|
||||
compressedTexImage3D(target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, srcData: ArrayBufferView, srcOffset?: number, srcLengthOverride?: GLuint): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGL2RenderingContext/compressedTexSubImage3D) */
|
||||
|
@ -7549,6 +7511,7 @@ declare var WebGLRenderingContext: {
|
|||
};
|
||||
|
||||
interface WebGLRenderingContextBase {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/drawingBufferColorSpace) */
|
||||
drawingBufferColorSpace: PredefinedColorSpace;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLRenderingContext/drawingBufferHeight) */
|
||||
readonly drawingBufferHeight: GLsizei;
|
||||
|
@ -8258,7 +8221,7 @@ declare var WebGLVertexArrayObject: {
|
|||
new(): WebGLVertexArrayObject;
|
||||
};
|
||||
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLVertexArrayObjectOES) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WebGLVertexArrayObject) */
|
||||
interface WebGLVertexArrayObjectOES {
|
||||
}
|
||||
|
||||
|
@ -8469,24 +8432,24 @@ interface WindowOrWorkerGlobalScope {
|
|||
/**
|
||||
* Available only in secure contexts.
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/caches)
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/caches)
|
||||
*/
|
||||
readonly caches: CacheStorage;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/crossOriginIsolated) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/crossOriginIsolated) */
|
||||
readonly crossOriginIsolated: boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/crypto_property) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/crypto) */
|
||||
readonly crypto: Crypto;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/indexedDB) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/indexedDB) */
|
||||
readonly indexedDB: IDBFactory;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/isSecureContext) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/isSecureContext) */
|
||||
readonly isSecureContext: boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/origin) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/origin) */
|
||||
readonly origin: string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/performance_property) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/performance) */
|
||||
readonly performance: Performance;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/atob) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */
|
||||
atob(data: string): string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/btoa) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */
|
||||
btoa(data: string): string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearInterval) */
|
||||
clearInterval(id: number | undefined): void;
|
||||
|
@ -8583,7 +8546,9 @@ interface WorkerGlobalScope extends EventTarget, FontFaceSource, WindowOrWorkerG
|
|||
onoffline: ((this: WorkerGlobalScope, ev: Event) => any) | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/online_event) */
|
||||
ononline: ((this: WorkerGlobalScope, ev: Event) => any) | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/rejectionhandled_event) */
|
||||
onrejectionhandled: ((this: WorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/unhandledrejection_event) */
|
||||
onunhandledrejection: ((this: WorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null;
|
||||
/**
|
||||
* Returns workerGlobal.
|
||||
|
@ -8641,7 +8606,7 @@ declare var WorkerLocation: {
|
|||
};
|
||||
|
||||
/**
|
||||
* A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling globalThis.self.navigator.
|
||||
* A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator.
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerNavigator)
|
||||
*/
|
||||
|
@ -8917,7 +8882,7 @@ interface Console {
|
|||
clear(): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
|
||||
count(label?: string): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countreset_static) */
|
||||
countReset(label?: string): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
|
||||
debug(...data: any[]): void;
|
||||
|
@ -8929,9 +8894,9 @@ interface Console {
|
|||
error(...data: any[]): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
|
||||
group(...data: any[]): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupcollapsed_static) */
|
||||
groupCollapsed(...data: any[]): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupend_static) */
|
||||
groupEnd(): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
|
||||
info(...data: any[]): void;
|
||||
|
@ -8941,9 +8906,9 @@ interface Console {
|
|||
table(tabularData?: any, properties?: string[]): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
|
||||
time(label?: string): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeend_static) */
|
||||
timeEnd(label?: string): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timelog_static) */
|
||||
timeLog(label?: string, ...data: any[]): void;
|
||||
timeStamp(label?: string): void;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
|
||||
|
@ -8966,9 +8931,7 @@ declare namespace WebAssembly {
|
|||
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/JavaScript_interface/Global) */
|
||||
interface Global<T extends ValueType = ValueType> {
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/JavaScript_interface/Global/value) */
|
||||
value: ValueTypeMap[T];
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/WebAssembly/JavaScript_interface/Global/valueOf) */
|
||||
valueOf(): ValueTypeMap[T];
|
||||
}
|
||||
|
||||
|
@ -9246,7 +9209,9 @@ declare var onlanguagechange: ((this: DedicatedWorkerGlobalScope, ev: Event) =>
|
|||
declare var onoffline: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/online_event) */
|
||||
declare var ononline: ((this: DedicatedWorkerGlobalScope, ev: Event) => any) | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/rejectionhandled_event) */
|
||||
declare var onrejectionhandled: ((this: DedicatedWorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/WorkerGlobalScope/unhandledrejection_event) */
|
||||
declare var onunhandledrejection: ((this: DedicatedWorkerGlobalScope, ev: PromiseRejectionEvent) => any) | null;
|
||||
/**
|
||||
* Returns workerGlobal.
|
||||
|
@ -9271,24 +9236,24 @@ declare var fonts: FontFaceSet;
|
|||
/**
|
||||
* Available only in secure contexts.
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/caches)
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/caches)
|
||||
*/
|
||||
declare var caches: CacheStorage;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/crossOriginIsolated) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/crossOriginIsolated) */
|
||||
declare var crossOriginIsolated: boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/crypto_property) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/crypto) */
|
||||
declare var crypto: Crypto;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/indexedDB) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/indexedDB) */
|
||||
declare var indexedDB: IDBFactory;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/isSecureContext) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/isSecureContext) */
|
||||
declare var isSecureContext: boolean;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/origin) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/origin) */
|
||||
declare var origin: string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/performance_property) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/performance) */
|
||||
declare var performance: Performance;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/atob) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */
|
||||
declare function atob(data: string): string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/btoa) */
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */
|
||||
declare function btoa(data: string): string;
|
||||
/** [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearInterval) */
|
||||
declare function clearInterval(id: number | undefined): void;
|
||||
|
@ -9365,7 +9330,7 @@ type ReportList = Report[];
|
|||
type RequestInfo = Request | string;
|
||||
type TexImageSource = ImageBitmap | ImageData | OffscreenCanvas | VideoFrame;
|
||||
type TimerHandler = string | Function;
|
||||
type Transferable = OffscreenCanvas | ImageBitmap | MessagePort | ReadableStream | WritableStream | TransformStream | VideoFrame | ArrayBuffer;
|
||||
type Transferable = OffscreenCanvas | ImageBitmap | MessagePort | MediaSourceHandle | ReadableStream | WritableStream | TransformStream | VideoFrame | ArrayBuffer;
|
||||
type Uint32List = Uint32Array | GLuint[];
|
||||
type XMLHttpRequestBodyInit = Blob | BufferSource | FormData | URLSearchParams | string;
|
||||
type AlphaOption = "discard" | "keep";
|
||||
|
|
82
cli/tsc/dts/lib.webworker.iterable.d.ts
vendored
82
cli/tsc/dts/lib.webworker.iterable.d.ts
vendored
|
@ -26,24 +26,24 @@ interface AbortSignal {
|
|||
}
|
||||
|
||||
interface CSSNumericArray {
|
||||
[Symbol.iterator](): IterableIterator<CSSNumericValue>;
|
||||
entries(): IterableIterator<[number, CSSNumericValue]>;
|
||||
keys(): IterableIterator<number>;
|
||||
values(): IterableIterator<CSSNumericValue>;
|
||||
[Symbol.iterator](): ArrayIterator<CSSNumericValue>;
|
||||
entries(): ArrayIterator<[number, CSSNumericValue]>;
|
||||
keys(): ArrayIterator<number>;
|
||||
values(): ArrayIterator<CSSNumericValue>;
|
||||
}
|
||||
|
||||
interface CSSTransformValue {
|
||||
[Symbol.iterator](): IterableIterator<CSSTransformComponent>;
|
||||
entries(): IterableIterator<[number, CSSTransformComponent]>;
|
||||
keys(): IterableIterator<number>;
|
||||
values(): IterableIterator<CSSTransformComponent>;
|
||||
[Symbol.iterator](): ArrayIterator<CSSTransformComponent>;
|
||||
entries(): ArrayIterator<[number, CSSTransformComponent]>;
|
||||
keys(): ArrayIterator<number>;
|
||||
values(): ArrayIterator<CSSTransformComponent>;
|
||||
}
|
||||
|
||||
interface CSSUnparsedValue {
|
||||
[Symbol.iterator](): IterableIterator<CSSUnparsedSegment>;
|
||||
entries(): IterableIterator<[number, CSSUnparsedSegment]>;
|
||||
keys(): IterableIterator<number>;
|
||||
values(): IterableIterator<CSSUnparsedSegment>;
|
||||
[Symbol.iterator](): ArrayIterator<CSSUnparsedSegment>;
|
||||
entries(): ArrayIterator<[number, CSSUnparsedSegment]>;
|
||||
keys(): ArrayIterator<number>;
|
||||
values(): ArrayIterator<CSSUnparsedSegment>;
|
||||
}
|
||||
|
||||
interface Cache {
|
||||
|
@ -62,34 +62,42 @@ interface CanvasPathDrawingStyles {
|
|||
}
|
||||
|
||||
interface DOMStringList {
|
||||
[Symbol.iterator](): IterableIterator<string>;
|
||||
[Symbol.iterator](): ArrayIterator<string>;
|
||||
}
|
||||
|
||||
interface FileList {
|
||||
[Symbol.iterator](): IterableIterator<File>;
|
||||
[Symbol.iterator](): ArrayIterator<File>;
|
||||
}
|
||||
|
||||
interface FontFaceSet extends Set<FontFace> {
|
||||
}
|
||||
|
||||
interface FormDataIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): FormDataIterator<T>;
|
||||
}
|
||||
|
||||
interface FormData {
|
||||
[Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
|
||||
[Symbol.iterator](): FormDataIterator<[string, FormDataEntryValue]>;
|
||||
/** Returns an array of key, value pairs for every entry in the list. */
|
||||
entries(): IterableIterator<[string, FormDataEntryValue]>;
|
||||
entries(): FormDataIterator<[string, FormDataEntryValue]>;
|
||||
/** Returns a list of keys in the list. */
|
||||
keys(): IterableIterator<string>;
|
||||
keys(): FormDataIterator<string>;
|
||||
/** Returns a list of values in the list. */
|
||||
values(): IterableIterator<FormDataEntryValue>;
|
||||
values(): FormDataIterator<FormDataEntryValue>;
|
||||
}
|
||||
|
||||
interface HeadersIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): HeadersIterator<T>;
|
||||
}
|
||||
|
||||
interface Headers {
|
||||
[Symbol.iterator](): IterableIterator<[string, string]>;
|
||||
[Symbol.iterator](): HeadersIterator<[string, string]>;
|
||||
/** Returns an iterator allowing to go through all key/value pairs contained in this object. */
|
||||
entries(): IterableIterator<[string, string]>;
|
||||
entries(): HeadersIterator<[string, string]>;
|
||||
/** Returns an iterator allowing to go through all keys of the key/value pairs contained in this object. */
|
||||
keys(): IterableIterator<string>;
|
||||
keys(): HeadersIterator<string>;
|
||||
/** Returns an iterator allowing to go through all values of the key/value pairs contained in this object. */
|
||||
values(): IterableIterator<string>;
|
||||
values(): HeadersIterator<string>;
|
||||
}
|
||||
|
||||
interface IDBDatabase {
|
||||
|
@ -113,19 +121,19 @@ interface IDBObjectStore {
|
|||
}
|
||||
|
||||
interface MessageEvent<T = any> {
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/MessageEvent/initMessageEvent)
|
||||
*/
|
||||
/** @deprecated */
|
||||
initMessageEvent(type: string, bubbles?: boolean, cancelable?: boolean, data?: any, origin?: string, lastEventId?: string, source?: MessageEventSource | null, ports?: Iterable<MessagePort>): void;
|
||||
}
|
||||
|
||||
interface StylePropertyMapReadOnlyIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): StylePropertyMapReadOnlyIterator<T>;
|
||||
}
|
||||
|
||||
interface StylePropertyMapReadOnly {
|
||||
[Symbol.iterator](): IterableIterator<[string, Iterable<CSSStyleValue>]>;
|
||||
entries(): IterableIterator<[string, Iterable<CSSStyleValue>]>;
|
||||
keys(): IterableIterator<string>;
|
||||
values(): IterableIterator<Iterable<CSSStyleValue>>;
|
||||
[Symbol.iterator](): StylePropertyMapReadOnlyIterator<[string, Iterable<CSSStyleValue>]>;
|
||||
entries(): StylePropertyMapReadOnlyIterator<[string, Iterable<CSSStyleValue>]>;
|
||||
keys(): StylePropertyMapReadOnlyIterator<string>;
|
||||
values(): StylePropertyMapReadOnlyIterator<Iterable<CSSStyleValue>>;
|
||||
}
|
||||
|
||||
interface SubtleCrypto {
|
||||
|
@ -143,14 +151,18 @@ interface SubtleCrypto {
|
|||
unwrapKey(format: KeyFormat, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: Iterable<KeyUsage>): Promise<CryptoKey>;
|
||||
}
|
||||
|
||||
interface URLSearchParamsIterator<T> extends IteratorObject<T, BuiltinIteratorReturn, unknown> {
|
||||
[Symbol.iterator](): URLSearchParamsIterator<T>;
|
||||
}
|
||||
|
||||
interface URLSearchParams {
|
||||
[Symbol.iterator](): IterableIterator<[string, string]>;
|
||||
[Symbol.iterator](): URLSearchParamsIterator<[string, string]>;
|
||||
/** Returns an array of key, value pairs for every entry in the search params. */
|
||||
entries(): IterableIterator<[string, string]>;
|
||||
entries(): URLSearchParamsIterator<[string, string]>;
|
||||
/** Returns a list of keys in the search params. */
|
||||
keys(): IterableIterator<string>;
|
||||
keys(): URLSearchParamsIterator<string>;
|
||||
/** Returns a list of values in the search params. */
|
||||
values(): IterableIterator<string>;
|
||||
values(): URLSearchParamsIterator<string>;
|
||||
}
|
||||
|
||||
interface WEBGL_draw_buffers {
|
||||
|
|
417
cli/tsc/dts/typescript.d.ts
vendored
417
cli/tsc/dts/typescript.d.ts
vendored
|
@ -214,6 +214,22 @@ declare namespace ts {
|
|||
* The time spent creating or updating the auto-import program, in milliseconds.
|
||||
*/
|
||||
createAutoImportProviderProgramDurationMs?: number;
|
||||
/**
|
||||
* The time spent computing diagnostics, in milliseconds.
|
||||
*/
|
||||
diagnosticsDuration?: FileDiagnosticPerformanceData[];
|
||||
}
|
||||
/**
|
||||
* Time spent computing each kind of diagnostics, in milliseconds.
|
||||
*/
|
||||
export type DiagnosticPerformanceData = {
|
||||
[Kind in DiagnosticEventKind]?: number;
|
||||
};
|
||||
export interface FileDiagnosticPerformanceData extends DiagnosticPerformanceData {
|
||||
/**
|
||||
* The file for which the performance data is reported.
|
||||
*/
|
||||
file: string;
|
||||
}
|
||||
/**
|
||||
* Arguments for FileRequest messages.
|
||||
|
@ -584,23 +600,7 @@ declare namespace ts {
|
|||
}
|
||||
export interface ApplyCodeActionCommandResponse extends Response {
|
||||
}
|
||||
export interface FileRangeRequestArgs extends FileRequestArgs {
|
||||
/**
|
||||
* The line number for the request (1-based).
|
||||
*/
|
||||
startLine: number;
|
||||
/**
|
||||
* The character offset (on the line) for the request (1-based).
|
||||
*/
|
||||
startOffset: number;
|
||||
/**
|
||||
* The line number for the request (1-based).
|
||||
*/
|
||||
endLine: number;
|
||||
/**
|
||||
* The character offset (on the line) for the request (1-based).
|
||||
*/
|
||||
endOffset: number;
|
||||
export interface FileRangeRequestArgs extends FileRequestArgs, FileRange {
|
||||
}
|
||||
/**
|
||||
* Instances of this interface specify errorcodes on a specific location in a sourcefile.
|
||||
|
@ -1866,7 +1866,7 @@ declare namespace ts {
|
|||
* List of file names for which to compute compiler errors.
|
||||
* The files will be checked in list order.
|
||||
*/
|
||||
files: string[];
|
||||
files: (string | FileRangesRequestArgs)[];
|
||||
/**
|
||||
* Delay in milliseconds to wait before starting to compute
|
||||
* errors for the files in the file list
|
||||
|
@ -1887,6 +1887,27 @@ declare namespace ts {
|
|||
command: CommandTypes.Geterr;
|
||||
arguments: GeterrRequestArgs;
|
||||
}
|
||||
export interface FileRange {
|
||||
/**
|
||||
* The line number for the request (1-based).
|
||||
*/
|
||||
startLine: number;
|
||||
/**
|
||||
* The character offset (on the line) for the request (1-based).
|
||||
*/
|
||||
startOffset: number;
|
||||
/**
|
||||
* The line number for the request (1-based).
|
||||
*/
|
||||
endLine: number;
|
||||
/**
|
||||
* The character offset (on the line) for the request (1-based).
|
||||
*/
|
||||
endOffset: number;
|
||||
}
|
||||
export interface FileRangesRequestArgs extends Pick<FileRequestArgs, "file"> {
|
||||
ranges: FileRange[];
|
||||
}
|
||||
export type RequestCompletedEventName = "requestCompleted";
|
||||
/**
|
||||
* Event that is sent when server have finished processing request with specified id.
|
||||
|
@ -1897,6 +1918,7 @@ declare namespace ts {
|
|||
}
|
||||
export interface RequestCompletedEventBody {
|
||||
request_seq: number;
|
||||
performanceData?: PerformanceData;
|
||||
}
|
||||
/**
|
||||
* Item of diagnostic information found in a DiagnosticEvent message.
|
||||
|
@ -1969,8 +1991,12 @@ declare namespace ts {
|
|||
* An array of diagnostic information items.
|
||||
*/
|
||||
diagnostics: Diagnostic[];
|
||||
/**
|
||||
* Spans where the region diagnostic was requested, if this is a region semantic diagnostic event.
|
||||
*/
|
||||
spans?: TextSpan[];
|
||||
}
|
||||
export type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag";
|
||||
export type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag" | "regionSemanticDiag";
|
||||
/**
|
||||
* Event message for DiagnosticEventKind event types.
|
||||
* These events provide syntactic and semantic errors for a file.
|
||||
|
@ -2510,6 +2536,7 @@ declare namespace ts {
|
|||
private readonly knownCachesSet;
|
||||
private readonly projectWatchers;
|
||||
private safeList;
|
||||
private pendingRunRequests;
|
||||
private installRunCount;
|
||||
private inFlightRequestCount;
|
||||
abstract readonly typesRegistry: Map<string, MapLike<string>>;
|
||||
|
@ -2636,6 +2663,7 @@ declare namespace ts {
|
|||
interface ServerHost extends System {
|
||||
watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
|
||||
watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
|
||||
preferNonRecursiveWatch?: boolean;
|
||||
setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
|
||||
clearTimeout(timeoutId: any): void;
|
||||
setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;
|
||||
|
@ -2644,6 +2672,18 @@ declare namespace ts {
|
|||
trace?(s: string): void;
|
||||
require?(initialPath: string, moduleName: string): ModuleImportResult;
|
||||
}
|
||||
interface InstallPackageOptionsWithProject extends InstallPackageOptions {
|
||||
projectName: string;
|
||||
projectRootPath: Path;
|
||||
}
|
||||
interface ITypingsInstaller {
|
||||
isKnownTypesPackageName(name: string): boolean;
|
||||
installPackage(options: InstallPackageOptionsWithProject): Promise<ApplyCodeActionCommandResult>;
|
||||
enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string> | undefined): void;
|
||||
attach(projectService: ProjectService): void;
|
||||
onProjectClosed(p: Project): void;
|
||||
readonly globalTypingsCacheLocation: string | undefined;
|
||||
}
|
||||
function createInstallTypingsRequest(project: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string>, cachePath?: string): DiscoverTypings;
|
||||
function toNormalizedPath(fileName: string): NormalizedPath;
|
||||
function normalizedPathToPath(normalizedPath: NormalizedPath, currentDirectory: string, getCanonicalFileName: (f: string) => string): Path;
|
||||
|
@ -2702,6 +2742,7 @@ declare namespace ts {
|
|||
readonly containingProjects: Project[];
|
||||
private formatSettings;
|
||||
private preferences;
|
||||
private realpath;
|
||||
constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent: boolean, path: Path, initialVersion?: number);
|
||||
isScriptOpen(): boolean;
|
||||
open(newText: string | undefined): void;
|
||||
|
@ -2735,19 +2776,6 @@ declare namespace ts {
|
|||
positionToLineOffset(position: number): protocol.Location;
|
||||
isJavaScript(): boolean;
|
||||
}
|
||||
interface InstallPackageOptionsWithProject extends InstallPackageOptions {
|
||||
projectName: string;
|
||||
projectRootPath: Path;
|
||||
}
|
||||
interface ITypingsInstaller {
|
||||
isKnownTypesPackageName(name: string): boolean;
|
||||
installPackage(options: InstallPackageOptionsWithProject): Promise<ApplyCodeActionCommandResult>;
|
||||
enqueueInstallTypingsRequest(p: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string> | undefined): void;
|
||||
attach(projectService: ProjectService): void;
|
||||
onProjectClosed(p: Project): void;
|
||||
readonly globalTypingsCacheLocation: string | undefined;
|
||||
}
|
||||
const nullTypingsInstaller: ITypingsInstaller;
|
||||
function allRootFilesAreJsOrDts(project: Project): boolean;
|
||||
function allFilesAreJsOrDts(project: Project): boolean;
|
||||
enum ProjectKind {
|
||||
|
@ -2789,33 +2817,31 @@ declare namespace ts {
|
|||
private externalFiles;
|
||||
private missingFilesMap;
|
||||
private generatedFilesMap;
|
||||
private hasAddedorRemovedFiles;
|
||||
private hasAddedOrRemovedSymlinks;
|
||||
protected languageService: LanguageService;
|
||||
languageServiceEnabled: boolean;
|
||||
readonly trace?: (s: string) => void;
|
||||
readonly realpath?: (path: string) => string;
|
||||
private builderState;
|
||||
/**
|
||||
* Set of files names that were updated since the last call to getChangesSinceVersion.
|
||||
*/
|
||||
private updatedFileNames;
|
||||
/**
|
||||
* Set of files that was returned from the last call to getChangesSinceVersion.
|
||||
*/
|
||||
private lastReportedFileNames;
|
||||
/**
|
||||
* Last version that was reported.
|
||||
*/
|
||||
private lastReportedVersion;
|
||||
protected projectErrors: Diagnostic[] | undefined;
|
||||
protected isInitialLoadPending: () => boolean;
|
||||
private typingsCache;
|
||||
private typingWatchers;
|
||||
private readonly cancellationToken;
|
||||
isNonTsProject(): boolean;
|
||||
isJsOnlyProject(): boolean;
|
||||
static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void): {} | undefined;
|
||||
private exportMapCache;
|
||||
private changedFilesForExportMapCache;
|
||||
private moduleSpecifierCache;
|
||||
private symlinks;
|
||||
readonly jsDocParsingMode: JSDocParsingMode | undefined;
|
||||
isKnownTypesPackageName(name: string): boolean;
|
||||
installPackage(options: InstallPackageOptions): Promise<ApplyCodeActionCommandResult>;
|
||||
private get typingsCache();
|
||||
getCompilationSettings(): ts.CompilerOptions;
|
||||
getCompilerOptions(): ts.CompilerOptions;
|
||||
getNewLine(): string;
|
||||
|
@ -2882,6 +2908,8 @@ declare namespace ts {
|
|||
* @returns: true if set of files in the project stays the same and false - otherwise.
|
||||
*/
|
||||
updateGraph(): boolean;
|
||||
private closeWatchingTypingLocations;
|
||||
private onTypingInstallerWatchInvoke;
|
||||
protected removeExistingTypings(include: string[]): string[];
|
||||
private updateGraphWorker;
|
||||
private detachScriptInfoFromProject;
|
||||
|
@ -2893,6 +2921,7 @@ declare namespace ts {
|
|||
getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined;
|
||||
getScriptInfo(uncheckedFileName: string): ts.server.ScriptInfo | undefined;
|
||||
filesToString(writeProjectFileNames: boolean): string;
|
||||
private filesToStringWorker;
|
||||
setCompilerOptions(compilerOptions: CompilerOptions): void;
|
||||
setTypeAcquisition(newTypeAcquisition: TypeAcquisition | undefined): void;
|
||||
getTypeAcquisition(): ts.TypeAcquisition;
|
||||
|
@ -2901,6 +2930,8 @@ declare namespace ts {
|
|||
protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[]): void;
|
||||
/** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */
|
||||
refreshDiagnostics(): void;
|
||||
private isDefaultProjectForOpenFiles;
|
||||
private getCompilerOptionsForNoDtsResolutionProject;
|
||||
}
|
||||
/**
|
||||
* If a file is opened and no tsconfig (or jsconfig) is found,
|
||||
|
@ -2920,6 +2951,7 @@ declare namespace ts {
|
|||
}
|
||||
class AutoImportProviderProject extends Project {
|
||||
private hostProject;
|
||||
private static readonly maxDependencies;
|
||||
private rootFileNames;
|
||||
updateGraph(): boolean;
|
||||
hasRoots(): boolean;
|
||||
|
@ -2936,6 +2968,8 @@ declare namespace ts {
|
|||
class ConfiguredProject extends Project {
|
||||
readonly canonicalConfigFilePath: NormalizedPath;
|
||||
private projectReferences;
|
||||
private compilerHost?;
|
||||
private releaseParsedConfig;
|
||||
/**
|
||||
* If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph
|
||||
* @returns: true if set of files in the project stays the same and false - otherwise.
|
||||
|
@ -3126,6 +3160,7 @@ declare namespace ts {
|
|||
configFileName?: NormalizedPath;
|
||||
configFileErrors?: readonly Diagnostic[];
|
||||
}
|
||||
const nullTypingsInstaller: ITypingsInstaller;
|
||||
interface ProjectServiceOptions {
|
||||
host: ServerHost;
|
||||
logger: Logger;
|
||||
|
@ -3151,16 +3186,8 @@ declare namespace ts {
|
|||
}
|
||||
class ProjectService {
|
||||
private readonly nodeModulesWatchers;
|
||||
/**
|
||||
* Contains all the deleted script info's version information so that
|
||||
* it does not reset when creating script info again
|
||||
* (and could have potentially collided with version where contents mismatch)
|
||||
*/
|
||||
private readonly filenameToScriptInfoVersion;
|
||||
private readonly allJsFilesForOpenFileTelemetry;
|
||||
/**
|
||||
* maps external project file name to list of config files that were the part of this project
|
||||
*/
|
||||
private readonly externalProjectToConfiguredProjectMap;
|
||||
/**
|
||||
* external projects (configuration and list of root files is not controlled by tsserver)
|
||||
|
@ -3178,13 +3205,8 @@ declare namespace ts {
|
|||
* Open files: with value being project root path, and key being Path of the file that is open
|
||||
*/
|
||||
readonly openFiles: Map<Path, NormalizedPath | undefined>;
|
||||
/** Config files looked up and cached config files for open script info */
|
||||
private readonly configFileForOpenFiles;
|
||||
/** Set of open script infos that are root of inferred project */
|
||||
private rootOfInferredProjects;
|
||||
/**
|
||||
* Map of open files that are opened without complete path but have projectRoot as current directory
|
||||
*/
|
||||
private readonly openFilesWithNonRootedDiskPath;
|
||||
private compilerOptionsForInferredProjects;
|
||||
private compilerOptionsForInferredProjectsPerProjectRoot;
|
||||
|
@ -3192,18 +3214,11 @@ declare namespace ts {
|
|||
private watchOptionsForInferredProjectsPerProjectRoot;
|
||||
private typeAcquisitionForInferredProjects;
|
||||
private typeAcquisitionForInferredProjectsPerProjectRoot;
|
||||
/**
|
||||
* Project size for configured or external projects
|
||||
*/
|
||||
private readonly projectToSizeMap;
|
||||
private readonly hostConfiguration;
|
||||
private safelist;
|
||||
private readonly legacySafelist;
|
||||
private pendingProjectUpdates;
|
||||
/**
|
||||
* All the open script info that needs recalculation of the default project,
|
||||
* this also caches config file info before config file change was detected to use it in case projects are not updated yet
|
||||
*/
|
||||
private pendingOpenFileProjectUpdates?;
|
||||
readonly currentDirectory: NormalizedPath;
|
||||
readonly toCanonicalFileName: (f: string) => string;
|
||||
|
@ -3221,8 +3236,11 @@ declare namespace ts {
|
|||
readonly allowLocalPluginLoads: boolean;
|
||||
readonly typesMapLocation: string | undefined;
|
||||
readonly serverMode: LanguageServiceMode;
|
||||
/** Tracks projects that we have already sent telemetry for. */
|
||||
private readonly seenProjects;
|
||||
private readonly sharedExtendedConfigFileWatchers;
|
||||
private readonly extendedConfigCache;
|
||||
private packageJsonFilesMap;
|
||||
private incompleteCompletionsCache;
|
||||
private performanceEventHandler?;
|
||||
private pendingPluginEnablements?;
|
||||
private currentPluginEnablementPromise?;
|
||||
|
@ -3236,20 +3254,9 @@ declare namespace ts {
|
|||
setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.InferredProjectCompilerOptions, projectRootPath?: string): void;
|
||||
findProject(projectName: string): Project | undefined;
|
||||
getDefaultProjectForFile(fileName: NormalizedPath, ensureProject: boolean): Project | undefined;
|
||||
/**
|
||||
* If there is default project calculation pending for this file,
|
||||
* then it completes that calculation so that correct default project is used for the project
|
||||
*/
|
||||
private tryGetDefaultProjectForEnsuringConfiguredProjectForFile;
|
||||
private doEnsureDefaultProjectForFile;
|
||||
getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo | undefined;
|
||||
/**
|
||||
* Ensures the project structures are upto date
|
||||
* This means,
|
||||
* - we go through all the projects and update them if they are dirty
|
||||
* - if updates reflect some change in structure or there was pending request to ensure projects for open files
|
||||
* ensure that each open script info has project
|
||||
*/
|
||||
private ensureProjectStructuresUptoDate;
|
||||
getFormatCodeOptions(file: NormalizedPath): FormatCodeSettings;
|
||||
getPreferences(file: NormalizedPath): protocol.UserPreferences;
|
||||
|
@ -3260,37 +3267,30 @@ declare namespace ts {
|
|||
private delayUpdateSourceInfoProjects;
|
||||
private delayUpdateProjectsOfScriptInfoPath;
|
||||
private handleDeletedFile;
|
||||
private watchWildcardDirectory;
|
||||
private onWildCardDirectoryWatcherInvoke;
|
||||
private delayUpdateProjectsFromParsedConfigOnConfigFileChange;
|
||||
private onConfigFileChanged;
|
||||
private removeProject;
|
||||
private assignOrphanScriptInfosToInferredProject;
|
||||
/**
|
||||
* Remove this file from the set of open, non-configured files.
|
||||
* @param info The file that has been closed or newly configured
|
||||
*/
|
||||
private closeOpenFile;
|
||||
private deleteScriptInfo;
|
||||
private configFileExists;
|
||||
/**
|
||||
* This function tries to search for a tsconfig.json for the given file.
|
||||
* This is different from the method the compiler uses because
|
||||
* the compiler can assume it will always start searching in the
|
||||
* current directory (the directory in which tsc was invoked).
|
||||
* The server must start searching from the directory containing
|
||||
* the newly opened file.
|
||||
*/
|
||||
private createConfigFileWatcherForParsedConfig;
|
||||
private forEachConfigFileLocation;
|
||||
/** Get cached configFileName for scriptInfo or ancestor of open script info */
|
||||
private getConfigFileNameForFileFromCache;
|
||||
/** Caches the configFilename for script info or ancestor of open script info */
|
||||
private setConfigFileNameForFileInCache;
|
||||
private printProjects;
|
||||
private getConfiguredProjectByCanonicalConfigFilePath;
|
||||
private findExternalProjectByProjectName;
|
||||
/** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */
|
||||
private getFilenameForExceededTotalSizeLimitForNonTsFiles;
|
||||
private createExternalProject;
|
||||
private addFilesToNonInferredProject;
|
||||
private loadConfiguredProject;
|
||||
private updateNonInferredProjectFiles;
|
||||
private updateRootAndOptionsOfNonInferredProject;
|
||||
private reloadFileNamesOfParsedConfig;
|
||||
private clearSemanticCache;
|
||||
private getOrCreateInferredProjectForProjectRootPathIfEnabled;
|
||||
private getOrCreateSingleInferredProjectIfEnabled;
|
||||
private getOrCreateSingleInferredWithoutProjectRoot;
|
||||
|
@ -3316,23 +3316,15 @@ declare namespace ts {
|
|||
private addSourceInfoToSourceMap;
|
||||
private addMissingSourceMapFile;
|
||||
setHostConfiguration(args: protocol.ConfigureRequestArguments): void;
|
||||
private getWatchOptionsFromProjectWatchOptions;
|
||||
closeLog(): void;
|
||||
private sendSourceFileChange;
|
||||
/**
|
||||
* This function rebuilds the project for every file opened by the client
|
||||
* This does not reload contents of open files from disk. But we could do that if needed
|
||||
*/
|
||||
reloadProjects(): void;
|
||||
/**
|
||||
* Remove the root of inferred project if script info is part of another project
|
||||
*/
|
||||
private removeRootOfInferredProjectIfNowPartOfOtherProject;
|
||||
/**
|
||||
* This function is to update the project structure for every inferred project.
|
||||
* It is called on the premise that all the configured projects are
|
||||
* up to date.
|
||||
* This will go through open files and assign them to inferred project if open file is not part of any other project
|
||||
* After that all the inferred project graphs are updated
|
||||
*/
|
||||
private ensureProjectForOpenFiles;
|
||||
/**
|
||||
* Open file whose contents is managed by the client
|
||||
|
@ -3343,20 +3335,12 @@ declare namespace ts {
|
|||
private findExternalProjectContainingOpenScriptInfo;
|
||||
private getOrCreateOpenScriptInfo;
|
||||
private assignProjectToOpenedScriptInfo;
|
||||
/**
|
||||
* Finds the default configured project for given info
|
||||
* For any tsconfig found, it looks into that project, if not then all its references,
|
||||
* The search happens for all tsconfigs till projectRootPath
|
||||
*/
|
||||
private tryFindDefaultConfiguredProjectForOpenScriptInfo;
|
||||
/**
|
||||
* Finds the default configured project, if found, it creates the solution projects (does not load them right away)
|
||||
* with Find: finds the projects even if the project is deferredClosed
|
||||
*/
|
||||
private tryFindDefaultConfiguredProjectAndLoadAncestorsForOpenScriptInfo;
|
||||
private ensureProjectChildren;
|
||||
private cleanupConfiguredProjects;
|
||||
private cleanupProjectsAndScriptInfos;
|
||||
private tryInvokeWildCardDirectories;
|
||||
openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult;
|
||||
private removeOrphanScriptInfos;
|
||||
private telemetryOnOpenFile;
|
||||
|
@ -3368,7 +3352,6 @@ declare namespace ts {
|
|||
private collectChanges;
|
||||
closeExternalProject(uncheckedFileName: string): void;
|
||||
openExternalProjects(projects: protocol.ExternalProject[]): void;
|
||||
/** Makes a filename safe to insert in a RegExp */
|
||||
private static readonly filenameEscapeRegexp;
|
||||
private static escapeFilenameForRegex;
|
||||
resetSafeList(): void;
|
||||
|
@ -3376,9 +3359,12 @@ declare namespace ts {
|
|||
private applySafeListWorker;
|
||||
openExternalProject(proj: protocol.ExternalProject): void;
|
||||
hasDeferredExtension(): boolean;
|
||||
private endEnablePlugin;
|
||||
private enableRequestedPluginsAsync;
|
||||
private enableRequestedPluginsWorker;
|
||||
configurePlugin(args: protocol.ConfigurePluginRequestArguments): void;
|
||||
private watchPackageJsonFile;
|
||||
private onPackageJsonChange;
|
||||
}
|
||||
function formatMessage<T extends protocol.Message>(msg: T, logger: Logger, byteLength: (s: string, encoding: BufferEncoding) => number, newLine: string): string;
|
||||
interface ServerCancellationToken extends HostCancellationToken {
|
||||
|
@ -3386,10 +3372,6 @@ declare namespace ts {
|
|||
resetRequest(requestId: number): void;
|
||||
}
|
||||
const nullCancellationToken: ServerCancellationToken;
|
||||
interface PendingErrorCheck {
|
||||
fileName: NormalizedPath;
|
||||
project: Project;
|
||||
}
|
||||
/** @deprecated use ts.server.protocol.CommandTypes */
|
||||
type CommandNames = protocol.CommandTypes;
|
||||
/** @deprecated use ts.server.protocol.CommandTypes */
|
||||
|
@ -3449,6 +3431,7 @@ declare namespace ts {
|
|||
constructor(opts: SessionOptions);
|
||||
private sendRequestCompletedEvent;
|
||||
private addPerformanceData;
|
||||
private addDiagnosticsPerformanceData;
|
||||
private performanceEventHandler;
|
||||
private defaultEventHandler;
|
||||
private projectsUpdatedInBackgroundEvent;
|
||||
|
@ -3460,8 +3443,8 @@ declare namespace ts {
|
|||
private semanticCheck;
|
||||
private syntacticCheck;
|
||||
private suggestionCheck;
|
||||
private regionSemanticCheck;
|
||||
private sendDiagnosticsEvent;
|
||||
/** It is the caller's responsibility to verify that `!this.suppressDiagnosticEvents`. */
|
||||
private updateErrorCheck;
|
||||
private cleanProjects;
|
||||
private cleanup;
|
||||
|
@ -3508,10 +3491,6 @@ declare namespace ts {
|
|||
private toSpanGroups;
|
||||
private getReferences;
|
||||
private getFileReferences;
|
||||
/**
|
||||
* @param fileName is the name of the file to be opened
|
||||
* @param fileContent is a version of the file content that is known to be more up to date than the one on disk
|
||||
*/
|
||||
private openClientFile;
|
||||
private getPosition;
|
||||
private getPositionInFile;
|
||||
|
@ -3610,19 +3589,12 @@ declare namespace ts {
|
|||
}
|
||||
namespace deno {
|
||||
function setIsNodeSourceFileCallback(callback: IsNodeSourceFileCallback): void;
|
||||
function setNodeBuiltInModuleNames(names: readonly string[]): void;
|
||||
function setNodeOnlyGlobalNames(names: readonly string[]): void;
|
||||
function createDenoForkContext({ mergeSymbol, globals, nodeGlobals, ambientModuleSymbolRegex }: {
|
||||
function createDenoForkContext({ mergeSymbol, globals, nodeGlobals }: {
|
||||
mergeSymbol(target: ts.Symbol, source: ts.Symbol, unidirectional?: boolean): ts.Symbol;
|
||||
globals: ts.SymbolTable;
|
||||
nodeGlobals: ts.SymbolTable;
|
||||
ambientModuleSymbolRegex: RegExp;
|
||||
}): {
|
||||
hasNodeSourceFile: (node: ts.Node | undefined) => boolean;
|
||||
getGlobalsForName: (id: ts.__String) => ts.SymbolTable;
|
||||
mergeGlobalSymbolTable: (node: ts.Node, source: ts.SymbolTable, unidirectional?: boolean) => void;
|
||||
combinedGlobals: ts.SymbolTable;
|
||||
};
|
||||
}): DenoForkContext;
|
||||
function tryParseNpmPackageReference(text: string): {
|
||||
name: string;
|
||||
versionReq: string | undefined;
|
||||
|
@ -3634,6 +3606,12 @@ declare namespace ts {
|
|||
subPath: string | undefined;
|
||||
};
|
||||
type IsNodeSourceFileCallback = (sourceFile: ts.SourceFile) => boolean;
|
||||
interface DenoForkContext {
|
||||
hasNodeSourceFile: (node: ts.Node | undefined) => boolean;
|
||||
getGlobalsForName: (id: ts.__String) => ts.SymbolTable;
|
||||
mergeGlobalSymbolTable: (node: ts.Node, source: ts.SymbolTable, unidirectional?: boolean) => void;
|
||||
combinedGlobals: ts.SymbolTable;
|
||||
}
|
||||
interface NpmPackageReference {
|
||||
name: string;
|
||||
versionReq: string;
|
||||
|
@ -3648,7 +3626,7 @@ declare namespace ts {
|
|||
readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[] | undefined, depth?: number): string[];
|
||||
}
|
||||
}
|
||||
const versionMajorMinor = "5.5";
|
||||
const versionMajorMinor = "5.6";
|
||||
/** The version of the TypeScript compiler release */
|
||||
const version: string;
|
||||
/**
|
||||
|
@ -4478,7 +4456,7 @@ declare namespace ts {
|
|||
readonly right: Identifier;
|
||||
}
|
||||
type EntityName = Identifier | QualifiedName;
|
||||
type PropertyName = Identifier | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier;
|
||||
type PropertyName = Identifier | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | ComputedPropertyName | PrivateIdentifier | BigIntLiteral;
|
||||
type MemberName = Identifier | PrivateIdentifier;
|
||||
type DeclarationName = PropertyName | JsxAttributeName | StringLiteralLike | ElementAccessExpression | BindingPattern | EntityNameExpression;
|
||||
interface Declaration extends Node {
|
||||
|
@ -4829,7 +4807,7 @@ declare namespace ts {
|
|||
readonly kind: SyntaxKind.StringLiteral;
|
||||
}
|
||||
type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral;
|
||||
type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral | JsxNamespacedName;
|
||||
type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral | JsxNamespacedName | BigIntLiteral;
|
||||
interface TemplateLiteralTypeNode extends TypeNode {
|
||||
kind: SyntaxKind.TemplateLiteralType;
|
||||
readonly head: TemplateHead;
|
||||
|
@ -5549,7 +5527,7 @@ declare namespace ts {
|
|||
interface NamespaceExport extends NamedDeclaration {
|
||||
readonly kind: SyntaxKind.NamespaceExport;
|
||||
readonly parent: ExportDeclaration;
|
||||
readonly name: Identifier;
|
||||
readonly name: ModuleExportName;
|
||||
}
|
||||
interface NamespaceExportDeclaration extends DeclarationStatement, JSDocContainer {
|
||||
readonly kind: SyntaxKind.NamespaceExportDeclaration;
|
||||
|
@ -5581,7 +5559,7 @@ declare namespace ts {
|
|||
interface ImportSpecifier extends NamedDeclaration {
|
||||
readonly kind: SyntaxKind.ImportSpecifier;
|
||||
readonly parent: NamedImports;
|
||||
readonly propertyName?: Identifier;
|
||||
readonly propertyName?: ModuleExportName;
|
||||
readonly name: Identifier;
|
||||
readonly isTypeOnly: boolean;
|
||||
}
|
||||
|
@ -5589,9 +5567,10 @@ declare namespace ts {
|
|||
readonly kind: SyntaxKind.ExportSpecifier;
|
||||
readonly parent: NamedExports;
|
||||
readonly isTypeOnly: boolean;
|
||||
readonly propertyName?: Identifier;
|
||||
readonly name: Identifier;
|
||||
readonly propertyName?: ModuleExportName;
|
||||
readonly name: ModuleExportName;
|
||||
}
|
||||
type ModuleExportName = Identifier | StringLiteral;
|
||||
type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier;
|
||||
type TypeOnlyCompatibleAliasDeclaration = ImportClause | ImportEqualsDeclaration | NamespaceImport | ImportOrExportSpecifier | ExportDeclaration | NamespaceExport;
|
||||
type TypeOnlyImportDeclaration =
|
||||
|
@ -6046,19 +6025,67 @@ declare namespace ts {
|
|||
isSourceFileFromExternalLibrary(file: SourceFile): boolean;
|
||||
isSourceFileDefaultLibrary(file: SourceFile): boolean;
|
||||
/**
|
||||
* Calculates the final resolution mode for a given module reference node. This is the resolution mode explicitly provided via import
|
||||
* attributes, if present, or the syntax the usage would have if emitted to JavaScript. In `--module node16` or `nodenext`, this may
|
||||
* depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the input syntax of the reference. In other
|
||||
* `module` modes, when overriding import attributes are not provided, this function returns `undefined`, as the result would have no
|
||||
* impact on module resolution, emit, or type checking.
|
||||
* Calculates the final resolution mode for a given module reference node. This function only returns a result when module resolution
|
||||
* settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes,
|
||||
* which cause an `import` or `require` condition to be used during resolution regardless of module resolution settings. In absence of
|
||||
* overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript.
|
||||
* Some examples:
|
||||
*
|
||||
* ```ts
|
||||
* // tsc foo.mts --module nodenext
|
||||
* import {} from "mod";
|
||||
* // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
|
||||
*
|
||||
* // tsc foo.cts --module nodenext
|
||||
* import {} from "mod";
|
||||
* // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
|
||||
*
|
||||
* // tsc foo.ts --module preserve --moduleResolution bundler
|
||||
* import {} from "mod";
|
||||
* // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
|
||||
* // supports conditional imports/exports
|
||||
*
|
||||
* // tsc foo.ts --module preserve --moduleResolution node10
|
||||
* import {} from "mod";
|
||||
* // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
|
||||
* // does not support conditional imports/exports
|
||||
*
|
||||
* // tsc foo.ts --module commonjs --moduleResolution node10
|
||||
* import type {} from "mod" with { "resolution-mode": "import" };
|
||||
* // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
|
||||
* ```
|
||||
*/
|
||||
getModeForUsageLocation(file: SourceFile, usage: StringLiteralLike): ResolutionMode;
|
||||
/**
|
||||
* Calculates the final resolution mode for an import at some index within a file's `imports` list. This is the resolution mode
|
||||
* explicitly provided via import attributes, if present, or the syntax the usage would have if emitted to JavaScript. In
|
||||
* `--module node16` or `nodenext`, this may depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the
|
||||
* input syntax of the reference. In other `module` modes, when overriding import attributes are not provided, this function returns
|
||||
* `undefined`, as the result would have no impact on module resolution, emit, or type checking.
|
||||
* Calculates the final resolution mode for an import at some index within a file's `imports` list. This function only returns a result
|
||||
* when module resolution settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided
|
||||
* via import attributes, which cause an `import` or `require` condition to be used during resolution regardless of module resolution
|
||||
* settings. In absence of overriding attributes, and in modes that support differing resolution, the result indicates the syntax the
|
||||
* usage would emit to JavaScript. Some examples:
|
||||
*
|
||||
* ```ts
|
||||
* // tsc foo.mts --module nodenext
|
||||
* import {} from "mod";
|
||||
* // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
|
||||
*
|
||||
* // tsc foo.cts --module nodenext
|
||||
* import {} from "mod";
|
||||
* // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
|
||||
*
|
||||
* // tsc foo.ts --module preserve --moduleResolution bundler
|
||||
* import {} from "mod";
|
||||
* // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
|
||||
* // supports conditional imports/exports
|
||||
*
|
||||
* // tsc foo.ts --module preserve --moduleResolution node10
|
||||
* import {} from "mod";
|
||||
* // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
|
||||
* // does not support conditional imports/exports
|
||||
*
|
||||
* // tsc foo.ts --module commonjs --moduleResolution node10
|
||||
* import type {} from "mod" with { "resolution-mode": "import" };
|
||||
* // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
|
||||
* ```
|
||||
*/
|
||||
getModeForResolutionAtIndex(file: SourceFile, index: number): ResolutionMode;
|
||||
getProjectReferences(): readonly ProjectReference[] | undefined;
|
||||
|
@ -6125,6 +6152,27 @@ declare namespace ts {
|
|||
getBaseTypes(type: InterfaceType): BaseType[];
|
||||
getBaseTypeOfLiteralType(type: Type): Type;
|
||||
getWidenedType(type: Type): Type;
|
||||
/**
|
||||
* Gets the "awaited type" of a type.
|
||||
*
|
||||
* If an expression has a Promise-like type, the "awaited type" of the expression is
|
||||
* derived from the type of the first argument of the fulfillment callback for that
|
||||
* Promise's `then` method. If the "awaited type" is itself a Promise-like, it is
|
||||
* recursively unwrapped in the same manner until a non-promise type is found.
|
||||
*
|
||||
* If an expression does not have a Promise-like type, its "awaited type" is the type
|
||||
* of the expression.
|
||||
*
|
||||
* If the resulting "awaited type" is a generic object type, then it is wrapped in
|
||||
* an `Awaited<T>`.
|
||||
*
|
||||
* In the event the "awaited type" circularly references itself, or is a non-Promise
|
||||
* object-type with a callable `then()` method, an "awaited type" cannot be determined
|
||||
* and the value `undefined` will be returned.
|
||||
*
|
||||
* This is used to reflect the runtime behavior of the `await` keyword.
|
||||
*/
|
||||
getAwaitedType(type: Type): Type | undefined;
|
||||
getReturnTypeOfSignature(signature: Signature): Type;
|
||||
getNullableType(type: Type, flags: TypeFlags): Type;
|
||||
getNonNullableType(type: Type): Type;
|
||||
|
@ -6217,6 +6265,7 @@ declare namespace ts {
|
|||
getNumberType(): Type;
|
||||
getNumberLiteralType(value: number): NumberLiteralType;
|
||||
getBigIntType(): Type;
|
||||
getBigIntLiteralType(value: PseudoBigInt): BigIntLiteralType;
|
||||
getBooleanType(): Type;
|
||||
getFalseType(): Type;
|
||||
getTrueType(): Type;
|
||||
|
@ -6686,7 +6735,11 @@ declare namespace ts {
|
|||
minLength: number;
|
||||
/** Number of initial required or optional elements */
|
||||
fixedLength: number;
|
||||
/** True if tuple has any rest or variadic elements */
|
||||
/**
|
||||
* True if tuple has any rest or variadic elements
|
||||
*
|
||||
* @deprecated Use `.combinedFlags & ElementFlags.Variable` instead
|
||||
*/
|
||||
hasRestElement: boolean;
|
||||
combinedFlags: ElementFlags;
|
||||
readonly: boolean;
|
||||
|
@ -7010,6 +7063,7 @@ declare namespace ts {
|
|||
strictBindCallApply?: boolean;
|
||||
strictNullChecks?: boolean;
|
||||
strictPropertyInitialization?: boolean;
|
||||
strictBuiltinIteratorReturn?: boolean;
|
||||
stripInternal?: boolean;
|
||||
/** @deprecated */
|
||||
suppressExcessPropertyErrors?: boolean;
|
||||
|
@ -7018,6 +7072,7 @@ declare namespace ts {
|
|||
target?: ScriptTarget;
|
||||
traceResolution?: boolean;
|
||||
useUnknownInCatchVariables?: boolean;
|
||||
noUncheckedSideEffectImports?: boolean;
|
||||
resolveJsonModule?: boolean;
|
||||
types?: string[];
|
||||
/** Paths used to compute primary types search locations */
|
||||
|
@ -7344,9 +7399,10 @@ declare namespace ts {
|
|||
TypeAssertions = 2,
|
||||
NonNullAssertions = 4,
|
||||
PartiallyEmittedExpressions = 8,
|
||||
ExpressionsWithTypeArguments = 16,
|
||||
Assertions = 6,
|
||||
All = 15,
|
||||
ExcludeJSDocTypeAssertion = 16,
|
||||
All = 31,
|
||||
ExcludeJSDocTypeAssertion = -2147483648,
|
||||
}
|
||||
type ImmediatelyInvokedFunctionExpression = CallExpression & {
|
||||
readonly expression: FunctionExpression;
|
||||
|
@ -7645,20 +7701,20 @@ declare namespace ts {
|
|||
updateImportAttribute(node: ImportAttribute, name: ImportAttributeName, value: Expression): ImportAttribute;
|
||||
createNamespaceImport(name: Identifier): NamespaceImport;
|
||||
updateNamespaceImport(node: NamespaceImport, name: Identifier): NamespaceImport;
|
||||
createNamespaceExport(name: Identifier): NamespaceExport;
|
||||
updateNamespaceExport(node: NamespaceExport, name: Identifier): NamespaceExport;
|
||||
createNamespaceExport(name: ModuleExportName): NamespaceExport;
|
||||
updateNamespaceExport(node: NamespaceExport, name: ModuleExportName): NamespaceExport;
|
||||
createNamedImports(elements: readonly ImportSpecifier[]): NamedImports;
|
||||
updateNamedImports(node: NamedImports, elements: readonly ImportSpecifier[]): NamedImports;
|
||||
createImportSpecifier(isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
|
||||
updateImportSpecifier(node: ImportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ImportSpecifier;
|
||||
createImportSpecifier(isTypeOnly: boolean, propertyName: ModuleExportName | undefined, name: Identifier): ImportSpecifier;
|
||||
updateImportSpecifier(node: ImportSpecifier, isTypeOnly: boolean, propertyName: ModuleExportName | undefined, name: Identifier): ImportSpecifier;
|
||||
createExportAssignment(modifiers: readonly ModifierLike[] | undefined, isExportEquals: boolean | undefined, expression: Expression): ExportAssignment;
|
||||
updateExportAssignment(node: ExportAssignment, modifiers: readonly ModifierLike[] | undefined, expression: Expression): ExportAssignment;
|
||||
createExportDeclaration(modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier?: Expression, attributes?: ImportAttributes): ExportDeclaration;
|
||||
updateExportDeclaration(node: ExportDeclaration, modifiers: readonly ModifierLike[] | undefined, isTypeOnly: boolean, exportClause: NamedExportBindings | undefined, moduleSpecifier: Expression | undefined, attributes: ImportAttributes | undefined): ExportDeclaration;
|
||||
createNamedExports(elements: readonly ExportSpecifier[]): NamedExports;
|
||||
updateNamedExports(node: NamedExports, elements: readonly ExportSpecifier[]): NamedExports;
|
||||
createExportSpecifier(isTypeOnly: boolean, propertyName: string | Identifier | undefined, name: string | Identifier): ExportSpecifier;
|
||||
updateExportSpecifier(node: ExportSpecifier, isTypeOnly: boolean, propertyName: Identifier | undefined, name: Identifier): ExportSpecifier;
|
||||
createExportSpecifier(isTypeOnly: boolean, propertyName: string | ModuleExportName | undefined, name: string | ModuleExportName): ExportSpecifier;
|
||||
updateExportSpecifier(node: ExportSpecifier, isTypeOnly: boolean, propertyName: ModuleExportName | undefined, name: ModuleExportName): ExportSpecifier;
|
||||
createExternalModuleReference(expression: Expression): ExternalModuleReference;
|
||||
updateExternalModuleReference(node: ExternalModuleReference, expression: Expression): ExternalModuleReference;
|
||||
createJSDocAllType(): JSDocAllType;
|
||||
|
@ -8238,6 +8294,7 @@ declare namespace ts {
|
|||
readonly interactiveInlayHints?: boolean;
|
||||
readonly allowRenameOfImportPath?: boolean;
|
||||
readonly autoImportFileExcludePatterns?: string[];
|
||||
readonly autoImportSpecifierExcludeRegexes?: string[];
|
||||
readonly preferTypeOnlyAutoImports?: boolean;
|
||||
/**
|
||||
* Indicates whether imports should be organized in a case-insensitive manner.
|
||||
|
@ -8976,6 +9033,7 @@ declare namespace ts {
|
|||
function isExportDeclaration(node: Node): node is ExportDeclaration;
|
||||
function isNamedExports(node: Node): node is NamedExports;
|
||||
function isExportSpecifier(node: Node): node is ExportSpecifier;
|
||||
function isModuleExportName(node: Node): node is ModuleExportName;
|
||||
function isMissingDeclaration(node: Node): node is MissingDeclaration;
|
||||
function isNotEmittedStatement(node: Node): node is NotEmittedStatement;
|
||||
function isExternalModuleReference(node: Node): node is ExternalModuleReference;
|
||||
|
@ -9411,24 +9469,43 @@ declare namespace ts {
|
|||
function getModeForResolutionAtIndex(file: SourceFile, index: number, compilerOptions: CompilerOptions): ResolutionMode;
|
||||
/**
|
||||
* Use `program.getModeForUsageLocation`, which retrieves the correct `compilerOptions`, instead of this function whenever possible.
|
||||
* Calculates the final resolution mode for a given module reference node. This is the resolution mode explicitly provided via import
|
||||
* attributes, if present, or the syntax the usage would have if emitted to JavaScript. In `--module node16` or `nodenext`, this may
|
||||
* depend on the file's `impliedNodeFormat`. In `--module preserve`, it depends only on the input syntax of the reference. In other
|
||||
* `module` modes, when overriding import attributes are not provided, this function returns `undefined`, as the result would have no
|
||||
* impact on module resolution, emit, or type checking.
|
||||
* Calculates the final resolution mode for a given module reference node. This function only returns a result when module resolution
|
||||
* settings allow differing resolution between ESM imports and CJS requires, or when a mode is explicitly provided via import attributes,
|
||||
* which cause an `import` or `require` condition to be used during resolution regardless of module resolution settings. In absence of
|
||||
* overriding attributes, and in modes that support differing resolution, the result indicates the syntax the usage would emit to JavaScript.
|
||||
* Some examples:
|
||||
*
|
||||
* ```ts
|
||||
* // tsc foo.mts --module nodenext
|
||||
* import {} from "mod";
|
||||
* // Result: ESNext - the import emits as ESM due to `impliedNodeFormat` set by .mts file extension
|
||||
*
|
||||
* // tsc foo.cts --module nodenext
|
||||
* import {} from "mod";
|
||||
* // Result: CommonJS - the import emits as CJS due to `impliedNodeFormat` set by .cts file extension
|
||||
*
|
||||
* // tsc foo.ts --module preserve --moduleResolution bundler
|
||||
* import {} from "mod";
|
||||
* // Result: ESNext - the import emits as ESM due to `--module preserve` and `--moduleResolution bundler`
|
||||
* // supports conditional imports/exports
|
||||
*
|
||||
* // tsc foo.ts --module preserve --moduleResolution node10
|
||||
* import {} from "mod";
|
||||
* // Result: undefined - the import emits as ESM due to `--module preserve`, but `--moduleResolution node10`
|
||||
* // does not support conditional imports/exports
|
||||
*
|
||||
* // tsc foo.ts --module commonjs --moduleResolution node10
|
||||
* import type {} from "mod" with { "resolution-mode": "import" };
|
||||
* // Result: ESNext - conditional imports/exports always supported with "resolution-mode" attribute
|
||||
* ```
|
||||
*
|
||||
* @param file The file the import or import-like reference is contained within
|
||||
* @param usage The module reference string
|
||||
* @param compilerOptions The compiler options for the program that owns the file. If the file belongs to a referenced project, the compiler options
|
||||
* should be the options of the referenced project, not the referencing project.
|
||||
* @returns The final resolution mode of the import
|
||||
*/
|
||||
function getModeForUsageLocation(
|
||||
file: {
|
||||
impliedNodeFormat?: ResolutionMode;
|
||||
},
|
||||
usage: StringLiteralLike,
|
||||
compilerOptions: CompilerOptions,
|
||||
): ModuleKind.CommonJS | ModuleKind.ESNext | undefined;
|
||||
function getModeForUsageLocation(file: SourceFile, usage: StringLiteralLike, compilerOptions: CompilerOptions): ResolutionMode;
|
||||
function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): readonly Diagnostic[];
|
||||
/**
|
||||
* A function for determining if a given file is esm or cjs format, assuming modern node module resolution rules, as configured by the
|
||||
|
@ -9654,6 +9731,7 @@ declare namespace ts {
|
|||
setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
|
||||
/** If provided, will be used to reset existing delayed compilation */
|
||||
clearTimeout?(timeoutId: any): void;
|
||||
preferNonRecursiveWatch?: boolean;
|
||||
}
|
||||
interface ProgramHost<T extends BuilderProgram> {
|
||||
/**
|
||||
|
@ -9776,6 +9854,7 @@ declare namespace ts {
|
|||
dry?: boolean;
|
||||
force?: boolean;
|
||||
verbose?: boolean;
|
||||
stopBuildOnErrors?: boolean;
|
||||
incremental?: boolean;
|
||||
assumeChangesOnlyAffectDirectDependencies?: boolean;
|
||||
declaration?: boolean;
|
||||
|
@ -10743,6 +10822,10 @@ declare namespace ts {
|
|||
*/
|
||||
isIncomplete?: true;
|
||||
entries: CompletionEntry[];
|
||||
/**
|
||||
* Default commit characters for the completion entries.
|
||||
*/
|
||||
defaultCommitCharacters?: string[];
|
||||
}
|
||||
interface CompletionEntryDataAutoImport {
|
||||
/**
|
||||
|
@ -10849,6 +10932,10 @@ declare namespace ts {
|
|||
* is an auto-import.
|
||||
*/
|
||||
data?: CompletionEntryData;
|
||||
/**
|
||||
* If this completion entry is selected, typing a commit character will cause the entry to be accepted.
|
||||
*/
|
||||
commitCharacters?: string[];
|
||||
}
|
||||
interface CompletionEntryLabelDetails {
|
||||
/**
|
||||
|
|
|
@ -1096,7 +1096,6 @@ mod tests {
|
|||
"jsxFactory": "React.createElement",
|
||||
"jsxFragmentFactory": "React.Fragment",
|
||||
"lib": ["deno.window"],
|
||||
"module": "esnext",
|
||||
"noEmit": true,
|
||||
"outDir": "internal:///",
|
||||
"strict": true,
|
||||
|
|
|
@ -52,11 +52,6 @@ itest!(check_npm_install_diagnostics {
|
|||
exit_code: 1,
|
||||
});
|
||||
|
||||
itest!(check_export_equals_declaration_file {
|
||||
args: "check --quiet check/export_equals_declaration_file/main.ts",
|
||||
exit_code: 0,
|
||||
});
|
||||
|
||||
itest!(check_static_response_json {
|
||||
args: "check --quiet check/response_json.ts",
|
||||
exit_code: 0,
|
||||
|
|
|
@ -5380,7 +5380,7 @@ fn lsp_jsr_auto_import_completion() {
|
|||
json!({ "triggerKind": 1 }),
|
||||
);
|
||||
assert!(!list.is_incomplete);
|
||||
assert_eq!(list.items.len(), 267);
|
||||
assert_eq!(list.items.len(), 268);
|
||||
let item = list.items.iter().find(|i| i.label == "add").unwrap();
|
||||
assert_eq!(&item.label, "add");
|
||||
assert_eq!(
|
||||
|
@ -5460,7 +5460,7 @@ fn lsp_jsr_auto_import_completion_import_map() {
|
|||
json!({ "triggerKind": 1 }),
|
||||
);
|
||||
assert!(!list.is_incomplete);
|
||||
assert_eq!(list.items.len(), 267);
|
||||
assert_eq!(list.items.len(), 268);
|
||||
let item = list.items.iter().find(|i| i.label == "add").unwrap();
|
||||
assert_eq!(&item.label, "add");
|
||||
assert_eq!(json!(&item.label_details), json!({ "description": "add" }));
|
||||
|
|
BIN
tests/registry/npm/@types/node/node-22.5.4.tgz
Normal file
BIN
tests/registry/npm/@types/node/node-22.5.4.tgz
Normal file
Binary file not shown.
|
@ -1,17 +1,49 @@
|
|||
{
|
||||
"name": "@types/node",
|
||||
"description": "TypeScript definitions for node",
|
||||
"dist-tags": {
|
||||
"latest": "18.8.2"
|
||||
"ts4.9": "22.5.4",
|
||||
"ts5.5": "22.5.4",
|
||||
"ts5.6": "22.5.4",
|
||||
"ts5.7": "22.5.4",
|
||||
"ts4.8": "22.5.4",
|
||||
"ts5.2": "22.5.4",
|
||||
"ts5.3": "22.5.4",
|
||||
"ts5.4": "22.5.4",
|
||||
"ts5.1": "22.5.4",
|
||||
"ts5.0": "22.5.4",
|
||||
"latest": "22.5.4"
|
||||
},
|
||||
"versions": {
|
||||
"18.8.2": {
|
||||
"name": "@types/node",
|
||||
"version": "18.8.2",
|
||||
"description": "TypeScript definitions for Node.js",
|
||||
"license": "MIT",
|
||||
"_id": "@types/node@18.8.2",
|
||||
"dist": {
|
||||
"shasum": "17d42c6322d917764dd3d2d3a10d7884925de067",
|
||||
"tarball": "http://localhost:4260/@types/node/node-18.8.2.tgz",
|
||||
"fileCount": 124,
|
||||
"integrity": "sha512-cRMwIgdDN43GO4xMWAfJAecYn8wV4JbsOGHNfNUIDiuYkUYAR5ec4Rj7IO2SAhFPEfpPtLtUTbbny/TCT7aDwA==",
|
||||
"signatures": [
|
||||
{
|
||||
"sig": "MEYCIQCAqI3XibndhBD647C/13AFb58Fhmg4WmfCoGrIYrgtzwIhAIB0b0D58Tigwb3qKaOVsKnuYOOr0strAmprZSCi/+oq",
|
||||
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
|
||||
}
|
||||
],
|
||||
"unpackedSize": 3524549,
|
||||
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPFItACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrKAg/+IwaUWPgePlO4IxW7CVhFEEFiyhjEH3FHe0ogC3YmreoBFv/A\r\nPwQrwObdskbGWrBzsAOVFvhzYktzP3kc857HtU2ia9FXeaEYvsSQBqh6jZfA\r\njR1+h+jn+W5JnmbnwRGfNn2riCo/un4tYoZ4o/bKiMdNd9WrdIs0Oii1Dd4N\r\nnsBXPb05UPPP4Uu8cz68u1bj+QQ6aslr6keGNyNeILf8bJsEfcfVkEO3l4cu\r\njyTIrxiD+tM8jrUE9CDeodF8CZNuvLh3hqdMPJeH3U47qkDtPDKEOvZTbyYm\r\ngodto6mcnuBr8F9vmikAQfGiXV0U2cg2XRjWc1lI8HT4X0kESTIo+nzNuliD\r\niTpfjyZHdKBGGIuHP1Ou9dVvx4t5XZ1JsK9EK5WTilvAlu/qZrynxXxAV3Rc\r\nvL9UhIacISprMWB3Sohl9ZtfcmGnV/KMRpM+yPZOWp39gQQCKaKF/j2f/mir\r\n8YFbFUnySZkXKzxgsgjrSsh9QiK2dYAzcqHlazITeFN9jOYRzYUjAFj3qOFm\r\n7o1eJpW0qM5vgR+fPq30WxcdcQ4PaWgHSlb/ll8hiwQG1ZUihO/1RU7FtDoc\r\n1KwcfrGOAJPL6vBSLPReUkhDIUTSBwfmvfMxzqD1aDp6YV5WX7h03B0dWbPJ\r\nmPJmJZjjZje4Trk9jBJ5/ZLpB8/zkrDKvhE=\r\n=LPWa\r\n-----END PGP SIGNATURE-----\r\n"
|
||||
},
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"scripts": {},
|
||||
"repository": {
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"type": "git",
|
||||
"directory": "types/node"
|
||||
},
|
||||
"description": "TypeScript definitions for Node.js",
|
||||
"directories": {},
|
||||
"dependencies": {},
|
||||
"typesVersions": {
|
||||
"<4.9.0-0": {
|
||||
"*": [
|
||||
|
@ -19,33 +51,39 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/node"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "034172ea945b66afc6502e6be34d6fb957c596091e39cf43672e8aca563a8c66",
|
||||
"_hasShrinkwrap": false,
|
||||
"typeScriptVersion": "4.1",
|
||||
"_id": "@types/node@18.8.2",
|
||||
"dist": {
|
||||
"integrity": "sha512-cRMwIgdDN43GO4xMWAfJAecYn8wV4JbsOGHNfNUIDiuYkUYAR5ec4Rj7IO2SAhFPEfpPtLtUTbbny/TCT7aDwA==",
|
||||
"shasum": "17d42c6322d917764dd3d2d3a10d7884925de067",
|
||||
"tarball": "http://localhost:4260/@types/node/node-18.8.2.tgz",
|
||||
"fileCount": 124,
|
||||
"unpackedSize": 3524549
|
||||
},
|
||||
"directories": {},
|
||||
"_hasShrinkwrap": false
|
||||
"typesPublisherContentHash": "034172ea945b66afc6502e6be34d6fb957c596091e39cf43672e8aca563a8c66"
|
||||
},
|
||||
"18.16.19": {
|
||||
"name": "@types/node",
|
||||
"version": "18.16.19",
|
||||
"description": "TypeScript definitions for Node.js",
|
||||
"license": "MIT",
|
||||
"_id": "@types/node@18.16.19",
|
||||
"dist": {
|
||||
"shasum": "cb03fca8910fdeb7595b755126a8a78144714eea",
|
||||
"tarball": "http://localhost:4260/@types/node/node-18.16.19.tgz",
|
||||
"fileCount": 125,
|
||||
"integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==",
|
||||
"signatures": [
|
||||
{
|
||||
"sig": "MEYCIQCrmUK+J0P1ywi+U/RBUqMXSK7c0kDYxMEYunkXNSPf+wIhANTRnqmuKWdzIKhsGHCZB+js8qhLcce/P+XOR1JmSNIc",
|
||||
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
|
||||
}
|
||||
],
|
||||
"unpackedSize": 3677153
|
||||
},
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"scripts": {},
|
||||
"repository": {
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"type": "git",
|
||||
"directory": "types/node"
|
||||
},
|
||||
"description": "TypeScript definitions for Node.js",
|
||||
"directories": {},
|
||||
"dependencies": {},
|
||||
"typesVersions": {
|
||||
"<=4.8": {
|
||||
"*": [
|
||||
|
@ -53,33 +91,54 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"_hasShrinkwrap": false,
|
||||
"typeScriptVersion": "4.3",
|
||||
"typesPublisherContentHash": "e0763594b4075c74150a6024cd39f92797ea5c273540e3a5fe0a63a791ffa0c8"
|
||||
},
|
||||
"22.5.4": {
|
||||
"name": "@types/node",
|
||||
"version": "22.5.4",
|
||||
"license": "MIT",
|
||||
"_id": "@types/node@22.5.4",
|
||||
"dist": {
|
||||
"shasum": "83f7d1f65bc2ed223bdbf57c7884f1d5a4fa84e8",
|
||||
"tarball": "http://localhost:4260/@types/node/node-22.5.4.tgz",
|
||||
"fileCount": 66,
|
||||
"integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==",
|
||||
"signatures": [
|
||||
{
|
||||
"sig": "MEQCIBbWAo9Soe8vwExWQDxwtbCM6CdXy4QChOKJVJSoNpNiAiBfaOBNxW/iDfPEGn6WQ/wZggtMCAdZNLbVBfSynJ/pdA==",
|
||||
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"
|
||||
}
|
||||
],
|
||||
"unpackedSize": 2203331
|
||||
},
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"scripts": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"type": "git",
|
||||
"directory": "types/node"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "e0763594b4075c74150a6024cd39f92797ea5c273540e3a5fe0a63a791ffa0c8",
|
||||
"typeScriptVersion": "4.3",
|
||||
"_id": "@types/node@18.16.19",
|
||||
"dist": {
|
||||
"integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==",
|
||||
"shasum": "cb03fca8910fdeb7595b755126a8a78144714eea",
|
||||
"tarball": "http://localhost:4260/@types/node/node-18.16.19.tgz",
|
||||
"fileCount": 125,
|
||||
"unpackedSize": 3677153
|
||||
},
|
||||
"description": "TypeScript definitions for node",
|
||||
"directories": {},
|
||||
"_hasShrinkwrap": false
|
||||
"dependencies": {
|
||||
"undici-types": "~6.19.2"
|
||||
},
|
||||
"_hasShrinkwrap": false,
|
||||
"typeScriptVersion": "4.8",
|
||||
"typesPublisherContentHash": "6ee9a11eba834031423800320320aa873d6bf2b6f33603c13a2aa9d90b3803ee"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"readmeFilename": "",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"type": "git",
|
||||
"directory": "types/node"
|
||||
},
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node"
|
||||
}
|
||||
"description": "TypeScript definitions for node",
|
||||
"readme": "[object Object]",
|
||||
"readmeFilename": ""
|
||||
}
|
0
tests/registry/npm/trim_registry_files.js
Executable file → Normal file
0
tests/registry/npm/trim_registry_files.js
Executable file → Normal file
53
tests/registry/npm/undici-types/registry.json
Normal file
53
tests/registry/npm/undici-types/registry.json
Normal file
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"name": "undici-types",
|
||||
"dist-tags": {
|
||||
"latest": "6.19.8"
|
||||
},
|
||||
"versions": {
|
||||
"6.19.8": {
|
||||
"name": "undici-types",
|
||||
"version": "6.19.8",
|
||||
"description": "A stand-alone types package for Undici",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nodejs/undici/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/nodejs/undici.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"types": "index.d.ts",
|
||||
"_id": "undici-types@6.19.8",
|
||||
"gitHead": "3d3ce0695c8c3f9a8f3c8af90dd42d0569d3f0bb",
|
||||
"_nodeVersion": "20.16.0",
|
||||
"_npmVersion": "10.8.1",
|
||||
"dist": {
|
||||
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
|
||||
"shasum": "35111c9d1437ab83a7cdc0abae2f26d88eda0a02",
|
||||
"tarball": "http://localhost:4260/undici-types/undici-types-6.19.8.tgz",
|
||||
"fileCount": 41,
|
||||
"unpackedSize": 84225,
|
||||
"signatures": [
|
||||
{
|
||||
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
|
||||
"sig": "MEUCIGHm3RU6nmPjpFrE7lus7cMT9nBeVHOhTWjzflE57x08AiEAs6/KJsXAnqL1KXWZBAkJ5Gf4NdDUqZcjr/OL+clXX3I="
|
||||
}
|
||||
]
|
||||
},
|
||||
"directories": {},
|
||||
"_hasShrinkwrap": false
|
||||
}
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/nodejs/undici/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"homepage": "https://undici.nodejs.org",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/nodejs/undici.git"
|
||||
},
|
||||
"description": "A stand-alone types package for Undici",
|
||||
"readme": "# undici-types\n\nThis package is a dual-publish of the [undici](https://www.npmjs.com/package/undici) library types. The `undici` package **still contains types**. This package is for users who _only_ need undici types (such as for `@types/node`). It is published alongside every release of `undici`, so you can always use the same version.\n\n- [GitHub nodejs/undici](https://github.com/nodejs/undici)\n- [Undici Documentation](https://undici.nodejs.org/#/)\n",
|
||||
"readmeFilename": "README.md"
|
||||
}
|
BIN
tests/registry/npm/undici-types/undici-types-6.19.8.tgz
Normal file
BIN
tests/registry/npm/undici-types/undici-types-6.19.8.tgz
Normal file
Binary file not shown.
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"steps": [{
|
||||
"args": "check main.ts",
|
||||
"output": "main.out"
|
||||
}, {
|
||||
// ensure diagnostic is not cached
|
||||
"args": "check main.ts",
|
||||
"output": "main.out"
|
||||
}]
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
Check file:///[WILDLINE]/main.ts
|
||||
TS1203 [WARN]: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. This will start erroring in a future version of Deno 2 in order to align with TypeScript.
|
||||
export = other;
|
||||
~~~~~~~~~~~~~~~
|
||||
at file:///[WILDLINE]/other.d.ts:1:1
|
||||
|
|
@ -1,7 +1,11 @@
|
|||
Warning Resolving "url" as "node:url" at file:///[WILDLINE]/mod.ts:1:22. If you want to use a built-in Node module, add a "node:" prefix.
|
||||
Warning Resolving "url" as "node:url" at file:///[WILDLINE]/mod.ts:1:22. If you want to use a built-in Node module, add a "node:" prefix.
|
||||
[UNORDERED_START]
|
||||
Download http://localhost:4260/@types/node
|
||||
Download http://localhost:4260/@types/node/node-18.16.19.tgz
|
||||
Download http://localhost:4260/undici-types
|
||||
Download http://localhost:4260/@types/node/node-22.5.4.tgz
|
||||
Download http://localhost:4260/undici-types/undici-types-6.19.8.tgz
|
||||
[UNORDERED_END]
|
||||
Check file:///[WILDLINE]/mod.ts
|
||||
Checking for slow types in the public API...
|
||||
Check file:///[WILDLINE]/mod.ts
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
[UNORDERED_START]
|
||||
Download http://localhost:4260/@types/node
|
||||
Download http://localhost:4260/@types/node/node-[WILDCARD].tgz
|
||||
Download http://localhost:4260/undici-types
|
||||
Download http://localhost:4260/@types/node/node-22.5.4.tgz
|
||||
Download http://localhost:4260/undici-types/undici-types-6.19.8.tgz
|
||||
[UNORDERED_END]
|
||||
Check file:///[WILDCARD]/mod.ts
|
||||
Checking for slow types in the public API...
|
||||
Check file:///[WILDCARD]/publish/node_specifier/mod.ts
|
||||
|
|
4
tests/testdata/npm/compare_globals/main.out
vendored
4
tests/testdata/npm/compare_globals/main.out
vendored
|
@ -1,10 +1,12 @@
|
|||
[UNORDERED_START]
|
||||
Download http://localhost:4260/@types/node
|
||||
Download http://localhost:4260/undici-types
|
||||
Download http://localhost:4260/@denotest/globals
|
||||
[UNORDERED_END]
|
||||
[UNORDERED_START]
|
||||
Download http://localhost:4260/@denotest/globals/1.0.0.tgz
|
||||
Download http://localhost:4260/@types/node/node-18.16.19.tgz
|
||||
Download http://localhost:4260/@types/node/node-22.5.4.tgz
|
||||
Download http://localhost:4260/undici-types/undici-types-6.19.8.tgz
|
||||
[UNORDERED_END]
|
||||
Check file:///[WILDCARD]/npm/compare_globals/main.ts
|
||||
true
|
||||
|
|
|
@ -6,5 +6,5 @@ Deno.test(function version() {
|
|||
const pattern = /^\d+\.\d+\.\d+/;
|
||||
assert(pattern.test(Deno.version.deno));
|
||||
assert(pattern.test(Deno.version.v8));
|
||||
assertEquals(Deno.version.typescript, "5.5.2");
|
||||
assertEquals(Deno.version.typescript, "5.6.2");
|
||||
});
|
||||
|
|
|
@ -133,7 +133,9 @@ Deno.test("[std/node/fs] stat callback isn't called twice if error is thrown", a
|
|||
Deno.test({
|
||||
name: "[std/node/fs] stat default methods",
|
||||
fn() {
|
||||
const stats = new Stats();
|
||||
// stats ctor is private
|
||||
// deno-lint-ignore no-explicit-any
|
||||
const stats = new (Stats as any)();
|
||||
assertEquals(stats.isFile(), false);
|
||||
assertEquals(stats.isDirectory(), false);
|
||||
assertEquals(stats.isBlockDevice(), false);
|
||||
|
|
|
@ -12,7 +12,7 @@ import {
|
|||
assertThrows,
|
||||
} from "@std/assert";
|
||||
import * as path from "@std/path";
|
||||
import { setTimeout } from "node:timers";
|
||||
import { clearTimeout, setTimeout } from "node:timers";
|
||||
|
||||
const { spawn, spawnSync, execFile, execFileSync, ChildProcess } = CP;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
// @ts-expect-error: @types/node is outdated
|
||||
import events, { addAbortListener, EventEmitter } from "node:events";
|
||||
|
||||
EventEmitter.captureRejections = true;
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
import { assert, assertEquals } from "@std/assert";
|
||||
import { fromFileUrl, relative } from "@std/path";
|
||||
import { pipeline } from "node:stream/promises";
|
||||
// @ts-expect-error: @types/node is outdated
|
||||
import { getDefaultHighWaterMark, Stream } from "node:stream";
|
||||
import { createReadStream, createWriteStream } from "node:fs";
|
||||
import { EventEmitter } from "node:events";
|
||||
|
|
|
@ -198,7 +198,7 @@ async function ensureNoNewITests() {
|
|||
"bench_tests.rs": 0,
|
||||
"cache_tests.rs": 0,
|
||||
"cert_tests.rs": 0,
|
||||
"check_tests.rs": 22,
|
||||
"check_tests.rs": 21,
|
||||
"compile_tests.rs": 0,
|
||||
"coverage_tests.rs": 0,
|
||||
"eval_tests.rs": 0,
|
||||
|
|
Loading…
Reference in a new issue