UNPKG

dt-app

Version:

The Dynatrace App Toolkit is a tool you can use from your command line to create, develop, and deploy apps on your Dynatrace environment.

112 lines (111 loc) 3.27 kB
import type { Options } from 'ora'; import ora from 'ora'; /** * Pauses the spinner if it is running */ declare function pauseMultiSpinner(): void; /** * Resumes the spinner if it was paused */ declare function resumeMultiSpinner(): void; /** * Stops the {@link multiSpinner}, aborts all {@link concurrentSpinners} and clears the interval of {@link updateMultiSpinner} */ declare function stopMultiSpinner(): void; /** * Ora Spinner Wrapper */ export interface Spinner { /** * Getter for the text of the spinner */ get text(): string; /** * Setter for the text of the spinner */ set text(text: string); /** * Start the spinner. * @param text - Set the current text. * @returns The spinner instance. */ start(text?: string): this; /** * Stops the spinner * @param text stop text for the spinner * @param stopOptions {@link ora.PersistOptions} * @returns The spinner instance. */ stop(text?: string, stopOptions?: ora.PersistOptions): this; /** * Aborts the spinner without printing anything * @returns The spinner instance. */ abort(): this; /** * Stops the spinner with info state * @param text info text for the spinner * @returns The spinner instance. */ info(text?: string): this; /** * Stops the spinner with succeed state * @param text succeed text for the spinner * @returns The spinner instance. */ succeed(text?: string): this; /** * Stops the spinner with fail state * @param text fail text for the spinner * @returns The spinner instance. */ fail(text?: string): this; /** * Stops the spinner with warn state * @param text warn text for the spinner * @returns The spinner instance. */ warn(text?: string): this; } export declare const SpinnerService: { /** * Creates an inactive spinner. * @param options - Optional {@link Options} for the spinner. * @returns A new Spinner instance. */ readonly create: (options?: Omit<Options, "spinner">) => Spinner; /** * Creates and starts a new spinner. * @param text - Optional text to be displayed. * @param options - Optional {@link Options} for the spinner. * @returns A new Spinner instance. */ readonly start: (text?: string, options?: Omit<Options, "spinner" | "text">) => Spinner; /** * Pauses all running spinners. */ readonly pause: typeof pauseMultiSpinner; /** * Resumes all paused spinners. */ readonly resume: typeof resumeMultiSpinner; /** * Resets all running or idle spinners. */ readonly reset: typeof stopMultiSpinner; /** * Marks all spinners as succeeded with optional text. * @param text - Optional text to be displayed. */ readonly successAll: (text?: string) => void; /** * Marks all spinners as failed with optional text. * @param text - Optional text to be displayed. */ readonly failAll: (text?: string) => void; readonly disable: () => void; readonly enable: () => void; readonly getInterval: () => number; readonly _getMockedSpinner: (text?: string) => Spinner; }; export {};