diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..2dadf14 --- /dev/null +++ b/index.d.ts @@ -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 +} diff --git a/package.json b/package.json index 9489888..c443a3d 100644 --- a/package.json +++ b/package.json @@ -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",