import type { FieldModification } from './FieldModification'; /** * WixData FieldModificationsBuilder type. * @internal */ export interface FieldModificationsBuilder { /** * Refines a patch operation to increment the specified field value by the specified parameter. * @public * @documentationMaturity preview * @param field - Field whose value is incremented. Nested fields can be specified using dot notation. For example: `address.street`. * @requiredField field * @param by - Value by which to increment the specified field. To decrement, specify a negative value. * @requiredField by * @returns Updated patch object. */ incrementField(field: string, by: number): Self; /** * Refines a patch operation to set the specified field to the specified value. * @public * @documentationMaturity preview * @param field - Field whose value is set. Nested fields can be specified using dot notation. For example: `address.street`. * @requiredField field * @param value - Value to set for the specified field. * @requiredField value * @returns Updated patch object. */ setField(field: string, value: any): Self; /** * Refines a patch operation to append the specified value to the specified array or multi-reference field. * @public * @documentationMaturity preview * @param field - Array or multi-reference field to append the specified value to. Nested fields can be specified using dot notation. For example: `address.street`. * @requiredField field * @param value - Value to append to the specified array or multi-reference field. * @requiredField value * @returns Updated patch object. */ appendToArray(field: string, value: any): Self; /** * Refines a patch operation to remove the first instance of the specified value from the specified array or multi-reference field. * @public * @documentationMaturity preview * @param field - Array or multi-reference field to remove the specified value from. Nested fields can be specified using dot notation. For example: `address.street`. * @requiredField field * @param value - Value whose first instance is removed from the specified array or multi-reference field. * @requiredField value * @returns Updated patch object. */ removeFromArray(field: string, value: any): Self; /** * Refines a patch operation to clear the specified field. * @public * @documentationMaturity preview * @param field - Field whose value is cleared. Nested fields can be specified using dot notation. For example: `address.street`. * @requiredField field * @returns Updated patch object. */ removeField(field: string): Self; } /** * WixData field modifications builder. * @internal */ export interface WixDataFieldModificationsBuilder extends FieldModificationsBuilder { /** Build the final array of field modifications */ build(): FieldModification[]; } /** * Creates a new field modifications builder. * @internal * * @example * ```ts title="Create field modifications" * import { FieldModificationsBuilder } from '@wix/data' * * const fieldModifications = FieldModificationsBuilder() * .setField('title', 'Updated title') * .incrementField('viewCount', 1) * .appendToArray('tags', 'featured') * .removeField('legacyField') * .build() * * const item = await wixData.patch('myCollection', 'itemId', fieldModifications) * ``` */ export declare const FieldModificationsBuilder: () => WixDataFieldModificationsBuilder; //# sourceMappingURL=WixDataFieldModificationsBuilder.d.ts.map