@rockcarver/frodo-lib
Version:
A library to manage ForgeRock Identity Cloud tenants, ForgeOps deployments, and classic deployments.
110 lines • 4.1 kB
TypeScript
import { State } from '../shared/State';
/**
* Handles data / messages output. The caller decides and implements how
* the data and messages are handled, by implementing the handler function
* on its side. `handler` is optional, and if not included by the caller,
* the data and messages will be lost.
*
* @param {string | unknown} message The string message to return
* @param {string} [type=text] "text", "info", "warn", "error" or "data". All but
* type="data" will be written to stderr.
* @param {boolean} [newline=true] Whether to add a newline at the end of message
* messages returned
*/
export declare function printMessage({ message, type, newline, state, }: {
message: string | object;
type?: string;
newline?: boolean;
state: State;
}): void;
/**
* Prints an error message from an error object and an optional custom message
*
* @param error error object
*/
export declare function printError({ error, message, state, }: {
error: Error;
message?: string;
state: State;
}): void;
/**
* Handles verbose output. The caller decides and implements how
* the messages are handled, by implementing the handler function
* on its side. Implementing and registering a `handler` is optional.
*
* @param {string | unknown} message The verbose output message
*/
export declare function verboseMessage({ message, state, }: {
message: string | object;
state: State;
}): void;
/**
* Handles debug output. The caller decides and implements how
* the messages are handled, by implementing the handler function
* on its side. Implementing and registering a `handler` is optional.
*
* @param {string | object} message The debug output message
*/
export declare function debugMessage({ message, state, }: {
message: string | object;
state: State;
}): void;
/**
* Handles curlirize output. The caller decides and implements how
* the messages are handled, by implementing the handler function
* on its side. Implementing and registering a `handler` is optional.
*
* @param {string} message The curlirize output message
*/
export declare function curlirizeMessage({ message, state, }: {
message: string;
state: State;
}): void;
export type ProgressIndicatorType = 'determinate' | 'indeterminate';
/**
* Calls a callback on client to create a progress indicator.
* The actual implementation of the indicator is left to the client
* Two types of indicators are supported:
* - determinate: should be used when the process completion rate
* can be detected (example: progress bar showing percentage or count)
* - indeterminate: used when progress isn’t detectable, or if
* it’s not necessary to indicate how long an activity will take.
* (example: spinner showing progress, but not quantifying the progress)
*
* Example:
* [========================================] 100% | 49/49 | Analyzing journey - transactional_auth
*
* @param {Number} total The total number of entries to track progress for
* @param {String} message optional progress bar message
* @param {String} type optional type of progress indicator. default is 'determinate'
*
*/
export declare function createProgressIndicator({ total, message, type, state, }: {
total: number;
message?: string;
type?: ProgressIndicatorType;
state: State;
}): string;
/**
* Updates the progress indicator with new data/updated status.
* @param {string} message optional message to show with the indicator
*
*/
export declare function updateProgressIndicator({ id, message, state, }: {
id: string;
message?: string;
state: State;
}): void;
export type ProgressIndicatorStatusType = 'none' | 'success' | 'warn' | 'fail';
/**
* Stop and hide the progress indicator
* @param {string} message optional message to show with the indicator
* @param {string} status one of 'none', 'success', 'warn', 'fail'
*/
export declare function stopProgressIndicator({ id, message, status, state, }: {
id: string;
message?: string;
status?: ProgressIndicatorStatusType;
state: State;
}): void;
//# sourceMappingURL=Console.d.ts.map