@eclipse-ditto/ditto-javascript-client-dom
Version:
DOM implementation of Eclipse Ditto JavaScript API to be used in browsers.
43 lines • 1.23 kB
JavaScript
/*!
* 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 { ApiVersion } from '../model/ditto-protocol';
export { AbstractBuilder };
/**
* Abstract implementation of the relevant builder steps that are probably the same for all builder implementations.
*/
class AbstractBuilder {
constructor() {
this.apiVersion = ApiVersion.V2;
}
withTls() {
this.tls = true;
return this;
}
withoutTls() {
this.tls = false;
return this;
}
withCustomPath(path) {
this.customPath = path;
return this;
}
withDomain(url) {
this.domain = url;
return this;
}
withAuthProvider(authProvider, ...additionalAuthProviders) {
this.authProviders = [authProvider, ...additionalAuthProviders];
return this.finalize();
}
}
//# sourceMappingURL=builder-steps.js.map