mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add types for package-info (#38235)
This commit is contained in:
parent
8ef32e4e85
commit
c8a421f842
19
types/package-info/index.d.ts
vendored
Normal file
19
types/package-info/index.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
// Type definitions for package-info 3.0
|
||||
// Project: https://github.com/AlessandroMinoccheri/package-info#readme
|
||||
// Definitions by: Florian Keller <https://github.com/ffflorian>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace info {
|
||||
interface Package {
|
||||
author: string;
|
||||
description: string;
|
||||
homepage: string;
|
||||
license: string;
|
||||
name: string;
|
||||
version: string;
|
||||
}
|
||||
}
|
||||
|
||||
declare function info(name: string): Promise<info.Package>;
|
||||
|
||||
export = info;
|
||||
10
types/package-info/package-info-tests.ts
Normal file
10
types/package-info/package-info-tests.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import info = require('package-info');
|
||||
|
||||
info('package-info').then(data => {
|
||||
data.author; // $ExpectType string
|
||||
data.description; // $ExpectType string
|
||||
data.homepage; // $ExpectType string
|
||||
data.license; // $ExpectType string
|
||||
data.name; // $ExpectType string
|
||||
data.version; // $ExpectType string
|
||||
});
|
||||
23
types/package-info/tsconfig.json
Normal file
23
types/package-info/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"package-info-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/package-info/tslint.json
Normal file
1
types/package-info/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user