mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-08-18 05:01:17 +02:00
TypeScript Improvement: Use [key: string]: unknown
, not [key: string]: any
(#3566)
* Change all [key:string]:any -> unknown Skipping slate-hyperscript, since it seems to be an appropriate use of key: any * Minor typo fix docs/api/locations * Check/assert unknown attributes when needed
This commit is contained in:
@@ -5,7 +5,7 @@ Slate works with pure JSON objects. All it requires is that those JSON objects c
|
||||
```ts
|
||||
interface Text {
|
||||
text: string
|
||||
[key: string]: any
|
||||
[key: string]: unknown
|
||||
}
|
||||
```
|
||||
|
||||
@@ -22,7 +22,7 @@ To take another example, the `Element` node interface in Slate is:
|
||||
```ts
|
||||
interface Element {
|
||||
children: Node[]
|
||||
[key: string]: any
|
||||
[key: string]: unknown
|
||||
}
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user