mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
[extract-stack] add typings (#18804)
This commit is contained in:
committed by
Mohamed Hegazy
parent
15196fb8bb
commit
dea21dbe47
8
types/extract-stack/extract-stack-tests.ts
Normal file
8
types/extract-stack/extract-stack-tests.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import extractStack = require('extract-stack');
|
||||
|
||||
const error = new Error('Missing unicorn');
|
||||
|
||||
extractStack(error); // $ExpectType string
|
||||
extractStack(error.stack); // $ExpectType string
|
||||
extractStack.lines(error); // $ExpectType string[]
|
||||
extractStack.lines(error.stack); // $ExpectType string[]
|
||||
12
types/extract-stack/index.d.ts
vendored
Normal file
12
types/extract-stack/index.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
// Type definitions for extract-stack 1.0
|
||||
// Project: https://github.com/sindresorhus/extract-stack#readme
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = extractStack;
|
||||
|
||||
declare function extractStack(input: Error | string | undefined): string;
|
||||
|
||||
declare namespace extractStack {
|
||||
function lines(input: Error | string | undefined): string[];
|
||||
}
|
||||
22
types/extract-stack/tsconfig.json
Normal file
22
types/extract-stack/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"extract-stack-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/extract-stack/tslint.json
Normal file
1
types/extract-stack/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user