From 7487d4e596daca68003cadda0d5b41a21ae72b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristj=C3=A1n=20Oddsson?= Date: Tue, 2 Jul 2019 10:55:14 +0100 Subject: [PATCH] add typescript definition file --- index.d.ts | 3 +++ package.json | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..ed047a3 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,3 @@ +export function install(container: Element, hotkey?: string): void; +export function uninstall(container: Element): void; +export function eventToHotkeyString(event: Event): string; diff --git a/package.json b/package.json index deeb6ae..34ac23a 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "", "main": "dist/index.umd.js", "module": "dist/index.esm.js", + "types": "index.d.ts", "repository": "github/hotkey", "scripts": { "build": "rollup -c && cp src/index.js.flow dist/index.esm.js.flow && cp src/index.js.flow dist/index.umd.js.flow", @@ -15,7 +16,8 @@ "prepublishOnly": "npm run build" }, "files": [ - "dist" + "dist", + "index.d.ts" ], "keywords": [], "author": "",