import { Guid } from '@cratis/fundamentals'; import { ICommandResult } from './ICommandResult'; import { ValidationResult } from '../validation/ValidationResult'; import { Constructor } from '@cratis/fundamentals'; type OnSuccess = ((response: TResponse) => void) | (() => void); type OnFailed = ((commandResult: CommandResult) => void) | (() => void); type OnException = (messages: string[], stackTrace: string) => void; type OnUnauthorized = () => void; type OnValidationFailure = (validationResults: ValidationResult[]) => void; type ServerCommandResult = { correlationId: string; isSuccess: boolean; isAuthorized: boolean; isValid: boolean; hasExceptions: boolean; validationResults: { severity: number; message: string; members: string[]; state: object; }[]; exceptionMessages: string[]; exceptionStackTrace: string; response: any; }; export declare class CommandResult implements ICommandResult { static empty: CommandResult; static failed: (exceptionMessages: string[]) => CommandResult; readonly correlationId: Guid; readonly isSuccess: boolean; readonly isAuthorized: boolean; readonly isValid: boolean; readonly hasExceptions: boolean; readonly validationResults: ValidationResult[]; readonly exceptionMessages: string[]; readonly exceptionStackTrace: string; readonly response?: TResponse; constructor(result: ServerCommandResult, responseInstanceType: Constructor | undefined, isResponseTypeEnumerable: boolean); onSuccess(callback: OnSuccess): CommandResult; onFailed(callback: OnFailed): CommandResult; onException(callback: OnException): CommandResult; onUnauthorized(callback: OnUnauthorized): CommandResult; onValidationFailure(callback: OnValidationFailure): CommandResult; } export {}; //# sourceMappingURL=CommandResult.d.ts.map