Skip to content

Commit 51d0acc

Browse files
authored
refactor!: rename interface starting with I Maj (#203)
1 parent d39905f commit 51d0acc

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ spinner.succeed("All done !");
7777
7878
## API
7979

80-
<details><summary>constructor(options?: ISpinnerOptions)</summary>
80+
<details><summary>constructor(options?: SpinnerOptions)</summary>
8181
<br>
8282

8383
Create a new Spinner. The **options** payload is described by the following TypeScript interface:
8484

8585
```ts
86-
export interface ISpinnerOptions {
86+
export interface SpinnerOptions {
8787
/**
8888
* Spinner name (from cli-spinners lib)
8989
*
@@ -114,14 +114,14 @@ new Spinner({ name: "dots2" });
114114

115115
</details>
116116

117-
<details><summary>start(text?: string, options?: IStartOptions): Spinner</summary>
117+
<details><summary>start(text?: string, options?: StartOptions): Spinner</summary>
118118

119119
Start the spinner and optionaly write the text passed as first parameter.
120120

121121
The **options** payload is described by the following TypeScript interface:
122122

123123
```ts
124-
export interface IStartOptions {
124+
export interface StartOptions {
125125
withPrefix?: string;
126126
}
127127
```

src/Spinner.class.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const kLogSymbols = process.platform !== "win32" || process.env.CI || process.en
2727
{ success: styleText("green", "✔"), error: styleText("red", "✖") } :
2828
{ success: styleText("green", "√"), error: styleText("red", "×") };
2929

30-
export interface ISpinnerOptions {
30+
export interface SpinnerOptions {
3131
/**
3232
* Spinner name (from cli-spinners lib)
3333
*
@@ -48,7 +48,7 @@ export interface ISpinnerOptions {
4848
verbose?: boolean;
4949
}
5050

51-
export interface IStartOptions {
51+
export interface StartOptions {
5252
withPrefix?: string;
5353
}
5454

@@ -71,7 +71,7 @@ export class Spinner extends EventEmitter {
7171
#spinnerPos = 0;
7272
#startTime: number;
7373

74-
constructor(options: ISpinnerOptions = {}) {
74+
constructor(options: SpinnerOptions = {}) {
7575
super();
7676
this.#verbose = options.verbose ?? true;
7777
if (!this.#verbose) {
@@ -169,7 +169,7 @@ export class Spinner extends EventEmitter {
169169
readline.moveCursor(this.stream, -(stringLength(line)), moveCursorPos);
170170
}
171171

172-
start(text?: string, options: IStartOptions = {}) {
172+
start(text?: string, options: StartOptions = {}) {
173173
this.#started = true;
174174
this.text = text;
175175
if (typeof options.withPrefix === "string") {

src/computeWithSpinner.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
// Import Internal Dependencies
22
import {
33
Spinner,
4-
type ISpinnerOptions
4+
type SpinnerOptions
55
} from "./Spinner.class.js";
66

77
// CONSTANTS
88
// eslint-disable-next-line func-style
99
const kDefaultSafeLogger = () => undefined;
1010

11-
export interface IComputeSpinnerOptions {
11+
export interface ComputeSpinnerOptions {
1212
text: string;
13-
spinner?: Omit<ISpinnerOptions, "verbose">;
13+
spinner?: Omit<SpinnerOptions, "verbose">;
1414
withPrefix?: string;
1515
}
1616

17-
export interface ISpinnerLoggerOptions {
17+
export interface SpinnerLoggerOptions {
1818
success?: (elapsedTime: number) => string;
1919
fail?: (error: Error) => string;
2020
}
2121

2222
export async function computeWithSpinner<T = void>(
2323
asynchronousOp: (spinner: Spinner) => Promise<T>,
24-
options: IComputeSpinnerOptions,
25-
logs: ISpinnerLoggerOptions = {}
24+
options: ComputeSpinnerOptions,
25+
logs: SpinnerLoggerOptions = {}
2626
): Promise<T> {
2727
const { success = kDefaultSafeLogger, fail = kDefaultSafeLogger } = logs;
2828
const spinner = new Spinner(options.spinner)

0 commit comments

Comments
 (0)