Skip to content

Commit

Permalink
feat(library): ✨ support built-in typescript definition
Browse files Browse the repository at this point in the history
add typescript definition which has stricter type than `@types/void-elements`

fix pugjs#23
  • Loading branch information
achmadk committed Oct 13, 2021
1 parent a10ede2 commit e834426
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "3.1.0",
"description": "Array of \"void elements\" defined by the HTML specification.",
"main": "index.js",
"typings": "types.d.ts",
"jsnext:main": "index.es.js",
"module": "index.es.js",
"exports": {
Expand All @@ -23,7 +24,8 @@
],
"files": [
"index.js",
"index.es.js"
"index.es.js",
"types.d.ts"
],
"repository": "pugjs/void-elements",
"author": "hemanth.hm",
Expand Down
5 changes: 5 additions & 0 deletions types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare type VoidElementKeys = 'area' | 'base' | 'br' | 'col' | 'embed' | 'hr' | 'img' | 'input' | 'link' | 'meta' | 'param' | 'source' | 'track' | 'wbr';

declare const voidElements: Record<VoidElementKeys, true>;

export default voidElements;

0 comments on commit e834426

Please sign in to comment.