Merge pull request #31166 from schultzp2020/constructor-parameters
refactor: convert constructor parameter properties for erasableSyntaxOnly compatibility
This commit is contained in:
@@ -27,11 +27,18 @@ export class ObservableConfigProxy implements Config {
|
||||
return new ObservableConfigProxy(undefined, undefined, abortController);
|
||||
}
|
||||
|
||||
private readonly parent?: ObservableConfigProxy;
|
||||
private readonly parentKey?: string;
|
||||
private readonly abortController?: AbortController;
|
||||
|
||||
private constructor(
|
||||
private readonly parent?: ObservableConfigProxy,
|
||||
private readonly parentKey?: string,
|
||||
private readonly abortController?: AbortController,
|
||||
parent?: ObservableConfigProxy,
|
||||
parentKey?: string,
|
||||
abortController?: AbortController,
|
||||
) {
|
||||
this.parent = parent;
|
||||
this.parentKey = parentKey;
|
||||
this.abortController = abortController;
|
||||
if (parent && !parentKey) {
|
||||
throw new Error('parentKey is required if parent is set');
|
||||
}
|
||||
|
||||
@@ -37,10 +37,13 @@ export interface StaticConfigSourceOptions {
|
||||
|
||||
/** @internal */
|
||||
class StaticObservableConfigSource implements ConfigSource {
|
||||
constructor(
|
||||
private readonly data: Observable<JsonObject>,
|
||||
private readonly context: string,
|
||||
) {}
|
||||
private readonly data: Observable<JsonObject>;
|
||||
private readonly context: string;
|
||||
|
||||
constructor(data: Observable<JsonObject>, context: string) {
|
||||
this.data = data;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
async *readConfigData(
|
||||
options?: ReadConfigDataOptions | undefined,
|
||||
@@ -131,10 +134,16 @@ export class StaticConfigSource implements ConfigSource {
|
||||
return new StaticConfigSource(data, context);
|
||||
}
|
||||
|
||||
private readonly promise: JsonObject | PromiseLike<JsonObject>;
|
||||
private readonly context: string;
|
||||
|
||||
private constructor(
|
||||
private readonly promise: JsonObject | PromiseLike<JsonObject>,
|
||||
private readonly context: string,
|
||||
) {}
|
||||
promise: JsonObject | PromiseLike<JsonObject>,
|
||||
context: string,
|
||||
) {
|
||||
this.promise = promise;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
async *readConfigData(): AsyncConfigSourceGenerator {
|
||||
yield { configs: [{ data: await this.promise, context: this.context }] };
|
||||
|
||||
Reference in New Issue
Block a user