mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #32096 from BendingBender/first-run
[first-run] Add types
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import firstRun = require('first-run');
|
||||
|
||||
firstRun(); // $ExpectType boolean
|
||||
firstRun({ name: 'foo' }); // $ExpectType boolean
|
||||
|
||||
firstRun.clear();
|
||||
Vendored
+26
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user