@eclipse-ditto/ditto-javascript-client-dom
Version:
DOM implementation of Eclipse Ditto JavaScript API to be used in browsers.
77 lines • 2.48 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
*/
import { EntityModel } from './model';
import { Thing } from './things.model';
/**
* A generic server response to a request.
*/
export interface GenericResponse {
/** The status code of the response. */
status: number;
/** The body of the response. */
body: any;
/** The headers of the response inside a map. */
headers: Map<string, string>;
}
/**
* A generic server response to a request.
*/
export interface ErrorResponse {
/** The status code of the error response. */
status: number;
/** The body of the error response. */
body: any;
/** The headers of the error response inside a map. */
headers: Map<string, string>;
}
export declare class PutResponse<T> implements GenericResponse {
private readonly _value;
private readonly _status;
private readonly _headers;
constructor(_value: T | null, _status: number, _headers: Map<string, string>);
wasCreated(): boolean;
wasUpdated(): boolean;
get body(): T | null;
get status(): number;
get headers(): Map<string, string>;
}
export declare class BasicErrorResponse<T> implements ErrorResponse {
private readonly _value;
private readonly _status;
private readonly _headers;
constructor(_value: T | null, _status: number, _headers: Map<string, string>);
get body(): T | null;
get status(): number;
get headers(): Map<string, string>;
}
/**
* Representation of a response ot a search request
*/
export declare class SearchThingsResponse extends EntityModel {
private readonly _items;
private readonly _nextPageOffset?;
private readonly _cursor?;
constructor(_items: Thing[], _nextPageOffset?: number | undefined, _cursor?: string | undefined);
/**
* Parses a SearchThingsResponse.
*
* @param o - The object to parse.
* @returns The SearchThingsResponse
*/
static fromObject(o: any): SearchThingsResponse;
toObject(): object;
get items(): Thing[];
get nextPageOffset(): number;
get cursor(): string;
}
//# sourceMappingURL=response.d.ts.map