import { type Signal } from '@wix/services-definitions/core-services/signals'; import { LinkItemParams, type WixDataItem } from './cms-collection-service.js'; export type { WixDataItem }; /** * Service definition for the CMS Item service. */ export declare const CmsItemServiceDefinition: string & { __api: { /** Reactive signal containing the individual item */ itemSignal: Signal; /** Reactive signal indicating if the item is currently being loaded for the first time (no data exists yet) */ loadingSignal: Signal; /** Reactive signal indicating if any fetch operation is currently in progress */ fetchingSignal: Signal; /** Reactive signal containing any error message, or null if no error */ errorSignal: Signal; /** The collection ID for this item */ collectionId: string; /** Function to update the current item */ updateItem: (itemData: Partial) => Promise; /** Function to delete the current item */ deleteItem: () => Promise; /** Function to link the current item to referenced items */ linkItem: (params: LinkItemParams) => Promise; /** Function to unlink the current item from referenced items */ unlinkItem: (params: LinkItemParams) => Promise; /** Function to fetch options for a field (referenced items or distinct values) */ fetchFieldOptions: (fieldId: string) => Promise; /** Function to create a new item in a referenced collection */ createReferencedCollectionItem: (referenceFieldId: string, itemData: Partial) => Promise; }; __config: {}; isServiceDefinition?: boolean; } & { /** Reactive signal containing the individual item */ itemSignal: Signal; /** Reactive signal indicating if the item is currently being loaded for the first time (no data exists yet) */ loadingSignal: Signal; /** Reactive signal indicating if any fetch operation is currently in progress */ fetchingSignal: Signal; /** Reactive signal containing any error message, or null if no error */ errorSignal: Signal; /** The collection ID for this item */ collectionId: string; /** Function to update the current item */ updateItem: (itemData: Partial) => Promise; /** Function to delete the current item */ deleteItem: () => Promise; /** Function to link the current item to referenced items */ linkItem: (params: LinkItemParams) => Promise; /** Function to unlink the current item from referenced items */ unlinkItem: (params: LinkItemParams) => Promise; /** Function to fetch options for a field (referenced items or distinct values) */ fetchFieldOptions: (fieldId: string) => Promise; /** Function to create a new item in a referenced collection */ createReferencedCollectionItem: (referenceFieldId: string, itemData: Partial) => Promise; }; /** * Configuration interface required to initialize the CmsItemService. */ export interface CmsItemServiceConfig { /** The collection ID to load the item from */ collectionId: string; /** The item ID to load */ itemId: string; /** Optional pre-loaded item to initialize the service with */ item?: WixDataItem; /** List of field IDs for single reference fields to include */ singleRefFieldIds?: string[]; /** List of field IDs for multi reference fields to include */ multiRefFieldIds?: string[]; } /** * Implementation of the CMS Item service that manages reactive item data. */ export declare const CmsItemServiceImplementation: import("@wix/services-definitions").ServiceFactory; /** Reactive signal indicating if the item is currently being loaded for the first time (no data exists yet) */ loadingSignal: Signal; /** Reactive signal indicating if any fetch operation is currently in progress */ fetchingSignal: Signal; /** Reactive signal containing any error message, or null if no error */ errorSignal: Signal; /** The collection ID for this item */ collectionId: string; /** Function to update the current item */ updateItem: (itemData: Partial) => Promise; /** Function to delete the current item */ deleteItem: () => Promise; /** Function to link the current item to referenced items */ linkItem: (params: LinkItemParams) => Promise; /** Function to unlink the current item from referenced items */ unlinkItem: (params: LinkItemParams) => Promise; /** Function to fetch options for a field (referenced items or distinct values) */ fetchFieldOptions: (fieldId: string) => Promise; /** Function to create a new item in a referenced collection */ createReferencedCollectionItem: (referenceFieldId: string, itemData: Partial) => Promise; }; __config: {}; isServiceDefinition?: boolean; } & { /** Reactive signal containing the individual item */ itemSignal: Signal; /** Reactive signal indicating if the item is currently being loaded for the first time (no data exists yet) */ loadingSignal: Signal; /** Reactive signal indicating if any fetch operation is currently in progress */ fetchingSignal: Signal; /** Reactive signal containing any error message, or null if no error */ errorSignal: Signal; /** The collection ID for this item */ collectionId: string; /** Function to update the current item */ updateItem: (itemData: Partial) => Promise; /** Function to delete the current item */ deleteItem: () => Promise; /** Function to link the current item to referenced items */ linkItem: (params: LinkItemParams) => Promise; /** Function to unlink the current item from referenced items */ unlinkItem: (params: LinkItemParams) => Promise; /** Function to fetch options for a field (referenced items or distinct values) */ fetchFieldOptions: (fieldId: string) => Promise; /** Function to create a new item in a referenced collection */ createReferencedCollectionItem: (referenceFieldId: string, itemData: Partial) => Promise; }, CmsItemServiceConfig>; /** * Result type for loading CMS item service configuration. */ export type CmsItemServiceConfigResult = {}; /** * Loads initial data for the CMS Item service. */ export declare const loadCmsItemServiceInitialData: (collectionId: string, itemId: string, singleRefFieldIds?: string[], multiRefFieldIds?: string[]) => Promise; /** * Service binding helper that bundles everything together for the service manager. */ export declare const cmsItemServiceBinding: >[typeof CmsItemServiceDefinition]; }>(servicesConfigs: T) => readonly [string & { __api: { /** Reactive signal containing the individual item */ itemSignal: Signal; /** Reactive signal indicating if the item is currently being loaded for the first time (no data exists yet) */ loadingSignal: Signal; /** Reactive signal indicating if any fetch operation is currently in progress */ fetchingSignal: Signal; /** Reactive signal containing any error message, or null if no error */ errorSignal: Signal; /** The collection ID for this item */ collectionId: string; /** Function to update the current item */ updateItem: (itemData: Partial) => Promise; /** Function to delete the current item */ deleteItem: () => Promise; /** Function to link the current item to referenced items */ linkItem: (params: LinkItemParams) => Promise; /** Function to unlink the current item from referenced items */ unlinkItem: (params: LinkItemParams) => Promise; /** Function to fetch options for a field (referenced items or distinct values) */ fetchFieldOptions: (fieldId: string) => Promise; /** Function to create a new item in a referenced collection */ createReferencedCollectionItem: (referenceFieldId: string, itemData: Partial) => Promise; }; __config: {}; isServiceDefinition?: boolean; } & { /** Reactive signal containing the individual item */ itemSignal: Signal; /** Reactive signal indicating if the item is currently being loaded for the first time (no data exists yet) */ loadingSignal: Signal; /** Reactive signal indicating if any fetch operation is currently in progress */ fetchingSignal: Signal; /** Reactive signal containing any error message, or null if no error */ errorSignal: Signal; /** The collection ID for this item */ collectionId: string; /** Function to update the current item */ updateItem: (itemData: Partial) => Promise; /** Function to delete the current item */ deleteItem: () => Promise; /** Function to link the current item to referenced items */ linkItem: (params: LinkItemParams) => Promise; /** Function to unlink the current item from referenced items */ unlinkItem: (params: LinkItemParams) => Promise; /** Function to fetch options for a field (referenced items or distinct values) */ fetchFieldOptions: (fieldId: string) => Promise; /** Function to create a new item in a referenced collection */ createReferencedCollectionItem: (referenceFieldId: string, itemData: Partial) => Promise; }, import("@wix/services-definitions").ServiceFactory; /** Reactive signal indicating if the item is currently being loaded for the first time (no data exists yet) */ loadingSignal: Signal; /** Reactive signal indicating if any fetch operation is currently in progress */ fetchingSignal: Signal; /** Reactive signal containing any error message, or null if no error */ errorSignal: Signal; /** The collection ID for this item */ collectionId: string; /** Function to update the current item */ updateItem: (itemData: Partial) => Promise; /** Function to delete the current item */ deleteItem: () => Promise; /** Function to link the current item to referenced items */ linkItem: (params: LinkItemParams) => Promise; /** Function to unlink the current item from referenced items */ unlinkItem: (params: LinkItemParams) => Promise; /** Function to fetch options for a field (referenced items or distinct values) */ fetchFieldOptions: (fieldId: string) => Promise; /** Function to create a new item in a referenced collection */ createReferencedCollectionItem: (referenceFieldId: string, itemData: Partial) => Promise; }; __config: {}; isServiceDefinition?: boolean; } & { /** Reactive signal containing the individual item */ itemSignal: Signal; /** Reactive signal indicating if the item is currently being loaded for the first time (no data exists yet) */ loadingSignal: Signal; /** Reactive signal indicating if any fetch operation is currently in progress */ fetchingSignal: Signal; /** Reactive signal containing any error message, or null if no error */ errorSignal: Signal; /** The collection ID for this item */ collectionId: string; /** Function to update the current item */ updateItem: (itemData: Partial) => Promise; /** Function to delete the current item */ deleteItem: () => Promise; /** Function to link the current item to referenced items */ linkItem: (params: LinkItemParams) => Promise; /** Function to unlink the current item from referenced items */ unlinkItem: (params: LinkItemParams) => Promise; /** Function to fetch options for a field (referenced items or distinct values) */ fetchFieldOptions: (fieldId: string) => Promise; /** Function to create a new item in a referenced collection */ createReferencedCollectionItem: (referenceFieldId: string, itemData: Partial) => Promise; }, CmsItemServiceConfig>, CmsItemServiceConfig | undefined];