import type { LibraryRegistrationMap } from '../library/component-library'; import type { ComponentPropsMap, MountsMap } from '../library/component-props'; import type { RuleCMSWidgetData } from '../models/widget-data'; import type { WidgetResolveContentType, WidgetSelection, WidgetSelectionParams } from '../widget-selection/types'; export type RuleCMSWidgetMode = 'clientFetch' | 'preFetched'; export interface RuleCMSWidgetProps { /** * Staging/production: published key (`{environmentId}---{widgetKey}`). * Development (`dev.` token): the live widget key (`widget-...`). * Omit when `rulesetPublishedKey` picks the widget. */ publishedKey?: string; /** Staging/production: `{environmentId}---ruleset-…`. Development: the `ruleset-…` key. */ rulesetPublishedKey?: string; /** Any JSON object sent to the resolve endpoint. The server flattens nested objects. */ params?: WidgetSelectionParams; /** * `false` skips minting an anonymous id. A string is used as `params.anonId`. * Omit it and the widget stores one for the process (or in `localStorage` on web). */ anonymousId?: string | false; /** Plain published-key GET used when the resolve request fails with a network error or 5xx. */ fallbackPublishedKey?: string; /** Defaults to `text/plain` so the browser skips the CORS preflight. */ contentType?: WidgetResolveContentType; token?: string; endpoint?: string; libraries?: LibraryRegistrationMap; componentProps?: ComponentPropsMap; /** * Copied onto every card as `placeholderValues`, unless that column's * `componentProps` entry already sets the key (including `null` to opt out). */ placeholderValues?: unknown; mounts?: MountsMap; mode?: RuleCMSWidgetMode; initialData?: RuleCMSWidgetData; loading?: React.ReactNode; error?: (error: unknown) => React.ReactNode; /** Called when a ruleset resolve returns a selection. */ onSelection?: (selection: WidgetSelection) => void; /** Composer canvas: ignore overlay layers, widget-level hide, and placeholder filling. Default false. */ isComposeMode?: boolean; } /** * Fetches (or accepts pre-fetched) RuleCMS widget data and renders it. * * Mirror of `@rulecms/widget-react`'s `RuleCMSWidget`. */ export declare function RuleCMSWidget({ publishedKey, rulesetPublishedKey, params, anonymousId, fallbackPublishedKey, contentType, token, endpoint, libraries, componentProps, placeholderValues, mounts, mode, initialData, loading, error: errorBuilder, onSelection, isComposeMode, }: RuleCMSWidgetProps): string | number | boolean | Iterable | import("react").JSX.Element | null; //# sourceMappingURL=rule-cms-widget.d.ts.map