Closed hrithikroboto closed 1 year ago
export const richText = s.array({ of: [image]});
Type '({ type: "document"; liveEdit?: boolean | undefined; orderings?: SortOrdering[] | undefined; options?: DocumentOptions | undefined; __experimental_search?: { ...; }[] | undefined; ... 13 more ...; name: "article"; } | { ...; } | { ...; })[]' is not assignable to type 'SchemaTypeDefinition[] | ComposableOption<SchemaTypeDefinition[], Omit<ConfigContext, "schema" | "currentUser" | "getClient" | "client">> | undefined'. Type '({ type: "document"; liveEdit?: boolean | undefined; orderings?: SortOrdering[] | undefined; options?: DocumentOptions | undefined; __experimental_search?: { ...; }[] | undefined; ... 13 more ...; name: "article"; } | { ...; } | { ...; })[]' is not assignable to type 'SchemaTypeDefinition[]'. Type '{ type: "document"; liveEdit?: boolean | undefined; orderings?: SortOrdering[] | undefined; options?: DocumentOptions | undefined; __experimental_search?: { ...; }[] | undefined; ... 13 more ...; name: "article"; } | { ...; } | { ...; }' is not assignable to type 'SchemaTypeDefinition'. Type '{ type: string; of: ItemDefinitions[]; validation: (rule: ArrayRule<{ _type: "image"; asset: SanityReference<false>; _key: string; }[]>) => RuleBuilder<ArrayRule<...>, { ...; }[]>; ... 5 more ...; icon?: ReactNode | ComponentType<...>; }' is not assignable to type 'SchemaTypeDefinition'. Property 'name' is missing in type '{ type: string; of: ItemDefinitions[]; validation: (rule: ArrayRule<{ _type: "image"; asset: SanityReference<false>; _key: string; }[]>) => RuleBuilder<ArrayRule<...>, { ...; }[]>; ... 5 more ...; icon?: ReactNode | ComponentType<...>; }' but required in type 'TypeAliasDefinition<string, "string" | "number" | "boolean" | "object" | "document" | "array" | "block" | "date" | "datetime" | "file" | "geopoint" | "image" | "reference" | "crossDatasetReference" | "slug" | "text" | "url" | "email">'.ts(2322) index.d.ts(136, 3): 'name' is declared here.
The documentation on types should explain why this isn't necessary. This replaces the type of a field, not the entire field, so there's actually no name to be had.
type
name