UNPKG

@qodalis/cli-core

Version:

Core Angular CLI for @qodalis extensions.

294 lines (293 loc) 7.14 kB
import { ITerminalInitOnlyOptions, ITerminalOptions } from '@xterm/xterm'; export type CliProcessCommand = { /** * The command that was entered */ command: string; /** * The data that was entered */ data?: any; /** * The chain of commands that were entered */ chainCommands: string[]; /** * The raw command that was entered */ rawCommand: string; /** * The value of the command */ value?: string; /** * The arguments that were entered */ args: Record<string, any>; }; export declare enum CliForegroundColor { Black = "\u001B[30m", Red = "\u001B[31m", Green = "\u001B[32m", Yellow = "\u001B[33m", Blue = "\u001B[34m", Magenta = "\u001B[35m", Cyan = "\u001B[36m", White = "\u001B[37m", Reset = "\u001B[0m" } export declare enum CliBackgroundColor { Black = "\u001B[40m", Red = "\u001B[41m", Green = "\u001B[42m", Yellow = "\u001B[43m", Blue = "\u001B[44m", Magenta = "\u001B[45m", Cyan = "\u001B[46m", White = "\u001B[47m" } export declare enum CliIcon { CheckIcon = "\u2714", CrossIcon = "\u2718", InfoIcon = "\u2139", WarningIcon = "\u26A0", QuestionMark = "?", Exclamation = "\u2757", Ellipsis = "\u2026", Dot = "\u2022", Bullet = "\u2023", ArrowRight = "\u2192", ArrowLeft = "\u2190", ArrowUp = "\u2191", ArrowDown = "\u2193", ArrowRightFilled = "\u25B6", ArrowLeftFilled = "\u25C0", ArrowUpFilled = "\u25B2", ArrowDownFilled = "\u25BC", DoubleArrowRight = "\u00BB", DoubleArrowLeft = "\u00AB", Star = "\u2605", StarEmpty = "\u2606", Plus = "+", Minus = "-", Progress = "\u23F3", Success = "\u2705", Failure = "\u274C", Clock = "\u23F0", Timer = "\u23F1", Alarm = "\uD83D\uDD14", Calendar = "\uD83D\uDCC5", Folder = "\uD83D\uDCC1", FolderOpen = "\uD83D\uDCC2", File = "\uD83D\uDCC4", Archive = "\uD83D\uDDC3", Link = "\uD83D\uDD17", Chain = "\u26D3", Bookmark = "\uD83D\uDD16", Edit = "\u270F", Trash = "\uD83D\uDDD1", Add = "\u2795", Remove = "\u2796", Reload = "\uD83D\uDD04", Save = "\uD83D\uDCBE", Undo = "\u21A9", Redo = "\u21AA", Play = "\u25B6", Pause = "\u23F8", Stop = "\u23F9", Cancel = "\u274E", User = "\uD83D\uDC64", Group = "\uD83D\uDC65", Lock = "\uD83D\uDD12", Unlock = "\uD83D\uDD13", Help = "\u2753", Key = "\uD83D\uDD11", Shield = "\uD83D\uDEE1", Gear = "\u2699", Settings = "\u2699\uFE0F", Theme = "\uD83C\uDFA8", Light = "\uD83D\uDCA1", Bug = "\uD83D\uDC1E", Wrench = "\uD83D\uDD27", Hammer = "\uD83D\uDD28", Terminal = "\uD83D\uDCBB", Database = "\uD83D\uDDC4", Server = "\uD83D\uDDA5", Cloud = "\u2601", Network = "\uD83C\uDF10", Monitor = "\uD83D\uDDA5", Printer = "\uD83D\uDDA8", USB = "\uD83D\uDD0C", Speaker = "\uD83D\uDD0A", Microphone = "\uD83C\uDF99", Camera = "\uD83D\uDCF7", Video = "\uD83C\uDFA5", Music = "\uD83C\uDFB5", Phone = "\uD83D\uDCDE", Package = "\uD83D\uDCE6", Plugin = "\uD83D\uDD0C", Extension = "\uD83E\uDDE9", Module = "\uD83D\uDCE6", Evaluate = "\uD83D\uDD0D", Variable = "\uD83D\uDD27", Script = "\uD83D\uDCDC", Code = "\uD83D\uDCBE", Logs = "\uD83D\uDCDC", Power = "\u23FB", Heart = "\u2764", Flame = "\uD83D\uDD25", Growth = "\uD83D\uDCC8", Decline = "\uD83D\uDCC9", WarningFilled = "\u26A0\uFE0F", Sun = "\u2600", Moon = "\uD83C\uDF19", Rain = "\uD83C\uDF27", Snow = "\u2744", Lightning = "\u26A1", Tree = "\uD83C\uDF32", Smile = "\uD83D\uDE0A", Sad = "\uD83D\uDE22", Angry = "\uD83D\uDE21", Clap = "\uD83D\uDC4F", ThumbsUp = "\uD83D\uDC4D", ThumbsDown = "\uD83D\uDC4E", Rocket = "\uD83D\uDE80", Globe = "\uD83C\uDF0D", Medal = "\uD83C\uDFC5", Trophy = "\uD83C\uDFC6", Flag = "\uD83D\uDEA9", StarFilled = "\u2B50", StarOutline = "\u2729", Fireworks = "\uD83C\uDF86", Balloon = "\uD83C\uDF88", Gift = "\uD83C\uDF81" } /** * Options for the CLI */ export type CliOptions = Record<string, any> & { /** * The welcome message options */ welcomeMessage?: { /** * The message to display */ message?: string; /** * When to show the welcome message * @default 'always' */ show?: 'always' | 'once' | 'daily' | 'never'; }; /** * If true, the welcome message is hidden * @default false */ hideWelcomeMessage?: boolean; /** * Users module options */ usersModule?: { /** * If true, the users module is enabled */ enabled: boolean; /** * Hide the prompt to display when the CLI is ready to accept input */ hideUserName?: boolean; /** * Reload the page when the user changes */ reloadPageOnUserChange?: boolean; }; /** * Custom terminal options */ terminalOptions?: ITerminalOptions & ITerminalInitOnlyOptions; /** * The minimum log level to display */ logLevel?: CliLogLevel; }; /** * Represents a package that can be installed */ export interface Package { /** * The name of the package */ name: string; /** * The global name used to access the package */ globalName?: string; /** * The version of the package */ version: string; /** * The unpkg url to the package */ url: string; /** * The dependencies for the module */ dependencies?: Package[]; } /** * Represents command processor metadata */ export type CliProcessorMetadata = Record<string, any> & { /** * If true, the processor is sealed and cannot be extended */ sealed?: boolean; /** * If true, the processor requires the server to be running */ requireServer?: boolean; /** * The module the processor belongs to */ module?: string; /** * An icon to display for the processor */ icon?: CliIcon | string; }; /** * Represents a state configuration for the CLI processor */ export type CliStateConfiguration = { /** * The initial state for the processor */ initialState: Record<string, any>; /** * The store identifier for the processor, if any * @remarks If the store identifier is not set, the processor command name is used */ storeName?: string; }; /** * Represents a log level for the CLI */ export declare enum CliLogLevel { None = 0, DEBUG = 1, LOG = 2, INFO = 3, WARN = 4, ERROR = 5 } export type CliState = Record<string, any>; export declare const enums: { CliForegroundColor: typeof CliForegroundColor; CliBackgroundColor: typeof CliBackgroundColor; CliIcon: typeof CliIcon; CliLogLevel: typeof CliLogLevel; }; export * from './services'; export * from './users';