@eclipse-ditto/ditto-javascript-client-dom
Version:
DOM implementation of Eclipse Ditto JavaScript API to be used in browsers.
72 lines • 2.07 kB
TypeScript
/*!
* Copyright (c) 2019 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
export { ApiVersion, Channel, DittoHeaders, ReservedDittoProtocolDittoHeaders, DittoProtocolEnvelope, DittoProtocolResponse, DefaultDittoProtocolEnvelope, DefaultDittoProtocolResponse };
declare enum ApiVersion {
V2 = 2
}
declare enum Channel {
twin = "twin",
live = "live"
}
/**
* Represents headers that can be used with Ditto.
*/
interface DittoHeaders extends Map<string, string> {
}
/**
* Known and reserved headers in Ditto.
*/
declare enum ReservedDittoProtocolDittoHeaders {
CORRELATION_ID = "correlation-id"
}
interface DittoProtocolEnvelope {
topic: string;
headers: object;
path: string;
value: object;
fields?: string;
toJson(): string;
}
declare class DefaultDittoProtocolEnvelope implements DittoProtocolEnvelope {
topic: string;
headers: object;
path: string;
value: object;
fields?: string;
constructor(topic: string, headers: object, path: string, value: object, fields?: string);
toJson(): string;
}
interface DittoProtocolResponse {
topic: string;
path: string;
status: number;
headers: {
[key: string]: any;
};
value: any;
correlationId(): string | undefined;
}
declare class DefaultDittoProtocolResponse implements DittoProtocolResponse {
topic: string;
headers: {
[key: string]: any;
};
path: string;
value: object;
status: number;
constructor(topic: string, headers: object, path: string, value: any, status: number);
private static tryParseJson;
static fromJson(json: string): DittoProtocolResponse;
correlationId(): string | undefined;
}
//# sourceMappingURL=ditto-protocol.d.ts.map