mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
feat(node): v13.7 (#41859)
This commit is contained in:
parent
27b7a0a4fd
commit
88dcea1ac6
2
types/node/index.d.ts
vendored
2
types/node/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for non-npm package Node.js 13.5
|
||||
// Type definitions for non-npm package Node.js 13.7
|
||||
// Project: http://nodejs.org/
|
||||
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
|
||||
// DefinitelyTyped <https://github.com/DefinitelyTyped>
|
||||
|
||||
39
types/node/module.d.ts
vendored
39
types/node/module.d.ts
vendored
@ -1,6 +1,43 @@
|
||||
declare module "module" {
|
||||
import { URL } from "url";
|
||||
namespace Module {}
|
||||
namespace Module {
|
||||
/**
|
||||
* Updates all the live bindings for builtin ES Modules to match the properties of the CommonJS exports.
|
||||
* It does not add or remove exported names from the ES Modules.
|
||||
*/
|
||||
function syncBuiltinESMExports(): void;
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
function findSourceMap(path: string, error?: Error): SourceMap;
|
||||
interface SourceMapPayload {
|
||||
file: string;
|
||||
version: number;
|
||||
sources: string[];
|
||||
sourcesContent: string[];
|
||||
names: string[];
|
||||
mappings: string;
|
||||
sourceRoot: string;
|
||||
}
|
||||
|
||||
interface SourceMapping {
|
||||
generatedLine: number;
|
||||
generatedColumn: number;
|
||||
originalSource: string;
|
||||
originalLine: number;
|
||||
originalColumn: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
class SourceMap {
|
||||
readonly payload: SourceMapPayload;
|
||||
constructor(payload: SourceMapPayload);
|
||||
findEntry(line: number, column: number): SourceMapping;
|
||||
}
|
||||
}
|
||||
interface Module extends NodeModule {}
|
||||
class Module {
|
||||
static runMain(): void;
|
||||
|
||||
@ -447,25 +447,6 @@ import * as trace_events from "trace_events";
|
||||
tracing.disable();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
/// stream tests : https://nodejs.org/api/stream.html ///
|
||||
/////////////////////////////////////////////////////////
|
||||
import stream = require('stream');
|
||||
import tty = require('tty');
|
||||
|
||||
{
|
||||
const writeStream = fs.createWriteStream('./index.d.ts');
|
||||
const _wom = writeStream.writableObjectMode; // $ExpectType boolean
|
||||
|
||||
const readStream = fs.createReadStream('./index.d.ts');
|
||||
const _rom = readStream.readableObjectMode; // $ExpectType boolean
|
||||
|
||||
const x: stream.Readable = process.stdin;
|
||||
const stdin: tty.ReadStream = process.stdin;
|
||||
const stdout: tty.WriteStream = process.stdout;
|
||||
const stderr: tty.WriteStream = process.stderr;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
/// Node.js ESNEXT Support
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
@ -329,3 +329,11 @@ async function testPromisify() {
|
||||
bufferSize: 42,
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
const writeStream = fs.createWriteStream('./index.d.ts');
|
||||
const _wom = writeStream.writableObjectMode; // $ExpectType boolean
|
||||
|
||||
const readStream = fs.createReadStream('./index.d.ts');
|
||||
const _rom = readStream.readableObjectMode; // $ExpectType boolean
|
||||
}
|
||||
|
||||
@ -42,3 +42,17 @@ const cachedModule2: Module = customRequire2.cache['/path/to/module.js'];
|
||||
|
||||
const main1: Module | undefined = customRequire1.main;
|
||||
const main2: Module | undefined = customRequire2.main;
|
||||
|
||||
Module.syncBuiltinESMExports();
|
||||
|
||||
const smap = new Module.SourceMap({
|
||||
file: 'test.js',
|
||||
mappings: 'ASDASd',
|
||||
names: [],
|
||||
sourceRoot: '/',
|
||||
sources: [],
|
||||
version: 3,
|
||||
sourcesContent: [],
|
||||
});
|
||||
const pl: Module.SourceMapPayload = smap.payload;
|
||||
const entry: Module.SourceMapping = smap.findEntry(1, 1);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import * as tty from 'tty';
|
||||
import { Readable } from 'stream';
|
||||
|
||||
const rs: tty.ReadStream = new tty.ReadStream(0);
|
||||
const ws: tty.WriteStream = new tty.WriteStream(1);
|
||||
@ -26,3 +27,8 @@ ws.getWindowSize();
|
||||
const hasCOlors: boolean = ws.hasColors();
|
||||
|
||||
const isTTY: boolean = tty.isatty(1);
|
||||
|
||||
const x: Readable = process.stdin;
|
||||
const stdin: tty.ReadStream = process.stdin;
|
||||
const stdout: tty.WriteStream = process.stdout;
|
||||
const stderr: tty.WriteStream = process.stderr;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user