Merge pull request #28460 from danwbyrne/elegant-spinner

adds typings for the 'elegant-spinner' package
This commit is contained in:
Armando Aguirre
2018-08-28 16:25:00 -07:00
committed by GitHub
4 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
import elegantSpinner = require('elegant-spinner');
const frameFunction = elegantSpinner();
// $ExpectType string
frameFunction();
const frames = elegantSpinner.frames;

12
types/elegant-spinner/index.d.ts vendored Normal file
View File

@@ -0,0 +1,12 @@
// Type definitions for elegant-spinner 1.0
// Project: https://github.com/sindresorhus/elegant-spinner
// Definitions by: Daniel Byrne <https://github.com/danwbyrne>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = elegantSpinner;
declare function elegantSpinner(): () => string;
declare namespace elegantSpinner {
const frames: ReadonlyArray<string>;
}

View File

@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"elegant-spinner-tests.ts"
]
}

View File

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