Skip to content

Commit

Permalink
feat: added components definitions for all intrinsic schema-types
Browse files Browse the repository at this point in the history
  • Loading branch information
snorrees committed Oct 26, 2022
1 parent ce93ab2 commit ae0d13d
Show file tree
Hide file tree
Showing 6 changed files with 943 additions and 10 deletions.
3 changes: 2 additions & 1 deletion packages/@sanity/types/src/reference/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export type ReferenceFilterResolver = (options: {

/** @public */
export interface ReferenceFilterResolverOptions {
filter: ReferenceFilterResolver
filter?: ReferenceFilterResolver
filterParams?: never
}

/** @public */
Expand Down
19 changes: 12 additions & 7 deletions packages/@sanity/types/src/schema/definition/type/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ export interface BaseSchemaDefinition {
hidden?: ConditionalProperty
readOnly?: ConditionalProperty
icon?: ComponentType | ReactNode
components?: {
diff?: ComponentType<any> // @todo: use `DiffProps` here
field?: ComponentType<any> // @todo: use `FieldProps` here
input?: ComponentType<any> // @todo: use `InputProps` here
item?: ComponentType<any> // @todo: use `ItemProps` here
preview?: ComponentType<any> // @todo: use `PreviewProps` here
}
validation?: unknown
initialValue?: unknown
/*
* These are not the properties you are looking for.
* To avoid cyclic dependencies on Prop-types, the components property is
* added to each intrinsic definition in sanity/core/schema/definitionExtensions.ts
*/
/*components?: {
diff?: ComponentType<any>
field?: ComponentType<any>
input?: ComponentType<any>
item?: ComponentType<any>
preview?: ComponentType<any>
}*/
}

/** @public */
Expand Down
Loading

0 comments on commit ae0d13d

Please sign in to comment.