import type * as core from '@contentlayer2/core'; import type { Thunk } from '@contentlayer2/utils'; import type { ComputedField } from './computed-field.js'; import type { FieldDef, FieldDefWithName } from './field.js'; export * from './field.js'; export type SchemaDef = { documentTypeDefs: DocumentTypeDef[]; }; export type DocumentContentType = 'markdown' | 'mdx' | 'data'; export type TypeExtensions = { stackbit?: core.StackbitExtension.TypeExtension; }; export type FieldDefs = Record | FieldDefWithName[]; export type DocumentTypeDef = { name: DefName; description?: string; /** * The field definitions can either be provided as an object with the field names as keys or * as an array of all field definitions including the name as an extra field. (The array definition * can be used if you want more control over the order of the fields.) * * @default [] */ fields?: FieldDefs; computedFields?: ComputedFields; /** Path is relative to the `contentDirPath` config */ filePathPattern?: string; /** * Default is `markdown` * * Choose `data` e.g. for a `.json` or `.yaml` file */ contentType?: DocumentContentType; isSingleton?: boolean; extensions?: TypeExtensions; }; export type ComputedFields = Record>; export type NestedTypeDef = { name: DefName; description?: string; /** @default [] */ fields?: FieldDefs; extensions?: TypeExtensions; }; export declare const isNestedTypeDef: (_: NestedTypeDef | NestedUnnamedTypeDef) => _ is NestedTypeDef; export type NestedUnnamedTypeDef = { /** @default [] */ fields?: FieldDefs; extensions?: TypeExtensions; }; export declare const isNestedUnnamedTypeDef: (_: NestedTypeDef | NestedUnnamedTypeDef) => _ is NestedUnnamedTypeDef; export type NestedType = { type: 'nested'; def: Thunk | NestedUnnamedTypeDef>; }; export type DocumentType = { type: 'document'; def: Thunk>; }; export type DocumentTypes = DocumentType[] | Record>; export declare const defineNestedType: (def: Thunk | NestedUnnamedTypeDef>) => NestedType; export declare const defineDocumentType: (def: Thunk>) => DocumentType; export declare const defineFields: (fields: TFieldDefs) => TFieldDefs; export declare const defineComputedFields: = ComputedFields>(computedFields: TComputedFields) => TComputedFields; //# sourceMappingURL=index.d.ts.map