2021-01-28 15:37:21 -05:00
|
|
|
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
|
|
|
|
|
|
|
// deno-lint-ignore-file no-explicit-any
|
|
|
|
|
|
|
|
/// <reference no-default-lib="true" />
|
|
|
|
/// <reference lib="esnext" />
|
|
|
|
|
|
|
|
declare namespace Deno {
|
|
|
|
declare namespace core {
|
2021-04-12 15:55:05 -04:00
|
|
|
/** Call an op in Rust, and synchronously receive the result. */
|
|
|
|
function opSync(
|
2021-01-28 15:37:21 -05:00
|
|
|
opName: string,
|
2021-06-05 17:10:07 -04:00
|
|
|
a?: any,
|
|
|
|
b?: any,
|
2021-01-28 15:37:21 -05:00
|
|
|
): any;
|
|
|
|
|
2021-04-12 15:55:05 -04:00
|
|
|
/** Call an op in Rust, and asynchronously receive the result. */
|
|
|
|
function opAsync(
|
2021-01-28 15:37:21 -05:00
|
|
|
opName: string,
|
2021-06-05 17:10:07 -04:00
|
|
|
a?: any,
|
|
|
|
b?: any,
|
2021-01-28 15:37:21 -05:00
|
|
|
): Promise<any>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve a list of all registered ops, in the form of a map that maps op
|
|
|
|
* name to internal numerical op id.
|
|
|
|
*/
|
|
|
|
function ops(): Record<string, number>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve a list of all open resources, in the form of a map that maps
|
|
|
|
* resource id to the resource name.
|
|
|
|
*/
|
|
|
|
function resources(): Record<string, string>;
|
|
|
|
|
|
|
|
/** Close the resource with the specified op id. */
|
|
|
|
function close(rid: number): void;
|
2021-03-23 10:33:06 -04:00
|
|
|
|
|
|
|
/** Get heap stats for current isolate/worker */
|
|
|
|
function heapStats(): Record<string, number>;
|
2021-06-05 17:10:07 -04:00
|
|
|
|
|
|
|
/** Encode a string to its Uint8Array representation. */
|
|
|
|
function encode(input: string): Uint8Array;
|
2021-01-28 15:37:21 -05:00
|
|
|
}
|
|
|
|
}
|