Merge pull request #32096 from BendingBender/first-run

[first-run] Add types
This commit is contained in:
Daniel Rosenwasser
2019-01-14 14:24:59 -08:00
committed by GitHub
4 changed files with 56 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
import firstRun = require('first-run');
firstRun(); // $ExpectType boolean
firstRun({ name: 'foo' }); // $ExpectType boolean
firstRun.clear();
+26
View File
@@ -0,0 +1,26 @@
// Type definitions for first-run 1.2
// Project: https://github.com/sindresorhus/first-run
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = firstRun;
/**
* Check if it's the first time the process is run.
*/
declare function firstRun(options?: firstRun.Options): boolean;
declare namespace firstRun {
/**
* Clear the state.
*/
function clear(): void;
interface Options {
/**
* The name used to identify it.
* @default name field in your package.json
*/
name: string;
}
}
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"first-run-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }