0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-01 12:16:11 -05:00

chore: add more TS/JS types

- Add missing internal file mappings
- Fix some obvious TS type errors
This commit is contained in:
Marvin Hagemeister 2024-07-09 01:23:16 +02:00
parent b338b541ac
commit 5f8834e15c
31 changed files with 374 additions and 31 deletions

View file

@ -1,7 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
/// <reference path="../../core/internal.d.ts" />
import { core, internals, primordials } from "ext:core/mod.js";
const {
isAnyArrayBuffer,

View file

@ -1,7 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// @ts-check
/// <reference path="../../core/lib.deno_core.d.ts" />
/// <reference path="../web/internal.d.ts" />
/// <reference path="../url/internal.d.ts" />
/// <reference path="../web/lib.deno_web.d.ts" />

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
/// <reference path="../../core/internal.d.ts" />
// @ts-check
import { primordials } from "ext:core/mod.js";
import { op_utf8_to_byte_string } from "ext:core/ops";

View file

@ -1,5 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// @ts-check
import { core, internals, primordials } from "ext:core/mod.js";
const {
isDate,

View file

@ -20,6 +20,7 @@ import {
notImplemented,
TextEncodings,
} from "ext:deno_node/_utils.ts";
import type { Buffer } from "node:buffer";
export type CallbackWithError = (err: ErrnoException | null) => void;

View file

@ -1,6 +1,8 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent, Inc. and Node.js contributors. All rights reserved. MIT license.
// @ts-check
import { primordials } from "ext:core/mod.js";
const {
Uint8ArrayPrototype,

View file

@ -4,6 +4,8 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
// @ts-check
import { op_preview_entries } from "ext:core/ops";
// Mock trace for now

View file

@ -2489,7 +2489,7 @@ export class ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL extends NodeTypeError {
}
export class ERR_PARSE_ARGS_UNKNOWN_OPTION extends NodeTypeError {
constructor(option, allowPositionals) {
constructor(option: string, allowPositionals: boolean) {
const suggestDashDash = allowPositionals
? ". To specify a positional " +
"argument starting with a '-', place it at the end of the command after " +

View file

@ -3,6 +3,7 @@
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials
// @ts-check
const kInternal = Symbol("internal properties");

View file

@ -170,6 +170,8 @@ function validateString(value, name) {
/**
* @param {unknown} value
* @param {string} name
* @param {number} [min]
* @param {number} [max]
*/
function validateNumber(value, name, min = undefined, max) {
if (typeof value !== "number") {

View file

@ -106,7 +106,7 @@ export function normalizeString(
return res;
}
function formatExt(ext) {
function formatExt(ext: string | undefined) {
return ext ? `${ext[0] === "." ? "" : "."}${ext}` : "";
}

View file

@ -1,8 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// Copyright Joyent and Node contributors. All rights reserved. MIT license.
/// <reference path="../../core/internal.d.ts" />
// TODO(petamoriken): enable prefer-primordials for node polyfills
// deno-lint-ignore-file prefer-primordials

View file

@ -7,6 +7,8 @@ declare module "ext:deno_url/00_url.js" {
const URL: typeof URL;
const URLSearchParams: typeof URLSearchParams;
function parseUrlEncoded(bytes: Uint8Array): [string, string][];
const URLPrototype: typeof URL.prototype;
}
declare module "ext:deno_url/01_urlpattern.js" {

View file

@ -1,8 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// @ts-check
/// <reference path="../../core/internal.d.ts" />
/// <reference path="../../core/lib.deno_core.d.ts" />
/// <reference path="../web/internal.d.ts" />
/// <reference path="../web/lib.deno_web.d.ts" />

View file

@ -1,8 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// @ts-check
/// <reference path="../../core/internal.d.ts" />
/// <reference path="../../core/lib.deno_core.d.ts" />
/// <reference path="../../../deno_core/core/lib.deno_core.d.ts" />
/// <reference path="../webidl/internal.d.ts" />
/// <reference path="../web/internal.d.ts" />
/// <reference path="../web/lib.deno_web.d.ts" />

View file

@ -1,8 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// @ts-check
/// <reference path="../../core/internal.d.ts" />
/// <reference path="../../core/lib.deno_core.d.ts" />
/// <reference path="../../../deno_core/core/lib.deno_core.d.ts" />
/// <reference path="../web/internal.d.ts" />
/// <reference path="../web/lib.deno_web.d.ts" />

View file

@ -1,8 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// @ts-check
/// <reference path="../../core/lib.deno_core.d.ts" />
/// <reference path="../../core/internal.d.ts" />
/// <reference path="../web/internal.d.ts" />
/// <reference path="../web/lib.deno_web.d.ts" />

View file

@ -1,7 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// @ts-check
/// <reference path="../../core/internal.d.ts" />
import { core, primordials } from "ext:core/mod.js";
const {

View file

@ -1,7 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// @ts-check
/// <reference path="../../core/internal.d.ts" />
import { primordials } from "ext:core/mod.js";
const {

View file

@ -1,7 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// @ts-check
/// <reference path="../../core/internal.d.ts" />
/// <reference path="../webidl/internal.d.ts" />
/// <reference path="../web/internal.d.ts" />
/// <reference lib="esnext" />

View file

@ -1,8 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// @ts-check
/// <reference path="../../core/lib.deno_core.d.ts" />
/// <reference path="../../core/internal.d.ts" />
/// <reference path="../webidl/internal.d.ts" />
/// <reference path="../fetch/lib.deno_fetch.d.ts" />
/// <reference path="../web/internal.d.ts" />

View file

@ -2,8 +2,6 @@
// @ts-check
/// <reference no-default-lib="true" />
/// <reference path="../../core/lib.deno_core.d.ts" />
/// <reference path="../../core/internal.d.ts" />
/// <reference path="../webidl/internal.d.ts" />
/// <reference path="../web/internal.d.ts" />
/// <reference path="../web/lib.deno_web.d.ts" />

View file

@ -2,8 +2,6 @@
// @ts-check
/// <reference no-default-lib="true" />
/// <reference path="../../core/lib.deno_core.d.ts" />
/// <reference path="../../core/internal.d.ts" />
/// <reference path="../webidl/internal.d.ts" />
/// <reference path="../web/internal.d.ts" />
/// <reference path="../web/lib.deno_web.d.ts" />

View file

@ -1,6 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
/// <reference path="../../core/internal.d.ts" />
// @ts-check
import { primordials } from "ext:core/mod.js";
const {

View file

@ -1,7 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// @ts-check
/// <reference path="../../core/lib.deno_core.d.ts" />
/// <reference path="../webidl/internal.d.ts" />
/// <reference path="./internal.d.ts" />
/// <reference path="./lib.deno_web.d.ts" />

View file

@ -1,7 +1,6 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// @ts-check
/// <reference path="../../core/lib.deno_core.d.ts" />
/// <reference path="./internal.d.ts" />
/// <reference path="./lib.deno_web.d.ts" />

View file

@ -44,6 +44,7 @@ declare module "ext:deno_web/00_infra.js" {
function forgivingBase64UrlEncode(data: Uint8Array | string): string;
function forgivingBase64UrlDecode(data: string): Uint8Array;
function serializeJSValueToJSONString(value: unknown): string;
function pathFromURL(url: URL): string;
}
declare module "ext:deno_web/01_dom_exception.js" {

View file

@ -4,8 +4,6 @@
// Copyright Domenic Denicola. Licensed under BSD-2-Clause License.
// Original license at https://github.com/jsdom/webidl-conversions/blob/master/LICENSE.md.
/// <reference path="../../core/internal.d.ts" />
import { core, primordials } from "ext:core/mod.js";
const {
isArrayBuffer,

View file

@ -1,5 +1,7 @@
{
"imports": {
"ext:core/mod.js": "./core_mod.d.ts",
"ext:core/ops": "./core_ops.d.ts",
"ext:deno_broadcast_channel/01_broadcast_channel.js": "../ext/broadcast_channel/01_broadcast_channel.js",
"ext:deno_cache/01_cache.js": "../ext/cache/01_cache.js",
"ext:deno_canvas/01_image.js": "../ext/canvas/01_image.js",
@ -22,20 +24,49 @@
"ext:deno_net/01_net.js": "../ext/net/01_net.js",
"ext:deno_net/02_tls.js": "../ext/net/02_tls.js",
"ext:deno_node/_events.d.ts": "../ext/node/polyfills/_events.d.ts",
"ext:deno_node/_fs/_fs_access.ts": "../ext/node/polyfills/_fs/_fs_access.ts",
"ext:deno_node/_fs/_fs_appendFile.ts": "../ext/node/polyfills/_fs/_fs_appendFile.ts",
"ext:deno_node/_fs/_fs_chmod.ts": "../ext/node/polyfills/_fs/_fs_chmod.ts",
"ext:deno_node/_fs/_fs_chown.ts": "../ext/node/polyfills/_fs/_fs_chown.ts",
"ext:deno_node/_fs/_fs_copy.ts": "../ext/node/polyfills/_fs/_fs_copy.ts",
"ext:deno_node/_fs/_fs_cp.js": "../ext/node/polyfills/_fs/_fs_cp.js",
"ext:deno_node/_fs/_fs_fstat.ts": "../ext/node/polyfills/_fs/_fs_fstat.ts",
"ext:deno_node/_fs/_fs_fsync.ts": "../ext/node/polyfills/_fs/_fs_fsync.ts",
"ext:deno_node/_fs/_fs_ftruncate.ts": "../ext/node/polyfills/_fs/_fs_ftruncate.ts",
"ext:deno_node/_fs/_fs_futimes.ts": "../ext/node/polyfills/_fs/_fs_futimes.ts",
"ext:deno_node/_fs/_fs_lchown.ts": "../ext/node/polyfills/_fs/_fs_lchown.ts",
"ext:deno_node/_fs/_fs_close.ts": "../ext/node/polyfills/_fs/_fs_close.ts",
"ext:deno_node/_fs/_fs_link.ts": "../ext/node/polyfills/_fs/_fs_link.ts",
"ext:deno_node/_fs/_fs_lutimes.ts": "../ext/node/polyfills/_fs/_fs_lutimes.ts",
"ext:deno_node/_fs/_fs_mkdtemp.ts": "../ext/node/polyfills/_fs/_fs_mkdtemp.ts",
"ext:deno_node/_fs/_fs_opendir.ts": "../ext/node/polyfills/_fs/_fs_opendir.ts",
"ext:deno_node/_fs/_fs_readdir.ts": "../ext/node/polyfills/_fs/_fs_readdir.ts",
"ext:deno_node/_fs/_fs_readFile.ts": "../ext/node/polyfills/_fs/_fs_readFile.ts",
"ext:deno_node/_fs/_fs_common.ts": "../ext/node/polyfills/_fs/_fs_common.ts",
"ext:deno_node/_fs/_fs_readlink.ts": "../ext/node/polyfills/_fs/_fs_readlink.ts",
"ext:deno_node/_fs/_fs_constants.ts": "../ext/node/polyfills/_fs/_fs_constants.ts",
"ext:deno_node/_fs/_fs_realpath.ts": "../ext/node/polyfills/_fs/_fs_realpath.ts",
"ext:deno_node/_fs/_fs_dir.ts": "../ext/node/polyfills/_fs/_fs_dir.ts",
"ext:deno_node/_fs/_fs_rename.ts": "../ext/node/polyfills/_fs/_fs_rename.ts",
"ext:deno_node/_fs/_fs_rmdir.ts": "../ext/node/polyfills/_fs/_fs_rmdir.ts",
"ext:deno_node/_fs/_fs_dirent.ts": "../ext/node/polyfills/_fs/_fs_dirent.ts",
"ext:deno_node/_fs/_fs_rm.ts": "../ext/node/polyfills/_fs/_fs_rm.ts",
"ext:deno_node/_fs/_fs_exists.ts": "../ext/node/polyfills/_fs/_fs_exists.ts",
"ext:deno_node/_fs/_fs_statfs.js": "../ext/node/polyfills/_fs/_fs_statfs.js",
"ext:deno_node/_fs/_fs_lstat.ts": "../ext/node/polyfills/_fs/_fs_lstat.ts",
"ext:deno_node/_fs/_fs_symlink.ts": "../ext/node/polyfills/_fs/_fs_symlink.ts",
"ext:deno_node/_fs/_fs_mkdir.ts": "../ext/node/polyfills/_fs/_fs_mkdir.ts",
"ext:deno_node/_fs/_fs_fdatasync.ts": "../ext/node/polyfills/_fs/_fs_fdatasync.ts",
"ext:deno_node/_fs/_fs_truncate.ts": "../ext/node/polyfills/_fs/_fs_truncate.ts",
"ext:deno_node/_fs/_fs_open.ts": "../ext/node/polyfills/_fs/_fs_open.ts",
"ext:deno_node/_fs/_fs_utimes.ts": "../ext/node/polyfills/_fs/_fs_utimes.ts",
"ext:deno_node/_fs/_fs_unlink.ts": "../ext/node/polyfills/_fs/_fs_unlink.ts",
"ext:deno_node/_fs/_fs_read.ts": "../ext/node/polyfills/_fs/_fs_read.ts",
"ext:deno_node/_fs/_fs_readv.ts": "../ext/node/polyfills/_fs/_fs_readv.ts",
"ext:deno_node/_fs/_fs_stat.ts": "../ext/node/polyfills/_fs/_fs_stat.ts",
"ext:deno_node/_fs/_fs_watch.ts": "../ext/node/polyfills/_fs/_fs_watch.ts",
"ext:deno_node/_fs/_fs_write.mjs": "../ext/node/polyfills/_fs/_fs_write.mjs",
"ext:deno_node/_fs/_fs_writeFile.ts": "../ext/node/polyfills/_fs/_fs_writeFile.ts",
"ext:deno_node/_fs/_fs_writev.mjs": "../ext/node/polyfills/_fs/_fs_writev.mjs",
"ext:deno_node/_global.d.ts": "../ext/node/polyfills/_global.d.ts",
"ext:deno_node/_http_agent.mjs": "../ext/node/polyfills/_http_agent.mjs",
@ -76,6 +107,7 @@
"node:http": "../ext/node/polyfills/http.ts",
"node:http2": "../ext/node/polyfills/http2.ts",
"node:https": "../ext/node/polyfills/https.ts",
"ext:deno_node/assertion_error.ts": "../ext/node/polyfills/assertion_error.ts",
"ext:deno_node/inspector.ts": "../ext/node/polyfills/inspector.ts",
"ext:deno_node/internal_binding/_libuv_winerror.ts": "../ext/node/polyfills/internal_binding/_libuv_winerror.ts",
"ext:deno_node/internal_binding/_listen.ts": "../ext/node/polyfills/internal_binding/_listen.ts",
@ -91,6 +123,8 @@
"ext:deno_node/internal_binding/crypto.ts": "../ext/node/polyfills/internal_binding/crypto.ts",
"ext:deno_node/internal_binding/handle_wrap.ts": "../ext/node/polyfills/internal_binding/handle_wrap.ts",
"ext:deno_node/internal_binding/mod.ts": "../ext/node/polyfills/internal_binding/mod.ts",
"ext:deno_node/internal_binding/node_file.ts": "../ext/node/polyfills/internal_binding/node_file.ts",
"ext:deno_node/internal_binding/node_options.ts": "../ext/node/polyfills/internal_binding/node_options.ts",
"ext:deno_node/internal_binding/pipe_wrap.ts": "../ext/node/polyfills/internal_binding/pipe_wrap.ts",
"ext:deno_node/internal_binding/stream_wrap.ts": "../ext/node/polyfills/internal_binding/stream_wrap.ts",
"ext:deno_node/internal_binding/string_decoder.ts": "../ext/node/polyfills/internal_binding/string_decoder.ts",
@ -105,6 +139,7 @@
"ext:deno_node/internal/buffer.mjs": "../ext/node/polyfills/internal/buffer.mjs",
"ext:deno_node/internal/child_process.ts": "../ext/node/polyfills/internal/child_process.ts",
"ext:deno_node/internal/cli_table.ts": "../ext/node/polyfills/internal/cli_table.ts",
"ext:deno_node/internal/console/constructor.mjs": "../ext/node/polyfills/internal/console/constructor.mjs",
"ext:deno_node/internal/constants.ts": "../ext/node/polyfills/internal/constants.ts",
"ext:deno_node/internal/crypto/_keys.ts": "../ext/node/polyfills/internal/crypto/_keys.ts",
"ext:deno_node/internal/crypto/_randomBytes.ts": "../ext/node/polyfills/internal/crypto/_randomBytes.ts",
@ -126,15 +161,25 @@
"ext:deno_node/internal/crypto/util.ts": "../ext/node/polyfills/internal/crypto/util.ts",
"ext:deno_node/internal/crypto/x509.ts": "../ext/node/polyfills/internal/crypto/x509.ts",
"ext:deno_node/internal/dgram.ts": "../ext/node/polyfills/internal/dgram.ts",
"ext:deno_node/_readline.mjs": "../ext/node/polyfills/_readline.mjs",
"ext:deno_node/_util/_util_callbackify.js": "../ext/node/polyfills/_util/_util_callbackify.js",
"ext:deno_node/internal/util/parse_args/parse_args.js": "../ext/node/polyfills/internal/util/parse_args/parse_args.js",
"ext:deno_node/_tls_wrap.ts": "../ext/node/polyfills/_tls_wrap.ts",
"ext:deno_node/internal/blocklist.mjs": "../ext/node/polyfills/internal/blocklist.mjs",
"ext:deno_node/_zlib.mjs": "../ext/node/polyfills/_zlib.mjs",
"ext:deno_node/_brotli.js": "../ext/node/polyfills/_brotli.js",
"ext:deno_node/internal/dns/promises.ts": "../ext/node/polyfills/internal/dns/promises.ts",
"ext:deno_node/internal/dns/utils.ts": "../ext/node/polyfills/internal/dns/utils.ts",
"ext:deno_node/internal/error_codes.ts": "../ext/node/polyfills/internal/error_codes.ts",
"ext:deno_node/internal/errors.ts": "../ext/node/polyfills/internal/errors.ts",
"ext:deno_node/internal/event_target.mjs": "../ext/node/polyfills/internal/event_target.mjs",
"ext:deno_node/internal/fixed_queue.ts": "../ext/node/polyfills/internal/fixed_queue.ts",
"ext:deno_node/internal/fs/handle.ts": "../ext/node/polyfills/internal/fs/handle.ts",
"ext:deno_node/internal/fs/streams.mjs": "../ext/node/polyfills/internal/fs/streams.mjs",
"ext:deno_node/internal/fs/utils.mjs": "../ext/node/polyfills/internal/fs/utils.mjs",
"ext:deno_node/internal/hide_stack_frames.ts": "../ext/node/polyfills/internal/hide_stack_frames.ts",
"ext:deno_node/internal/http.ts": "../ext/node/polyfills/internal/http.ts",
"ext:deno_node/internal/idna.ts": "../ext/node/polyfills/internal/idna.ts",
"ext:deno_node/internal/net.ts": "../ext/node/polyfills/internal/net.ts",
"ext:deno_node/internal/normalize_encoding.mjs": "../ext/node/polyfills/internal/normalize_encoding.mjs",
"ext:deno_node/internal/options.ts": "../ext/node/polyfills/internal/options.ts",
@ -148,6 +193,7 @@
"ext:deno_node/internal/readline/promises.mjs": "../ext/node/polyfills/internal/readline/promises.mjs",
"ext:deno_node/internal/readline/symbols.mjs": "../ext/node/polyfills/internal/readline/symbols.mjs",
"ext:deno_node/internal/readline/utils.mjs": "../ext/node/polyfills/internal/readline/utils.mjs",
"ext:deno_node/internal/stream_base_commons.ts": "../ext/node/polyfills/internal/stream_base_commons.ts",
"ext:deno_node/internal/streams/add-abort-signal.mjs": "../ext/node/polyfills/internal/streams/add-abort-signal.mjs",
"ext:deno_node/internal/streams/buffer_list.mjs": "../ext/node/polyfills/internal/streams/buffer_list.mjs",
"ext:deno_node/internal/streams/destroy.mjs": "../ext/node/polyfills/internal/streams/destroy.mjs",
@ -164,6 +210,7 @@
"ext:deno_node/internal/timers.mjs": "../ext/node/polyfills/internal/timers.mjs",
"ext:deno_node/internal/url.ts": "../ext/node/polyfills/internal/url.ts",
"ext:deno_node/internal/util.mjs": "../ext/node/polyfills/internal/util.mjs",
"ext:deno_node/internal/util/comparisons.ts": "../ext/node/polyfills/internal/util/comparisons.ts",
"ext:deno_node/internal/util/debuglog.ts": "../ext/node/polyfills/internal/util/debuglog.ts",
"ext:deno_node/internal/util/inspect.mjs": "../ext/node/polyfills/internal/util/inspect.mjs",
"ext:deno_node/internal/util/types.ts": "../ext/node/polyfills/internal/util/types.ts",
@ -176,6 +223,7 @@
"ext:deno_node/path/_posix.ts": "../ext/node/polyfills/path/_posix.ts",
"ext:deno_node/path/_util.ts": "../ext/node/polyfills/path/_util.ts",
"ext:deno_node/path/_win32.ts": "../ext/node/polyfills/path/_win32.ts",
"ext:deno_node/path/common.ts": "../ext/node/polyfills/path/common.ts",
"ext:deno_node/path/mod.ts": "../ext/node/polyfills/path/mod.ts",
"node:path/posix": "../ext/node/polyfills/path/posix.ts",
"ext:deno_node/path/separator.ts": "../ext/node/polyfills/path/separator.ts",
@ -243,6 +291,10 @@
"ext:runtime/41_prompt.js": "../runtime/js/41_prompt.js",
"ext:runtime/90_deno_ns.js": "../runtime/js/90_deno_ns.js",
"ext:runtime/98_global_scope.js": "../runtime/js/98_global_scope.js",
"ext:deno_node/_util/std_fmt_colors.ts": "../ext/node/polyfills/_util/std_fmt_colors.ts"
"ext:runtime/98_global_scope_shared.js": "../runtime/js/98_global_scope_shared.js",
"ext:deno_node/_events.mjs": "../ext/node/polyfills/_events.mjs",
"ext:deno_node/_util/std_fmt_colors.ts": "../ext/node/polyfills/_util/std_fmt_colors.ts",
"ext:deno_node/_util/std_testing_diff.ts": "../ext/node/polyfills/_util/std_testing_diff.ts",
"ext:deno_node/_util/std_asserts.ts": "../ext/node/polyfills/_util/std_asserts.ts"
}
}

15
tools/core_mod.d.ts vendored Normal file
View file

@ -0,0 +1,15 @@
/// <reference path="../../deno_core/core/internal.d.ts" />
// deno-lint-ignore no-explicit-any
export const core: any;
// deno-lint-ignore no-explicit-any
type UncurryThis<T extends (this: any, ...args: any[]) => any> = (
self: ThisParameterType<T>,
...args: Parameters<T>
) => ReturnType<T>;
export const primordials: typeof __bootstrap.primordials;
// deno-lint-ignore no-explicit-any
export const internals: any;

287
tools/core_ops.d.ts vendored Normal file
View file

@ -0,0 +1,287 @@
import { Buffer } from "node:buffer";
export const op_add_main_module_handler: any;
export const op_base64_atob: any;
export const op_base64_btoa: any;
export const op_base64_decode: any;
export const op_base64_encode: any;
export const op_blob_create_object_url: any;
export const op_blob_create_part: any;
export const op_blob_from_object_url: any;
export const op_blob_read_part: any;
export const op_blob_remove_part: any;
export const op_blob_revoke_object_url: any;
export const op_blob_slice_part: any;
export const op_encode_binary_string: any;
export const op_encoding_decode_single: any;
export const op_encoding_decode_utf8: any;
export const op_encoding_decode: any;
export const op_encoding_encode_into: any;
export const op_encoding_new_decoder: any;
export const op_encoding_normalize_label: any;
export const op_get_constructor_name: any;
export const op_read_all: any;
export const op_readable_stream_resource_allocate_sized: any;
export const op_readable_stream_resource_allocate: any;
export const op_readable_stream_resource_await_close: any;
export const op_readable_stream_resource_close: any;
export const op_readable_stream_resource_get_sink: any;
export const op_readable_stream_resource_write_buf: any;
export const op_readable_stream_resource_write_error: any;
export const op_readable_stream_resource_write_sync: any;
export const op_message_port_create_entangled: any;
export const op_message_port_post_message: any;
export const op_message_port_recv_message: any;
export const op_compression_finish: any;
export const op_compression_new: any;
export const op_compression_write: any;
export const op_cron_next: any;
export const op_cron_create: any;
export const op_fetch_custom_client: any;
export const op_fetch: any;
export const op_fetch_send: any;
export const op_wasm_streaming_feed: any;
export const op_wasm_streaming_set_url: any;
export const op_utf8_to_byte_string: any;
export const op_ffi_buf_copy_into: any;
export const op_ffi_call_nonblocking: any;
export const op_ffi_call_ptr: any;
export const op_ffi_call_ptr_nonblocking: any;
export const op_ffi_cstr_read: any;
export const op_ffi_get_buf: any;
export const op_ffi_get_static: any;
export const op_ffi_load: any;
export const op_ffi_ptr_create: any;
export const op_ffi_ptr_equals: any;
export const op_ffi_ptr_of: any;
export const op_ffi_ptr_of_exact: any;
export const op_ffi_ptr_offset: any;
export const op_ffi_ptr_value: any;
export const op_ffi_read_bool: any;
export const op_ffi_read_f32: any;
export const op_ffi_read_f64: any;
export const op_ffi_read_i16: any;
export const op_ffi_read_i32: any;
export const op_ffi_read_i64: any;
export const op_ffi_read_i8: any;
export const op_ffi_read_ptr: any;
export const op_ffi_read_u16: any;
export const op_ffi_read_u32: any;
export const op_ffi_read_u64: any;
export const op_ffi_read_u8: any;
export const op_ffi_unsafe_callback_close: any;
export const op_ffi_unsafe_callback_create: any;
export const op_ffi_unsafe_callback_ref: any;
export const op_fs_chdir: any;
export const op_fs_chmod_async: any;
export const op_fs_chmod_sync: any;
export const op_fs_chown_async: any;
export const op_fs_chown_sync: any;
export const op_fs_copy_file_async: any;
export const op_fs_copy_file_sync: any;
export const op_fs_cwd: any;
export const op_fs_fdatasync_async: any;
export const op_fs_fdatasync_sync: any;
export const op_fs_file_stat_async: any;
export const op_fs_file_stat_sync: any;
export const op_fs_flock_async: any;
export const op_fs_flock_async_unstable: any;
export const op_fs_flock_sync: any;
export const op_fs_flock_sync_unstable: any;
export const op_fs_fsync_async: any;
export const op_fs_fsync_sync: any;
export const op_fs_ftruncate_async: any;
export const op_fs_ftruncate_sync: any;
export const op_fs_funlock_async: any;
export const op_fs_funlock_async_unstable: any;
export const op_fs_funlock_sync: any;
export const op_fs_funlock_sync_unstable: any;
export const op_fs_futime_async: any;
export const op_fs_futime_sync: any;
export const op_fs_link_async: any;
export const op_fs_link_sync: any;
export const op_fs_lstat_async: any;
export const op_fs_lstat_sync: any;
export const op_fs_make_temp_dir_async: any;
export const op_fs_make_temp_dir_sync: any;
export const op_fs_make_temp_file_async: any;
export const op_fs_make_temp_file_sync: any;
export const op_fs_mkdir_async: any;
export const op_fs_mkdir_sync: any;
export const op_fs_open_async: any;
export const op_fs_open_sync: any;
export const op_fs_read_dir_async: any;
export const op_fs_read_dir_sync: any;
export const op_fs_read_file_async: any;
export const op_fs_read_file_sync: any;
export const op_fs_read_file_text_async: any;
export const op_fs_read_file_text_sync: any;
export const op_fs_read_link_async: any;
export const op_fs_read_link_sync: any;
export const op_fs_realpath_async: any;
export const op_fs_realpath_sync: any;
export const op_fs_remove_async: any;
export const op_fs_remove_sync: any;
export const op_fs_rename_async: any;
export const op_fs_rename_sync: any;
export const op_fs_seek_async: any;
export const op_fs_seek_sync: any;
export const op_fs_stat_async: any;
export const op_fs_stat_sync: any;
export const op_fs_symlink_async: any;
export const op_fs_symlink_sync: any;
export const op_fs_truncate_async: any;
export const op_fs_truncate_sync: any;
export const op_fs_umask: any;
export const op_fs_utime_async: any;
export const op_fs_utime_sync: any;
export const op_fs_write_file_async: any;
export const op_fs_write_file_sync: any;
export const op_set_raw: any;
export const op_http_cancel: any;
export const op_http_close: any;
export const op_http_close_after_finish: any;
export const op_http_get_request_headers: any;
export const op_http_get_request_method_and_url: any;
export const op_http_read_request_body: any;
export const op_http_serve: any;
export const op_http_serve_on: any;
export const op_http_set_promise_complete: any;
export const op_http_set_response_body_bytes: any;
export const op_http_set_response_body_resource: any;
export const op_http_set_response_body_text: any;
export const op_http_set_response_header: any;
export const op_http_set_response_headers: any;
export const op_http_set_response_trailers: any;
export const op_http_try_wait: any;
export const op_http_upgrade_raw: any;
export const op_http_upgrade_websocket_next: any;
export const op_http_wait: any;
export const op_http_accept: any;
export const op_http_headers: any;
export const op_http_shutdown: any;
export const op_http_start: any;
export const op_http_upgrade_websocket: any;
export const op_http_write: any;
export const op_http_write_headers: any;
export const op_http_write_resource: any;
export const op_http_websocket_accept_header: any;
export const op_kv_atomic_write: any;
export const op_kv_database_open: any;
export const op_kv_dequeue_next_message: any;
export const op_kv_encode_cursor: any;
export const op_kv_finish_dequeued_message: any;
export const op_kv_snapshot_read: any;
export const op_kv_watch: any;
export const op_kv_watch_next: any;
export const op_dns_resolve: any;
export const op_net_accept_tcp: any;
export const op_net_accept_unix: any;
export const op_net_connect_tcp: any;
export const op_net_connect_unix: any;
export const op_net_join_multi_v4_udp: any;
export const op_net_join_multi_v6_udp: any;
export const op_net_leave_multi_v4_udp: any;
export const op_net_leave_multi_v6_udp: any;
export const op_net_listen_tcp: any;
export const op_net_listen_unix: any;
export const op_net_recv_udp: any;
export const op_net_recv_unixpacket: any;
export const op_net_send_udp: any;
export const op_net_send_unixpacket: any;
export const op_net_set_multi_loopback_udp: any;
export const op_net_set_multi_ttl_udp: any;
export const op_set_keepalive: any;
export const op_set_nodelay: any;
export const op_net_accept_tls: any;
export const op_net_connect_tls: any;
export const op_net_listen_tls: any;
export const op_tls_cert_resolver_create: any;
export const op_tls_cert_resolver_poll: any;
export const op_tls_cert_resolver_resolve: any;
export const op_tls_cert_resolver_resolve_error: any;
export const op_tls_handshake: any;
export const op_tls_key_null: any;
export const op_tls_key_static: any;
export const op_tls_key_static_from_file: any;
export const op_tls_start: any;
export const op_node_cp: any;
export const op_node_cp_sync: any;
export const op_node_fs_exists_sync: any;
export const op_node_lchown: any;
export const op_node_lchown_sync: any;
export const op_node_statfs: any;
export const op_node_build_os: any;
export const op_preview_entries: any;
export const op_node_ipc_read: any;
export const op_node_ipc_write: any;
export const op_node_idna_domain_to_ascii: any;
export const op_node_idna_domain_to_unicode: any;
export const op_node_guess_handle_type: any;
export const op_node_unstable_net_listen_udp: any;
export const op_node_is_promise_rejected: any;
export const op_bootstrap_unstable_args: any;
export const op_node_child_ipc_pipe: any;
export const op_fetch_response_upgrade: any;
export const op_npm_process_state: any;
export const op_node_http_request: any;
export const op_http2_client_get_response: any;
export const op_http2_client_get_response_body_chunk: any;
export const op_http2_client_get_response_trailers: any;
export const op_http2_client_request: any;
export const op_http2_client_reset_stream: any;
export const op_http2_client_send_data: any;
export const op_http2_client_send_trailers: any;
export const op_http2_connect: any;
export const op_http2_poll_client_connection: any;
export const op_cpus: any;
export const op_homedir: any;
export const op_node_os_get_priority: any;
export const op_node_os_set_priority: any;
export const op_node_os_username: any;
export const op_getegid: any;
export const op_geteuid: any;
export const op_node_process_kill: any;
export const op_process_abort: any;
export const op_node_idna_punycode_decode: any;
export const op_node_idna_punycode_encode: any;
export const op_node_idna_punycode_to_ascii: any;
export const op_node_idna_punycode_to_unicode: any;
export const op_v8_get_heap_statistics: any;
export const op_v8_cached_data_version_tag: any;
export const op_vm_create_context: any;
export const op_vm_create_script: any;
export const op_vm_is_context: any;
export const op_vm_script_run_in_context: any;
export const op_vm_script_run_in_this_context: any;
export const op_create_worker: any;
export const op_host_post_message: any;
export const op_host_recv_ctrl: any;
export const op_host_recv_message: any;
export const op_host_terminate_worker: any;
export const op_message_port_recv_message_sync: any;
export const op_worker_threads_filename: any;
export const op_node_unstable_net_listen_unixpacket: any;
export function op_can_write_vectored(rid: number): boolean;
export function op_raw_write_vectored(
rid: number,
chunkA: Buffer | Array<string | Buffer>,
chunkB: Buffer | Array<string | Buffer>,
): Promise<number>;
export function op_node_sys_to_uv_error(sysErrno: number): string;