diff --git a/src/model/customType.ts b/src/model/customType.ts index 2972962..86c1926 100644 --- a/src/model/customType.ts +++ b/src/model/customType.ts @@ -33,11 +33,13 @@ type MockCustomTypeModel< Definition extends | prismic.CustomTypeModelTab | prismic.CustomTypeModelDefinition, -> = Definition extends prismic.CustomTypeModelTab +> = (Definition extends prismic.CustomTypeModelTab ? prismic.CustomTypeModel> : Definition extends prismic.CustomTypeModelDefinition ? prismic.CustomTypeModel - : never; + : never) & { + label: NonNullable; +}; export const customType = < Definition extends @@ -60,7 +62,7 @@ export const customType = < const format = config.format ?? faker.randomElement(["page", "custom"]); - let json = {} as MockCustomTypeModel["json"]; + let json = {} as prismic.CustomTypeModelDefinition; if ("fields" in config && config.fields) { json = { Main: config.fields } as typeof json;