import type { Id as IdType } from '../id.js'; import type { CreateResult, UpdateCommentParams } from '../types.js'; export type ReplyToContext = { /** Ancestor entity ID from an existing reply-to relation. */ entityId: string; /** Space ID associated with the ancestor reply target. */ spaceId: string; /** Existing reply-to relation position used for parent-to-root ordering. */ position: string | null; }; export type CreateCommentOpsParams = { id?: IdType | string; content: string; replyTo: { entityId: IdType | string; spaceId: IdType | string; }; resolved?: boolean; replyToRelations?: ReplyToContext[]; }; /** * Builds create-comment ops. * * The direct `replyTo` target is always included. If `replyToRelations` are * provided, they are sorted by position and appended after the direct parent so * nested comments preserve a parent-to-root reply chain. * * @example * Create a comment on an entity. * * ```ts * import { comments } from '@geoprotocol/geo-sdk/ops'; * * const { id, ops } = comments.create({ * content: 'Looks good to me', * replyTo: { entityId, spaceId }, * }); * ``` * * @example * Create a nested comment when reply context is already available. * * ```ts * const { ops } = comments.create({ * content: 'Replying to the parent comment', * replyTo: { entityId: parentCommentId, spaceId }, * replyToRelations: [ * { entityId: rootEntityId, spaceId, position: 'a0' }, * ], * }); * ``` * * @param params Comment content, reply target, optional ID, resolved state, and optional ancestor reply context. * @returns Comment entity ID and create ops. * @throws When the comment ID or reply target IDs are invalid. */ export declare const create: ({ id: providedId, content, replyTo, resolved, replyToRelations, }: CreateCommentOpsParams) => CreateResult; /** * Builds update-comment ops. * * If `content` is supplied, both markdown content and the derived comment name * are updated. If `resolved` is supplied, the resolved property is updated. * * @example * ```ts * import { comments } from '@geoprotocol/geo-sdk/ops'; * * const { ops } = comments.update({ * id: commentId, * content: 'Updated comment text', * resolved: true, * }); * ``` * * @param params Comment ID plus content and/or resolved state to update. * @returns Comment entity ID and update ops. * @throws When the comment ID is invalid. */ export declare const update: ({ id, content, resolved }: UpdateCommentParams) => CreateResult; //# sourceMappingURL=comments.d.ts.map