// Instance Props types /** All public-facing link mode identifiers. */ type LinkMode = | 'url' | 'page' | 'pageSection' | 'email' | 'phone' | 'file' | 'collectionPage'; interface LinkResolvedValueBase { mode: LinkMode; openInNewTab?: boolean; rel?: 'none' | 'preload' | 'prefetch' | 'prerender'; } interface PageLinkResolvedValue extends LinkResolvedValueBase { mode: 'page'; to?: {pageId: string}; } interface PageSectionLinkResolvedValue extends LinkResolvedValueBase { mode: 'pageSection'; to?: {fullElementId: FullElementId}; } interface CollectionPageLinkResolvedValue extends LinkResolvedValueBase { mode: 'collectionPage'; to?: {pageSlug: string}; } interface EmailLinkResolvedValue extends LinkResolvedValueBase { mode: 'email'; to?: string; emailSubject?: string; } interface FileLinkResolvedValue extends LinkResolvedValueBase { mode: 'file'; to?: {assetId: string}; } interface GenericLinkResolvedValue extends LinkResolvedValueBase { mode: 'url' | 'phone'; to?: string; } type LinkResolvedValue = | PageLinkResolvedValue | PageSectionLinkResolvedValue | CollectionPageLinkResolvedValue | EmailLinkResolvedValue | FileLinkResolvedValue | GenericLinkResolvedValue; interface VideoResolvedValue { src?: string; title?: string; } interface RichTextResolvedValue { innerText: string; } type ResolvedValue = | string | number | boolean | null | LinkResolvedValue | VideoResolvedValue | RichTextResolvedValue; interface StaticPropValue { sourceType: 'static'; value: ResolvedValue | null; } type BindingValue = | { sourceType: 'prop'; propId: string; propName: string; propGroup: string | null; } | { sourceType: 'cms'; collectionId: string; collectionName: string; fieldId: string; fieldName: string; fieldGroup: string | null; fieldType: CmsFieldType; } | { sourceType: 'locale'; fieldKey: string; fieldName: string; fieldType: 'string'; } | { sourceType: 'localeItem'; fieldKey: string; fieldName: string; fieldType: 'string'; } | { sourceType: 'page'; fieldKey: string; fieldName: string; } | {sourceType: 'conditional'} | {sourceType: 'legacyConditional'} | {sourceType: 'legacy'}; type SettingValue = StaticPropValue | BindingValue; type UnsupportedBindingValue = | {sourceType: 'conditional'} | {sourceType: 'legacyConditional'} | {sourceType: 'legacy'}; type InstancePropSummaryBindingValue = BindingInput | UnsupportedBindingValue; interface SettingDisplay { label: string; group: string | null; trueLabel?: string; falseLabel?: string; /** Available choices for variant props. Each entry is a variant the component author defined. */ options?: Array>; } interface InstanceProp { propId: string; valueType: BindableValueType; hasOverride: boolean; value: SettingValue; resolvedValue: ResolvedValue | null; defaultValue: ResolvedValue | null; display: SettingDisplay; } interface InstancePropSummary { propId: string; value: ResolvedValue | InstancePropSummaryBindingValue | null; hasOverride: boolean; } interface ResolvedInstanceProp { propId: string; value: ResolvedValue | null; } interface SearchInstancePropsOptions { /** Filter to props that produce a specific value type (e.g., "string", "boolean") */ valueType?: BindableValueType; } // Set Instance Props types interface PropBindingInput { sourceType: 'prop'; propId: string; } interface CmsBindingInput { sourceType: 'cms'; collectionId: string; fieldId: string; } interface PageBindingInput { sourceType: 'page'; fieldKey: string; } interface LocaleBindingInput { sourceType: 'locale'; fieldKey: string; } interface LocaleItemBindingInput { sourceType: 'localeItem'; fieldKey: string; } type BindingInput = | PropBindingInput | CmsBindingInput | PageBindingInput | LocaleBindingInput | LocaleItemBindingInput; interface SetInstancePropEntry { propId: string; value: ResolvedValue | BindingInput | null; }