Skip to content

Commit

Permalink
[types] Add options typings for array schema type
Browse files Browse the repository at this point in the history
  • Loading branch information
rexxars committed Oct 6, 2020
1 parent a64a572 commit 1a31c69
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/@sanity/types/src/schema/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,19 @@ export interface BooleanSchemaType extends BaseSchemaType {
}
}

export interface ArraySchemaType extends BaseSchemaType {
export interface ArraySchemaType<V = unknown> extends BaseSchemaType {
jsonType: 'array'
of: Exclude<SchemaType, ArraySchemaType>[]
options?: {
list?: {title?: string; value: V}[] | V[]
layout?: V extends string ? 'tags' : 'grid'
sortable?: boolean

/**
* @deprecated
*/
editModal?: 'dialog' | 'fullscreen' | 'popover'
}
}

export interface BlockSchemaType extends ObjectSchemaType {
Expand Down

0 comments on commit 1a31c69

Please sign in to comment.