Skip to content

Commit 1fe32ec

Browse files
committed
Make the type right for BindingFunc
1 parent 133b088 commit 1fe32ec

File tree

10 files changed

+10
-10
lines changed

10 files changed

+10
-10
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vanjs-core",
3-
"version": "1.2.0-rc.2",
3+
"version": "1.2.0-rc.3",
44
"description": "VanJS. A minimalist React-like UI library based on vanilla JavaScript and DOM.",
55
"files": [
66
"src/van.js",

public/van-1.2.0.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type Props = Record<string, PropValue | StateView<PropValue> | (() => Pro
1515

1616
export type ValidChildDomValue = Primitive | Node | null | undefined
1717

18-
export type BindingFunc = (dom: Node) => ValidChildDomValue
18+
export type BindingFunc = (dom: Node | undefined) => ValidChildDomValue
1919

2020
export type ChildDom = ValidChildDomValue | StateView<Primitive | null | undefined> | BindingFunc | readonly ChildDom[]
2121

public/van-1.2.0.debug.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type Props = Record<string, PropValue | StateView<PropValue> | (() => Pro
1515

1616
export type ValidChildDomValue = Primitive | Node | null | undefined
1717

18-
export type BindingFunc = (dom: Node) => ValidChildDomValue
18+
export type BindingFunc = (dom: Node | undefined) => ValidChildDomValue
1919

2020
export type ChildDom = ValidChildDomValue | StateView<Primitive | null | undefined> | BindingFunc | readonly ChildDom[]
2121

public/van-1.2.0.min.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type Props = Record<string, PropValue | StateView<PropValue> | (() => Pro
1515

1616
export type ValidChildDomValue = Primitive | Node | null | undefined
1717

18-
export type BindingFunc = (dom: Node) => ValidChildDomValue
18+
export type BindingFunc = (dom: Node | undefined) => ValidChildDomValue
1919

2020
export type ChildDom = ValidChildDomValue | StateView<Primitive | null | undefined> | BindingFunc | readonly ChildDom[]
2121

public/van-latest.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type Props = Record<string, PropValue | StateView<PropValue> | (() => Pro
1515

1616
export type ValidChildDomValue = Primitive | Node | null | undefined
1717

18-
export type BindingFunc = (dom: Node) => ValidChildDomValue
18+
export type BindingFunc = (dom: Node | undefined) => ValidChildDomValue
1919

2020
export type ChildDom = ValidChildDomValue | StateView<Primitive | null | undefined> | BindingFunc | readonly ChildDom[]
2121

public/van-latest.debug.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type Props = Record<string, PropValue | StateView<PropValue> | (() => Pro
1515

1616
export type ValidChildDomValue = Primitive | Node | null | undefined
1717

18-
export type BindingFunc = (dom: Node) => ValidChildDomValue
18+
export type BindingFunc = (dom: Node | undefined) => ValidChildDomValue
1919

2020
export type ChildDom = ValidChildDomValue | StateView<Primitive | null | undefined> | BindingFunc | readonly ChildDom[]
2121

public/van-latest.min.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type Props = Record<string, PropValue | StateView<PropValue> | (() => Pro
1515

1616
export type ValidChildDomValue = Primitive | Node | null | undefined
1717

18-
export type BindingFunc = (dom: Node) => ValidChildDomValue
18+
export type BindingFunc = (dom: Node | undefined) => ValidChildDomValue
1919

2020
export type ChildDom = ValidChildDomValue | StateView<Primitive | null | undefined> | BindingFunc | readonly ChildDom[]
2121

src/van.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type Props = Record<string, PropValue | StateView<PropValue> | (() => Pro
1515

1616
export type ValidChildDomValue = Primitive | Node | null | undefined
1717

18-
export type BindingFunc = (dom: Node) => ValidChildDomValue
18+
export type BindingFunc = (dom: Node | undefined) => ValidChildDomValue
1919

2020
export type ChildDom = ValidChildDomValue | StateView<Primitive | null | undefined> | BindingFunc | readonly ChildDom[]
2121

src/van.debug.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export type Props = Record<string, PropValue | StateView<PropValue> | (() => Pro
1515

1616
export type ValidChildDomValue = Primitive | Node | null | undefined
1717

18-
export type BindingFunc = (dom: Node) => ValidChildDomValue
18+
export type BindingFunc = (dom: Node | undefined) => ValidChildDomValue
1919

2020
export type ChildDom = ValidChildDomValue | StateView<Primitive | null | undefined> | BindingFunc | readonly ChildDom[]
2121

test/van.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1335,7 +1335,7 @@ const runTests = async (van: VanForTesting, msgDom: Element, {debug}: BundleOpti
13351335
const OptimizedCounter = ({
13361336
van: {state, derive, val, tags: {button, div}},
13371337
id, init = 0, buttonStyle = "👍👎",
1338-
}: CounterProps) => <HTMLDivElement>div((dom: Node) => {
1338+
}: CounterProps) => <HTMLDivElement>div((dom: Node | undefined) => {
13391339
if (dom) return dom
13401340

13411341
const counter = state(init)

0 commit comments

Comments
 (0)