`distributionSelected` on the `ProgressReporter` interface currently takes five positional parameters, three of which are optional and only meaningful together:
distributionSelected(
dataset: Dataset,
distribution: Distribution,
importedFrom?: Distribution,
importDuration?: number,
tripleCount?: number,
): void
`importedFrom` acts as a discriminant — when present, `importDuration` and `tripleCount` apply; when absent, neither does. This makes the call sites fragile (callers must pass `undefined` in the right positions) and the signature hard to extend.
Proposed change
Replace the trailing optional parameters with an options object or explicit overloads, e.g.:
distributionSelected(
dataset: Dataset,
distribution: Distribution,
imported?: {
from: Distribution;
duration?: number;
tripleCount?: number;
},
): void
This requires updating:
- `ProgressReporter` interface in `@lde/pipeline`
- `ConsoleReporter` in `@lde/pipeline-console-reporter`
- All call sites that invoke `distributionSelected`
`distributionSelected` on the `ProgressReporter` interface currently takes five positional parameters, three of which are optional and only meaningful together:
`importedFrom` acts as a discriminant — when present, `importDuration` and `tripleCount` apply; when absent, neither does. This makes the call sites fragile (callers must pass `undefined` in the right positions) and the signature hard to extend.
Proposed change
Replace the trailing optional parameters with an options object or explicit overloads, e.g.:
This requires updating: