mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-31 03:02:04 +08:00
Merge pull request #21598 from dex4er/nodejs-string
node: String object has additional ESNEXT methods
This commit is contained in:
8
types/node/index.d.ts
vendored
8
types/node/index.d.ts
vendored
@@ -68,6 +68,14 @@ interface SymbolConstructor {
|
||||
}
|
||||
declare var Symbol: SymbolConstructor;
|
||||
|
||||
// Node.js ESNEXT support
|
||||
interface String {
|
||||
/** Removes whitespace from the left end of a string. */
|
||||
trimLeft(): string;
|
||||
/** Removes whitespace from the right end of a string. */
|
||||
trimRight(): string;
|
||||
}
|
||||
|
||||
/************************************************
|
||||
* *
|
||||
* GLOBAL *
|
||||
|
||||
@@ -3751,3 +3751,13 @@ namespace module_tests {
|
||||
const m1: Module = new Module("moduleId");
|
||||
const m2: Module = new Module.Module("moduleId");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
/// Node.js ESNEXT Support
|
||||
////////////////////////////////////////////////////
|
||||
|
||||
namespace esnext_string_tests {
|
||||
const s: string = 'foo';
|
||||
const s1: string = s.trimLeft();
|
||||
const s2: string = s.trimRight();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user