import type { WixDataItem } from './cms-collection-service.js'; import type { DataCollection } from '@wix/auto_sdk_data_collections'; /** * Transforms item data fields based on the collection schema. * Uses the schema to determine field types and apply appropriate transformers and validators. * If no schema is provided, returns data unchanged (graceful degradation). */ export declare function transformFields(itemData: Partial, collectionSchema: DataCollection | null): Partial; /** * Loads collection schema with error handling. * Returns null if schema cannot be loaded. */ export declare function loadCollectionSchema(collectionId: string): Promise; export interface GetReferencedCollectionOptions { referenceFieldId: string; getSchema: () => Promise; } /** * Gets the referenced collection ID for a reference field. * Returns null if the field is not found or is not a reference field. */ export declare function getReferencedCollectionId(options: GetReferencedCollectionOptions): Promise; /** * Gets options for a field. * If the field is a reference field, returns the items from the referenced collection. * If the field is a regular field, returns the distinct values for that field. */ export interface FetchFieldOptionsOptions { collectionId: string; fieldId: string; getSchema: () => Promise; } export declare function fetchFieldOptions(options: FetchFieldOptionsOptions): Promise; /** * Creates a new item in a referenced collection. * Gets the referenced collection ID from the reference field, loads its schema, * transforms the item data, and inserts the item. */ export declare function createReferencedCollectionItem(options: GetReferencedCollectionOptions & { itemData: Partial; }): Promise;