mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 15:00:26 +00:00
Add ms.macro (#43789)
This commit is contained in:
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// Type definitions for ms.macro 2.0
|
||||
// Project: https://github.com/knpwrs/ms.macro#readme
|
||||
// Definitions by: Cameron Knight <https://github.com/ckknight>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Convert various time formats to milliseconds at build time in Babel.
|
||||
* @param value The value to convert
|
||||
* @example
|
||||
* const ONE_DAY = ms('1 day');
|
||||
* const TWO_DAYS = ms('2 days');
|
||||
* @example
|
||||
* const ONE_DAY = ms`1 day`;
|
||||
* const TWO_DAYS = ms`2 days`;
|
||||
*/
|
||||
export default function ms(value: string | TemplateStringsArray): number;
|
||||
@@ -0,0 +1,4 @@
|
||||
import ms from 'ms.macro';
|
||||
|
||||
const threeSeconds: number = ms('3 seconds');
|
||||
const threeHundredMilliseconds: number = ms`300 ms`;
|
||||
@@ -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",
|
||||
"ms.macro-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user