UNPKG

@prismicio/mock

Version:

Generate mock Prismic documents, fields, Slices, and models for development and testing environments

24 lines (23 loc) 1.24 kB
import { MockModelConfig } from "../types.cjs"; import * as prismic from "@prismicio/client"; //#region src/model/customType.d.ts type MockCustomTypeModelConfig<Definition extends prismic.CustomTypeModelTab | prismic.CustomTypeModelDefinition = prismic.CustomTypeModelTab | prismic.CustomTypeModelDefinition> = { id?: string; label?: string; status?: boolean; repeatable?: boolean; format?: prismic.CustomTypeModel["format"]; } & ({ fields?: Definition; tabs?: never; } | { tabs?: Definition; fields?: never; }) & MockModelConfig; type MockCustomTypeModel<Definition extends prismic.CustomTypeModelTab | prismic.CustomTypeModelDefinition> = (Definition extends prismic.CustomTypeModelTab ? prismic.CustomTypeModel<string, Record<"Main", Definition>> : Definition extends prismic.CustomTypeModelDefinition ? prismic.CustomTypeModel<string, Definition> : never) & { label: NonNullable<prismic.CustomTypeModel["label"]>; }; declare const customType: <Definition extends prismic.CustomTypeModelTab | prismic.CustomTypeModelDefinition>(config: MockCustomTypeModelConfig<Definition>) => MockCustomTypeModel<Definition>; //#endregion export { MockCustomTypeModelConfig, customType }; //# sourceMappingURL=customType.d.cts.map