mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
feat: add type definitions for easydate
This commit is contained in:
10
types/easydate/easydate-tests.ts
Normal file
10
types/easydate/easydate-tests.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import easydate = require('easydate');
|
||||
|
||||
easydate('d/M/Y');
|
||||
easydate('Y-d-M', {adjust: true, timeZone: 'local'});
|
||||
easydate('d-M-Y @ h:m', '2015-11-03T16:06:00.000Z');
|
||||
easydate('Y-d-M', {
|
||||
adjust: true,
|
||||
timeZone: 'utc',
|
||||
setDate: '2015-11-03T16:06:00.000Z'
|
||||
});
|
||||
14
types/easydate/index.d.ts
vendored
Normal file
14
types/easydate/index.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// Type definitions for easydate 2.2
|
||||
// Project: https://github.com/roryrjb/easydate
|
||||
// Definitions by: Satya Rohith <https://github.com/satyarohith>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export = easydate;
|
||||
|
||||
interface DateConfig {
|
||||
setDate?: string;
|
||||
timeZone?: 'utc' | 'local';
|
||||
adjust?: boolean;
|
||||
}
|
||||
|
||||
declare function easydate(pattern: string, config?: DateConfig | string): string;
|
||||
23
types/easydate/tsconfig.json
Normal file
23
types/easydate/tsconfig.json
Normal 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",
|
||||
"easydate-tests.ts"
|
||||
]
|
||||
}
|
||||
3
types/easydate/tslint.json
Normal file
3
types/easydate/tslint.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user