/** * Task property update methods: text, notes, planned time, due date, stream, snooze */ import type { TaskNotesContent, UpdateTaskNotesOptions, UpdateTaskPayload } from '../../types/index.js'; import { TaskLifecycleMethods } from './task-lifecycle.js'; export declare abstract class TaskUpdateMethods extends TaskLifecycleMethods { /** * Updates a task's snooze date for scheduling operations * * This method provides a unified interface for all task scheduling operations: * - Schedule a task to a specific date * - Move a task to the backlog (unschedule) * - Reschedule a task from one date to another * * @param taskId - The ID of the task to reschedule * @param newDay - Target date in YYYY-MM-DD format, or null to move to backlog * @param options - Additional options for the operation * @returns The update result with success status * @throws SunsamaAuthError if not authenticated or request fails * * @example * ```typescript * // Schedule a task to tomorrow * const result = await client.updateTaskSnoozeDate('taskId123', '2025-06-16'); * * // Move a task to the backlog (unschedule) * const result = await client.updateTaskSnoozeDate('taskId123', null); * * // Schedule with specific timezone * const result = await client.updateTaskSnoozeDate('taskId123', '2025-06-16', { * timezone: 'America/New_York' * }); * * // Get full response payload instead of limited response * const result = await client.updateTaskSnoozeDate('taskId123', '2025-06-16', { * limitResponsePayload: false * }); * ``` */ updateTaskSnoozeDate(taskId: string, newDay: string | null, options?: { timezone?: string; limitResponsePayload?: boolean; }): Promise; /** * Updates the notes of a task * * This method allows you to update task notes by providing content in either HTML or Markdown * format. The other format will be automatically generated using conversion utilities. It uses * the existing collaborative editing snapshot from the task to ensure proper synchronization * with the Sunsama editor. * * @param taskId - The ID of the task to update * @param content - The new notes content in either HTML or Markdown format * @param options - Additional options for the operation * @returns The update result with success status * @throws SunsamaAuthError if not authenticated, task not found, or no collaborative snapshot available * * @example * ```typescript * // Update task notes with HTML content * const result = await client.updateTaskNotes('taskId123', { * html: '

Updated notes with bold text

' * }); * * // Update task notes with Markdown content * const result = await client.updateTaskNotes('taskId123', { * markdown: 'Updated notes with **bold** text' * }); * * // Get full response payload instead of limited response * const result = await client.updateTaskNotes('taskId123', { * html: '

New notes

' * }, { limitResponsePayload: false }); * * // Provide a specific collaborative snapshot to use * const task = await client.getTaskById('taskId123'); * const result = await client.updateTaskNotes('taskId123', { * markdown: 'New notes' * }, { collabSnapshot: task.collabSnapshot }); * ``` */ updateTaskNotes(taskId: string, content: TaskNotesContent, options?: UpdateTaskNotesOptions): Promise; /** * Updates the planned time (time estimate) for a task * * This method allows you to update the time estimate for a task in minutes. * The time estimate represents how long you expect the task to take. * * @param taskId - The ID of the task to update * @param timeEstimateMinutes - The planned time in minutes (will be converted to seconds for the API) * @param limitResponsePayload - Whether to limit the response payload size (defaults to true) * @returns The update result with success status * @throws SunsamaAuthError if not authenticated or request fails * * @example * ```typescript * // Set task time estimate to 30 minutes * const result = await client.updateTaskPlannedTime('taskId123', 30); * * // Set time estimate with full response payload * const result = await client.updateTaskPlannedTime('taskId123', 45, false); * * // Clear time estimate (set to 0) * const result = await client.updateTaskPlannedTime('taskId123', 0); * ``` */ updateTaskPlannedTime(taskId: string, timeEstimateMinutes: number, limitResponsePayload?: boolean): Promise; /** * Updates the due date for a task * * This method allows you to set or clear a task's due date. The due date represents * when the task should be completed and can be used for deadline tracking and planning. * * @param taskId - The ID of the task to update * @param dueDate - The due date as Date, ISO string, or null to clear the due date * @param limitResponsePayload - Whether to limit the response payload size (defaults to true) * @returns The update result with success status * @throws SunsamaAuthError if not authenticated or request fails * * @example * ```typescript * // Set task due date to a specific date * const result = await client.updateTaskDueDate('taskId123', new Date('2025-06-21')); * * // Set due date with ISO string * const result = await client.updateTaskDueDate('taskId123', '2025-06-21T04:00:00.000Z'); * * // Clear the due date * const result = await client.updateTaskDueDate('taskId123', null); * * // Get full response payload instead of limited response * const result = await client.updateTaskDueDate('taskId123', new Date('2025-06-21'), false); * ``` */ updateTaskDueDate(taskId: string, dueDate: Date | string | null, limitResponsePayload?: boolean): Promise; /** * Updates the text/title of a task * * This method allows you to update the main text or title of a task. You can optionally * specify a recommended stream ID for the task. * * @param taskId - The ID of the task to update * @param text - The new text/title for the task * @param options - Additional options for the operation * @returns The update result with success status * @throws SunsamaAuthError if not authenticated or request fails * * @example * ```typescript * // Update task text to a new title * const result = await client.updateTaskText('taskId123', 'Updated task title'); * * // Update with recommended stream ID * const result = await client.updateTaskText('taskId123', 'Task with stream', { * recommendedStreamId: 'stream-id-123' * }); * * // Get full response payload instead of limited response * const result = await client.updateTaskText('taskId123', 'New title', { * limitResponsePayload: false * }); * ``` */ updateTaskText(taskId: string, text: string, options?: { recommendedStreamId?: string | null; limitResponsePayload?: boolean; }): Promise; /** * Updates the stream assignment for a task * * This method allows you to assign a task to a specific stream (project/category). * A stream represents a project, area of focus, or organizational category in Sunsama. * * @param taskId - The ID of the task to update * @param streamId - The ID of the stream to assign the task to * @param limitResponsePayload - Whether to limit the response payload size (defaults to true) * @returns The update result with success status * @throws SunsamaAuthError if not authenticated or request fails * * @example * ```typescript * // Assign task to a specific stream * const result = await client.updateTaskStream('taskId123', 'streamId456'); * * // Get full response payload instead of limited response * const result = await client.updateTaskStream('taskId123', 'streamId456', false); * ``` */ updateTaskStream(taskId: string, streamId: string, limitResponsePayload?: boolean): Promise; } //# sourceMappingURL=task-updates.d.ts.map