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AM,CAE9B;CACJ;AAED,qBAAa,oBAAqB,SAAQ,eAAe;IACrD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAEf,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAMtE,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED,IAAW,IAAI,IAAI,MAAM,CAExB;CACJ;AAED,qBAAa,6BAA8B,SAAQ,eAAe;IAC9D,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAS;gBAER,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAM3E,IAAW,MAAM,IAAI,MAAM,CAE1B;IAED,IAAW,UAAU,IAAI,MAAM,CAE9B;CACJ;AAED,qBAAa,8BAA+B,SAAQ,eAAe;IAC/D,OAAO,CAAC,uBAAuB,CAAS;IACxC,OAAO,CAAC,WAAW,CAAoB;gBAEpB,YAAY,EAAE,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB;IAMnG,IAAW,mBAAmB,IAAI,MAAM,CAEvC;IAED,IAAW,OAAO,IAAI,iBAAiB,CAEtC;CACJ;AAED,qBAAa,0BAA2B,SAAQ,eAAe;IAC3D,OAAO,CAAC,mBAAmB,CAAS;IACpC,OAAO,CAAC,WAAW,CAAoB;gBAEpB,YAAY,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB;IAM/F,IAAW,eAAe,IAAI,MAAM,CAEnC;IAED,IAAW,OAAO,IAAI,iBAAiB,CAEtC;CACJ","file":"ConnectionEvents.d.ts","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\r\n// Licensed under the MIT license.\r\n\r\n/* eslint-disable max-classes-per-file */\r\n\r\nimport { ConnectionMessage } from \"./ConnectionMessage.js\";\r\nimport { IStringDictionary } from \"./IDictionary.js\";\r\nimport { EventType, PlatformEvent } from \"./PlatformEvent.js\";\r\n\r\nexport class ServiceEvent extends PlatformEvent {\r\n private privJsonResult: string;\r\n\r\n public constructor(eventName: string, jsonstring: string, eventType: EventType = EventType.Info) {\r\n super(eventName, eventType);\r\n this.privJsonResult = jsonstring;\r\n }\r\n\r\n public get jsonString(): string {\r\n return this.privJsonResult;\r\n }\r\n}\r\n\r\nexport class ConnectionEvent extends PlatformEvent {\r\n private privConnectionId: string;\r\n\r\n public constructor(eventName: string, connectionId: string, eventType: EventType = EventType.Info) {\r\n super(eventName, eventType);\r\n this.privConnectionId = connectionId;\r\n }\r\n\r\n public get connectionId(): string {\r\n return this.privConnectionId;\r\n }\r\n}\r\n\r\nexport class ConnectionStartEvent extends ConnectionEvent {\r\n private privUri: string;\r\n private privHeaders: IStringDictionary<string>;\r\n\r\n public constructor(connectionId: string, uri: string, headers?: IStringDictionary<string>) {\r\n super(\"ConnectionStartEvent\", connectionId);\r\n this.privUri = uri;\r\n this.privHeaders = headers;\r\n }\r\n\r\n public get uri(): string {\r\n return this.privUri;\r\n }\r\n\r\n public get headers(): IStringDictionary<string> {\r\n return this.privHeaders;\r\n }\r\n}\r\n\r\nexport class ConnectionEstablishedEvent extends ConnectionEvent {\r\n public constructor(connectionId: string) {\r\n super(\"ConnectionEstablishedEvent\", connectionId);\r\n }\r\n}\r\n\r\nexport class ConnectionClosedEvent extends ConnectionEvent {\r\n private privReason: string;\r\n private privStatusCode: number;\r\n\r\n public constructor(connectionId: string, statusCode: number, reason: string) {\r\n super(\"ConnectionClosedEvent\", connectionId, EventType.Debug);\r\n this.privReason = reason;\r\n this.privStatusCode = statusCode;\r\n }\r\n\r\n public get reason(): string {\r\n return this.privReason;\r\n }\r\n\r\n public get statusCode(): number {\r\n return this.privStatusCode;\r\n }\r\n}\r\n\r\nexport class ConnectionErrorEvent extends ConnectionEvent {\r\n private readonly privMessage: string;\r\n private readonly privType: string;\r\n\r\n public constructor(connectionId: string, message: string, type: string) {\r\n super(\"ConnectionErrorEvent\", connectionId, EventType.Debug);\r\n this.privMessage = message;\r\n this.privType = type;\r\n }\r\n\r\n public get message(): string {\r\n return this.privMessage;\r\n }\r\n\r\n public get type(): string {\r\n return this.privType;\r\n }\r\n}\r\n\r\nexport class ConnectionEstablishErrorEvent extends ConnectionEvent {\r\n private privStatusCode: number;\r\n private privReason: string;\r\n\r\n public constructor(connectionId: string, statuscode: number, reason: string) {\r\n super(\"ConnectionEstablishErrorEvent\", connectionId, EventType.Error);\r\n this.privStatusCode = statuscode;\r\n this.privReason = reason;\r\n }\r\n\r\n public get reason(): string {\r\n return this.privReason;\r\n }\r\n\r\n public get statusCode(): number {\r\n return this.privStatusCode;\r\n }\r\n}\r\n\r\nexport class ConnectionMessageReceivedEvent extends ConnectionEvent {\r\n private privNetworkReceivedTime: string;\r\n private privMessage: ConnectionMessage;\r\n\r\n public constructor(connectionId: string, networkReceivedTimeISO: string, message: ConnectionMessage) {\r\n super(\"ConnectionMessageReceivedEvent\", connectionId);\r\n this.privNetworkReceivedTime = networkReceivedTimeISO;\r\n this.privMessage = message;\r\n }\r\n\r\n public get networkReceivedTime(): string {\r\n return this.privNetworkReceivedTime;\r\n }\r\n\r\n public get message(): ConnectionMessage {\r\n return this.privMessage;\r\n }\r\n}\r\n\r\nexport class ConnectionMessageSentEvent extends ConnectionEvent {\r\n private privNetworkSentTime: string;\r\n private privMessage: ConnectionMessage;\r\n\r\n public constructor(connectionId: string, networkSentTimeISO: string, message: ConnectionMessage) {\r\n super(\"ConnectionMessageSentEvent\", connectionId);\r\n this.privNetworkSentTime = networkSentTimeISO;\r\n this.privMessage = message;\r\n }\r\n\r\n public get networkSentTime(): string {\r\n return this.privNetworkSentTime;\r\n }\r\n\r\n public get message(): ConnectionMessage {\r\n return this.privMessage;\r\n }\r\n}\r\n"]}