Skip to content

Commit

Permalink
fix: Create separate TypeScript typings for every dist module
Browse files Browse the repository at this point in the history
  • Loading branch information
prantlf committed Oct 7, 2018
1 parent 0f8c317 commit 9f42ceb
Show file tree
Hide file tree
Showing 12 changed files with 311 additions and 59 deletions.
4 changes: 2 additions & 2 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ Load the main module in the browser with [RequireJS]:
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/date-fns/1.29.0/date_fns.min.js"></script>
<script src="https://unpkg.com/timezone-support@1.5.1/dist/index.umd.js"></script>
<script src="https://unpkg.com/date-fns-timezone@0.1.2/dist/index.umd.js"></script>
<script src="https://unpkg.com/timezone-support@1.5.3/dist/index.umd.js"></script>
<script src="https://unpkg.com/date-fns-timezone@0.1.3/dist/index.umd.js"></script>
<script>
require(['date-fns-timezone'], ({ parseFromTimeZone, formatToTimeZone }) => {
})
Expand Down
44 changes: 0 additions & 44 deletions index.d.ts

This file was deleted.

241 changes: 238 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 14 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,19 @@
"node": ">=6"
},
"main": "dist/index.js",
"types": "index.d.ts",
"typings": "dist/index.d.ts",
"files": [
"dist",
"src"
],
"scripts": {
"prepare": "npm run build",
"lint": "standard --verbose",
"lint": "run-s lint:js lint:ts",
"lint:js": "standard --verbose",
"lint:ts": "tslint -t stylish src/*.ts test/*.ts",
"compile": "rollup -c",
"build": "run-s lint compile",
"copy:typings": "cpy src/*.d.ts dist",
"build": "run-s lint compile copy:typings",
"compile:tests": "tsc --lib es6 test/typings.test.ts",
"check": "jest",
"test": "run-s lint compile:tests check",
Expand All @@ -47,10 +54,6 @@
"docs"
]
},
"files": [
"dist",
"src"
],
"jest": {
"roots": [
"test"
Expand All @@ -74,7 +77,7 @@
},
"dependencies": {
"date-fns": "^1.29.0",
"timezone-support": "^1.5.1"
"timezone-support": "^1.5.3"
},
"devDependencies": {
"@babel/core": "^7.1.2",
Expand All @@ -83,6 +86,7 @@
"benchmark": "^2.1.4",
"connect": "^3.6.6",
"coveralls": "^3.0.2",
"cpy-cli": "^2.0.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^7.0.1",
Expand All @@ -106,6 +110,8 @@
"standard": "^12.0.1",
"tiny-glob": "^0.2.2",
"travis-deploy-once": "^5.0.9",
"tslint": "^5.11.0",
"tslint-config-standard": "^8.0.1",
"typescript": "^3.1.1"
},
"keywords": [
Expand Down
8 changes: 8 additions & 0 deletions src/convertToLocalTime.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type DateInput = string | number | Date
interface TimeZoneOptions {
timeZone: string
}

declare function convertToLocalTime (dateInput: DateInput, options: TimeZoneOptions): Date

export { convertToLocalTime }

0 comments on commit 9f42ceb

Please sign in to comment.