import { type FilterShape, type VariationMode } from './filters.js'; import type { PreviewContext } from '../infer.js'; /** The content type, DAM and forms probe for one piece of content. */ export declare function getMetadataQuery(shape: FilterShape, variationMode?: VariationMode, withForms?: boolean, publishedOnly?: boolean): string; /** * The content types that really own a `composition` field. * * Kept in its own document on purpose. Graph truncates `possibleTypes` to just * `_Section` when this introspection shares a query with a data field, which * silently produces the opposite of the intended answer. */ export declare const GET_SECTION_TYPES_QUERY = "\nquery GetSectionTypes {\n sectionTypes: __type(name: \"_ISection\") {\n possibleTypes {\n name\n }\n }\n}\n"; /** * Whether the application registered a section of its own. * * The schema lookup only changes the outcome for such a type: a form container * is handled by the fallback, and everything else is not a section either way. */ export declare const hasOwnSectionTypes: () => boolean; /** Content type key of the section Optimizely Forms uses for a form. */ export declare const FORM_CONTAINER_TYPE = "OptiFormsContainerData"; /** * Collects the form containers in a response whose steps did not arrive. * * Graph resolves a section's `composition` only when that section is the * content being asked for. Reached through a content area the field comes back * empty, so `liftSectionNodes` finds nothing to lift and the container is left * with no `nodes` at all — which is what tells the two cases apart. A form that * genuinely has no steps still gets `nodes: []` and is not collected here. */ export declare function findUnresolvedForms(value: any, found?: any[], seen?: Set): any[]; /** The ancestors of one piece of content. */ export declare function getLinksQuery(opName: string, shape: FilterShape, publishedOnly?: boolean): string; /** The children of one piece of content. */ export declare function getItemsQuery(opName: string, shape: FilterShape, publishedOnly?: boolean): string; export type GetLinksResponse = { _Content: { item: { _id: string | null; _metadata: { path?: string[]; }; _link: { _Page: { items: Array<{ _metadata?: { key: string; sortOrder?: number; displayName?: string; locale?: string; types: string[]; url?: { base?: string; hierarchical?: string; default?: string; }; }; }>; }; }; }; }; }; /** * Removes GraphQL alias prefixes from object keys in the response data. * * For objects with a `__typename` property, removes the `{typename}__` prefix * from all field names (e.g., `ContentType__p1` becomes `p1`). * This reverses the aliasing applied in query generation to prevent field * name collisions in GraphQL fragments. * * Traverses all keys in an object recursively, processing arrays and nested objects. * * @param obj - The object to process (typically a GraphQL response) * @returns A new object with prefixes removed, or the original value for primitives * * Note: this function is exported only on this level for testing purposes. * It should not be exported in the user-facing API */ export declare function removeTypePrefix(obj: any): any; /** * Puts a section's child nodes where the renderer looks for them. * * Inside an experience, a section's children arrive as `content.nodes`. On * their own (e.g. previewing a shared block, or a section within a form), * they arrive as `composition.nodes` instead, though `InferSection` expects * `nodes` either way. An experience also has a `composition`, so we only lift * when the root node is itself a section. */ export declare function liftSectionNodes(item: any): any; /** Adds an extra `__context` property next to each `__typename` property */ export declare function decorateWithContext(obj: any, context: PreviewContext): any;