///
import prompts from "prompts";
//#region src/i18n.d.ts
declare const supportedLanguages: readonly ["zh", "en"];
type SupportedLanguage = typeof supportedLanguages[number];
//#endregion
//#region src/cli.d.ts
type CliOptionsRecord = Record;
interface RunCliOptions {
argv?: string[];
name?: string;
version?: string;
}
declare function formatOptionKey(optionKey: string): string;
declare function findUnknownOptionKeys(options: CliOptionsRecord, allowedOptionKeys: Set): string[];
declare function resolveCliLanguage(value: unknown): SupportedLanguage | undefined;
declare function runCli(runOptions?: RunCliOptions): Promise;
/** @internal */
declare const cliInternal: {
formatOptionKey: typeof formatOptionKey;
findUnknownOptionKeys: typeof findUnknownOptionKeys;
resolveCliLanguage: typeof resolveCliLanguage;
};
//#endregion
//#region ../../node_modules/.pnpm/dayjs@1.11.21/node_modules/dayjs/index.d.ts
declare function dayjs(date?: dayjs.ConfigType): dayjs.Dayjs;
declare function dayjs(date?: dayjs.ConfigType, format?: dayjs.OptionType, strict?: boolean): dayjs.Dayjs;
declare function dayjs(date?: dayjs.ConfigType, format?: dayjs.OptionType, locale?: string, strict?: boolean): dayjs.Dayjs;
declare namespace dayjs {
interface ConfigTypeMap {
default: string | number | Date | Dayjs | null | undefined;
}
export type ConfigType = ConfigTypeMap[keyof ConfigTypeMap];
export interface FormatObject {
locale?: string;
format?: string;
utc?: boolean;
}
export type OptionType = FormatObject | string | string[];
export type UnitTypeShort = 'd' | 'D' | 'M' | 'y' | 'h' | 'm' | 's' | 'ms';
export type UnitTypeLong = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'date';
export type UnitTypeLongPlural = 'milliseconds' | 'seconds' | 'minutes' | 'hours' | 'days' | 'months' | 'years' | 'dates';
export type UnitType = UnitTypeLong | UnitTypeLongPlural | UnitTypeShort;
export type OpUnitType = UnitType | "week" | "weeks" | 'w';
export type QUnitType = UnitType | "quarter" | "quarters" | 'Q';
export type ManipulateType = Exclude;
class Dayjs {
constructor(config?: ConfigType);
/**
* All Day.js objects are immutable. Still, `dayjs#clone` can create a clone of the current object if you need one.
* ```
* dayjs().clone()// => Dayjs
* dayjs(dayjs('2019-01-25')) // passing a Dayjs object to a constructor will also clone it
* ```
* Docs: https://day.js.org/docs/en/parse/dayjs-clone
*/
clone(): Dayjs;
/**
* This returns a `boolean` indicating whether the Day.js object contains a valid date or not.
* ```
* dayjs().isValid()// => boolean
* ```
* Docs: https://day.js.org/docs/en/parse/is-valid
*/
isValid(): boolean;
/**
* Get the year.
* ```
* dayjs().year()// => 2020
* ```
* Docs: https://day.js.org/docs/en/get-set/year
*/
year(): number;
/**
* Set the year.
* ```
* dayjs().year(2000)// => Dayjs
* ```
* Docs: https://day.js.org/docs/en/get-set/year
*/
year(value: number): Dayjs;
/**
* Get the month.
*
* Months are zero indexed, so January is month 0.
* ```
* dayjs().month()// => 0-11
* ```
* Docs: https://day.js.org/docs/en/get-set/month
*/
month(): number;
/**
* Set the month.
*
* Months are zero indexed, so January is month 0.
*
* Accepts numbers from 0 to 11. If the range is exceeded, it will bubble up to the next year.
* ```
* dayjs().month(0)// => Dayjs
* ```
* Docs: https://day.js.org/docs/en/get-set/month
*/
month(value: number): Dayjs;
/**
* Get the date of the month.
* ```
* dayjs().date()// => 1-31
* ```
* Docs: https://day.js.org/docs/en/get-set/date
*/
date(): number;
/**
* Set the date of the month.
*
* Accepts numbers from 1 to 31. If the range is exceeded, it will bubble up to the next months.
* ```
* dayjs().date(1)// => Dayjs
* ```
* Docs: https://day.js.org/docs/en/get-set/date
*/
date(value: number): Dayjs;
/**
* Get the day of the week.
*
* Returns numbers from 0 (Sunday) to 6 (Saturday).
* ```
* dayjs().day()// 0-6
* ```
* Docs: https://day.js.org/docs/en/get-set/day
*/
day(): 0 | 1 | 2 | 3 | 4 | 5 | 6;
/**
* Set the day of the week.
*
* Accepts numbers from 0 (Sunday) to 6 (Saturday). If the range is exceeded, it will bubble up to next weeks.
* ```
* dayjs().day(0)// => Dayjs
* ```
* Docs: https://day.js.org/docs/en/get-set/day
*/
day(value: number): Dayjs;
/**
* Get the hour.
* ```
* dayjs().hour()// => 0-23
* ```
* Docs: https://day.js.org/docs/en/get-set/hour
*/
hour(): number;
/**
* Set the hour.
*
* Accepts numbers from 0 to 23. If the range is exceeded, it will bubble up to the next day.
* ```
* dayjs().hour(12)// => Dayjs
* ```
* Docs: https://day.js.org/docs/en/get-set/hour
*/
hour(value: number): Dayjs;
/**
* Get the minutes.
* ```
* dayjs().minute()// => 0-59
* ```
* Docs: https://day.js.org/docs/en/get-set/minute
*/
minute(): number;
/**
* Set the minutes.
*
* Accepts numbers from 0 to 59. If the range is exceeded, it will bubble up to the next hour.
* ```
* dayjs().minute(59)// => Dayjs
* ```
* Docs: https://day.js.org/docs/en/get-set/minute
*/
minute(value: number): Dayjs;
/**
* Get the seconds.
* ```
* dayjs().second()// => 0-59
* ```
* Docs: https://day.js.org/docs/en/get-set/second
*/
second(): number;
/**
* Set the seconds.
*
* Accepts numbers from 0 to 59. If the range is exceeded, it will bubble up to the next minutes.
* ```
* dayjs().second(1)// Dayjs
* ```
*/
second(value: number): Dayjs;
/**
* Get the milliseconds.
* ```
* dayjs().millisecond()// => 0-999
* ```
* Docs: https://day.js.org/docs/en/get-set/millisecond
*/
millisecond(): number;
/**
* Set the milliseconds.
*
* Accepts numbers from 0 to 999. If the range is exceeded, it will bubble up to the next seconds.
* ```
* dayjs().millisecond(1)// => Dayjs
* ```
* Docs: https://day.js.org/docs/en/get-set/millisecond
*/
millisecond(value: number): Dayjs;
/**
* Generic setter, accepting unit as first argument, and value as second, returns a new instance with the applied changes.
*
* In general:
* ```
* dayjs().set(unit, value) === dayjs()[unit](value)
* ```
* Units are case insensitive, and support plural and short forms.
* ```
* dayjs().set('date', 1)
* dayjs().set('month', 3) // April
* dayjs().set('second', 30)
* ```
* Docs: https://day.js.org/docs/en/get-set/set
*/
set(unit: UnitType, value: number): Dayjs;
/**
* String getter, returns the corresponding information getting from Day.js object.
*
* In general:
* ```
* dayjs().get(unit) === dayjs()[unit]()
* ```
* Units are case insensitive, and support plural and short forms.
* ```
* dayjs().get('year')
* dayjs().get('month') // start 0
* dayjs().get('date')
* ```
* Docs: https://day.js.org/docs/en/get-set/get
*/
get(unit: UnitType): number;
/**
* Returns a cloned Day.js object with a specified amount of time added.
* ```
* dayjs().add(7, 'day')// => Dayjs
* ```
* Units are case insensitive, and support plural and short forms.
*
* Docs: https://day.js.org/docs/en/manipulate/add
*/
add(value: number, unit?: ManipulateType): Dayjs;
/**
* Returns a cloned Day.js object with a specified amount of time subtracted.
* ```
* dayjs().subtract(7, 'year')// => Dayjs
* ```
* Units are case insensitive, and support plural and short forms.
*
* Docs: https://day.js.org/docs/en/manipulate/subtract
*/
subtract(value: number, unit?: ManipulateType): Dayjs;
/**
* Returns a cloned Day.js object and set it to the start of a unit of time.
* ```
* dayjs().startOf('year')// => Dayjs
* ```
* Units are case insensitive, and support plural and short forms.
*
* Docs: https://day.js.org/docs/en/manipulate/start-of
*/
startOf(unit: OpUnitType): Dayjs;
/**
* Returns a cloned Day.js object and set it to the end of a unit of time.
* ```
* dayjs().endOf('month')// => Dayjs
* ```
* Units are case insensitive, and support plural and short forms.
*
* Docs: https://day.js.org/docs/en/manipulate/end-of
*/
endOf(unit: OpUnitType): Dayjs;
/**
* Get the formatted date according to the string of tokens passed in.
*
* To escape characters, wrap them in square brackets (e.g. [MM]).
* ```
* dayjs().format()// => current date in ISO8601, without fraction seconds e.g. '2020-04-02T08:02:17-05:00'
* dayjs('2019-01-25').format('[YYYYescape] YYYY-MM-DDTHH:mm:ssZ[Z]')// 'YYYYescape 2019-01-25T00:00:00-02:00Z'
* dayjs('2019-01-25').format('DD/MM/YYYY') // '25/01/2019'
* ```
* Docs: https://day.js.org/docs/en/display/format
*/
format(template?: string): string;
/**
* This indicates the difference between two date-time in the specified unit.
*
* To get the difference in milliseconds, use `dayjs#diff`
* ```
* const date1 = dayjs('2019-01-25')
* const date2 = dayjs('2018-06-05')
* date1.diff(date2) // 20214000000 default milliseconds
* date1.diff() // milliseconds to current time
* ```
*
* To get the difference in another unit of measurement, pass that measurement as the second argument.
* ```
* const date1 = dayjs('2019-01-25')
* date1.diff('2018-06-05', 'month') // 7
* ```
* Units are case insensitive, and support plural and short forms.
*
* Docs: https://day.js.org/docs/en/display/difference
*/
diff(date?: ConfigType, unit?: QUnitType | OpUnitType, float?: boolean): number;
/**
* This returns the number of **milliseconds** since the Unix Epoch of the Day.js object.
* ```
* dayjs('2019-01-25').valueOf() // 1548381600000
* +dayjs(1548381600000) // 1548381600000
* ```
* To get a Unix timestamp (the number of seconds since the epoch) from a Day.js object, you should use Unix Timestamp `dayjs#unix()`.
*
* Docs: https://day.js.org/docs/en/display/unix-timestamp-milliseconds
*/
valueOf(): number;
/**
* This returns the Unix timestamp (the number of **seconds** since the Unix Epoch) of the Day.js object.
* ```
* dayjs('2019-01-25').unix() // 1548381600
* ```
* This value is floored to the nearest second, and does not include a milliseconds component.
*
* Docs: https://day.js.org/docs/en/display/unix-timestamp
*/
unix(): number;
/**
* Get the number of days in the current month.
* ```
* dayjs('2019-01-25').daysInMonth() // 31
* ```
* Docs: https://day.js.org/docs/en/display/days-in-month
*/
daysInMonth(): number;
/**
* To get a copy of the native `Date` object parsed from the Day.js object use `dayjs#toDate`.
* ```
* dayjs('2019-01-25').toDate()// => Date
* ```
*/
toDate(): Date;
/**
* To serialize as an ISO 8601 string.
* ```
* dayjs('2019-01-25').toJSON() // '2019-01-25T02:00:00.000Z'
* ```
* Docs: https://day.js.org/docs/en/display/as-json
*/
toJSON(): string;
/**
* To format as an ISO 8601 string.
* ```
* dayjs('2019-01-25').toISOString() // '2019-01-25T02:00:00.000Z'
* ```
* Docs: https://day.js.org/docs/en/display/as-iso-string
*/
toISOString(): string;
/**
* Returns a string representation of the date.
* ```
* dayjs('2019-01-25').toString() // 'Fri, 25 Jan 2019 02:00:00 GMT'
* ```
* Docs: https://day.js.org/docs/en/display/as-string
*/
toString(): string;
/**
* Get the UTC offset in minutes.
* ```
* dayjs().utcOffset()
* ```
* Docs: https://day.js.org/docs/en/manipulate/utc-offset
*/
utcOffset(): number;
/**
* This indicates whether the Day.js object is before the other supplied date-time.
* ```
* dayjs().isBefore(dayjs('2011-01-01')) // default milliseconds
* ```
* If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter.
* ```
* dayjs().isBefore('2011-01-01', 'year')// => boolean
* ```
* Units are case insensitive, and support plural and short forms.
*
* Docs: https://day.js.org/docs/en/query/is-before
*/
isBefore(date?: ConfigType, unit?: OpUnitType): boolean;
/**
* This indicates whether the Day.js object is the same as the other supplied date-time.
* ```
* dayjs().isSame(dayjs('2011-01-01')) // default milliseconds
* ```
* If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter.
* ```
* dayjs().isSame('2011-01-01', 'year')// => boolean
* ```
* Docs: https://day.js.org/docs/en/query/is-same
*/
isSame(date?: ConfigType, unit?: OpUnitType): boolean;
/**
* This indicates whether the Day.js object is after the other supplied date-time.
* ```
* dayjs().isAfter(dayjs('2011-01-01')) // default milliseconds
* ```
* If you want to limit the granularity to a unit other than milliseconds, pass it as the second parameter.
* ```
* dayjs().isAfter('2011-01-01', 'year')// => boolean
* ```
* Units are case insensitive, and support plural and short forms.
*
* Docs: https://day.js.org/docs/en/query/is-after
*/
isAfter(date?: ConfigType, unit?: OpUnitType): boolean;
locale(): string;
locale(preset: string | ILocale, object?: Partial): Dayjs;
}
export type PluginFunc = (option: T, c: typeof Dayjs, d: typeof dayjs) => void;
export function extend(plugin: PluginFunc, option?: T): Dayjs;
export function locale(preset?: string | ILocale, object?: Partial, isLocal?: boolean): string;
export function isDayjs(d: any): d is Dayjs;
export function unix(t: number): Dayjs;
const Ls: {
[key: string]: ILocale;
};
}
//#endregion
//#region src/constants.d.ts
declare const profileData: {
whenToStartWork: ReturnType;
name: string;
nickname: string;
gender: string;
startWorkDay: string;
};
declare function getProfileExperienceYears(referenceDate?: dayjs.Dayjs): number;
declare const optionsData: {
readonly profile: "profile";
readonly contact: "contact";
readonly blogWeb: "blogWeb";
readonly blogMp: "blogMp";
readonly leaveMsg: "leaveMsg";
readonly about: "about";
readonly music: "music";
readonly quit: "quit";
readonly photo: "photo";
readonly timeline: "timeline";
readonly changeLanguage: "changeLanguage";
readonly myRepositories: "myRepositories";
readonly shareCenter: "shareCenter";
readonly arcade: "arcade";
};
type ProfileOptions = typeof optionsData;
declare const profileLinks: {
readonly github: "https://github.com/sonofmagic";
readonly website: "https://icebreaker.top";
readonly repositories: "https://github.com/sonofmagic?tab=repositories";
readonly juejin: "https://juejin.cn/user/1943592290496919";
readonly blog: "http://blog.icebreaker.top/";
readonly x: "https://x.com/sonofmagic95";
};
type ProfileLinkKey = keyof typeof profileLinks;
declare const assetPaths: {
readonly photosDir: string;
};
//#endregion
//#region src/program.d.ts
interface MainOptions {
language?: string;
}
declare function main(options?: MainOptions): Promise;
//#endregion
//#region ../../node_modules/.pnpm/is-interactive@2.0.0/node_modules/is-interactive/index.d.ts
interface Options$1 {
/**
The stream to check.
@default process.stdout
*/
readonly stream?: NodeJS.WritableStream;
}
/**
Check if stdout or stderr is [interactive](https://unix.stackexchange.com/a/43389/7678).
It checks that the stream is [TTY](https://jameshfisher.com/2017/12/09/what-is-a-tty/), not a dumb terminal, and not running in a CI.
This can be useful to decide whether to present interactive UI or animations in the terminal.
@example
```
import isInteractive from 'is-interactive';
isInteractive();
//=> true
```
*/
declare function isInteractive(options?: Options$1): boolean;
//#endregion
//#region ../../node_modules/.pnpm/is-unicode-supported@2.1.0/node_modules/is-unicode-supported/index.d.ts
/**
Detect whether the terminal supports Unicode.
@example
```
import isUnicodeSupported from 'is-unicode-supported';
isUnicodeSupported();
//=> true
```
*/
declare function isUnicodeSupported(): boolean;
//#endregion
//#region ../../node_modules/.pnpm/ansis@4.3.1/node_modules/ansis/index.d.ts
type N = number;
type S = string;
type C = 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white';
type H = `${C}Bright`;
type AnsiColors = 'black' | 'gray' | C | H | `bg${'Black' | 'Gray' | Capitalize}`;
type AnsiStyles = 'reset' | 'inverse' | 'hidden' | 'visible' | 'bold' | 'dim' | 'italic' | 'underline' | 'strikethrough';
type Q = (n: N) => A;
type L = (s: S) => A;
type R = (r: N, g: N, b: N) => A;
type W = (text: S, url?: S) => S;
type A = Ansis;
type Ansis = {
level: N;
open: S;
close: S;
(v: unknown): S;
(s: TemplateStringsArray, ...v: any[]): S;
fg: Q;
bg: Q;
rgb: R;
bgRgb: R;
hex: L;
bgHex: L;
link: W;
isSupported(): boolean;
strip(s: S): S;
extend(c: Record): A & Record}`, A>;
} & { [K in AnsiStyles | AnsiColors]: A };
declare const Ansis: new (o?: N | object) => A, a: A, fg: Q, rgb: R, hex: L, link: W;
//#endregion
//#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/primitive.d.ts
/**
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
@category Type
*/
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
//#endregion
//#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/observable-like.d.ts
declare global {
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
interface SymbolConstructor {
readonly observable: symbol;
}
}
/**
@remarks
The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
As well, some guidance on making an `Observable` to not include `closed` property.
@see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
@see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
@see https://github.com/benlesh/symbol-observable#making-an-object-observable
@category Observable
*/
//#endregion
//#region ../../node_modules/.pnpm/type-fest@4.41.0/node_modules/type-fest/source/literal-union.d.ts
/**
Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union.
Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals.
This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore.
@example
```
import type {LiteralUnion} from 'type-fest';
// Before
type Pet = 'dog' | 'cat' | string;
const pet: Pet = '';
// Start typing in your TypeScript-enabled IDE.
// You **will not** get auto-completion for `dog` and `cat` literals.
// After
type Pet2 = LiteralUnion<'dog' | 'cat', string>;
const pet: Pet2 = '';
// You **will** get auto-completion for `dog` and `cat` literals.
```
@category Type
*/
type LiteralUnion = LiteralType | (BaseType & Record);
//#endregion
//#region ../../node_modules/.pnpm/cli-boxes@4.0.1/node_modules/cli-boxes/index.d.ts
/**
Style of the box border.
*/
type BoxStyle = {
readonly topLeft: string;
readonly top: string;
readonly topRight: string;
readonly right: string;
readonly bottomRight: string;
readonly bottom: string;
readonly bottomLeft: string;
readonly left: string;
};
/**
All box styles.
*/
type Boxes$1 = {
/**
@example
```
┌────┐
│ │
└────┘
```
*/
readonly single: BoxStyle;
/**
@example
```
╔════╗
║ ║
╚════╝
```
*/
readonly double: BoxStyle;
/**
@example
```
╭────╮
│ │
╰────╯
```
*/
readonly round: BoxStyle;
/**
@example
```
┏━━━━┓
┃ ┃
┗━━━━┛
```
*/
readonly bold: BoxStyle;
/**
@example
```
╓────╖
║ ║
╙────╜
```
*/
readonly singleDouble: BoxStyle;
/**
@example
```
╒════╕
│ │
╘════╛
```
*/
readonly doubleSingle: BoxStyle;
/**
@example
```
+----+
| |
+----+
```
*/
readonly classic: BoxStyle;
/**
@example
```
↘↓↓↓↓↙
→ ←
↗↑↑↑↑↖
```
*/
readonly arrow: BoxStyle;
};
//#endregion
//#region ../../node_modules/.pnpm/boxen@8.0.1/node_modules/boxen/index.d.ts
/**
All box styles.
*/
type Boxes = {
readonly none: BoxStyle;
} & Boxes$1;
/**
Characters used for custom border.
@example
```
// attttb
// l r
// dbbbbc
const border: CustomBorderStyle = {
topLeft: 'a',
topRight: 'b',
bottomRight: 'c',
bottomLeft: 'd',
left: 'l',
right: 'r',
top: 't',
bottom: 'b',
};
```
*/
type CustomBorderStyle = {
/**
@deprecated Use `top` and `bottom` instead.
*/
horizontal?: string;
/**
@deprecated Use `left` and `right` instead.
*/
vertical?: string;
} & BoxStyle;
/**
Spacing used for `padding` and `margin`.
*/
type Spacing = {
readonly top?: number;
readonly right?: number;
readonly bottom?: number;
readonly left?: number;
};
type Options = {
/**
Color of the box border.
*/
readonly borderColor?: LiteralUnion<'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray' | 'grey' | 'blackBright' | 'redBright' | 'greenBright' | 'yellowBright' | 'blueBright' | 'magentaBright' | 'cyanBright' | 'whiteBright', string>;
/**
Style of the box border.
@default 'single'
*/
readonly borderStyle?: keyof Boxes | CustomBorderStyle;
/**
Reduce opacity of the border.
@default false
*/
readonly dimBorder?: boolean;
/**
Space between the text and box border.
@default 0
*/
readonly padding?: number | Spacing;
/**
Space around the box.
@default 0
*/
readonly margin?: number | Spacing;
/**
Float the box on the available terminal screen space.
@default 'left'
*/
readonly float?: 'left' | 'right' | 'center';
/**
Color of the background.
*/
readonly backgroundColor?: LiteralUnion<'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'blackBright' | 'redBright' | 'greenBright' | 'yellowBright' | 'blueBright' | 'magentaBright' | 'cyanBright' | 'whiteBright', string>;
/**
Align the text in the box based on the widest line.
@default 'left'
@deprecated Use `textAlignment` instead.
*/
readonly align?: 'left' | 'right' | 'center';
/**
Align the text in the box based on the widest line.
@default 'left'
*/
readonly textAlignment?: 'left' | 'right' | 'center';
/**
Display a title at the top of the box.
If needed, the box will horizontally expand to fit the title.
@example
```
console.log(boxen('foo bar', {title: 'example'}));
// ┌ example ┐
// │foo bar │
// └─────────┘
```
*/
readonly title?: string;
/**
Align the title in the top bar.
@default 'left'
@example
```
console.log(boxen('foo bar foo bar', {title: 'example', titleAlignment: 'center'}));
// ┌─── example ───┐
// │foo bar foo bar│
// └───────────────┘
console.log(boxen('foo bar foo bar', {title: 'example', titleAlignment: 'right'}));
// ┌────── example ┐
// │foo bar foo bar│
// └───────────────┘
```
*/
readonly titleAlignment?: 'left' | 'right' | 'center';
/**
Set a fixed width for the box.
__Note__: This disables terminal overflow handling and may cause the box to look broken if the user's terminal is not wide enough.
@example
```
import boxen from 'boxen';
console.log(boxen('foo bar', {width: 15}));
// ┌─────────────┐
// │foo bar │
// └─────────────┘
```
*/
readonly width?: number;
/**
Set a fixed height for the box.
__Note__: This option will crop overflowing content.
@example
```
import boxen from 'boxen';
console.log(boxen('foo bar', {height: 5}));
// ┌───────┐
// │foo bar│
// │ │
// │ │
// └───────┘
```
*/
readonly height?: number;
/**
__boolean__: Whether or not to fit all available space within the terminal.
__function__: Pass a callback function to control box dimensions.
@example
```
import boxen from 'boxen';
console.log(boxen('foo bar', {
fullscreen: (width, height) => [width, height - 1],
}));
```
*/
readonly fullscreen?: boolean | ((width: number, height: number) => [width: number, height: number]);
};
/**
Creates a box in the terminal.
@param text - The text inside the box.
@returns The box.
@example
```
import boxen from 'boxen';
console.log(boxen('unicorn', {padding: 1}));
// ┌─────────────┐
// │ │
// │ unicorn │
// │ │
// └─────────────┘
console.log(boxen('unicorn', {padding: 1, margin: 1, borderStyle: 'double'}));
//
// ╔═════════════╗
// ║ ║
// ║ unicorn ║
// ║ ║
// ╚═════════════╝
//
```
*/
declare function boxen(text: string, options?: Options): string;
declare namespace index_d_exports {
export { EmojifyFormat, EmojifyOptions, ReplaceReplacement, StripOptions, WhichOptions, emojify, find, get, has, random, replace, search, strip, unemojify, which };
}
type EmojifyFormat = (name: string, part?: string, input?: string) => string;
interface EmojifyOptions {
/**
* The string to fallback to if an emoji was not found.
*/
fallback?: ((part: string) => string) | string;
/**
* Adds a middleware layer to modify each matched emoji after parsing.
*/
format?: EmojifyFormat;
}
/**
* Parse all markdown-encoded emojis in a string.
*/
declare const emojify: (input: string, {
fallback,
format
}?: EmojifyOptions) => string;
/**
* Get the name and character of an emoji.
*/
declare const find: (codeOrName: string) => {
emoji: string;
key: string;
} | undefined;
/**
* Get an emoji from an emoji name.
*/
declare const get: (codeOrName: string) => string | undefined;
/**
* Check if this library supports a specific emoji.
*/
declare const has: (codeOrName: string) => boolean;
/**
* Get a random emoji.
*/
declare const random: () => {
emoji: string;
name: string;
};
interface Emoji {
emoji: string;
key: string;
}
type ReplaceReplacement = (emoji: Emoji, index: number, string: string) => string;
/**
* Replace the emojis in a string.
*/
declare const replace: (input: string, replacement: ReplaceReplacement | string, {
preserveSpaces
}?: {
preserveSpaces?: boolean | undefined;
}) => string;
/**
* Search for emojis containing the provided name or pattern in their name.
*/
declare const search: (keyword: RegExp | string) => {
emoji: string;
name: string;
}[];
interface StripOptions {
/**
* Whether to keep the extra space after a stripped emoji.
*/
preserveSpaces?: boolean;
}
/**
* Remove all the emojis from a string.
*/
declare const strip: (input: string, {
preserveSpaces
}?: StripOptions) => string;
/**
* Convert all emojis in a string to their markdown-encoded counterparts.
*/
declare const unemojify: (input: string) => string;
interface WhichOptions {
markdown?: boolean;
}
/**
* Get an emoji name from an emoji.
*/
declare const which: (emoji: string, {
markdown
}?: WhichOptions) => string | undefined;
//#endregion
//#region src/theme.d.ts
type TerminalThemeMode = 'light' | 'dark';
type Colorizer = (value: string) => string;
interface MenuPalette {
border: string;
header: Colorizer;
body: Colorizer;
}
interface HeroColors {
palette: Colorizer[];
subtitle: Colorizer;
accent: Colorizer;
tagline?: Colorizer;
borderColor: string;
}
interface QrcodeColors {
highlight: Colorizer;
base: Colorizer;
}
interface MenuColors {
headingPrefix: Colorizer;
body: Colorizer;
palettes: MenuPalette[];
}
interface ProfileTheme {
mode: TerminalThemeMode;
colors: {
primary: Colorizer;
primaryStrong: Colorizer;
primaryUnderline: Colorizer;
accent: Colorizer;
accentStrong: Colorizer;
secondary: Colorizer;
secondaryStrong: Colorizer;
prompt: Colorizer;
success: Colorizer;
successStrong: Colorizer;
heading: Colorizer;
arrowHint: Colorizer;
link: Colorizer;
hero: HeroColors;
qrcode: QrcodeColors;
menu: MenuColors;
};
}
declare const profileTheme: ProfileTheme;
//#endregion
//#region src/utils/hero-banner.d.ts
interface HeroBannerOptions {
title: string;
subtitle?: string;
tagline?: string[];
accent?: string;
accentColor?: Colorizer;
taglineColor?: Colorizer | null;
subtitleColor?: Colorizer;
palette?: Colorizer[];
borderColor?: string;
}
declare function displayHeroBanner(options: HeroBannerOptions): Promise;
//#endregion
//#region src/utils/open-url.d.ts
declare function openUrl(url: string): Promise;
//#endregion
//#region src/utils/qrcode.d.ts
declare function generateQrcode(input: string): Promise;
declare function renderQrcodeBox(qrcode: string, options?: Options): string;
interface QrcodeAnimationOptions {
frameDelay?: number;
settleDelay?: number;
highlightColor?: Colorizer;
baseColor?: Colorizer;
boxenOptions?: Options;
}
declare function animateQrcodeBox(qrcode: string, options?: QrcodeAnimationOptions): Promise;
//#endregion
//#region src/utils/shared.d.ts
declare function sleep(ms: number): Promise;
declare function stripAnsi(input: string): string;
declare function terminalDisplayWidth(input: string): number;
declare function padEndDisplay(input: string, targetWidth: number): string;
declare function truncateDisplay(input: string, maxWidth: number): string;
declare function isPrimitivesType(value: unknown): value is string | number | bigint | boolean | symbol | null | undefined;
declare function isComplexType(value: unknown): boolean;
declare function splitParagraphByLines(text: string, linesPerGroup?: number): string[];
//#endregion
//#region src/utils/typewriter.d.ts
declare function typeWriter(text: string, speed?: number, randomSeed?: number): Promise;
declare function typeWriterLines(lines: string[], speed?: number, lineDelay?: number, randomSeed?: number): Promise;
//#endregion
export { type HeroBannerOptions, MainOptions, ProfileLinkKey, ProfileOptions, type QrcodeAnimationOptions, RunCliOptions, animateQrcodeBox, a as ansis, assetPaths, boxen, cliInternal, dayjs, displayHeroBanner, index_d_exports as emoji, generateQrcode, getProfileExperienceYears, isComplexType, isInteractive, isPrimitivesType, isUnicodeSupported, main, openUrl, optionsData, padEndDisplay, profileData, profileLinks, profileTheme, prompts, renderQrcodeBox, runCli, sleep, splitParagraphByLines, stripAnsi, terminalDisplayWidth, truncateDisplay, typeWriter, typeWriterLines };