add definitions for package-json

This commit is contained in:
Jinwoo Lee
2017-11-16 09:47:07 -08:00
parent 7e1da1b921
commit f016814716
4 changed files with 46 additions and 0 deletions

15
types/package-json/index.d.ts vendored Normal file
View File

@@ -0,0 +1,15 @@
// Type definitions for package-json 4.0
// Project: https://github.com/sindresorhus/package-json#readme
// Definitions by: Jinwoo Lee <https://github.com/jinwoo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface PackageJsonOptions {
version?: string;
fullMetadata?: boolean;
allVersions?: boolean;
}
type PackageJson = (name: string, options?: PackageJsonOptions) => {};
declare const packageJson: PackageJson;
export = packageJson;

View File

@@ -0,0 +1,7 @@
import * as packageJson from 'package-json';
const pkg = packageJson('package-json', {
version: '1.2.3',
fullMetadata: true,
allVersions: true,
});

View 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-json-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }