Skip to content

Commit

Permalink
fix bad merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret committed May 23, 2024
1 parent b7d203d commit 6e4a0ab
Showing 1 changed file with 8 additions and 31 deletions.
39 changes: 8 additions & 31 deletions cli/spinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,38 +90,12 @@ export class Spinner {

/**
* The message to display next to the spinner.
* This can be changed while the spinner is active.
*
* @example Usage
* ```ts no-eval
* import { Spinner } from "@std/cli/spinner";
*
* const loadingText = "Loading...";
* const startTime = new Date().getTime();
* const spinner = new Spinner({ message: loadingText, color: "yellow" });
* spinner.start();
*
* setInterval(() => {
* const durationMs = new Date().getTime() - startTime;
* const durationSec = Math.round(durationMs / 1_000);
* spinner.message = `${loadingText} (${durationSec}s)`;
* }, 1_000);
* ```
*/
message: string;

#interval: number;
#color?: Color;
#intervalId: number | undefined;
#active = false;

/**
* The message to display next to the spinner.
* This can be changed while the spinner is active.
*
* @example
* ```ts
* import { Spinner } from "@std/cli/spinner";
*
* const spinner = new Spinner({ message: "Working..." });
* spinner.start();
*
Expand All @@ -136,7 +110,12 @@ export class Spinner {
* console.log("Done!");
* ```
*/
message: string = "";
message: string;

#interval: number;
#color?: Color;
#intervalId: number | undefined;
#active = false;

/**
* Creates a new spinner.
Expand Down Expand Up @@ -167,12 +146,10 @@ export class Spinner {
*
* Providing `undefined` will use the default terminal color.
*
*
* @example
* ```ts
* @param value Color to set.
*
* @example Usage
* ```ts no-eval
* import { Spinner } from "@std/cli/spinner";
*
* const spinner = new Spinner({ message: "Loading...", color: "yellow" });
Expand Down

0 comments on commit 6e4a0ab

Please sign in to comment.