import { AnyProperty } from './properties.js'; export declare const MAIN_BASE_TYPES: readonly ["_component", "_experience", "_section", "_page"]; export declare const MEDIA_BASE_TYPES: readonly ["_image", "_media", "_video"]; export declare const OTHER_BASE_TYPES: readonly ["_folder"]; export declare const ALL_BASE_TYPES: readonly ["_component", "_experience", "_section", "_page", "_image", "_media", "_video", "_folder"]; export type BaseTypes = (typeof ALL_BASE_TYPES)[number]; export type MediaStringTypes = (typeof MEDIA_BASE_TYPES)[number]; export type PropertiesRecord = Record; /** A "Base" content type that includes all common attributes for all content types */ type BaseContentType = { key: string; displayName: string; extends?: AnyContract | Array; properties?: PropertiesRecord; }; /** Represents the required values to be provided to make a Contract type */ export type SuppliedContractValues

= { key: string; displayName: string; properties?: P; baseType?: never; }; type InnerContractValues

= { isContract: true; __type: 'contract'; /** * Phantom property, never set at runtime. It makes `P` invariant, which stops * TypeScript from subtype-reducing a union of contracts (as inferred from * `extends: [A, B]`) down to the one with the fewest properties. */ readonly __properties?: (properties: P) => P; }; /** Represents the Contract type in CMS */ export type Contract

= SuppliedContractValues

& InnerContractValues

; /** A contract with any properties. Use this when passing a contract around. */ export type AnyContract = SuppliedContractValues & InnerContractValues; /** Convert union to intersection type */ type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; /** Extract properties from contracts without distributing */ type ExtractContractProperties = C extends Contract ? P : never; /** Type-level property merging - mirrors the runtime getMergedProps function */ type MergedPropertiesType = ('extends' extends keyof T ? T['extends'] extends Array ? UnionToIntersection> : T['extends'] extends Contract ? P : {} : {}) & ('properties' extends keyof T ? T['properties'] : {}); /** Utility type for content types that don't support composition behaviors */ type SkipCompositionBehaviors = Omit; /** Represents the Page type in CMS */ export type PageContentType = SkipCompositionBehaviors | '_self' | string>; }>; /** Represents the Experience type in CMS */ export type ExperienceContentType = SkipCompositionBehaviors | '_self' | string>; }>; /** Represents the Folder (Used in the asset panel to organizing content and not in Graph) type in CMS */ export type FolderContentType = SkipCompositionBehaviors | '_self' | string>; }>; /** Represents the "Component" type (also called "Block") in CMS */ export type ComponentContentType = BaseContentType & { baseType: '_component'; compositionBehaviors?: ('sectionEnabled' | 'elementEnabled' | 'formsElementEnabled')[]; mayContainTypes?: Array | '_self' | string>; }; /** This content type is used only internally */ export type SectionContentType = SkipCompositionBehaviors; /** Represents a "Media" content type (Image, Media, Video) */ export type MediaContentType = SkipCompositionBehaviors; /** All possible content types */ export type AnyContentType = ComponentContentType | ExperienceContentType | PageContentType | FolderContentType | SectionContentType | MediaContentType; export type ContentType = Omit & { properties: MergedPropertiesType; __type: 'contentType'; }; /** All possible content types for allowed and restricted fields */ export type PermittedTypes = AnyContract | ContentType | AnyContentType['baseType'] | '_self' | (string & {}); export {};