The onResultsChange callback in src/index.d.ts has a loosely typed parameter:
onResultsChange: ({ type: string }) => void;
This should be a union type matching the MeasurementConfig types to provide better type safety:
onResultsChange: ({ type: 'download' | 'upload' | 'latency' | 'packetLoss' }) => void;
or
onResultsChange: (change: { type: MeasurementConfig['type'] }) => void;