/**
 * Shared API utilities for handling Todoist API responses and common operations
 */
import { TodoistApi } from "@doist/todoist-api-typescript";
/**
 * Generic interface for Todoist API responses that may return data in different formats
 */
export interface TodoistAPIResponse<T> {
    results?: T[];
    data?: T[];
}
/**
 * Extracts array data from various Todoist API response formats.
 * Handles both direct arrays and object responses with 'results' or 'data' properties.
 *
 * @param result - The API response which could be an array or an object containing arrays
 * @returns Array of items of type T, or empty array if no data found
 *
 * @example
 * ```typescript
 * const tasks = extractArrayFromResponse<TodoistTask>(apiResponse);
 * const comments = extractArrayFromResponse<TodoistComment>(commentResponse);
 * ```
 */
export declare function extractArrayFromResponse<T>(result: unknown): T[];
/**
 * Interface for comment response data from Todoist API
 */
export interface CommentResponse {
    content: string;
    attachment?: {
        fileName: string;
        fileType: string;
    };
    postedAt?: string;
    taskId?: string;
    projectId?: string;
}
/**
 * Interface for comment creation data
 */
export interface CommentCreationData {
    content: string;
    taskId: string;
    attachment?: {
        fileName: string;
        fileUrl: string;
        fileType: string;
    };
}
/**
 * Validates that a response object has the expected structure
 *
 * @param response - The API response to validate
 * @param expectedFields - Array of field names that should exist in the response
 * @returns boolean indicating if the response is valid
 */
export declare function validateApiResponse(response: unknown, expectedFields: string[]): boolean;
/**
 * Creates a cache key from an object by serializing its properties
 *
 * @param prefix - Prefix for the cache key
 * @param params - Object containing parameters to include in the key
 * @returns Standardized cache key string
 */
export declare function createCacheKey(prefix: string, params?: Record<string, unknown>): string;
/**
 * Formats a Todoist task for display in responses
 *
 * @param task - The task object to format
 * @returns Formatted string representation of the task
 */
export declare function formatTaskForDisplay(task: {
    id?: string;
    content: string;
    description?: string;
    due?: {
        string: string;
    } | null;
    deadline?: {
        date: string;
    } | null;
    priority?: number;
    labels?: string[];
    assigneeId?: string | null;
    assignedByUid?: string | null;
    responsibleUid?: string | null;
    duration?: {
        amount: number;
        unit: string;
    } | null;
}): string;
/**
 * Safely extracts string value from unknown input
 *
 * @param value - The value to extract as string
 * @param defaultValue - Default value if extraction fails
 * @returns String value or default
 */
export declare function safeStringExtract(value: unknown, defaultValue?: string): string;
/**
 * Safely extracts number value from unknown input
 *
 * @param value - The value to extract as number
 * @param defaultValue - Default value if extraction fails
 * @returns Number value or default
 */
export declare function safeNumberExtract(value: unknown, defaultValue?: number): number;
/**
 * Resolves a project identifier to a project ID.
 * If the input is already a valid project ID, returns it as-is.
 * If the input is a project name, searches for the project and returns its ID.
 *
 * @param todoistClient - The Todoist API client
 * @param projectIdentifier - Either a project ID or project name
 * @returns The resolved project ID
 * @throws Error if project name is not found
 */
export declare function resolveProjectIdentifier(todoistClient: {
    getProjects: () => Promise<unknown>;
}, projectIdentifier: string): Promise<string>;
/**
 * Extracts the API token from a TodoistApi client instance.
 * This is needed for direct API calls (e.g., Sync API) that bypass the SDK.
 *
 * Note: This relies on internal implementation details of the TodoistApi client.
 * If the library's internal structure changes, this may need to be updated.
 *
 * @param client - The TodoistApi client instance
 * @returns The API token string
 * @throws AuthenticationError if token cannot be extracted
 */
export declare function extractApiToken(client: TodoistApi): string;
