import _ from 'lodash'; import type { UID, Schema, Data, Modules } from '@strapi/types'; type Input = Modules.Documents.Params.Data.Input; type LoadedComponents = Data.Entity>; type SingleComponentValue = Schema.Attribute.ComponentValue; type RepeatableComponentValue = Schema.Attribute.ComponentValue; type ComponentValue = SingleComponentValue | RepeatableComponentValue; type DynamicZoneValue = Schema.Attribute.DynamicZoneValue; type ComponentBody = { [key: string]: ComponentValue | DynamicZoneValue; }; declare const omitComponentData: _.CurriedFunction2, Partial>>; declare const createComponents: >(uid: TUID, data: TData) => Promise; declare const getComponents: (uid: TUID, entity: { id: Modules.EntityService.Params.Attribute.ID; }) => Promise>; declare const updateComponents: >>(uid: TUID, entityToUpdate: { id: Modules.EntityService.Params.Attribute.ID; }, data: TData) => Promise; declare const deleteComponents: , string>>>(uid: TUID, entityToDelete: TEntity, { loadComponents }?: { loadComponents?: boolean | undefined; }) => Promise; declare const deleteComponent: (uid: TUID, componentToDelete: Data.Component) => Promise; declare const assignComponentData: _.CurriedFunction3, ComponentBody & Partial>>; /** ************************* Component relation handling for document operations ************************** */ /** * Find the parent entry of a component instance. * * Given a component model, a specific component instance id, and the list of * possible parent content types (those that can embed this component), * this function checks each parent's *_cmps join table to see if the component * instance is linked to a parent entity. * * - Returns the parent uid, parent table name, and parent id if found. * - Returns null if no parent relationship exists. */ declare const findComponentParent: (componentSchema: Schema.Component, componentId: number | string, parentSchemasForComponent: (Schema.ContentType | Schema.Component)[], opts?: { trx?: any; }) => Promise<{ uid: string; table: string; parentId: number | string; } | null>; /** * Finds content types that contain the given component and have draft & publish enabled. */ declare const getParentSchemasForComponent: (componentSchema: Schema.Component) => Array; /** * Creates a filter function for component relations that can be passed to the generic * unidirectional relations utility */ declare const createComponentRelationFilter: () => (relation: Record, model: Schema.Component | Schema.ContentType, trx: any) => Promise; export { omitComponentData, assignComponentData, getComponents, createComponents, updateComponents, deleteComponents, deleteComponent, createComponentRelationFilter, findComponentParent, getParentSchemasForComponent, }; //# sourceMappingURL=components.d.ts.map