From d0a9a14759a049a060b4ccea78f2f126f579fd53 Mon Sep 17 00:00:00 2001 From: Gerben Date: Sat, 25 Apr 2020 11:36:27 +0200 Subject: [PATCH] Add typescript declaration, also publish as module, tweak package.json --- package.json | 13 ++++++++++--- src/index.d.ts | 3 +++ 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 src/index.d.ts diff --git a/package.json b/package.json index ff3bc50..71000a5 100644 --- a/package.json +++ b/package.json @@ -2,21 +2,28 @@ "name": "doctype-to-string", "version": "0.1.3", "description": "Convert a DOM DocumentType into a string, e.g. \"\"", + "keywords": [ + "dom" + ], + "homepage": "https://code.treora.com/gerben/doctype-to-string", "repository": { "type": "git", "url": "https://code.treora.com/gerben/doctype-to-string" }, - "main": "lib", + "main": "lib/index.js", + "module": "src/index.js", + "types": "src/index.d.ts", "scripts": { "build": "babel -d lib src", - "postpublish": "publish-to-git --force && publish-to-git --force --tag latest", + "postpublish": "publish-to-git --force", "prepublish": "npm run build", "test": "ava" }, "author": "Gerben ", "license": "CC0-1.0", "files": [ - "lib" + "lib", + "src" ], "devDependencies": { "ava": "^1.4.1", diff --git a/src/index.d.ts b/src/index.d.ts new file mode 100644 index 0000000..719a55c --- /dev/null +++ b/src/index.d.ts @@ -0,0 +1,3 @@ +declare module 'doctype-to-string' { + export default function(doctype: DocumentType | null): string +}