@baseplate-dev/sync
Version:
Library for syncing Baseplate descriptions
79 lines • 2.81 kB
TypeScript
import { z } from 'zod';
export declare const templateFileMetadataBaseSchema: z.ZodObject<{
/**
* The name of the template (must be unique within a generator).
*/
name: z.ZodString;
/**
* The template extractor type e.g. ts or raw.
*/
type: z.ZodString;
/**
* The name of the generator that created the file.
*/
generator: z.ZodString;
}, "strip", z.ZodTypeAny, {
type: string;
name: string;
generator: string;
}, {
type: string;
name: string;
generator: string;
}>;
export type TemplateFileMetadataBase = z.infer<typeof templateFileMetadataBaseSchema>;
/**
* Schema for individual template info in .templates-info.json
*/
export declare const templateInfoSchema: z.ZodObject<{
/**
* The name of the template (references template name key in extractor.json)
*/
template: z.ZodString;
/**
* The name of the generator that created the file.
*/
generator: z.ZodString;
/**
* Instance-specific data for the template. Presence indicates file is extractable.
*/
instanceData: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
}, "strip", z.ZodTypeAny, {
generator: string;
template: string;
instanceData?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
}, {
generator: string;
template: string;
instanceData?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
}>;
export type TemplateInfo<TInstanceData extends Record<string, unknown> = Record<string, unknown>> = z.infer<typeof templateInfoSchema> & {
instanceData?: TInstanceData | undefined;
};
/**
* Schema for the entire .templates-info.json file
*/
export declare const templatesInfoFileSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
/**
* The name of the template (references template name key in extractor.json)
*/
template: z.ZodString;
/**
* The name of the generator that created the file.
*/
generator: z.ZodString;
/**
* Instance-specific data for the template. Presence indicates file is extractable.
*/
instanceData: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>;
}, "strip", z.ZodTypeAny, {
generator: string;
template: string;
instanceData?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
}, {
generator: string;
template: string;
instanceData?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined;
}>>;
export type TemplatesInfoFile = z.infer<typeof templatesInfoFileSchema>;
//# sourceMappingURL=metadata.d.ts.map