Skip to content

Commit

Permalink
Merge pull request #118 from github/add-typescript-definition-file
Browse files Browse the repository at this point in the history
Add typescript definition file
  • Loading branch information
koddsson authored Aug 14, 2019
2 parents 1a9c306 + 743a66a commit cbb381a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
21 changes: 21 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
declare class ExtendedTimeElement extends HTMLElement {
readonly date: Date | undefined
getFormattedTitle(): string | undefined
getFormattedDate(): string | undefined
}

export class LocalTimeElement extends ExtendedTimeElement {
getFormattedDate(): string | undefined
}

export class RelativeTimeElement extends ExtendedTimeElement {
getFormattedDate(): string | undefined
}

export class TimeAgoElement extends ExtendedTimeElement {
getFormattedDate(): string | undefined
}

export class TimeUntilElement extends ExtendedTimeElement {
getFormattedDate(): string | undefined
}
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"version": "3.0.5",
"main": "dist/time-elements-legacy.js",
"module": "dist/time-elements.js",
"types": "index.d.ts",
"license": "MIT",
"files": [
"dist",
"index.d.ts"
],
"scripts": {
"clean": "rm -rf dist",
"lint": "github-lint",
Expand Down

0 comments on commit cbb381a

Please sign in to comment.