crelt 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,8 @@
1
1
  type Child = string | Node | null | undefined | readonly Child[]
2
2
 
3
- export default function crelt(elt: string | HTMLElement, attrs: {[attr: string]: any}, ...children: Child[]): HTMLElement
4
- export default function crelt(elt: string | HTMLElement, ...children: Child[]): HTMLElement
3
+ type EltType<N extends string> = N extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[N] : HTMLElement
4
+
5
+ export default function crelt<N extends string>(elt: N, attrs: {[attr: string]: any}, ...children: Child[]): EltType<N>
6
+ export default function crelt<N extends string>(elt: N, ...children: Child[]): EltType<N>
7
+ export default function crelt(elt: HTMLElement, attrs: {[attr: string]: any}, ...children: Child[]): HTMLElement
8
+ export default function crelt(elt: HTMLElement, ...children: Child[]): HTMLElement
package/index.d.ts CHANGED
@@ -1,4 +1,8 @@
1
1
  type Child = string | Node | null | undefined | readonly Child[]
2
2
 
3
- export default function crelt(elt: string | HTMLElement, attrs: {[attr: string]: any}, ...children: Child[]): HTMLElement
4
- export default function crelt(elt: string | HTMLElement, ...children: Child[]): HTMLElement
3
+ type EltType<N extends string> = N extends keyof HTMLElementTagNameMap ? HTMLElementTagNameMap[N] : HTMLElement
4
+
5
+ export default function crelt<N extends string>(elt: N, attrs: {[attr: string]: any}, ...children: Child[]): EltType<N>
6
+ export default function crelt<N extends string>(elt: N, ...children: Child[]): EltType<N>
7
+ export default function crelt(elt: HTMLElement, attrs: {[attr: string]: any}, ...children: Child[]): HTMLElement
8
+ export default function crelt(elt: HTMLElement, ...children: Child[]): HTMLElement
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crelt",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Tiny DOM-element-creation utility",
5
5
  "main": "dist/index.cjs",
6
6
  "type": "module",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "repository": {
17
17
  "type": "git",
18
- "url": "git+https://github.com/marijnh/crelt.git"
18
+ "url": "git+https://code.haverbeke.berlin/marijn/crelt.git"
19
19
  },
20
20
  "keywords": [
21
21
  "dom",
@@ -25,9 +25,9 @@
25
25
  "author": "Marijn Haverbeke <marijn@haverbeke.berlin>",
26
26
  "license": "MIT",
27
27
  "bugs": {
28
- "url": "https://github.com/marijnh/crelt/issues"
28
+ "url": "https://code.haverbeke.berlin/marijn/crelt/issues"
29
29
  },
30
- "homepage": "https://github.com/marijnh/crelt#readme",
30
+ "homepage": "https://code.haverbeke.berlin/marijn/crelt",
31
31
  "devDependencies": {
32
32
  "rollup": "^2.0.5",
33
33
  "rollup-plugin-copy": "^3.4.0"