import { ExtensionSearchOptions } from './extension-search-options'; /** * Defines the contract object for extension errors */ export declare const enum ExtensionBrokerResponseErrorType { Unknown = 0, ExtensionTargetNotFound = 1, MethodNotFound = 2, EntryPointNotFound = 3, InstanceNotFound = 4, InvalidSearchOptions = 5, InvalidArgument = 6 } /** * Defines the contract object for extension errors */ export declare type ExtensionBrokerResponseError = ExtensionBrokerUnknownError | ExtensionBrokerExtensionTargetNotFoundError | ExtensionBrokerExtensionMethodNotFoundError | ExtensionBrokerExtensionMethodInvalidArgument | ExtensionBrokerEntryPointNotFoundError | ExtensionBrokerInstanceNotFoundError | ExtensionBrokerInvalidSearchOptionsError; /** * Defines An error object for more manageable extension broker error handeling */ export interface ExtensionBrokerResponseErrorBase { /** * The type of extension broker response error */ errorType: ExtensionBrokerResponseErrorType; } /** * Defines An error object for when an unknown error has occurred */ export interface ExtensionBrokerUnknownError extends ExtensionBrokerResponseErrorBase { /** * The type of extension broker response error */ errorType: ExtensionBrokerResponseErrorType.Unknown; /** * The original error object for this error */ error: any; } /** * Defines An error object for when an extension target cannot be found */ export interface ExtensionBrokerExtensionTargetNotFoundError extends ExtensionBrokerResponseErrorBase { /** * The type of extension broker response error */ errorType: ExtensionBrokerResponseErrorType.ExtensionTargetNotFound; /** * The extensionTargetId we were unable to find */ extensionTargetId: string; } /** * Defines An error object for when an method cannot be found */ export interface ExtensionBrokerExtensionMethodNotFoundError extends ExtensionBrokerResponseErrorBase { /** * The type of extension broker response error */ errorType: ExtensionBrokerResponseErrorType.MethodNotFound; /** * The method we were unable to find */ method: string; /** * The version of the method we were unable to find */ version: number; } /** * Defines An error object for when an methods argument is invalid */ export interface ExtensionBrokerExtensionMethodInvalidArgument extends ExtensionBrokerResponseErrorBase { /** * The type of extension broker response error */ errorType: ExtensionBrokerResponseErrorType.InvalidArgument; /** * The method we were trying to call */ method: string; /** * The version of the method we were trying to call */ version: number; /** * The name of the argument that is invalid */ argumentName: string; /** * The reason that this argument is invalid. */ argumentInvalidReason?: string; } /** * Defines An error object for when an entry point cannot be found */ export interface ExtensionBrokerEntryPointNotFoundError extends ExtensionBrokerResponseErrorBase { /** * The type of extension broker response error */ errorType: ExtensionBrokerResponseErrorType.EntryPointNotFound; /** * The entryPointId we were unable to find */ entryPointId: string; } /** * Defines An error object for when an extension instance cannot be found */ export interface ExtensionBrokerInstanceNotFoundError extends ExtensionBrokerResponseErrorBase { /** * The type of extension broker response error */ errorType: ExtensionBrokerResponseErrorType.InstanceNotFound; /** * The instanceId we were unable to find */ instanceId: string; } /** * Defines An error object for when an extension instance cannot be found */ export interface ExtensionBrokerInvalidSearchOptionsError extends ExtensionBrokerResponseErrorBase { /** * The type of extension broker response error */ errorType: ExtensionBrokerResponseErrorType.InvalidSearchOptions; /** * The instanceId we were unable to find */ searchOptions: ExtensionSearchOptions; }