micro:bit connection library
    Preparing search index...

    Type Alias ProgressCallback

    ProgressCallback: (stage: ProgressStage, progress?: number) => void

    Progress callback for tracking operation stages (connection and flashing).

    Type Declaration

      • (stage: ProgressStage, progress?: number): void
      • Parameters

        • stage: ProgressStage

          The current stage of the operation

        • Optionalprogress: number

          Optional progress value (0-1) for PartialFlashing and FullFlashing stages. Initializing, FindingDevice, CheckingBond (only for native platforms), ResettingDevice (only for native platforms), and Connecting stages are called once without progress values to indicate stage entry.

        Returns void

    const progressCallback = (stage, progress) => {
    if (progress !== undefined) {
    console.log(`${stage}: ${Math.round(progress * 100)}%`);
    } else {
    console.log(`Stage: ${stage}`);
    }
    };