blob: 28e701ec0a9074c5b6c3b76b1b3ef9463a47d418 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
import { BridgeSettings, IBridgeConstraints } from './daemon-rpc-types';
import makeLocationBuilder, { ILocationBuilder } from './relay-location-builder';
export default class BridgeSettingsBuilder {
private payload: Partial<IBridgeConstraints> = {};
public build(): BridgeSettings {
if (this.payload.location) {
return {
normal: {
location: this.payload.location,
},
};
} else {
throw new Error('Unsupported configuration');
}
}
get location(): ILocationBuilder<BridgeSettingsBuilder> {
return makeLocationBuilder(this, (location) => {
this.payload.location = location;
});
}
}
|