Browse Source

Add typescript declaration, also publish as module

master
Gerben 2 months ago
parent
commit
72d4b5e2ab
2 changed files with 9 additions and 3 deletions
  1. +6
    -3
      package.json
  2. +3
    -0
      src/index.d.ts

+ 6
- 3
package.json View File

@@ -10,7 +10,9 @@
"type": "git",
"url": "https://code.treora.com/gerben/document-outerhtml"
},
"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",
@@ -20,7 +22,8 @@
"author": "Gerben <gerben@treora.com>",
"license": "CC0-1.0",
"files": [
"lib"
"lib",
"src"
],
"devDependencies": {
"ava": "^1.4.1",
@@ -41,6 +44,6 @@
]
},
"dependencies": {
"doctype-to-string": "git+https://code.treora.com/gerben/doctype-to-string#semver:^0.1.3"
"doctype-to-string": "git+https://code.treora.com/gerben/doctype-to-string#semver:^0.1.4"
}
}

+ 3
- 0
src/index.d.ts View File

@@ -0,0 +1,3 @@
declare module 'document-outerhtml' {
export default function(doc: Document): string
}

Loading…
Cancel
Save