Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli/spinner): export private type aliases used in public API #4012

Merged
merged 1 commit into from Dec 21, 2023
Merged

fix(cli/spinner): export private type aliases used in public API #4012

merged 1 commit into from Dec 21, 2023

Conversation

jsejcksn
Copy link
Contributor

Ref: #3968

I saw this new feature in the release notes for 0.210.0 and noticed that there's no way to access the Color type alias which is used by the public options property at SpinnerOptions.color. This exports that union and one of its members which was also still private.

deno_std/cli/spinner.ts

Lines 41 to 58 in 5ddf32a

/** Options for {@linkcode Spinner}. */
export interface SpinnerOptions {
/**
* The sequence of characters to be iterated through for animation.
*
* @default {["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]}
*/
spinner?: string[];
/** The message to display next to the spinner. */
message?: string;
/** The time between each frame of the spinner.
*
* @default {75}
*/
interval?: number;
/** The color of the spinner. Defaults to the default terminal color. */
color?: Color;
}

deno_std/cli/spinner.ts

Lines 13 to 27 in 5ddf32a

// This is a hack to allow us to use the same type for both the color name and an ANSI escape code.
// ref: https://github.com/microsoft/TypeScript/issues/29729#issuecomment-460346421
// deno-lint-ignore ban-types
type Ansi = string & {};
type Color =
| "black"
| "red"
| "green"
| "yellow"
| "blue"
| "magenta"
| "cyan"
| "white"
| "gray"
| Ansi;

@jsejcksn jsejcksn requested a review from kt3k as a code owner December 21, 2023 16:51
@github-actions github-actions bot added the cli label Dec 21, 2023
@iuioiua
Copy link
Collaborator

iuioiua commented Dec 21, 2023

Towards #3764 and #3878.

Copy link
Collaborator

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Thank you.

@iuioiua iuioiua merged commit fd31167 into denoland:main Dec 21, 2023
12 checks passed
@jsejcksn jsejcksn deleted the patch-1 branch December 22, 2023 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants