/** * Subtask management methods */ import type { UpdateTaskPayload } from '../../types/index.js'; import { TaskUpdateMethods } from './task-updates.js'; export declare abstract class SubtaskMethods extends TaskUpdateMethods { /** * Creates subtasks for a task * * This registers new subtask IDs with the parent task. After calling this, * use updateSubtaskTitle to set the title for each subtask. * * @param taskId - The parent task ID * @param subtaskIds - Array of subtask IDs to register (24-char hex MongoDB ObjectId format) * @param limitResponsePayload - Whether to limit response size (defaults to true) * @returns The update result with success status and optionally the updated task * @throws SunsamaAuthError if not authenticated or request fails * * @example * ```typescript * // Create subtasks with auto-generated IDs * const subtaskId1 = SunsamaClient.generateTaskId(); * const subtaskId2 = SunsamaClient.generateTaskId(); * await client.createSubtasks('parentTaskId', [subtaskId1, subtaskId2]); * * // Then set their titles * await client.updateSubtaskTitle('parentTaskId', subtaskId1, 'First subtask'); * await client.updateSubtaskTitle('parentTaskId', subtaskId2, 'Second subtask'); * ``` */ createSubtasks(taskId: string, subtaskIds: string[], limitResponsePayload?: boolean): Promise; /** * Updates a subtask's title * * @param taskId - The parent task ID * @param subtaskId - The subtask ID to update * @param title - The new subtask title * @returns The update result with success status and optionally the updated task * @throws SunsamaAuthError if not authenticated or request fails * * @example * ```typescript * // Update subtask title * await client.updateSubtaskTitle('parentTaskId', 'subtaskId', 'Buy milk'); * ``` */ updateSubtaskTitle(taskId: string, subtaskId: string, title: string): Promise; /** * Marks a subtask as complete * * @param taskId - The parent task ID * @param subtaskId - The subtask ID to mark as complete * @param completedDate - ISO 8601 timestamp when completed (optional, defaults to now) * @param limitResponsePayload - Whether to limit response size (defaults to true) * @returns The update result with success status and optionally the updated task * @throws SunsamaAuthError if not authenticated or request fails * * @example * ```typescript * // Mark subtask as complete with current timestamp * await client.completeSubtask('parentTaskId', 'subtaskId'); * * // Mark subtask as complete with specific timestamp * await client.completeSubtask('parentTaskId', 'subtaskId', '2024-01-15T10:00:00Z'); * ``` */ completeSubtask(taskId: string, subtaskId: string, completedDate?: string, limitResponsePayload?: boolean): Promise; /** * Marks a subtask as incomplete (uncompletes it) * * @param taskId - The parent task ID * @param subtaskId - The subtask ID to mark as incomplete * @param limitResponsePayload - Whether to limit response size (defaults to true) * @returns The update result with success status and optionally the updated task * @throws SunsamaAuthError if not authenticated or request fails * * @example * ```typescript * // Mark subtask as incomplete * await client.uncompleteSubtask('parentTaskId', 'subtaskId'); * ``` */ uncompleteSubtask(taskId: string, subtaskId: string, limitResponsePayload?: boolean): Promise; /** * Convenience method to create a subtask with a title in one call * * This is a convenience wrapper around createSubtasks and updateSubtaskTitle. * * @param taskId - The parent task ID * @param title - The subtask title * @returns The subtask ID and the update result * @throws SunsamaAuthError if not authenticated or request fails * * @example * ```typescript * // Create a subtask with title in one call * const { subtaskId, result } = await client.addSubtask('parentTaskId', 'Buy milk'); * console.log('Created subtask:', subtaskId); * * // Later, mark it complete * await client.completeSubtask('parentTaskId', subtaskId); * ``` */ addSubtask(taskId: string, title: string): Promise<{ subtaskId: string; result: UpdateTaskPayload; }>; } //# sourceMappingURL=subtasks.d.ts.map