Skip to content

Commit

Permalink
Update types in docs from 'any' to 'unknown'
Browse files Browse the repository at this point in the history
  • Loading branch information
skirtles-code committed Jan 16, 2024
1 parent 2f92c29 commit 2e60c3a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
```ts
function addProps(
children: VNodeArrayChildren,
callback: (vnode: VNode) => (Record<string, any> | null | void),
callback: (vnode: VNode) => (Record<string, unknown> | null | void),
options: IterationOptions = COMPONENTS_AND_ELEMENTS
): VNodeArrayChildren
```
Expand Down Expand Up @@ -179,7 +179,7 @@ Returns the text content of a text node. If the passed value is not a text node
### Type

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

```ts
function isComment(vnode: any): vnode is (null | undefined | boolean | (VNode & { type: typeof Comment }))
function isComment(vnode: unknown): vnode is (null | undefined | boolean | (VNode & { type: typeof Comment }))
```

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

```ts
function isComponent(vnode: any): vnode is (VNode & { type: Component })
function isComponent(vnode: unknown): vnode is (VNode & { type: Component })
```

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

```ts
function isElement(vnode: any): vnode is (VNode & { type: string })
function isElement(vnode: unknown): vnode is (VNode & { type: string })
```

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

```ts
function isFragment(vnode: any): vnode is ((VNode & { type: typeof Fragment }) | VNodeArrayChildren)
function isFragment(vnode: unknown): vnode is ((VNode & { type: typeof Fragment }) | VNodeArrayChildren)
```

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

```ts
function isFunctionalComponent(vnode: any): vnode is (VNode & { type: FunctionalComponent })
function isFunctionalComponent(vnode: unknown): vnode is (VNode & { type: FunctionalComponent })
```

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

```ts
function isStatefulComponent(vnode: any): vnode is (VNode & { type: ComponentOptions })
function isStatefulComponent(vnode: unknown): vnode is (VNode & { type: ComponentOptions })
```

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

```ts
function isStatic(vnode: any): vnode is (VNode & { type: typeof Static })
function isStatic(vnode: unknown): vnode is (VNode & { type: typeof Static })
```

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

```ts
function isText(vnode: any): vnode is (string | number | (VNode & { type: typeof Text }))
function isText(vnode: unknown): vnode is (string | number | (VNode & { type: typeof Text }))
```

### Description
Expand Down

0 comments on commit 2e60c3a

Please sign in to comment.