@types/node 9.6.35 → 9.6.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- node v9/README.md +1 -1
- node v9/index.d.ts +368 -39
- node v9/package.json +3 -2
node v9/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (http://nodejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v9
|
|
9
9
|
|
|
10
10
|
Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Thu, 15 Nov 2018 20:14:07 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: Buffer, NodeJS, SlowBuffer, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, require, setImmediate, setInterval, setTimeout
|
|
14
14
|
|
node v9/index.d.ts
CHANGED
|
@@ -1881,66 +1881,372 @@ declare module "punycode" {
|
|
|
1881
1881
|
}
|
|
1882
1882
|
|
|
1883
1883
|
declare module "repl" {
|
|
1884
|
-
import
|
|
1885
|
-
import
|
|
1884
|
+
import { Interface, Completer, AsyncCompleter } from "readline";
|
|
1885
|
+
import { Context } from "vm";
|
|
1886
|
+
import { InspectOptions } from "util";
|
|
1886
1887
|
|
|
1887
|
-
|
|
1888
|
+
interface ReplOptions {
|
|
1889
|
+
/**
|
|
1890
|
+
* The input prompt to display.
|
|
1891
|
+
* Default: `"> "`
|
|
1892
|
+
*/
|
|
1888
1893
|
prompt?: string;
|
|
1894
|
+
/**
|
|
1895
|
+
* The `Readable` stream from which REPL input will be read.
|
|
1896
|
+
* Default: `process.stdin`
|
|
1897
|
+
*/
|
|
1889
1898
|
input?: NodeJS.ReadableStream;
|
|
1899
|
+
/**
|
|
1900
|
+
* The `Writable` stream to which REPL output will be written.
|
|
1901
|
+
* Default: `process.stdout`
|
|
1902
|
+
*/
|
|
1890
1903
|
output?: NodeJS.WritableStream;
|
|
1904
|
+
/**
|
|
1905
|
+
* If `true`, specifies that the output should be treated as a TTY terminal, and have
|
|
1906
|
+
* ANSI/VT100 escape codes written to it.
|
|
1907
|
+
* Default: checking the value of the `isTTY` property on the output stream upon
|
|
1908
|
+
* instantiation.
|
|
1909
|
+
*/
|
|
1891
1910
|
terminal?: boolean;
|
|
1892
|
-
|
|
1911
|
+
/**
|
|
1912
|
+
* The function to be used when evaluating each given line of input.
|
|
1913
|
+
* Default: an async wrapper for the JavaScript `eval()` function. An `eval` function can
|
|
1914
|
+
* error with `repl.Recoverable` to indicate the input was incomplete and prompt for
|
|
1915
|
+
* additional lines.
|
|
1916
|
+
*
|
|
1917
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_default_evaluation
|
|
1918
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_custom_evaluation_functions
|
|
1919
|
+
*/
|
|
1920
|
+
eval?: REPLEval;
|
|
1921
|
+
/**
|
|
1922
|
+
* If `true`, specifies that the default `writer` function should include ANSI color
|
|
1923
|
+
* styling to REPL output. If a custom `writer` function is provided then this has no
|
|
1924
|
+
* effect.
|
|
1925
|
+
* Default: the REPL instance's `terminal` value.
|
|
1926
|
+
*/
|
|
1893
1927
|
useColors?: boolean;
|
|
1928
|
+
/**
|
|
1929
|
+
* If `true`, specifies that the default evaluation function will use the JavaScript
|
|
1930
|
+
* `global` as the context as opposed to creating a new separate context for the REPL
|
|
1931
|
+
* instance. The node CLI REPL sets this value to `true`.
|
|
1932
|
+
* Default: `false`.
|
|
1933
|
+
*/
|
|
1894
1934
|
useGlobal?: boolean;
|
|
1935
|
+
/**
|
|
1936
|
+
* If `true`, specifies that the default writer will not output the return value of a
|
|
1937
|
+
* command if it evaluates to `undefined`.
|
|
1938
|
+
* Default: `false`.
|
|
1939
|
+
*/
|
|
1895
1940
|
ignoreUndefined?: boolean;
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1941
|
+
/**
|
|
1942
|
+
* The function to invoke to format the output of each command before writing to `output`.
|
|
1943
|
+
* Default: a wrapper for `util.inspect`.
|
|
1944
|
+
*
|
|
1945
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_customizing_repl_output
|
|
1946
|
+
*/
|
|
1947
|
+
writer?: REPLWriter;
|
|
1948
|
+
/**
|
|
1949
|
+
* An optional function used for custom Tab auto completion.
|
|
1950
|
+
*
|
|
1951
|
+
* @see https://nodejs.org/dist/latest-v11.x/docs/api/readline.html#readline_use_of_the_completer_function
|
|
1952
|
+
*/
|
|
1953
|
+
completer?: Completer | AsyncCompleter;
|
|
1954
|
+
/**
|
|
1955
|
+
* A flag that specifies whether the default evaluator executes all JavaScript commands in
|
|
1956
|
+
* strict mode or default (sloppy) mode.
|
|
1957
|
+
* Accepted values are:
|
|
1958
|
+
* - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode.
|
|
1959
|
+
* - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
|
|
1960
|
+
* prefacing every repl statement with `'use strict'`.
|
|
1961
|
+
*/
|
|
1962
|
+
replMode?: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
|
|
1963
|
+
/**
|
|
1964
|
+
* Stop evaluating the current piece of code when `SIGINT` is received, i.e. `Ctrl+C` is
|
|
1965
|
+
* pressed. This cannot be used together with a custom `eval` function.
|
|
1966
|
+
* Default: `false`.
|
|
1967
|
+
*/
|
|
1968
|
+
breakEvalOnSigint?: boolean;
|
|
1900
1969
|
}
|
|
1901
1970
|
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
inputStream: NodeJS.ReadableStream;
|
|
1905
|
-
outputStream: NodeJS.WritableStream;
|
|
1971
|
+
type REPLEval = (this: REPLServer, evalCmd: string, context: Context, file: string, cb: (err: Error | null, result: any) => void) => void;
|
|
1972
|
+
type REPLWriter = (this: REPLServer, obj: any) => string;
|
|
1906
1973
|
|
|
1907
|
-
|
|
1974
|
+
/**
|
|
1975
|
+
* This is the default "writer" value, if none is passed in the REPL options,
|
|
1976
|
+
* and it can be overridden by custom print functions.
|
|
1977
|
+
*/
|
|
1978
|
+
const writer: REPLWriter & { options: InspectOptions };
|
|
1979
|
+
|
|
1980
|
+
type REPLCommandAction = (this: REPLServer, text: string) => void;
|
|
1981
|
+
|
|
1982
|
+
interface REPLCommand {
|
|
1983
|
+
/**
|
|
1984
|
+
* Help text to be displayed when `.help` is entered.
|
|
1985
|
+
*/
|
|
1986
|
+
help?: string;
|
|
1987
|
+
/**
|
|
1988
|
+
* The function to execute, optionally accepting a single string argument.
|
|
1989
|
+
*/
|
|
1990
|
+
action: REPLCommandAction;
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
/**
|
|
1994
|
+
* Provides a customizable Read-Eval-Print-Loop (REPL).
|
|
1995
|
+
*
|
|
1996
|
+
* Instances of `repl.REPLServer` will accept individual lines of user input, evaluate those
|
|
1997
|
+
* according to a user-defined evaluation function, then output the result. Input and output
|
|
1998
|
+
* may be from `stdin` and `stdout`, respectively, or may be connected to any Node.js `stream`.
|
|
1999
|
+
*
|
|
2000
|
+
* Instances of `repl.REPLServer` support automatic completion of inputs, simplistic Emacs-style
|
|
2001
|
+
* line editing, multi-line inputs, ANSI-styled output, saving and restoring current REPL session
|
|
2002
|
+
* state, error recovery, and customizable evaluation functions.
|
|
2003
|
+
*
|
|
2004
|
+
* Instances of `repl.REPLServer` are created using the `repl.start()` method and _should not_
|
|
2005
|
+
* be created directly using the JavaScript `new` keyword.
|
|
2006
|
+
*
|
|
2007
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_repl
|
|
2008
|
+
*/
|
|
2009
|
+
class REPLServer extends Interface {
|
|
2010
|
+
/**
|
|
2011
|
+
* The `vm.Context` provided to the `eval` function to be used for JavaScript
|
|
2012
|
+
* evaluation.
|
|
2013
|
+
*/
|
|
2014
|
+
readonly context: Context;
|
|
2015
|
+
/**
|
|
2016
|
+
* The `Readable` stream from which REPL input will be read.
|
|
2017
|
+
*/
|
|
2018
|
+
readonly inputStream: NodeJS.ReadableStream;
|
|
2019
|
+
/**
|
|
2020
|
+
* The `Writable` stream to which REPL output will be written.
|
|
2021
|
+
*/
|
|
2022
|
+
readonly outputStream: NodeJS.WritableStream;
|
|
2023
|
+
/**
|
|
2024
|
+
* The commands registered via `replServer.defineCommand()`.
|
|
2025
|
+
*/
|
|
2026
|
+
readonly commands: { readonly [name: string]: REPLCommand | undefined };
|
|
2027
|
+
/**
|
|
2028
|
+
* A value indicating whether the REPL is currently in "editor mode".
|
|
2029
|
+
*
|
|
2030
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_commands_and_special_keys
|
|
2031
|
+
*/
|
|
2032
|
+
readonly editorMode: boolean;
|
|
2033
|
+
/**
|
|
2034
|
+
* A value indicating whether the `_` variable has been assigned.
|
|
2035
|
+
*
|
|
2036
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
2037
|
+
*/
|
|
2038
|
+
readonly underscoreAssigned: boolean;
|
|
2039
|
+
/**
|
|
2040
|
+
* The last evaluation result from the REPL (assigned to the `_` variable inside of the REPL).
|
|
2041
|
+
*
|
|
2042
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
2043
|
+
*/
|
|
2044
|
+
readonly last: any;
|
|
2045
|
+
/**
|
|
2046
|
+
* A value indicating whether the `_error` variable has been assigned.
|
|
2047
|
+
*
|
|
2048
|
+
* @since v9.8.0
|
|
2049
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
2050
|
+
*/
|
|
2051
|
+
readonly underscoreErrAssigned: boolean;
|
|
2052
|
+
/**
|
|
2053
|
+
* The last error raised inside the REPL (assigned to the `_error` variable inside of the REPL).
|
|
2054
|
+
*
|
|
2055
|
+
* @since v9.8.0
|
|
2056
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_assignment_of_the_underscore_variable
|
|
2057
|
+
*/
|
|
2058
|
+
readonly lastError: any;
|
|
2059
|
+
/**
|
|
2060
|
+
* Specified in the REPL options, this is the function to be used when evaluating each
|
|
2061
|
+
* given line of input. If not specified in the REPL options, this is an async wrapper
|
|
2062
|
+
* for the JavaScript `eval()` function.
|
|
2063
|
+
*/
|
|
2064
|
+
readonly eval: REPLEval;
|
|
2065
|
+
/**
|
|
2066
|
+
* Specified in the REPL options, this is a value indicating whether the default
|
|
2067
|
+
* `writer` function should include ANSI color styling to REPL output.
|
|
2068
|
+
*/
|
|
2069
|
+
readonly useColors: boolean;
|
|
2070
|
+
/**
|
|
2071
|
+
* Specified in the REPL options, this is a value indicating whether the default `eval`
|
|
2072
|
+
* function will use the JavaScript `global` as the context as opposed to creating a new
|
|
2073
|
+
* separate context for the REPL instance.
|
|
2074
|
+
*/
|
|
2075
|
+
readonly useGlobal: boolean;
|
|
2076
|
+
/**
|
|
2077
|
+
* Specified in the REPL options, this is a value indicating whether the default `writer`
|
|
2078
|
+
* function should output the result of a command if it evaluates to `undefined`.
|
|
2079
|
+
*/
|
|
2080
|
+
readonly ignoreUndefined: boolean;
|
|
2081
|
+
/**
|
|
2082
|
+
* Specified in the REPL options, this is the function to invoke to format the output of
|
|
2083
|
+
* each command before writing to `outputStream`. If not specified in the REPL options,
|
|
2084
|
+
* this will be a wrapper for `util.inspect`.
|
|
2085
|
+
*/
|
|
2086
|
+
readonly writer: REPLWriter;
|
|
2087
|
+
/**
|
|
2088
|
+
* Specified in the REPL options, this is the function to use for custom Tab auto-completion.
|
|
2089
|
+
*/
|
|
2090
|
+
readonly completer: Completer | AsyncCompleter;
|
|
2091
|
+
/**
|
|
2092
|
+
* Specified in the REPL options, this is a flag that specifies whether the default `eval`
|
|
2093
|
+
* function should execute all JavaScript commands in strict mode or default (sloppy) mode.
|
|
2094
|
+
* Possible values are:
|
|
2095
|
+
* - `repl.REPL_MODE_SLOPPY` - evaluates expressions in sloppy mode.
|
|
2096
|
+
* - `repl.REPL_MODE_STRICT` - evaluates expressions in strict mode. This is equivalent to
|
|
2097
|
+
* prefacing every repl statement with `'use strict'`.
|
|
2098
|
+
*/
|
|
2099
|
+
readonly replMode: typeof REPL_MODE_SLOPPY | typeof REPL_MODE_STRICT;
|
|
2100
|
+
|
|
2101
|
+
/**
|
|
2102
|
+
* NOTE: According to the documentation:
|
|
2103
|
+
*
|
|
2104
|
+
* > Instances of `repl.REPLServer` are created using the `repl.start()` method and
|
|
2105
|
+
* > _should not_ be created directly using the JavaScript `new` keyword.
|
|
2106
|
+
*
|
|
2107
|
+
* `REPLServer` cannot be subclassed due to implementation specifics in NodeJS.
|
|
2108
|
+
*
|
|
2109
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_class_replserver
|
|
2110
|
+
*/
|
|
2111
|
+
private constructor();
|
|
2112
|
+
|
|
2113
|
+
/**
|
|
2114
|
+
* Used to add new `.`-prefixed commands to the REPL instance. Such commands are invoked
|
|
2115
|
+
* by typing a `.` followed by the `keyword`.
|
|
2116
|
+
*
|
|
2117
|
+
* @param keyword The command keyword (_without_ a leading `.` character).
|
|
2118
|
+
* @param cmd The function to invoke when the command is processed.
|
|
2119
|
+
*
|
|
2120
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_replserver_definecommand_keyword_cmd
|
|
2121
|
+
*/
|
|
2122
|
+
defineCommand(keyword: string, cmd: REPLCommandAction | REPLCommand): void;
|
|
2123
|
+
/**
|
|
2124
|
+
* Readies the REPL instance for input from the user, printing the configured `prompt` to a
|
|
2125
|
+
* new line in the `output` and resuming the `input` to accept new input.
|
|
2126
|
+
*
|
|
2127
|
+
* When multi-line input is being entered, an ellipsis is printed rather than the 'prompt'.
|
|
2128
|
+
*
|
|
2129
|
+
* This method is primarily intended to be called from within the action function for
|
|
2130
|
+
* commands registered using the `replServer.defineCommand()` method.
|
|
2131
|
+
*
|
|
2132
|
+
* @param preserveCursor When `true`, the cursor placement will not be reset to `0`.
|
|
2133
|
+
*/
|
|
1908
2134
|
displayPrompt(preserveCursor?: boolean): void;
|
|
2135
|
+
/**
|
|
2136
|
+
* Clears any command that has been buffered but not yet executed.
|
|
2137
|
+
*
|
|
2138
|
+
* This method is primarily intended to be called from within the action function for
|
|
2139
|
+
* commands registered using the `replServer.defineCommand()` method.
|
|
2140
|
+
*
|
|
2141
|
+
* @since v9.0.0
|
|
2142
|
+
*/
|
|
2143
|
+
clearBufferedCommand(): void;
|
|
1909
2144
|
|
|
1910
2145
|
/**
|
|
1911
2146
|
* events.EventEmitter
|
|
1912
|
-
* 1.
|
|
1913
|
-
* 2.
|
|
2147
|
+
* 1. close - inherited from `readline.Interface`
|
|
2148
|
+
* 2. line - inherited from `readline.Interface`
|
|
2149
|
+
* 3. pause - inherited from `readline.Interface`
|
|
2150
|
+
* 4. resume - inherited from `readline.Interface`
|
|
2151
|
+
* 5. SIGCONT - inherited from `readline.Interface`
|
|
2152
|
+
* 6. SIGINT - inherited from `readline.Interface`
|
|
2153
|
+
* 7. SIGTSTP - inherited from `readline.Interface`
|
|
2154
|
+
* 8. exit
|
|
2155
|
+
* 9. reset
|
|
1914
2156
|
*/
|
|
1915
2157
|
|
|
1916
2158
|
addListener(event: string, listener: (...args: any[]) => void): this;
|
|
2159
|
+
addListener(event: "close", listener: () => void): this;
|
|
2160
|
+
addListener(event: "line", listener: (input: string) => void): this;
|
|
2161
|
+
addListener(event: "pause", listener: () => void): this;
|
|
2162
|
+
addListener(event: "resume", listener: () => void): this;
|
|
2163
|
+
addListener(event: "SIGCONT", listener: () => void): this;
|
|
2164
|
+
addListener(event: "SIGINT", listener: () => void): this;
|
|
2165
|
+
addListener(event: "SIGTSTP", listener: () => void): this;
|
|
1917
2166
|
addListener(event: "exit", listener: () => void): this;
|
|
1918
|
-
addListener(event: "reset", listener: (
|
|
2167
|
+
addListener(event: "reset", listener: (context: Context) => void): this;
|
|
1919
2168
|
|
|
1920
2169
|
emit(event: string | symbol, ...args: any[]): boolean;
|
|
2170
|
+
emit(event: "close"): boolean;
|
|
2171
|
+
emit(event: "line", input: string): boolean;
|
|
2172
|
+
emit(event: "pause"): boolean;
|
|
2173
|
+
emit(event: "resume"): boolean;
|
|
2174
|
+
emit(event: "SIGCONT"): boolean;
|
|
2175
|
+
emit(event: "SIGINT"): boolean;
|
|
2176
|
+
emit(event: "SIGTSTP"): boolean;
|
|
1921
2177
|
emit(event: "exit"): boolean;
|
|
1922
|
-
emit(event: "reset", context:
|
|
2178
|
+
emit(event: "reset", context: Context): boolean;
|
|
1923
2179
|
|
|
1924
2180
|
on(event: string, listener: (...args: any[]) => void): this;
|
|
2181
|
+
on(event: "close", listener: () => void): this;
|
|
2182
|
+
on(event: "line", listener: (input: string) => void): this;
|
|
2183
|
+
on(event: "pause", listener: () => void): this;
|
|
2184
|
+
on(event: "resume", listener: () => void): this;
|
|
2185
|
+
on(event: "SIGCONT", listener: () => void): this;
|
|
2186
|
+
on(event: "SIGINT", listener: () => void): this;
|
|
2187
|
+
on(event: "SIGTSTP", listener: () => void): this;
|
|
1925
2188
|
on(event: "exit", listener: () => void): this;
|
|
1926
|
-
on(event: "reset", listener: (
|
|
2189
|
+
on(event: "reset", listener: (context: Context) => void): this;
|
|
1927
2190
|
|
|
1928
2191
|
once(event: string, listener: (...args: any[]) => void): this;
|
|
2192
|
+
once(event: "close", listener: () => void): this;
|
|
2193
|
+
once(event: "line", listener: (input: string) => void): this;
|
|
2194
|
+
once(event: "pause", listener: () => void): this;
|
|
2195
|
+
once(event: "resume", listener: () => void): this;
|
|
2196
|
+
once(event: "SIGCONT", listener: () => void): this;
|
|
2197
|
+
once(event: "SIGINT", listener: () => void): this;
|
|
2198
|
+
once(event: "SIGTSTP", listener: () => void): this;
|
|
1929
2199
|
once(event: "exit", listener: () => void): this;
|
|
1930
|
-
once(event: "reset", listener: (
|
|
2200
|
+
once(event: "reset", listener: (context: Context) => void): this;
|
|
1931
2201
|
|
|
1932
2202
|
prependListener(event: string, listener: (...args: any[]) => void): this;
|
|
2203
|
+
prependListener(event: "close", listener: () => void): this;
|
|
2204
|
+
prependListener(event: "line", listener: (input: string) => void): this;
|
|
2205
|
+
prependListener(event: "pause", listener: () => void): this;
|
|
2206
|
+
prependListener(event: "resume", listener: () => void): this;
|
|
2207
|
+
prependListener(event: "SIGCONT", listener: () => void): this;
|
|
2208
|
+
prependListener(event: "SIGINT", listener: () => void): this;
|
|
2209
|
+
prependListener(event: "SIGTSTP", listener: () => void): this;
|
|
1933
2210
|
prependListener(event: "exit", listener: () => void): this;
|
|
1934
|
-
prependListener(event: "reset", listener: (
|
|
2211
|
+
prependListener(event: "reset", listener: (context: Context) => void): this;
|
|
1935
2212
|
|
|
1936
2213
|
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
|
2214
|
+
prependOnceListener(event: "close", listener: () => void): this;
|
|
2215
|
+
prependOnceListener(event: "line", listener: (input: string) => void): this;
|
|
2216
|
+
prependOnceListener(event: "pause", listener: () => void): this;
|
|
2217
|
+
prependOnceListener(event: "resume", listener: () => void): this;
|
|
2218
|
+
prependOnceListener(event: "SIGCONT", listener: () => void): this;
|
|
2219
|
+
prependOnceListener(event: "SIGINT", listener: () => void): this;
|
|
2220
|
+
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
|
|
1937
2221
|
prependOnceListener(event: "exit", listener: () => void): this;
|
|
1938
|
-
prependOnceListener(event: "reset", listener: (
|
|
2222
|
+
prependOnceListener(event: "reset", listener: (context: Context) => void): this;
|
|
1939
2223
|
}
|
|
1940
2224
|
|
|
1941
|
-
|
|
2225
|
+
/**
|
|
2226
|
+
* A flag passed in the REPL options. Evaluates expressions in sloppy mode.
|
|
2227
|
+
*/
|
|
2228
|
+
export const REPL_MODE_SLOPPY: symbol; // TODO: unique symbol
|
|
2229
|
+
|
|
2230
|
+
/**
|
|
2231
|
+
* A flag passed in the REPL options. Evaluates expressions in strict mode.
|
|
2232
|
+
* This is equivalent to prefacing every repl statement with `'use strict'`.
|
|
2233
|
+
*/
|
|
2234
|
+
export const REPL_MODE_STRICT: symbol; // TODO: unique symbol
|
|
1942
2235
|
|
|
1943
|
-
|
|
2236
|
+
/**
|
|
2237
|
+
* Creates and starts a `repl.REPLServer` instance.
|
|
2238
|
+
*
|
|
2239
|
+
* @param options The options for the `REPLServer`. If `options` is a string, then it specifies
|
|
2240
|
+
* the input prompt.
|
|
2241
|
+
*/
|
|
2242
|
+
function start(options?: string | ReplOptions): REPLServer;
|
|
2243
|
+
|
|
2244
|
+
/**
|
|
2245
|
+
* Indicates a recoverable error that a `REPLServer` can use to support multi-line input.
|
|
2246
|
+
*
|
|
2247
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/repl.html#repl_recoverable_errors
|
|
2248
|
+
*/
|
|
2249
|
+
class Recoverable extends SyntaxError {
|
|
1944
2250
|
err: Error;
|
|
1945
2251
|
|
|
1946
2252
|
constructor(err: Error);
|
|
@@ -1951,7 +2257,7 @@ declare module "readline" {
|
|
|
1951
2257
|
import * as events from "events";
|
|
1952
2258
|
import * as stream from "stream";
|
|
1953
2259
|
|
|
1954
|
-
|
|
2260
|
+
interface Key {
|
|
1955
2261
|
sequence?: string;
|
|
1956
2262
|
name?: string;
|
|
1957
2263
|
ctrl?: boolean;
|
|
@@ -1959,12 +2265,33 @@ declare module "readline" {
|
|
|
1959
2265
|
shift?: boolean;
|
|
1960
2266
|
}
|
|
1961
2267
|
|
|
1962
|
-
|
|
2268
|
+
class Interface extends events.EventEmitter {
|
|
2269
|
+
readonly terminal: boolean;
|
|
2270
|
+
|
|
2271
|
+
/**
|
|
2272
|
+
* NOTE: According to the documentation:
|
|
2273
|
+
*
|
|
2274
|
+
* > Instances of the `readline.Interface` class are constructed using the
|
|
2275
|
+
* > `readline.createInterface()` method.
|
|
2276
|
+
*
|
|
2277
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
|
|
2278
|
+
*/
|
|
2279
|
+
protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean);
|
|
2280
|
+
/**
|
|
2281
|
+
* NOTE: According to the documentation:
|
|
2282
|
+
*
|
|
2283
|
+
* > Instances of the `readline.Interface` class are constructed using the
|
|
2284
|
+
* > `readline.createInterface()` method.
|
|
2285
|
+
*
|
|
2286
|
+
* @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
|
|
2287
|
+
*/
|
|
2288
|
+
protected constructor(options: ReadLineOptions);
|
|
2289
|
+
|
|
1963
2290
|
setPrompt(prompt: string): void;
|
|
1964
2291
|
prompt(preserveCursor?: boolean): void;
|
|
1965
2292
|
question(query: string, callback: (answer: string) => void): void;
|
|
1966
|
-
pause():
|
|
1967
|
-
resume():
|
|
2293
|
+
pause(): this;
|
|
2294
|
+
resume(): this;
|
|
1968
2295
|
close(): void;
|
|
1969
2296
|
write(data: string | Buffer, key?: Key): void;
|
|
1970
2297
|
|
|
@@ -2034,12 +2361,14 @@ declare module "readline" {
|
|
|
2034
2361
|
prependOnceListener(event: "SIGTSTP", listener: () => void): this;
|
|
2035
2362
|
}
|
|
2036
2363
|
|
|
2364
|
+
type ReadLine = Interface; // type forwarded for backwards compatiblity
|
|
2365
|
+
|
|
2037
2366
|
type Completer = (line: string) => CompleterResult;
|
|
2038
2367
|
type AsyncCompleter = (line: string, callback: (err: any, result: CompleterResult) => void) => any;
|
|
2039
2368
|
|
|
2040
|
-
|
|
2369
|
+
type CompleterResult = [string[], string];
|
|
2041
2370
|
|
|
2042
|
-
|
|
2371
|
+
interface ReadLineOptions {
|
|
2043
2372
|
input: NodeJS.ReadableStream;
|
|
2044
2373
|
output?: NodeJS.WritableStream;
|
|
2045
2374
|
completer?: Completer | AsyncCompleter;
|
|
@@ -2050,14 +2379,14 @@ declare module "readline" {
|
|
|
2050
2379
|
removeHistoryDuplicates?: boolean;
|
|
2051
2380
|
}
|
|
2052
2381
|
|
|
2053
|
-
|
|
2054
|
-
|
|
2382
|
+
function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
|
|
2383
|
+
function createInterface(options: ReadLineOptions): Interface;
|
|
2055
2384
|
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2385
|
+
function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number): void;
|
|
2386
|
+
function emitKeypressEvents(stream: NodeJS.ReadableStream, interface?: Interface): void;
|
|
2387
|
+
function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void;
|
|
2388
|
+
function clearLine(stream: NodeJS.WritableStream, dir: number): void;
|
|
2389
|
+
function clearScreenDown(stream: NodeJS.WritableStream): void;
|
|
2061
2390
|
}
|
|
2062
2391
|
|
|
2063
2392
|
declare module "vm" {
|
|
@@ -4856,7 +5185,7 @@ declare module "path" {
|
|
|
4856
5185
|
/**
|
|
4857
5186
|
* The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
|
|
4858
5187
|
*
|
|
4859
|
-
* Starting from leftmost {from}
|
|
5188
|
+
* Starting from leftmost {from} parameter, resolves {to} to an absolute path.
|
|
4860
5189
|
*
|
|
4861
5190
|
* If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.
|
|
4862
5191
|
*
|
|
@@ -5397,8 +5726,8 @@ declare module "crypto" {
|
|
|
5397
5726
|
export interface Signer extends NodeJS.WritableStream {
|
|
5398
5727
|
update(data: string | Buffer | DataView): Signer;
|
|
5399
5728
|
update(data: string | Buffer | DataView, input_encoding: Utf8AsciiLatin1Encoding): Signer;
|
|
5400
|
-
sign(private_key: string | { key: string; passphrase
|
|
5401
|
-
sign(private_key: string | { key: string; passphrase
|
|
5729
|
+
sign(private_key: string | { key: string; passphrase?: string }): Buffer;
|
|
5730
|
+
sign(private_key: string | { key: string; passphrase?: string }, output_format: HexBase64Latin1Encoding): string;
|
|
5402
5731
|
}
|
|
5403
5732
|
export function createVerify(algorith: string): Verify;
|
|
5404
5733
|
export interface Verify extends NodeJS.WritableStream {
|
node v9/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "9.6.
|
|
3
|
+
"version": "9.6.39",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"contributors": [
|
|
@@ -136,12 +136,13 @@
|
|
|
136
136
|
}
|
|
137
137
|
],
|
|
138
138
|
"main": "",
|
|
139
|
+
"types": "index",
|
|
139
140
|
"repository": {
|
|
140
141
|
"type": "git",
|
|
141
142
|
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
|
142
143
|
},
|
|
143
144
|
"scripts": {},
|
|
144
145
|
"dependencies": {},
|
|
145
|
-
"typesPublisherContentHash": "
|
|
146
|
+
"typesPublisherContentHash": "3d6a8b5453c5338c08459a64cf383c317e45f7a5c6a63c872a2d4c53c7aae73d",
|
|
146
147
|
"typeScriptVersion": "2.0"
|
|
147
148
|
}
|