Skip to content

Commit 2e60c3a

Browse files
committed
Update types in docs from 'any' to 'unknown'
1 parent 2f92c29 commit 2e60c3a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docs/api.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
```ts
88
function addProps(
99
children: VNodeArrayChildren,
10-
callback: (vnode: VNode) => (Record<string, any> | null | void),
10+
callback: (vnode: VNode) => (Record<string, unknown> | null | void),
1111
options: IterationOptions = COMPONENTS_AND_ELEMENTS
1212
): VNodeArrayChildren
1313
```
@@ -179,7 +179,7 @@ Returns the text content of a text node. If the passed value is not a text node
179179
### Type
180180

181181
```ts
182-
function getType(vnode: any):
182+
function getType(vnode: unknown):
183183
'comment' |
184184
'component' |
185185
'element' |
@@ -204,7 +204,7 @@ If the passed value doesn't appear to be convertible to a VNode, the returned va
204204
### Type
205205

206206
```ts
207-
function isComment(vnode: any): vnode is (null | undefined | boolean | (VNode & { type: typeof Comment }))
207+
function isComment(vnode: unknown): vnode is (null | undefined | boolean | (VNode & { type: typeof Comment }))
208208
```
209209

210210
### Description
@@ -220,7 +220,7 @@ Returns `true` if the passed value is considered to be a comment. This could be
220220
### Type
221221

222222
```ts
223-
function isComponent(vnode: any): vnode is (VNode & { type: Component })
223+
function isComponent(vnode: unknown): vnode is (VNode & { type: Component })
224224
```
225225

226226
### Description
@@ -238,7 +238,7 @@ Returns `true` if the passed value is a component VNode. This includes both stat
238238
### Type
239239

240240
```ts
241-
function isElement(vnode: any): vnode is (VNode & { type: string })
241+
function isElement(vnode: unknown): vnode is (VNode & { type: string })
242242
```
243243

244244
### Description
@@ -278,7 +278,7 @@ This helper is written using `someChild()`. If the exact criteria it uses to dec
278278
### Type
279279

280280
```ts
281-
function isFragment(vnode: any): vnode is ((VNode & { type: typeof Fragment }) | VNodeArrayChildren)
281+
function isFragment(vnode: unknown): vnode is ((VNode & { type: typeof Fragment }) | VNodeArrayChildren)
282282
```
283283

284284
### Description
@@ -294,7 +294,7 @@ Returns `true` if the passed value is considered a fragment. This could either b
294294
### Type
295295

296296
```ts
297-
function isFunctionalComponent(vnode: any): vnode is (VNode & { type: FunctionalComponent })
297+
function isFunctionalComponent(vnode: unknown): vnode is (VNode & { type: FunctionalComponent })
298298
```
299299

300300
### Description
@@ -312,7 +312,7 @@ Returns `true` if the passed value is a VNode for a [functional component](https
312312
### Type
313313

314314
```ts
315-
function isStatefulComponent(vnode: any): vnode is (VNode & { type: ComponentOptions })
315+
function isStatefulComponent(vnode: unknown): vnode is (VNode & { type: ComponentOptions })
316316
```
317317

318318
### Description
@@ -330,7 +330,7 @@ Returns `true` if the passed value is a VNode for a stateful (i.e. non-functiona
330330
### Type
331331

332332
```ts
333-
function isStatic(vnode: any): vnode is (VNode & { type: typeof Static })
333+
function isStatic(vnode: unknown): vnode is (VNode & { type: typeof Static })
334334
```
335335

336336
### Description
@@ -346,7 +346,7 @@ Returns `true` if the passed value is a static VNode. Static VNodes are a specia
346346
### Type
347347

348348
```ts
349-
function isText(vnode: any): vnode is (string | number | (VNode & { type: typeof Text }))
349+
function isText(vnode: unknown): vnode is (string | number | (VNode & { type: typeof Text }))
350350
```
351351

352352
### Description

0 commit comments

Comments
 (0)