Standard result interface for all operations

interface OperationResult<T> {
    data?: T;
    error?: string;
    metadata: {
        executionTime: number;
        filesAffected?: string[];
        linesProcessed?: number;
        operation: string;
        timestamp: Date;
    };
    success: boolean;
}

Type Parameters

  • T = any

    The type of data returned on success

Hierarchy (view full)

Properties

data?: T

Data returned by the operation (if successful)

error?: string

Error message (if operation failed)

metadata: {
    executionTime: number;
    filesAffected?: string[];
    linesProcessed?: number;
    operation: string;
    timestamp: Date;
}

Operation metadata for debugging and monitoring

Type declaration

  • executionTime: number

    Time taken to execute the operation (in milliseconds)

  • OptionalfilesAffected?: string[]

    List of files that were affected by the operation

  • OptionallinesProcessed?: number

    Number of lines processed during the operation

  • operation: string

    Name of the operation performed

  • timestamp: Date

    When the operation was executed

success: boolean

Whether the operation completed successfully