import type { LucidModel, LucidRow } from '@adonisjs/lucid/types/model'; import type { JsonApiRegistry } from './registry.ts'; import type { ResourceIdentifier } from './types.ts'; export type RelationshipAction = 'replace' | 'add' | 'remove'; /** * Resolves a relationship by name, accepting both the Lucid relation name * and its kebab-cased URL segment (received-comments → receivedComments). * Returns the booted relation; use relation.relationName for Lucid calls. * * A relation the resource does not expose is reported as missing rather than * forbidden, so a hidden relation cannot be told apart from one that was * never defined. The registry is required so a new call site cannot reach a * relation without passing the visibility rule. */ export declare function getRelationOrFail(Model: LucidModel, name: string, registry: JsonApiRegistry): import("@adonisjs/lucid/types/relations").RelationshipsContract; /** * Applies a relationship-endpoint write (PATCH/POST/DELETE * /:id/relationships/:name) to a Lucid row. */ export declare function updateRelationship(row: LucidRow, name: string, registry: JsonApiRegistry, body: unknown, action: RelationshipAction): Promise; /** * Loads (or reloads) a relation and returns its current linkage. */ export declare function fetchLinkage(row: LucidRow, name: string, registry: JsonApiRegistry): Promise;