import { TBaseComponent, TComponent } from '@namiml/sdk-core'; import { TButtonContainer, TProductContainer, TResponsiveGrid, TRepeatingGrid, TTimelineRail } from "@namiml/sdk-core"; import { TConditionalComponent } from "@namiml/sdk-core"; import { TPaywallMedia } from "@namiml/sdk-core"; import { PaywallSKU } from "@namiml/sdk-core"; import { PaywallContextProvider } from "../ContextProvider"; type ReplacementsType = { [type: string]: any extends Array ? never : any; }; export declare function interpolate(value: T, replacements: ReplacementsType): T; export declare function getInterpolatedButtonComponents(contextProvider: PaywallContextProvider, component: TButtonContainer): TComponent[]; export declare function getSkuButtonComponents(contextProvider: PaywallContextProvider, items: PaywallSKU[], component: TProductContainer, mediaList?: { [mediaName: string]: Pick; }): [boolean, TComponent[]][]; /** * A repeating-list section. `key` is the group key (empty string when grouping is * inactive). `header` is null when grouping is inactive; otherwise it is the * interpolated group-header component-list. `items` holds one component-list per repeated item. */ export type TRepeatingListSection = { key: string; header: TComponent[] | null; items: TComponent[][]; }; /** * Effective grid-column span for a slot in a feed with a fixed column count. * "all" spans the full row; invalid values (non-integer, < 1, unknown strings) * fall back to 1; values above the column count clamp to it. */ export declare function clampSlotColumnSpan(raw: unknown, columns: number): number; /** * Partitions a repeating grid's loop source into sections. Blocks failing any * `loopSourceConditions` assertion are dropped first (evaluated per block, so * `${block.*}` and `${launch.*}` smart text both resolve). With no * `groupBy`/`groupHeaderTemplate` a single header-less section is returned; with grouping, * one section per group key in first-appearance order. Consumed by `nami-repeating-grid` * so headers can render as full-width rows above their group's items. */ export declare function getRepeatingListSections(contextProvider: PaywallContextProvider, component: TResponsiveGrid | TRepeatingGrid): TRepeatingListSection[]; /** * Flattened view of {@link getRepeatingListSections} that interleaves header and item * component-lists. Preserves the historical `TComponent[][]` contract used by `nami-responsive-grid`. */ export declare function getRepeatingListBlocks(contextProvider: PaywallContextProvider, component: TResponsiveGrid | TRepeatingGrid): TComponent[][]; export declare function conditionComponentMatches(contextProvider: PaywallContextProvider, condition: TConditionalComponent, sku?: PaywallSKU): boolean; export declare function withOverrides(contextProvider: PaywallContextProvider, { conditionAttributes, ...component }: T, sku?: PaywallSKU): T; export declare function valueFromSmartText(contextProvider: PaywallContextProvider, value: T, sku?: PaywallSKU, block?: any): T; /** * Evaluates `max(a, b)`, e.g. `"max(${state.safeAreaBottom}, 40)"`, so an author can floor a * safe-area inset at a minimum (NAM-5329; same contract as Apple NAM-4613 and Android NAM-4614). * * Exactly two arguments, each a plain number or a single `${...}` token. An argument that does * not resolve to a number contributes 0. Returns undefined for anything that is not a * well-formed two-argument `max(...)`, so the caller resolves it as ordinary smart text. */ export declare function resolveMaxExpression(value: string, resolveToken: (argument: string) => unknown): number | undefined; export declare const totalTimeSpentOnPaywall: (contextProvider: PaywallContextProvider) => number | undefined; export declare const rgbaToHex: (rgba?: string) => string | null; export declare const sameColors: (color1?: string, color2?: string) => boolean; export type TResolvedTimeline = Required> & Pick; export declare function resolveTimelineDefaults(timeline: TTimelineRail): TResolvedTimeline; export type TTimelineDotStyle = { dotSize: number; dotColor: string; dotCornerRadius: number; dotBorderWidth: number; dotBorderColor: string; }; /** * Per-group dot style: base timeline values overlaid with any conditionAttributes * whose assertions pass for this group. `${group.key}` is pre-resolved via * interpolate before evaluation, so the assertion values become literals and * conditionComponentMatches evaluates them against the context state cleanly. */ export declare function resolveTimelineDotStyle(contextProvider: PaywallContextProvider, timeline: TTimelineRail, groupKey: string): TTimelineDotStyle; export type TTimelineSegment = { top: number; height: number; }; export declare function computeTimelineSegments(args: { railHeight: number; lineTopOffset: number; lineBottomOffset: number; dotLineSpacing: number; dots: Array<{ centerY: number; size: number; }>; }): TTimelineSegment[]; export {};