+20
-6
@@ -59,5 +59,7 @@ import {type SpinnerName} from 'cli-spinners'; | ||
| Set to `false` to disable the color. | ||
| @default 'cyan' | ||
| */ | ||
| readonly color?: Color | boolean; | ||
| readonly color?: Color | false | undefined; | ||
@@ -165,3 +167,3 @@ /** | ||
| */ | ||
| failText?: string | ((error: Error) => string) | undefined; | ||
| failText?: string | ((error: unknown) => string) | undefined; | ||
@@ -213,3 +215,3 @@ /** | ||
| */ | ||
| prefixText: string; | ||
| prefixText: string | PrefixTextGenerator; | ||
@@ -221,8 +223,10 @@ /** | ||
| */ | ||
| suffixText: string; | ||
| suffixText: string | SuffixTextGenerator; | ||
| /** | ||
| Change the spinner color. | ||
| Set to `false` to disable the color. | ||
| */ | ||
| color: Color | boolean; | ||
| color: Color | false | undefined; | ||
@@ -250,2 +254,12 @@ /** | ||
| /** | ||
| A boolean indicating whether the spinner and log text are enabled. | ||
| */ | ||
| isEnabled: boolean; | ||
| /** | ||
| A boolean indicating whether all output is suppressed. | ||
| */ | ||
| isSilent: boolean; | ||
| /** | ||
| The interval between each frame. | ||
@@ -328,3 +342,3 @@ | ||
| @returns The spinner instance text. | ||
| @returns The rendered frame text. | ||
| */ | ||
@@ -331,0 +345,0 @@ frame(): string; |
+3
-3
@@ -511,3 +511,3 @@ import process from 'node:process'; | ||
| start(text) { | ||
| if (text) { | ||
| if (text !== undefined) { | ||
| this.text = text; | ||
@@ -622,3 +622,3 @@ } | ||
| const actionIsFunction = typeof action === 'function'; | ||
| const actionIsPromise = typeof action.then === 'function'; | ||
| const actionIsPromise = typeof action?.then === 'function'; | ||
@@ -634,3 +634,3 @@ if (!actionIsFunction && !actionIsPromise) { | ||
| failSymbol, | ||
| } = typeof options === 'object' | ||
| } = (typeof options === 'object' && options !== null) | ||
| ? options | ||
@@ -637,0 +637,0 @@ : {}; |
+1
-1
| { | ||
| "name": "ora", | ||
| "version": "9.4.0", | ||
| "version": "9.4.1", | ||
| "description": "Elegant terminal spinner", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
+12
-4
@@ -79,5 +79,5 @@ # ora | ||
| Type: `string | boolean`\ | ||
| Type: `string | false`\ | ||
| Default: `'cyan'`\ | ||
| Values: `'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray' | boolean` | ||
| Values: `'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray' | false` | ||
@@ -178,2 +178,10 @@ The color of the spinner. Set to `false` to disable coloring. | ||
| #### .isEnabled <sup>get/set</sup> | ||
| A boolean indicating whether the spinner and log text are enabled. | ||
| #### .isSilent <sup>get/set</sup> | ||
| A boolean indicating whether all output is suppressed. | ||
| #### .interval <sup>get</sup> | ||
@@ -272,3 +280,3 @@ | ||
| Type: `Promise | ((spinner: ora.Ora) => Promise)` | ||
| Type: `Promise | ((spinner: Ora) => Promise)` | ||
@@ -291,3 +299,3 @@ #### options | ||
| Type: `string | ((error: Error) => string) | undefined` | ||
| Type: `string | ((error: unknown) => string) | undefined` | ||
@@ -294,0 +302,0 @@ The new text of the spinner when the promise is rejected. |
40673
1.38%813
1.25%428
1.9%