Skip to content

Commit

Permalink
fix: type blocks as BlockType[] not BlockType[][]
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Apr 2, 2020
1 parent 2dfd6bf commit 51bfe9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/schema/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ export type FieldType<T extends UnnamedField> =
T extends PureType<'array'> & { of: Array<infer B> }
? Array<FieldType<B>>
: T extends PureType<'block'>
? BlockType[]
? BlockType
: T extends PureType<'boolean'>
? boolean
: T extends
Expand Down
8 changes: 4 additions & 4 deletions src/types/block.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
interface BlockMarkDefs {
interface MarkDefs {
_key: string
_type: string
[key: string]: string
}

interface BlockChildren {
interface Children {
_key: string
_type: string
marks: string[]
Expand All @@ -14,9 +14,9 @@ interface BlockChildren {
export interface BlockType {
_key: string
_type: string
children: BlockChildren[]
children: Children[]
level?: number
listItem?: string
markDefs: BlockMarkDefs[]
markDefs: MarkDefs[]
style: string
}

0 comments on commit 51bfe9a

Please sign in to comment.