import { rgbToHex, rgbToCIELab, rgbToHsl, rgbToXyz, xyzToCIELab, hslToRgb, hexToRgb } from '@vibrant/color';
import chromaJS from 'chroma-js';
import { Font } from '@ascii-kit/font';
import chalk, { ChalkInstance } from 'chalk';
import { highlight as highlight$1 } from 'cli-highlight';
import { TableConstructorOptions } from 'cli-table3';
export { default as Table, TableConstructorOptions } from 'cli-table3';
import columnify from 'columnify';
import { boxen } from '@visulima/boxen';
import * as node_fs from 'node:fs';
export { createWriteStream } from 'node:fs';
import { globby, globbyStream } from 'globby';
import { readFile as readFile$1, rename, writeFile as writeFile$1 } from 'node:fs/promises';
import { resolve, basename, dirname, extname, isAbsolute, normalize, relative } from 'node:path';
import { LocalStorage } from 'node-localstorage';
import * as o from 'open';
import { TreeContent, TreeConfig } from '@ascii-kit/tree';
import * as json_schema_to_zod from 'json-schema-to-zod';
import { JsonSchema } from 'json-schema-to-zod';
import * as zod_v4_core from 'zod/v4/core';
import { z as z$1, ZodError } from 'zod/v4';
import * as z from 'zod';
import { ZodType } from 'zod';
import { compile, Options as Options$1 } from 'json-schema-to-typescript-lite';
export { default as supportsHyperlinks } from 'supports-hyperlinks';
import { npmRunPathEnv } from 'npm-run-path';
import { hideBin as hideBin$1 } from 'yargs/helpers';
import { Argv } from 'yargs';
import * as p from '@clack/prompts';
import Enquirer from 'enquirer';
import * as consola from 'consola';
import ora from 'ora';
import { matcher } from 'matcher';
export { qrcode } from '@ascii-kit/qr';
import { JSONSchemaForNPMPackageJsonFiles } from '@schemastore/package';
import { deepmergeCustom } from 'deepmerge-ts';
export { deepmerge, deepmergeCustom } from 'deepmerge-ts';
import * as csv from '@structium/csv';
export { csv };
import * as nodeEmoji from 'node-emoji';
export { nodeEmoji as emoji };
export { fileURLToPath } from 'node:url';
export { gzip, tar, tgz, zip } from 'compressing';
export { html, markdown } from '@structium/html-markdown';
import * as ini from '@structium/ini';
export { ini };
export { default as process } from 'node:process';
export { default as stringWidth } from 'string-width';
import * as svg from '@structium/svg';
export { svg };
export { default as terminalSize } from 'terminal-size';
import * as toml from '@structium/toml';
export { toml };
import * as xml from '@structium/xml';
export { xml };
import * as yaml from '@structium/yaml';
export { yaml };

/** List of figfonts names */
declare const fonts: [
	"morse",
	"jerusalem",
	"moscow",
	"katakana",
	"runic",
	"smtengwar",
	"mshebrew210",
	"ntgreek",
	"runyc",
	"1row",
	"tengwar",
	"3-d",
	"tsalagi",
	"3d-ascii",
	"3d--diagonal",
	"4max",
	"amc--3--liv1",
	"amc--3--line",
	"5--line--oblique",
	"5lineoblique",
	"amc--razor",
	"amc--neko",
	"amc--slash",
	"amc--thin",
	"amc--tubes",
	"amc--slider",
	"3d_diagonal",
	"ansi--regular",
	"ascii--new--roman",
	"amc--untitled",
	"alligator",
	"acrobatic",
	"ansi--shadow",
	"alligator2",
	"avatar",
	"arrows",
	"b1ff",
	"banner3-d",
	"alphabet",
	"banner3",
	"alpha",
	"banner4",
	"banner",
	"basic",
	"barbwire",
	"benjamin",
	"bell",
	"big--chief",
	"3d",
	"big--money-ne",
	"big--money-se",
	"big--money-sw",
	"big--money-nw",
	"bigfig",
	"big",
	"binary",
	"block",
	"bright",
	"bloody",
	"bolger",
	"broadway--kb",
	"catwalk",
	"calvin--s",
	"braced",
	"cards",
	"blocks",
	"bulbhead",
	"broadway",
	"chiseled",
	"bubble",
	"caligraphy",
	"chunky",
	"coinstak",
	"cola",
	"caligraphy2",
	"contrast",
	"computer",
	"crawford",
	"crawford2",
	"colossal",
	"cosmike",
	"cursive",
	"cybermedium",
	"cyberlarge",
	"cricket",
	"cygnet",
	"cybersmall",
	"crazy",
	"decimal",
	"danc4",
	"dwhistled",
	"dos--rebel",
	"dancing--font",
	"diamond",
	"doom",
	"diet--cola",
	"delta--corps--priest--1",
	"dot--matrix",
	"digital",
	"double",
	"dr--pepper",
	"double--shorts",
	"efti--chess",
	"efti--italic",
	"efti--piti",
	"def--leppard",
	"efti--robot",
	"efti--font",
	"efti--water",
	"efti--wall",
	"elite",
	"doh",
	"epic",
	"filter",
	"electronic",
	"fender",
	"fire--font-k",
	"fire--font-s",
	"flower--power",
	"flipped",
	"fun--face",
	"four--tops",
	"fun--faces",
	"fuzzy",
	"ghost",
	"fraktur",
	"graceful",
	"goofy",
	"ghoulish",
	"glenyn",
	"greek",
	"gradient",
	"gothic",
	"graffiti",
	"georgi16",
	"heart--left",
	"horizontal--left",
	"hieroglyphs",
	"heart--right",
	"hollywood",
	"hex",
	"horizontal--right",
	"henry--3d",
	"invita",
	"georgia11",
	"isometric1",
	"isometric3",
	"icl-1900",
	"isometric2",
	"impossible",
	"italic",
	"js--block--letters",
	"isometric4",
	"ivrit",
	"js--bracket--letters",
	"js--capital--curves",
	"js--cursive",
	"amc--razor2",
	"js--stick--letters",
	"konto",
	"amc--aaa01",
	"jacky",
	"jazmine",
	"3x5",
	"knob",
	"keyboard",
	"konto--slant",
	"letters",
	"lcd",
	"larry--3d--2",
	"linux",
	"line--blocks",
	"lockergnome",
	"maxfour",
	"larry--3d",
	"marquee",
	"lean",
	"lil--devil",
	"madrid",
	"merlin2",
	"mike",
	"kban",
	"merlin1",
	"morse2",
	"mirror",
	"modular",
	"mini",
	"muzzle",
	"nt--greek",
	"nancyj-fancy",
	"nancyj-underlined",
	"nv--script",
	"nscript",
	"nancyj",
	"mnemonic",
	"nipples",
	"octal",
	"nancyj-improved",
	"o8",
	"old--banner",
	"patorjks--cheese",
	"os2",
	"pawp",
	"pepper",
	"patorjk-hex",
	"ogre",
	"puffy",
	"poison",
	"peaks--slant",
	"contessa",
	"puzzle",
	"rectangles",
	"red--phoenix",
	"pyramid",
	"roman",
	"rammstein",
	"rounded",
	"relief",
	"relief2",
	"reverse",
	"rotated",
	"sl--script",
	"rot13",
	"rowan--cap",
	"rozzo",
	"s--blood",
	"serifcap",
	"santa--clara",
	"slide",
	"short",
	"small--caps",
	"slant",
	"small--isometric1",
	"small--slant",
	"slant--relief",
	"small--script",
	"small--poison",
	"small--shadow",
	"spliff",
	"soft",
	"small--tengwar",
	"small",
	"stacey",
	"stforek",
	"speed",
	"stampate",
	"stampatello",
	"stick--letters",
	"star--wars",
	"stop",
	"star--strips",
	"straight",
	"script",
	"sub-zero",
	"stellar",
	"standard",
	"test1",
	"stronger--than--all",
	"swan",
	"tanja",
	"swamp--land",
	"pebbles",
	"three--point",
	"the--edge",
	"thin",
	"thick",
	"term",
	"ticks",
	"ticks--slant",
	"thorned",
	"tombstone",
	"tiles",
	"tinker-toy",
	"train",
	"tubes-smushed",
	"bear",
	"tubular",
	"two--point",
	"usa--flag",
	"weird",
	"varsity",
	"wow",
	"twisted",
	"wavy",
	"univers",
	"wet--letter",
	"amc3line",
	"amc3liv1",
	"alligator3",
	"amcrazo2",
	"amcaaa01",
	"amcslder",
	"amcneko",
	"amcun1",
	"amcslash",
	"ascii_new_roman",
	"amcrazor",
	"broadway_kb",
	"amcthin",
	"amctubes",
	"cosmic",
	"bigchief",
	"dietcola",
	"dancingfont",
	"calgphy2",
	"drpepper",
	"doubleshorts",
	"dotmatrix",
	"eftipiti",
	"eftichess",
	"eftifont",
	"eftiwall",
	"eftitalic",
	"funface",
	"eftiwater",
	"fire_font-k",
	"eftirobot",
	"fourtops",
	"dosrebel",
	"flowerpower",
	"fire_font-s",
	"heart_right",
	"horizontalleft",
	"halfiwi",
	"funfaces",
	"koholint",
	"horizontalright",
	"larry3d",
	"kontoslant",
	"maxiwi",
	"lineblocks",
	"heart_left",
	"miniwi",
	"kompaktblk",
	"red_phoenix",
	"defleppard",
	"rowancap",
	"oldbanner",
	"rev",
	"lildevil",
	"santaclara",
	"sblood",
	"peaksslant",
	"smscript",
	"s-relief",
	"slscript",
	"smkeyboard",
	"smpoison",
	"smshadow",
	"smisome1",
	"six-fo",
	"starwars",
	"threepoint",
	"smslant",
	"starstrips",
	"twopoint",
	"ticksslant",
	"swampland",
	"wetletter",
	"sweet",
	"ublk",
	"shimrod",
	"usaflag",
	"tubes-regular",
	"whimsy",
	"smallcaps",
	"peaks",
	"small--keyboard",
	"stencil",
	"l4me",
	"nvscript",
	"5x8",
	"brite",
	"6x9",
	"5x7",
	"chartr",
	"briteb",
	"6x10",
	"britebi",
	"chartri",
	"britei",
	"clb6x10",
	"clb8x10",
	"cli8x8",
	"clb8x8",
	"clr4x6",
	"clr6x6",
	"clr5x6",
	"clr5x8",
	"clr6x10",
	"clr6x8",
	"clr5x10",
	"clr7x8",
	"clr8x10",
	"clr7x10",
	"courbi",
	"clr8x8",
	"courb",
	"couri",
	"cour",
	"helv",
	"helvb",
	"helvi",
	"sansb",
	"sansbi",
	"sans",
	"sbook",
	"sbookbi",
	"sansi",
	"times",
	"sbookb",
	"sbooki",
	"tty",
	"ttyb",
	"xbrite",
	"helvbi",
	"utopia",
	"utopiab",
	"utopiai",
	"xbritei",
	"xchartr",
	"xbritebi",
	"utopiabi",
	"xbriteb",
	"xchartri",
	"xhelvb",
	"xcourb",
	"xhelv",
	"xcourbi",
	"xcour",
	"xsbookbi",
	"xsansi",
	"xhelvbi",
	"xsansb",
	"trek",
	"xsbookb",
	"64f1____",
	"xcouri",
	"xsbooki",
	"xttyb",
	"xtimes",
	"4x4_offr",
	"advenger",
	"1943____",
	"aquaplan",
	"a_zooloo",
	"xsbook",
	"atc_gran",
	"this",
	"assalt_m",
	"atc_____",
	"asc_____",
	"battle_s",
	"b_m__200",
	"baz__bil",
	"c_ascii_",
	"c1______",
	"beer_pub",
	"shadow",
	"c_consen",
	"bubble__",
	"c2______",
	"bubble_b",
	"char3___",
	"caus_in_",
	"charact1",
	"char1___",
	"charact2",
	"charact4",
	"char4___",
	"char2___",
	"charact5",
	"charact6",
	"characte",
	"coil_cop",
	"charact3",
	"charset_",
	"d_dragon",
	"com_sen_",
	"dcs_bfmo",
	"convoy__",
	"demo_m__",
	"deep_str",
	"druid___",
	"devilish",
	"demo_2__",
	"demo_1__",
	"e__fist_",
	"eca_____",
	"ebbs_2__",
	"fair_mea",
	"faces_of",
	"fbr1____",
	"fairligh",
	"f15_____",
	"fbr2____",
	"fantasy_",
	"fbr_stri",
	"fbr_tilt",
	"flyn_sh",
	"fbr12___",
	"fp1_____",
	"finalass",
	"future_3",
	"funky_dr",
	"fireing_",
	"future_1",
	"fp2_____",
	"future_5",
	"future_2",
	"future_6",
	"future_4",
	"future_7",
	"grand_pr",
	"future_8",
	"gauntlet",
	"ghost_bo",
	"battlesh",
	"gothic__",
	"heroboti",
	"hills___",
	"green_be",
	"hades___",
	"house_of",
	"hypa_bal",
	"high_noo",
	"heavy_me",
	"henry3d",
	"italics_",
	"home_pak",
	"hyper___",
	"inc_raw_",
	"kgames_i",
	"krak_out",
	"kik_star",
	"lazy_jon",
	"letter_w",
	"lexible_",
	"master_o",
	"letterw3",
	"mad_nurs",
	"magic_ma",
	"joust___",
	"modern__",
	"mig_ally",
	"nfi1____",
	"npn_____",
	"mayhem_d",
	"outrun__",
	"mcg_____",
	"odel_lak",
	"notie_ca",
	"pacos_pe",
	"ok_beer_",
	"p_s_h_m_",
	"panther_",
	"platoon_",
	"platoon2",
	"pod_____",
	"xsansbi",
	"phonix__",
	"rally_s2",
	"rainbow_",
	"pawn_ins",
	"r2-d2___",
	"radical_",
	"xhelvi",
	"raw_recu",
	"rally_sp",
	"rampage_",
	"rastan__",
	"road_rai",
	"rok_____",
	"skateord",
	"rockbox_",
	"skate_ro",
	"roman___",
	"skateroc",
	"script__",
	"ripper_",
	"sketch_s",
	"sm______",
	"spc_demo",
	"stencil1",
	"stealth_",
	"street_s",
	"stencil2",
	"super_te",
	"subteran",
	"space_op",
	"star_war",
	"tec_7000",
	"tec1____",
	"taxi____",
	"tecrvs__",
	"top_duck",
	"tav1____",
	"timesofl",
	"ti_pan__",
	"trashman",
	"tomahawk",
	"tsn_base",
	"twin_cob",
	"tsm_____",
	"triad_st",
	"ucf_fan_",
	"unarmed_",
	"ts1_____",
	"xsans",
	"type_set",
	"ugalympi",
	"usa_____",
	"xtty",
	"asslt__m",
	"war_of_w",
	"vortron_",
	"usa_pq__",
	"yie_ar_k",
	"z-pilot_",
	"yie-ar__",
	"zig_zag_",
	"zone7___",
	"etcrvs__",
	"p_skateb",
	"ascii___",
	"t__of_ap",
	"rad_phan",
	"ebbs_1__",
	"rad_____",
	"new_asci",
	"rci_____"
];

/**
 * Any Array type
 * Same as `any[]` type. Used only for prevent ts errors.
 */
type AnyArray = any[];
/**
 * Any type
 * Same as `any` type. Used only for prevent ts errors.
 */
type Any = any;
/**
 * Values of Object.
 */
type ObjectValues<Values> = Values[keyof Values];
/**
 * Keys of Object.
 */
type ObjectKeys<Values> = keyof Values;
/**
 * DeepPartial.
 */
type DeepPartial<T> = T extends object ? {
    [P in keyof T]?: DeepPartial<T[P]>;
} : T;
/**
 * Prettify your type for better readability.
 */
type Prettify<T> = {
    [K in keyof T]: T[K];
} & {};
/**
 * NonUndefined.
 *
 * @description Exclude undefined from set `A`.
 * @example
 *   // Expect: "string | null"
 *   SymmetricDifference<string | null | undefined>;
 */
type NonUndefined<A> = A extends undefined ? never : A;
/**
 * FunctionKeys.
 *
 * @description Get union type of keys that are functions in object type `T`.
 * @example
 *  type MixedProps = {name: string; setName: (name: string) => void; someKeys?: string; someFn?: (...args: any) => any;};
 *
 *   // Expect: "setName | someFn"
 *   type Keys = FunctionKeys<MixedProps>;
 */
type FunctionKeys<T extends object> = {
    [K in keyof T]-?: NonUndefined<T[K]> extends Function ? K : never;
}[keyof T];
/**
 * NonFunctionKeys.
 *
 * @description Get union type of keys that are non-functions in object type `T`.
 * @example
 *   type MixedProps = {name: string; setName: (name: string) => void; someKeys?: string; someFn?: (...args: any) => any;};
 *
 *   // Expect: "name | someKey"
 *   type Keys = NonFunctionKeys<MixedProps>;
 */
type NonFunctionKeys<T extends object> = {
    [K in keyof T]-?: NonUndefined<T[K]> extends Function ? never : K;
}[keyof T];
/**
 * AssertEqual.
 *
 * @description Checks if two types `T` and `U` are equal.
 * @example
 *   type Test = AssertEqual<string, string>; // Expected: true
 *   type TestFail = AssertEqual<string, number>; // Expected: false
 */
type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends (<V>() => V extends U ? 1 : 2) ? true : false;
/**
 * ExpectEqual.
 *
 * @description Returns the type `T` if `T` and `U` are equal; otherwise, returns `never`.
 * @example
 *   type Test = ExpectEqual<string, string>; // Expected: string
 *   type TestFail = ExpectEqual<string, number>; // Expected: never
 */
type ExpectEqual<T, U> = AssertEqual<T, U> extends true ? T : never;

/**
 * DeepNonNullable.
 *
 * @description NonNullable that works for deeply nested structure.
 * @example
 *   type NestedProps = {
 *     first?: null | {
 *       second?: null | {
 *         name?: string | null |
 *         undefined;
 *       };
 *     };
 *   };
 *   type RequiredNestedProps = DeepNonNullable<NestedProps>;
 *   // Expect: {
 *   //   first: {
 *   //     second: {
 *   //       name: string;
 *   //     };
 *   //   };
 *   // }
 */
type DeepNonNullable<T> = Prettify<_DeepNonNullable<T>>;
type _DeepNonNullable<T> = T extends (...args: AnyArray) => Any ? T : T extends AnyArray ? Prettify<Array<_DeepNonNullable<NonNullable<T[number]>>>> : T extends object ? Prettify<{
    [P in keyof T]-?: _DeepNonNullable<NonNullable<T[P]>>;
}> : Prettify<NonNullable<T>>;

type ReturnAwaitedType<T extends (...args: Any) => Any> = Awaited<ReturnType<T>>;

/**
 * DeepRequired.
 *
 * @description Required that works for deeply nested structure.
 * @example
 *   type NestedProps = {
 *     first?: {
 *       second?: {
 *         name?: string;
 *       };
 *     };
 *   };
 *   type RequiredNestedProps = DeepRequired<NestedProps>
 *   // Expect: {
 *   //   first: {
 *   //     second: {
 *   //       name: string;
 *   //     };
 *   //   };
 *   // }
 */
type DeepRequired<T> = Prettify<_DeepRequired<T>>;
type _DeepRequired<T> = T extends (...args: AnyArray) => Any ? T : T extends AnyArray ? Prettify<_DeepRequiredArray<T[number]>> : T extends object ? Prettify<_DeepRequiredObject<T>> : T;
type _DeepRequiredArray<T> = Array<_DeepRequired<NonUndefined<T>>>;
type _DeepRequiredObject<T> = {
    [P in keyof T]-?: _DeepRequired<NonUndefined<T[P]>>;
};

type PackageJSON = Prettify<JSONSchemaForNPMPackageJsonFiles & {
    /**
     * The devEngines field aids engineers working on a codebase to all be using the same tooling.
     *
     * @see https://docs.npmjs.com/cli/v11/configuring-npm/package-json#devengines
     */
    devEngines?: {
        [key in 'cpu' | 'os' | 'libc' | 'runtime' | 'packageManager']?: {
            name: string;
            version?: string;
            onFail?: 'warn' | 'error' | 'ignore';
        };
    };
}>;

type Color$1 = typeof chalk;
type HighlightOpts = Parameters<typeof highlight$1>[1];
type FontName = typeof fonts[number];
type FontOptions = NonNullable<Parameters<Font['text']>[1]>;
type GradientColors = string[] | {
    color: string;
    pos: number;
}[];
type GradientOpts = {
    /**
       The gradient can be generated using RGB or HSV interpolation. HSV usually produces brighter colors. Interpolation can be set to rgb for RGB interpolation, orhsv for HSV interpolation.
       Defaults to rgb. Case insentitive.
     */
    interpolation?: 'rgb' | 'hsv';
    /**
       Used only in the case of HSV interpolation.
       Because hue can be considered as a circle, there are two ways to go from a color to another color.
       HsvSpin can be either short or long, depending on if you want to take the shortest or the longest way between two colors.
       Defaults to short. Case insensitive.
     */
    hsvSpin?: 'short' | 'long';
};

declare const chroma: typeof chromaJS;
declare const colorConversion: {
    rgb2hex: typeof rgbToHex;
    rgb2CIELab: typeof rgbToCIELab;
    rgb2sl: typeof rgbToHsl;
    rgb2xyz: typeof rgbToXyz;
    xyz2CIELab: typeof xyzToCIELab;
    hslToRgb: typeof hslToRgb;
    hex2rgb: typeof hexToRgb;
};
/**
 * Highlights the given code using CLI highlighting.
 *
 * @param   {string}        code            - The code to highlight.
 * @param   {HighlightOpts} [opts]          - Optional options for highlighting.
 * @param   {string}        [opts.language] - The language of the code to highlight. Defaults to 'auto'.
 * @param   {string}        [opts.theme]    - The theme to use for highlighting. Defaults to 'github'.
 * @returns {string}                        - The highlighted code.
 * @example
 * const code = `
 * function greet(name) {
 *     return 'Hello, ' + name + '!';
 * }
 * console.log(greet('World'));
 * `;
 *
 * const highlightedCode = highlight(code, { language: 'javascript' });
 * console.log(highlightedCode);
 */
declare const highlight: (code: string, opts?: HighlightOpts) => string;
/**
 * Provides colors for terminal output.
 *
 * @type {object}
 * @example
 * console.log(color.green('This text is green'));
 */
declare const color: Color$1;
/**
 * Generates a gradient string with the specified colors.
 *
 * @param   {string}         txt    - The text to apply the gradient to.
 * @param   {GradientColors} colors - An array of color names or hex values.
 * @param   {GradientOpts}   [opts] - Custom opts.
 * @returns {string}                - The text with the applied gradient.
 * @example
 * // Example usage:
 * const gradientText = gradient('Gradient Text', ['red', 'yellow', 'green']);
 * console.log(gradientText);
 */
declare const gradient: (txt: string, colors: GradientColors, opts?: GradientOpts) => string;

/**
 * Unicode symbols with fallbacks for older terminals.
 *
 * @see https://github.com/sindresorhus/figures/blob/main/index.js
 * @example
 * console.log(
 *   icon.warning,
 *   icon.cross,
 *   icon.arrowDown,
 *   icon.bullet
 * )
 */
declare const icon: {
    readonly tick: string;
    readonly info: string;
    readonly warning: string;
    readonly cross: string;
    readonly square: string;
    readonly squareSmall: string;
    readonly squareSmallFilled: string;
    readonly squareDarkShade: string;
    readonly squareMediumShade: string;
    readonly squareLightShade: string;
    readonly squareTop: string;
    readonly squareBottom: string;
    readonly squareLeft: string;
    readonly squareRight: string;
    readonly squareCenter: string;
    readonly circle: string;
    readonly circleFilled: string;
    readonly circleDotted: string;
    readonly circleDouble: string;
    readonly circleCircle: string;
    readonly circleCross: string;
    readonly circlePipe: string;
    readonly circleQuestionMark: string;
    readonly radioOn: string;
    readonly radioOff: string;
    readonly checkboxOn: string;
    readonly checkboxOff: string;
    readonly checkboxCircleOn: string;
    readonly checkboxCircleOff: string;
    readonly questionMarkPrefix: string;
    readonly bullet: string;
    readonly dot: string;
    readonly ellipsis: string;
    readonly pointer: string;
    readonly pointerSmall: string;
    readonly triangleUp: string;
    readonly triangleUpSmall: string;
    readonly triangleUpOutline: string;
    readonly triangleDown: string;
    readonly triangleDownSmall: string;
    readonly triangleLeft: string;
    readonly triangleLeftSmall: string;
    readonly triangleRight: string;
    readonly triangleRightSmall: string;
    readonly lozenge: string;
    readonly lozengeOutline: string;
    readonly home: string;
    readonly hamburger: string;
    readonly smiley: string;
    readonly mustache: string;
    readonly heart: string;
    readonly star: string;
    readonly play: string;
    readonly musicNote: string;
    readonly musicNoteBeamed: string;
    readonly nodejs: string;
    readonly arrowUp: string;
    readonly arrowDown: string;
    readonly arrowLeft: string;
    readonly arrowRight: string;
    readonly arrowLeftRight: string;
    readonly arrowUpDown: string;
    readonly almostEqual: string;
    readonly notEqual: string;
    readonly lessOrEqual: string;
    readonly greaterOrEqual: string;
    readonly identical: string;
    readonly infinity: string;
    readonly subscriptZero: string;
    readonly subscriptOne: string;
    readonly subscriptTwo: string;
    readonly subscriptThree: string;
    readonly subscriptFour: string;
    readonly subscriptFive: string;
    readonly subscriptSix: string;
    readonly subscriptSeven: string;
    readonly subscriptEight: string;
    readonly subscriptNine: string;
    readonly oneHalf: string;
    readonly oneThird: string;
    readonly oneQuarter: string;
    readonly oneFifth: string;
    readonly oneSixth: string;
    readonly oneSeventh: string;
    readonly oneEighth: string;
    readonly oneNinth: string;
    readonly oneTenth: string;
    readonly twoThirds: string;
    readonly twoFifths: string;
    readonly threeQuarters: string;
    readonly threeFifths: string;
    readonly threeEighths: string;
    readonly fourFifths: string;
    readonly fiveSixths: string;
    readonly fiveEighths: string;
    readonly sevenEighth: string;
    readonly line: string;
    readonly lineBold: string;
    readonly lineDouble: string;
    readonly lineDashed0: string;
    readonly lineDashed1: string;
    readonly lineDashed2: string;
    readonly lineDashed3: string;
    readonly lineDashed4: string;
    readonly lineDashed5: string;
    readonly lineDashed6: string;
    readonly lineDashed7: string;
    readonly lineDashed8: string;
    readonly lineDashed9: string;
    readonly lineDashed10: string;
    readonly lineDashed11: string;
    readonly lineDashed12: string;
    readonly lineDashed13: string;
    readonly lineDashed14: string;
    readonly lineDashed15: string;
    readonly lineVertical: string;
    readonly lineVerticalBold: string;
    readonly lineVerticalDouble: string;
    readonly lineVerticalDashed0: string;
    readonly lineVerticalDashed1: string;
    readonly lineVerticalDashed2: string;
    readonly lineVerticalDashed3: string;
    readonly lineVerticalDashed4: string;
    readonly lineVerticalDashed5: string;
    readonly lineVerticalDashed6: string;
    readonly lineVerticalDashed7: string;
    readonly lineVerticalDashed8: string;
    readonly lineVerticalDashed9: string;
    readonly lineVerticalDashed10: string;
    readonly lineVerticalDashed11: string;
    readonly lineDownLeft: string;
    readonly lineDownLeftArc: string;
    readonly lineDownBoldLeftBold: string;
    readonly lineDownBoldLeft: string;
    readonly lineDownLeftBold: string;
    readonly lineDownDoubleLeftDouble: string;
    readonly lineDownDoubleLeft: string;
    readonly lineDownLeftDouble: string;
    readonly lineDownRight: string;
    readonly lineDownRightArc: string;
    readonly lineDownBoldRightBold: string;
    readonly lineDownBoldRight: string;
    readonly lineDownRightBold: string;
    readonly lineDownDoubleRightDouble: string;
    readonly lineDownDoubleRight: string;
    readonly lineDownRightDouble: string;
    readonly lineUpLeft: string;
    readonly lineUpLeftArc: string;
    readonly lineUpBoldLeftBold: string;
    readonly lineUpBoldLeft: string;
    readonly lineUpLeftBold: string;
    readonly lineUpDoubleLeftDouble: string;
    readonly lineUpDoubleLeft: string;
    readonly lineUpLeftDouble: string;
    readonly lineUpRight: string;
    readonly lineUpRightArc: string;
    readonly lineUpBoldRightBold: string;
    readonly lineUpBoldRight: string;
    readonly lineUpRightBold: string;
    readonly lineUpDoubleRightDouble: string;
    readonly lineUpDoubleRight: string;
    readonly lineUpRightDouble: string;
    readonly lineUpDownLeft: string;
    readonly lineUpBoldDownBoldLeftBold: string;
    readonly lineUpBoldDownBoldLeft: string;
    readonly lineUpDownLeftBold: string;
    readonly lineUpBoldDownLeftBold: string;
    readonly lineUpDownBoldLeftBold: string;
    readonly lineUpDownBoldLeft: string;
    readonly lineUpBoldDownLeft: string;
    readonly lineUpDoubleDownDoubleLeftDouble: string;
    readonly lineUpDoubleDownDoubleLeft: string;
    readonly lineUpDownLeftDouble: string;
    readonly lineUpDownRight: string;
    readonly lineUpBoldDownBoldRightBold: string;
    readonly lineUpBoldDownBoldRight: string;
    readonly lineUpDownRightBold: string;
    readonly lineUpBoldDownRightBold: string;
    readonly lineUpDownBoldRightBold: string;
    readonly lineUpDownBoldRight: string;
    readonly lineUpBoldDownRight: string;
    readonly lineUpDoubleDownDoubleRightDouble: string;
    readonly lineUpDoubleDownDoubleRight: string;
    readonly lineUpDownRightDouble: string;
    readonly lineDownLeftRight: string;
    readonly lineDownBoldLeftBoldRightBold: string;
    readonly lineDownLeftBoldRightBold: string;
    readonly lineDownBoldLeftRight: string;
    readonly lineDownBoldLeftBoldRight: string;
    readonly lineDownBoldLeftRightBold: string;
    readonly lineDownLeftRightBold: string;
    readonly lineDownLeftBoldRight: string;
    readonly lineDownDoubleLeftDoubleRightDouble: string;
    readonly lineDownDoubleLeftRight: string;
    readonly lineDownLeftDoubleRightDouble: string;
    readonly lineUpLeftRight: string;
    readonly lineUpBoldLeftBoldRightBold: string;
    readonly lineUpLeftBoldRightBold: string;
    readonly lineUpBoldLeftRight: string;
    readonly lineUpBoldLeftBoldRight: string;
    readonly lineUpBoldLeftRightBold: string;
    readonly lineUpLeftRightBold: string;
    readonly lineUpLeftBoldRight: string;
    readonly lineUpDoubleLeftDoubleRightDouble: string;
    readonly lineUpDoubleLeftRight: string;
    readonly lineUpLeftDoubleRightDouble: string;
    readonly lineUpDownLeftRight: string;
    readonly lineUpBoldDownBoldLeftBoldRightBold: string;
    readonly lineUpDownBoldLeftBoldRightBold: string;
    readonly lineUpBoldDownLeftBoldRightBold: string;
    readonly lineUpBoldDownBoldLeftRightBold: string;
    readonly lineUpBoldDownBoldLeftBoldRight: string;
    readonly lineUpBoldDownLeftRight: string;
    readonly lineUpDownBoldLeftRight: string;
    readonly lineUpDownLeftBoldRight: string;
    readonly lineUpDownLeftRightBold: string;
    readonly lineUpBoldDownBoldLeftRight: string;
    readonly lineUpDownLeftBoldRightBold: string;
    readonly lineUpBoldDownLeftBoldRight: string;
    readonly lineUpBoldDownLeftRightBold: string;
    readonly lineUpDownBoldLeftBoldRight: string;
    readonly lineUpDownBoldLeftRightBold: string;
    readonly lineUpDoubleDownDoubleLeftDoubleRightDouble: string;
    readonly lineUpDoubleDownDoubleLeftRight: string;
    readonly lineUpDownLeftDoubleRightDouble: string;
    readonly lineCross: string;
    readonly lineBackslash: string;
    readonly lineSlash: string;
};
/**
 * Generates ASCII art text using the specified font.
 *
 * @param   {string}           txt      - The text to render as ASCII art.
 * @param   {string}           fontData - The font to use for rendering. Defaults to 'Standard'.
 * @param   {FontOptions}      [opts]   - Optional parameters for font rendering.
 * @returns { Promise<string>}          - The ASCII art text.
 * @example
 * import font_three_d from '@ascii-kit/font-3d';
 * const asciiText = await renderAsciiFont('Hello, World!', font_three_d);
 * console.log(asciiText);
 */
declare const renderAsciiFont: (txt: string, fontData: string, opts?: FontOptions) => Promise<string>;
/**
 * Fetches and generates ASCII art text using the specified font name.
 *
 * @param   {string}          txt      - The text to render as ASCII art.
 * @param   {FontName}        fontName - The name of the font to use for rendering.
 * @param   {FontOptions}     [opts]   - Optional parameters for font rendering.
 * @returns {Promise<string>}          - The ASCII art text.
 * @example
 * const asciiText = await asciiFont('Hello, World!', '3-d');
 * console.log(asciiText);
 */
declare const asciiFont: (txt: string, fontName: FontName, opts?: FontOptions) => Promise<string>;
/**
 * Creates a clickable hyperlink in the terminal, if supported.
 * If terminal doesn't support clickable links, returns the URL string.
 *
 * @param   {string} text - The text to display as the link.
 * @param   {string} url  - The URL to link to.
 * @returns {string}      - The clickable hyperlink or URL string.
 * @example
 * const linkedText = link('Visit Clippo docs', 'https://clippo.pigeonposse.com');
 * console.log(linkedText);
 */
declare const link$1: (text: string, url: string) => string;

type TableData = string[][];
type TableOpts = TableConstructorOptions;
type ColumnOpts = columnify.GlobalOptions;
type ColumnData = Record<string, unknown> | Record<string, unknown>[];

/**
 * Generates a text-based table from the provided data array.
 *
 * @param   {TableData} data      - The data to display in the table.
 * @param   {TableOpts} [options] - Optional configuration options for the table.
 * @returns {string}              - The text-based table.
 * @see https://www.npmjs.com/package/table
 * @example
 * const data = [
 *     ['Name', 'Age', 'Country'],
 *     ['John', 30, 'USA'],
 *     ['Alice', 25, 'UK'],
 *     ['Bob', 35, 'Canada'],
 * ];
 * const tableText = table(data);
 * console.log(tableText);
 */
declare const table: (data: TableData, options?: TableConstructorOptions) => string;
/**
 * Formats data into aligned columns for better readability.
 *
 * @param   {ColumnData} data      - The data to format into columns.
 * @param   {ColumnOpts} [options] - Optional configuration options for column formatting.
 * @returns {string}               - The text with the data formatted into columns.
 * @see https://www.npmjs.com/package/columnify
 * @example
 * // data for columns
 * const data = [
 *     {
 *         name: 'mod1',
 *         description: 'some description which happens to be far larger than the max',
 *         version: '0.0.1',
 *     },
 *     {
 *         name: 'module-two',
 *         description: 'another description larger than the max',
 *         version: '0.2.0',
 *     }
 * ];
 *
 * // set columns with custom config
 * const columnText = columns(data, {
 *     showHeaders: false,
 *     minWidth: 20,
 *     config: {
 *         description: {
 *             maxWidth: 30
 *         }
 *     }
 * });
 *
 * // print columns
 * console.log(columnText);
 */
declare const columns: <Data extends ColumnData>(data: Data, options?: ColumnOpts) => string;

type BoxOptions = NonNullable<Parameters<typeof boxen>[1]>;
/**
 * Creates a styled box around the provided text.
 *
 * @param   {string}     text      - The text to display inside the box.
 * @param   {BoxOptions} [options] - Optional configuration options for the box.
 * @returns {string}               - The text with the styled box around it.
 * @see https://www.npmjs.com/package/boxen
 * @example
 * const boxedText = box('This is a boxed text', { padding: 1 });
 * console.log(boxedText);
 */
declare const box: (text: string, options?: BoxOptions) => string;

type LineAlign = 'left' | 'center' | 'right';
type TitleAlign = `${LineAlign}` | `top-${LineAlign}` | `bottom-${LineAlign}`;
type Color = NonNullable<Parameters<typeof box>[1]>['borderColor'];
type LineProps = {
    title?: string;
    lineChar?: string;
    lineColor?: Color;
    lineDim?: boolean;
    align?: LineAlign;
    titleAlign?: TitleAlign;
    width?: number;
};
/**
 * Generates a line with a title and customizable alignment for both the title and line.
 *
 * @param   {LineProps} props - Options object.
 * @returns {string}          Formatted line.
 * @throws {Error} If `width` is not between 1 and 100.
 */
declare const line: (props?: LineProps) => string;

/**
 * Resolves a sequence of paths or path segments into an absolute path.
 *
 * @example
 * resolvePath('foo', 'bar') // '/absolute/path/foo/bar'
 */
declare const resolvePath: typeof resolve;
/**
 * Determines the relative path from one location to another.
 *
 * @example
 * relativePath('/data/source', '/data/source/project') // 'project'
 */
declare const relativePath: typeof relative;
/**
 * Returns the file extension of a path.
 *
 * @example
 * getExtName('file.txt') // '.txt'
 */
declare const getExtName: typeof extname;
/**
 * Returns the directory name of a path.
 *
 * @example
 * getDirName('/path/to/file.txt') // '/path/to'
 */
declare const getDirName: typeof dirname;
/**
 * Returns the last portion of a path.
 *
 * @example
 * getBaseName('/path/file.txt') // 'file.txt'
 * getBaseName('/path/file.txt', '.txt') // 'file'
 */
declare const getBaseName: typeof basename;
/**
 * Determines whether a path is absolute.
 *
 * @example
 * isAbsolutePath('/usr/bin') // true
 * isAbsolutePath('file.txt') // false
 */
declare const isAbsolutePath: typeof isAbsolute;
/**
 * Normalizes a path, resolving '..', '.', and redundant separators.
 *
 * @example
 * normalizePath('foo//bar/../baz') // 'foo/baz'
 */
declare const normalizePath: typeof normalize;
/**
 * Renames (moves) a file or directory asynchronously.
 *
 * @param   {string}        oldPath - The current name or path of the file/directory.
 * @param   {string}        newPath - The new name or path for the file/directory.
 * @returns {Promise<void>}         Resolves when the operation is complete.
 * @example
 * await renamePath('./old-name.txt', './new-name.txt')
 */
declare const renamePath: typeof rename;

declare const writeFile: typeof writeFile$1;
/**
 * Find files and directories using glob patterns.
 *
 * @example const paths = await getPaths(['*', '!src']);
 * console.log(paths);
 * //=> ['pigeon', 'rainbow']
 */
declare const getPaths: typeof globby;
/**
 * Find files and directories using glob patterns.
 *
 * @example
 * for await (const path of getPathsStream('*.tmp')) {
 *    console.log(paths);
 * }
 */
declare const getPathsStream: typeof globbyStream;
/**
 * Checks if two file paths are equal after normalization.
 * Normalization ensures that differences like trailing slashes or redundant path segments are ignored.
 *
 * ---.
 *
 * @param   {string}  path1 - The first file path to compare.
 * @param   {string}  path2 - The second file path to compare.
 * @returns {boolean}       `true` if the paths are equal, `false` otherwise.
 */
declare const arePathsEqual: (path1: string, path2: string) => boolean;
/**
 * Converts a file path to a file URL.
 *
 * @param   {string} input - The file path to convert.
 * @returns {string}       The file URL.
 * @example
 * const fileUrl = path2FileUrl('./path/to/file')
 * console.log(fileUrl)
 * //=> 'file:///path/to/file'
 */
declare const path2FileUrl: (input: string) => string;
/**
 * Check if a string is a valid path.
 *
 * @param   {string}  str - The string to test.
 * @returns {boolean}     True if the string is a valid path.
 * @example
 * isPath('..') // true
 * isPath('foo bar') // false
 * isPath('C:\\') // true
 * isPath('foo\\bar') // true
 * isPath('foo/bar') // true
 * isPath('foo bar/baz') // false
 */
declare const isPath: (str: string) => boolean;
/**
 * Creates a directory if it does not exist.
 *
 * @param   {string}        path - Path to the directory to create.
 * @returns {Promise<void>}      - A promise that resolves when the directory has been created.
 * @example
 * await ensureDir('./path/to/directory')
 */
declare const ensureDir: (path: string) => Promise<void>;
/**
 * Reads the contents of a directory.
 *
 * @param   {string}                              path - Path to the directory to read.
 * @returns {Promise<import('node:fs').Dirent[]>}      - A promise that resolves to an array of {@link https://nodejs.org/api/fs.html#class-fs-dirent | fs.Dirent} objects.
 * @example
 * const dirItems = await readDir('./path/to/directory')
 */
declare const readDir: (path: string) => Promise<node_fs.Dirent<string>[]>;
/**
 * Gets the file names in a directory and filters them by extension.
 *
 * @param   {object}            props            - Function props.
 * @param   {string}            props.path       - Path to the directory.
 * @param   {string[]}          props.extensions - Array of extensions to filter by, e.g., ['.md', '.txt'].
 * @returns {Promise<string[]>}                  - A promise that resolves with an array of file names without extensions.
 */
declare function getFilteredFileNames({ path, extensions, }: {
    path: string;
    extensions: string[];
}): Promise<string[]>;
/**
 * Gets the current directory.
 *
 * @param   {string} [path] - An optional path to resolve the directory from.
 * @returns {string}        - The current directory.
 * @example getCurrentDir()
 */
declare const getCurrentDir: (path?: string) => string;
/**
 * Joins path segments.
 *
 * @param   {...string} paths - Path segments to join.
 * @returns {string}          - The joined path.
 * @example joinPath('user', 'pigeonposse')
 */
declare function joinPath(...paths: string[]): string;
/**
 * Resolves path segments into an absolute path.
 *
 * @param   {...string} paths - Path segments to resolve.
 * @returns {string}          - The resolved absolute path.
 */
declare const getAbsolutePath: typeof resolve;
/**
 * Validates and resolves a path with home directory replacement.
 *
 * @param   {string} path - The path to validate and resolve.
 * @returns {string}      - The validated and resolved absolute path.
 * @example
 * import { validateHomeDir } from '@dovenv/utils'
 *
 * const path = validateHomeDir('~/Documents')
 *
 * console.log(path) // returns: /users/{username}/Documents
 *
 * const path = validateHomeDir('/Home')
 *
 * console.log(path) // returns same: /Home
 */
declare function validateHomeDir(path: string): string;
/**
 * Reads the content of a file at the specified path.
 *
 * @param   {string}                   path - The path of the file to read.
 * @returns {Promise<string | Buffer>}      - A promise that resolves to the content of the file as a string or buffer.
 * @throws {Error} If an error occurs while reading the file.
 * @example import { readFile } from '@dovenv/utils'
 *
 * try {
 *   const content = await readFile('./example.txt');
 *   console.log(content);
 * } catch (error) {
 *   console.error('Error reading file:', error);
 * }
 */
declare const readFile: typeof readFile$1;
/**
 * Reads multiple files based on specified glob patterns and returns their contents.
 *
 * @param   {Parameters<typeof getPaths>[0]}               patterns           - The glob patterns to match file paths.
 * @param   {object}                                       [opts]             - Optional configurations.
 * @param   {Parameters<typeof getPaths>[1]}               [opts.inputOpts]   - Optional options for glob pattern matching.
 * @param   {object}                                       [opts.hook]        - Optional hooks for handling file data.
 * @param   {Function}                                     [opts.hook.onFile] - A callback function invoked for each file's path and content.
 * @returns {Promise<{ path: string, content: string }[]>}                    - A promise that resolves to an array of objects containing file paths and their contents.
 * @throws {Error} If an error occurs while reading any file.
 */
declare const readFiles: (patterns: Parameters<typeof getPaths>[0], opts?: {
    inputOpts?: Parameters<typeof getPaths>[1];
    hook?: {
        onFile?: (data: {
            path: string;
            content: string;
        }) => void | Promise<void>;
    };
}) => Promise<{
    path: string;
    content: string;
}[]>;
/**
 * Removes a directory and its contents if it exists.
 *
 * @param {string} path - The path of the directory to remove.
 * @throws {Error} If an error occurs while removing the directory.
 * @example import { removeDir } from '@dovenv/utils'
 *
 * try {
 *   await removeDir('./my/path')
 * } catch (e) {
 *   console.log(e)
 * }
 */
declare function removeDir(path: string): Promise<void>;
/**
 * Removes a directory and its contents if it exists.
 *
 * @param {string} path - The path of the directory to remove.
 * @throws {Error} If an error occurs while removing the directory.
 * @example import { removeDirIfExist } from '@dovenv/utils'
 *
 * await removeDirIfExist('./my/path')
 */
declare function removeDirIfExist(path: string): Promise<void>;
/**
 * Removes a file or directory if it exists.
 *
 * @param {string} path - The path of the file or directory to remove.
 * @throws {Error} If an error occurs while removing the file or directory.
 * @example
 * try {
 *   await removePathIfExist('./my/path')
 * } catch (e) {
 *   console.log(e)
 * }
 */
declare function removePathIfExist(path: string): Promise<void>;
/**
 * Removes a file if it exists.
 *
 * @param {string} path - The path of the file to remove.
 * @throws {Error} If an error occurs while removing the file.
 * @example
 * try {
 *   await removeFile('./my/path')
 * } catch (e) {
 *   console.log(e)
 * }
 */
declare function removeFileIfExist(path: string): Promise<void>;
/**
 * Removes a file.
 *
 * @param {string} path - The path of the file to remove.
 * @throws {Error} If an error occurs while removing the file.
 * @example
 * try {
 *   await removeFile('./my/path')
 * } catch (e) {
 *   console.log(e)
 * }
 */
declare function removeFile(path: string): Promise<void>;
/**
 * Checks if the given path points to a directory.
 *
 * @param   {string}           path - The path to check.
 * @returns {Promise<boolean>}      - A promise that resolves to true if the path points to a directory, otherwise false.
 * @example import { isDirectory } from '@dovenv/utils'
 *
 * const isDir = await isDirectory('./my/path')
 */
declare function isDirectory(path: string): Promise<boolean>;
/**
 * Creates a directory at the specified path.
 *
 * @param {string} path - The path of the directory to create.
 * @throws {Error} If an error occurs while creating the directory.
 * @example import { createDir } from '@dovenv/utils'
 * await createDir('./my/dir')
 */
declare function createDir(path: string): Promise<void>;
/**
 * Checks if a directory exists at the specified path.
 *
 * @param   {string}           path - The path to check.
 * @returns {Promise<boolean>}      - A promise that resolves to true if a directory exists at the specified path, otherwise false.
 * @example import { existsDir } from '@dovenv/utils'
 * const exist = await existsDir('./my/dir')
 */
declare function existsDir(path: string): Promise<boolean>;
/**
 * Checks if a file exists at the specified path.
 *
 * @param   {string}           path - The path to the file.
 * @returns {Promise<boolean>}      - A promise that resolves to true if the file exists, otherwise false.
 * @throws {Error} If an error occurs while checking the existence of the file.
 * @example import { existsFile } from '@dovenv/utils'
 *
 * const existPKG = await existsFile('./package.json')
 */
declare function existsFile(path: string): Promise<boolean>;
/**
 * Writes content to a file at the specified path.
 *
 * @param {string}          path    - The path of the file to write to.
 * @param {string | Buffer} content - The content to write to the file.
 * @throws {Error} If an error occurs while writing to the file.
 * @example import { writeFileContent } from '@dovenv/utils'
 *
 * await writeFileContent('./greetFile.txt', 'Hello')
 */
declare function writeFileContent(path: string, content: string | Buffer): Promise<void>;
/**
 * Checks if a file or directory exists at the specified path.
 *
 * @param   {string}           path - The path to check.
 * @returns {Promise<boolean>}      - A promise that resolves to true if a file or directory exists at the specified path, otherwise false.
 * @throws {Error} If an error occurs while checking the existence of the path.
 * @example import { existsPath } from '@dovenv/utils'
 *
 * const existPKG = await existsPath('./package.json')
 */
declare function existsPath(path: string): Promise<boolean>;
/**
 * Copy a file from input path to output path.
 *
 * @param   {{input: string, output: string}} options - Options object with input and output paths.
 * @returns {Promise<void>}                           - Resolves when the file has been copied.
 * @throws {Error} If there is an error copying the file.
 * @example import { copyFile } from '@dovenv/utils'
 *
 * const copyResult = await copyFile({
 *   input : '/path/to/source.txt',
 *   output: '/path/to/destination.txt',
 * })
 */
declare const copyFile: ({ input, output, }: {
    input: string;
    output: string;
}) => Promise<void>;
/**
 * Copy a directory from input path to output path.
 *
 * @param   {{input: string, output: string}} options - Options object with input and output paths.
 * @returns {Promise<void>}                           - Resolves when the directory has been copied.
 * @throws {Error} If there is an error copying the directory.
 * @example
 *
 * const copyResult = await copyDir({
 *   input : '/path/to/sourceDir',
 *   output: '/path/to/destinationDir',
 * })
 */
declare const copyDir: ({ input, output, }: {
    input: string;
    output: string;
}) => Promise<void>;
/**
 * Creates a symbolic link from the input path to the output path.
 *
 * @param   {{input: string, output: string}} options - Options object with input and output paths.
 * @returns {Promise<void>}                           - Resolves when the symbolic link has been created.
 * @throws {Error} If there is an error creating the symbolic link.
 * @example import { createSymlink } from '@dovenv/utils'
 *
 * const symlinkResult = await createSymlink({
 *   input : '/path/to/source',
 *   output: '/path/to/destination',
 * })
 */
declare const createSymlink: ({ input, output, }: {
    input: string;
    output: string;
}) => Promise<void>;

/**
 * Creates a new instance of LocalStorage with the specified location.
 *
 * @param   {string}       location - The location where the local storage data will be stored.
 * @returns {LocalStorage}          - A new instance of LocalStorage.
 * @example import { localStorage } from "@dovenv/utils"
 *
 * // Creates a local storage instance in the './myStorage' directory
 * const storage = localStorage('./myStorage');
 * // Sets an item in the local storage
 * storage.setItem('key', 'value');
 * // Retrieves the value of the item from the local storage
 * const value = storage.getItem('key');
 */
declare function localStorage(location: string): LocalStorage;

/**
 * Opens a system file or URL.
 *
 * @param {string} target - The file path or URL to open.
 * @example import { open } from "@dovenv/utils"
 *
 * // Opens the image in the default image viewer.
 * await open('pigeon.png', {wait: true});
 */
declare const open: typeof o.default;
/**
 * Open an app. Cross-platform.
 *
 * @param {string} name - The app you want to open. Can be either builtin supported apps names or other name supported in platform.
 * @example import { openApp } from "@dovenv/utils"
 *
 * // Open Xcode
 * await openApp('xcode');
 */
declare const openApp: typeof o.openApp;

/**
 * Resolves the directory path of a specified module entry.
 *
 * @param   {object}   opts      - An object with options for resolving the module path.
 * @param   {string}   opts.id   - The module entry name to resolve, such as a package name.
 * @param   {string[]} opts.path - Optional additional path segments to join with the resolved module directory.
 * @param   {string}   opts.from - The path to resolve the module from. Defaults to the current working directory.
 * @returns {string}             - The resolved directory path of the module.
 * @throws {Error} If the module cannot be found in the lookup paths.
 * @example
 *
 * const moduleDir = await getModulePath({ id: '@dovenv/utils' })
 * console.log(moduleDir) // returns: {workspace}/node_modules/@dovenv/utils
 *
 * const moduleFile = await getModulePath({ id: '@dovenv/utils', path: ['dist','main.mjs'] })
 * console.log(moduleFile) // returns: {workspace}/node_modules/@dovenv/utils/index.js
 */
declare const getModulePath: ({ from, id, path, }: {
    /**
     * The path to resolve the module from.
     *
     * @default process.cwd()
     */
    from?: string;
    /** The module entry name to resolve, such as a package name*/
    id: string;
    /** Optional additional path segments to join with the resolved module directory. */
    path?: string[];
}) => Promise<string>;

declare const getFileText: (path: string) => Promise<string>;
/**
 * Fetch content from a URL to string.
 *
 * @param   {string}          url - URL of the resource.
 * @returns {Promise<string>}     - The fetched content.
 * @throws {Error} If there is an error fetching content from the URL.
 * @example import { fetch2string } from '@dovenv/utils'
 *
 * const imageData = await fetch2string('https://source.unsplash.com/random')
 * console.log(imageData)
 */
declare function fetch2string(url: string): Promise<string>;
/**
 * Retrieves a string from either a file specified by path or a URL.
 * Supports fetching remote content via URLs and reading local files.
 *
 * @param   {string}          input - Path to a file or URL of the resource.
 * @returns {Promise<string>}       - The string retrieved from the file or URL.
 * @throws {Error} If there is an error fetching data or parsing the string.
 * @example import { getStringFrom } from "@dovenv/utils"
 *
 * const stringFromYamlUrl = await getStringFrom( 'https://raw.githubusercontent.com/pigeonposse/super8/main/.pigeonposse.yml' )
 * const stringFromJSON = await getStringFrom('/my/file.json')
 *
 * console.log( stringFromYamlUrl, stringFromJSON )
 */
declare const getStringFrom: (input: string) => Promise<string>;
/**
 *
 * Fetches all strings from a given patterns (URLs or paths).
 *
 * @param   {string[]}          patterns  - An array of strings with URLs or paths.
 * @param   {object}            opts      - An optional object with options.
 * @param   {object}            opts.path - An optional object with path options.
 * @returns {Promise<object[]>}           - The fetched content.
 * @throws {Error} If there is an error fetching content from the URLs or paths.
 * @example import { getStringsFrom } from '@dovenv/utils'
 *
 * const patterns = [
 *   'https://pigeonposse.com', // fetches and returns content as a string
 *   './docs/*.md',             // reads files matching the pattern and returns content as strings
 *   'Just a simple string'     // returns the same string as provided
 * ];
 *
 * const data = await getStringsFrom(patterns);
 * console.log(data);
 */
declare const getStringsFrom: (patterns: string[], opts?: {
    path: Parameters<typeof getPaths>[1];
}) => Promise<({
    type: "url";
    path: string;
    id: string;
    content: string;
} | {
    type: "text";
    id: string;
    content: string;
    path?: undefined;
})[]>;

type CacheOptions<Values extends Record<string, unknown>> = {
    /**
     * Project name for search cache.
     * You can reuse the same cache for multiple instances.
     */
    projectName: string;
    /**
     * Identifier for the values.
     */
    id: string;
    /**
     * Cache Default Values.
     */
    values: Values;
    /**
     * Directory to save cache file.
     * Default: System default user config directory.
     * You most likely don't need this. Please don't use it unless you really have to.
     */
    cwd?: string;
    /**
     * Suffix for cache directory.
     */
    suffix?: string;
};
/**
 * Creates a caching mechanism for storing and retrieving values.
 *
 * @param   {object} opts - Parameters for configuring the cache.
 * @returns {object}      - An object with methods to interact with the cache.
 * @throws {Error} If the cache value is unexpected or not found.
 * @example import { cache } from "@dovenv/utils"
 *
 * const { get, set } = await cache({
 *   projectName: 'myApp',
 *   id: 'userSettings',
 *   values: {
 *      theme: 'dark',
 *      language: 'en'
 *   },
 * });
 *
 * // Set a new value in the cache
 * set({ theme: 'light' });
 *
 * // Retrieve a value from the cache
 * const theme = get('theme');
 * console.log(theme); // Output: 'light'
 *
 * // Retrieve all cached values
 * const allValues = get();
 * console.log(allValues); // Output: { theme: 'light', language: 'en' }
 *
 * // Handle unexpected cache value
 * try {
 *   const nonExistentValue = get('nonExistent');
 * } catch (error) {
 *   console.error('Error:', error.message); // Output: Cache value is unexpected: nonExistent
 * }
 */
declare const cache: <Values extends Record<string, unknown>>(opts: CacheOptions<Values>) => Promise<{
    /**
     * The default values for the cache.
     */
    defaultValues: Values;
    /**
     * Retrieve a value from the cache.
     *
     * @example
     * const theme = get('theme');
     * console.log(theme); // Output: 'light'
     */
    get: <ID extends string | undefined = undefined>(v?: ID) => Promise<ID extends keyof Values ? Values[ID] : ID extends string ? undefined : Values>;
    /**
     * Updates the cache with the provided values.
     *
     * Merges the existing cached values with the new partial values and updates the cache.
     */
    set: (obj: Partial<Values>) => Promise<void>;
    /**
     * Resets the cache to its default values.
     *
     * @example
     * reset();
     */
    reset: () => Promise<void>;
    /**
     * The path to the cache file.
     */
    path: string;
}>;

/**
 * Returns the path to the operating system's temporary directory.
 *
 * @returns {string} The path to the operating system's temporary directory.
 */
declare const getTempDir: () => string;
/**
 * Determines the operating system.
 *
 * @returns {'windows' | 'macos' | 'linux' | 'unknown'} - The operating system. Possible values are 'linux', 'macos', or 'windows'.
 */
declare const getPlatform: () => Promise<"windows" | "macos" | "linux" | "unknown">;
/**
 * Returns the operating system CPU architecture.
 *
 * @returns {'arm64' | 'x64' | 'unknown'} - The operating system CPU architecture.
 */
declare function getArch(): 'arm64' | 'x64' | 'unknown';

declare const FORMATS: {
    readonly ZIP: "zip";
    readonly TAR: "tar";
    readonly TGZ: "tgz";
    readonly GZ: "gz";
};
type CompressFormat = typeof FORMATS[keyof typeof FORMATS];
type CompressTypeAdvancedOpts = {
    zip?: Record<string, unknown>;
    tar?: Record<string, unknown>;
    tgz?: Record<string, unknown>;
    gzip?: Record<string, unknown>;
};
type DecompresFileOptions = {
    /**
     * The path to the input compressed file.
     */
    input: string;
    /**
     * The directory where the file should be decompressed.
     */
    output?: string;
    /**
     * The new name for the decompressed file or directory.
     */
    newName?: string;
    /**
     * The format of the compressed file.
     * Automatically detected if not specified.
     *
     * @default 'auto'
     */
    format?: CompressFormat | 'auto';
    /**
     * Whether to remove the original compressed file after decompression.
     *
     * @default false
     */
    remove?: boolean;
    /**
     * Additional options for compression.
     *
     * @see https://www.npmjs.com/package/compressing
     */
    opts?: CompressTypeAdvancedOpts;
};
type CompressOptionsShared = {
    /**
     * Output directory
     *
     * @default process.cwd()
     */
    output?: string;
    /**
     * The format of the compressed file.
     * Automatically detected if not specified.
     *
     * @default 'zip'
     */
    format?: CompressFormat;
    /**
     * Additional options for compression.
     *
     * @see https://www.npmjs.com/package/compressing
     */
    opts?: CompressTypeAdvancedOpts;
};
type CompressOptions = CompressOptionsShared & {
    /**
     * The path to the input file or directory.
     */
    input: string;
    /**
     * The new name for the compressed file.
     * If not specified, random UUID will be used.
     */
    name?: string;
};
type CompressDirOptions = CompressOptionsShared & {
    /**
     * The path to the input directory.
     */
    input: string;
    /**
     * The new name for the compressed file.
     * If not specified, random UUID will be used.
     */
    name?: string;
};
type CompressFileOptions = CompressOptionsShared & {
    /**
     * The path to the input file.
     */
    input: string;
    /**
     * The new name for the compressed file.
     * If not specified, random UUID will be used.
     */
    name?: string;
};
type CompressFilesOptions = CompressOptionsShared & {
    /**
     * Array of patterns to compress.
     *
     * @example ['dist/*.js']
     */
    input: string[];
    /**
     * Additional options for input patterns.
     */
    inputOpts?: Parameters<typeof getPaths>[1];
    /**
     * Hook functions.
     */
    hook?: {
        /**
         * Before compressing a file.
         */
        beforeFile?: (n: string) => void | Promise<void>;
        /**
         * After compressing a file.
         */
        afterFile?: (n: string) => void | Promise<void>;
    };
};

/**
 * Decompresses an archive file (zip, tar, tgz) to a specified output directory.
 *
 * @param   {object}          params - The options object.
 * @returns {Promise<string>}        - A promise that resolves to the path of the decompressed file or directory.
 * @example
 * await decompressFile( {
 *   input   : resolve(  'downloads', 'example-file.zip' ), // Path to the compressed file
 *   output  : resolve(  'decompressed' ),                  // Directory where the file should be decompressed
 *   newName : 'renamed-decompressed-file',                 // New name for the decompressed file or directory (optional)
 *   remove  : true,                                        // Remove the original compressed file after decompression
 * } )
 */
declare const decompress: (params: DecompresFileOptions) => Promise<string>;
/**
 * Compresses multiple files matching the given input patterns to a specified output directory.
 *
 * @param   {CompressFilesOptions} params - The options object.
 * @returns {Promise<void>}               - A promise that resolves when all files have been compressed.
 * @example
 * await compressFiles( {
 *   input  : [ 'src/*.js' ],
 *   output : 'compressed',
 *   format : 'tar',
 *   hook   : {
 *     beforeFile: (file) => console.log(`Compressing ${file}...`),
 *     afterFile : (file) => console.log(`${file} compressed.`),
 *   },
 * } )
 */
declare const compressFiles: (params: CompressFilesOptions) => Promise<void>;
/**
 * Compresses a file to a specified output directory.
 *
 * @param   {object}          params - The options object.
 * @returns {Promise<string>}        - A promise that resolves to the path of the compressed file.
 * @example
 * const compressedFilePath = await compressFile( {
 *   input : resolve( 'file.txt' ),
 *   output: resolve( 'compressed' ),
 *   name  : 'renamed-compressed-file',
 *   format: 'tar',
 *   opts  : {
 *     tar: {
 *       strip: 1,
 *     },
 *   },
 * } )
 */
declare const compressFile: (params: CompressFileOptions) => Promise<string>;
/**
 * Compresses a directory to a specified output directory.
 *
 * @param   {object}          params - The options object.
 * @returns {Promise<string>}        - A promise that resolves to the path of the compressed archive file.
 * @example
 * const compressedFilePath = await compressDir( {
 *   input   : resolve(  'build' ), // Path to the directory to compress
 *   output  : resolve(  'dist' ), // Directory where the compressed file should be saved
 *   name    : 'compressed-archive', // Optional name for the compressed archive file
 *   format  : 'zip', // Optional format for the compressed archive file
 * } )
 */
declare const compressDir: (params: CompressDirOptions) => Promise<string>;
/**
 * Compresses a file or directory to a specified output directory.
 *
 * @param   {object}          opts - The options object.
 * @returns {Promise<string>}      - A promise that resolves to the path of the compressed archive file.
 * @example
 * const compressedFilePath = await compress( {
 *   input   : resolve(  'build' ), // Path to the directory or file to compress
 *   output  : resolve(  'dist' ), // Directory where the compressed file should be saved
 *   name    : 'compressed-archive', // Optional name for the compressed archive file
 *   format  : 'zip', // Optional format for the compressed archive file
 * } )
 */
declare const compress: (opts: CompressOptions) => Promise<string>;

type GetCharsAndWordsFromPathsOptions = {
    input: string[];
    opts?: Parameters<typeof getPaths>[1];
};
type GetCharsAndWordsFromUrlOptions = {
    input: string[];
};
type GetCharsAndWordsFromContentOptions = {
    input: string[];
};
type GetCharsAndWordsFromOptions = {
    paths?: GetCharsAndWordsFromPathsOptions['input'];
    url?: GetCharsAndWordsFromUrlOptions['input'];
    content?: GetCharsAndWordsFromContentOptions['input'];
    opts?: {
        paths?: GetCharsAndWordsFromPathsOptions['opts'];
    };
};
type GetCharsAndWordsFromResponse = {
    chars: number;
    words: number;
};
/**
 * Gets the total number of characters and words in all files matching the given glob pattern.
 *
 * @param   {GetCharsAndWordsFromPathsOptions}                         param0 - An object containing the input glob pattern and options.
 * @returns {Promise<{ files: number, chars: number, words: number }>}        - An object with properties for the number of files, the total number of characters, and the total number of words.
 * @throws {Error} If there is an error while reading the files.
 */
declare const getCountFromPaths: ({ input, opts, }: GetCharsAndWordsFromPathsOptions) => Promise<{
    files: number;
    chars: number;
    words: number;
}>;
/**
 * Gets the total number of characters and words in all files matching the given glob pattern.
 *
 * @param   {GetCharsAndWordsFromPathsOptions}      param0 - An object containing the input glob pattern and options.
 * @returns {Promise<GetCharsAndWordsFromResponse>}        - An object with the total number of characters and words.
 * @throws {Error} If an error occurs while reading the files.
 * @example const result = await getCharsAndWordsFromPaths({ input: ['*.md'] });
 * console.log(result.chars); // Total characters
 * console.log(result.words); // Total words
 */
declare const getCharsAndWordsFromPaths: ({ input, opts, }: GetCharsAndWordsFromPathsOptions) => Promise<GetCharsAndWordsFromResponse>;
/**
 * Gets the total number of characters and words from the given URLs.
 *
 * @param   {GetCharsAndWordsFromPathsOptions}      param0 - An object containing the input URLs.
 * @returns {Promise<GetCharsAndWordsFromResponse>}        - An object with the total number of characters and words.
 * @throws {Error} If an error occurs while fetching the URLs.
 * @example const result = await getCharsAndWordsFromUrl({ input: ['https://example.com'] });
 * console.log(result.chars); // Total characters
 * console.log(result.words); // Total words
 */
declare const getCharsAndWordsFromUrl: ({ input }: GetCharsAndWordsFromPathsOptions) => Promise<GetCharsAndWordsFromResponse>;
/**
 * Calculates the total number of characters and words from a list of string content.
 *
 * @param   {GetCharsAndWordsFromContentOptions}    param0 - An object containing the input strings to analyze.
 * @returns {Promise<GetCharsAndWordsFromResponse>}        - An object with the total number of characters and words.
 * @example
 * const result = await getCharsAndWordsFromContent({ input: ['Hello world!', 'This is a test.'] });
 * console.log(result.chars); // Total characters
 * console.log(result.words); // Total words
 */
declare const getCharsAndWordsFromContent: ({ input }: GetCharsAndWordsFromContentOptions) => Promise<GetCharsAndWordsFromResponse>;
/**
 * Gets the total number of characters and words from various sources: glob pattern, URL, or string content.
 *
 * @param   {object}                                    options           - Options for processing content.
 * @param   {string[]}                                  [options.paths]   - Glob pattern to search for files.
 * @param   {string}                                    [options.url]     - URL to fetch content from.
 * @param   {string}                                    [options.content] - Direct string content to analyze.
 * @param   {GetCharsAndWordsFromOptions['opts']}       [options.opts]    - Additional options for processing content.
 * @returns {Promise<{ chars: number, words: number }>}                   - Total characters and words in the content.
 * @throws {Error} If an error occurs while processing.
 * @example
 * const result = await getCharsAndWordsFrom({ pattern: ['*.md'] });
 * console.log(result.chars); // Total characters
 * console.log(result.words); // Total words
 *
 * const resultFromUrl = await getCharsAndWordsFrom({ url: 'https://example.com/file.txt' });
 * console.log(resultFromUrl);
 *
 * const resultFromContent = await getCharsAndWordsFrom({ content: 'Direct string content' });
 * console.log(resultFromContent);
 */
declare const getCharsAndWordsFrom: ({ paths, url, content, opts, }: GetCharsAndWordsFromOptions) => Promise<{
    chars: number;
    words: number;
    paths: {
        chars: number;
        words: number;
    };
    url: {
        chars: number;
        words: number;
    };
    content: {
        chars: number;
        words: number;
    };
}>;

declare const getSystemEnvPaths: ({ name, suffix, }: {
    name: string;
    suffix?: string;
}) => {
    data: string;
    config: string;
    cache: string;
    log: string;
    temp: string;
};

type LazyLoaderOptions = {
    /**
     * Option to enable debug logging for loading time
     */
    debug?: boolean;
};
declare class LazyLoader<O extends Record<string, () => Promise<unknown>>> {
    #private;
    private resources;
    options: LazyLoaderOptions;
    constructor(resources: O, options?: LazyLoaderOptions);
    /**
     * Retrieves a resource by its key, loading it if necessary and caching the result.
     *
     * @param   {keyof O}                            key - The key of the resource to load.
     * @returns {Promise<Awaited<ReturnType<O[K]>>>}     The loaded resource.
     */
    get<K extends keyof O>(key: K): Promise<Awaited<ReturnType<O[K]>>>;
}

type SetDirTree = {
    structure: TreeContent;
    opts?: TreeConfig;
};
type SharedStructure = {
    /**
     * The maximum number of directories to traverse.
     */
    max?: number;
    /**
     * The order to traverse the directories.
     *
     * @default 'atoz'
     */
    sort?: 'atoz' | 'ztoa';
};
type DirStructureParams = SharedStructure & {
    /**
     * The root path of the directory to read.
     */
    input: string;
};
type PathsStructureParams = SharedStructure & {
    /**
     * The input paths to process.
     */
    input: string[];
    /**
     * Additional options for the pattern.
     */
    patternOpts?: Parameters<typeof getPaths>[1];
};
type PathTreeOpts = Prettify<Omit<SetDirTree, 'structure'> & DirStructureParams>;
type PatternTreeOpts = Prettify<Omit<SetDirTree, 'structure'> & PathsStructureParams>;

/**
 * Returns a string representing the content of an object as a directory structure.
 *
 * @param   {object} opts           - An object with options for generating the directory structure string.
 * @param   {object} opts.structure - An object representing the directory structure.
 *                                  Receives an object with properties: name, indent, isLast, isFirst, isFolder.
 * @returns {string}                A string representing the content of `structure` as a directory structure.
 *
 *                                  ---.
 * @example
 *
 * const result = setDirTree({
 *   structure: {
 *   src: {
 *     components: {
 *       "Button.js": null,
 *       "Header.js": null
 *     },
 *     utils: {
 *       "helpers.js": null
 *     },
 *     "index.js": null
 *   },
 *   "package.json": null
 *   },
 *   name: "my-project",
 * });
 *
 * console.log(result);
 */
declare const setDirTree: (opts: SetDirTree) => string;

/**
 * Generates a string representing the directory structure of a given path.
 *
 * @param   {object}          props       - Function props.
 * @param   {string}          props.input - The root path of the directory to read.
 * @returns {Promise<string>}             The directory structure as a string.
 */
declare const getDirTree: (props: PathTreeOpts) => Promise<string>;
declare const getPathsStructure: (props: PathsStructureParams) => Promise<TreeContent>;
declare const getPathsTree: (props: PatternTreeOpts) => Promise<string>;

/**
 * fork: https://github.com/colinhacks/tozod/blob/master/src/index.ts
 */

type isAny<T> = [any extends T ? 'true' : 'false'] extends ['true'] ? true : false;
type nonoptional<T> = T extends undefined ? never : T;
type nonnullable<T> = T extends null ? never : T;
type equals<X, Y> = [X] extends [Y] ? ([Y] extends [X] ? true : false) : false;
type toZod<T> = {
    any: never;
    optional: z.ZodUnion<[toZod<nonoptional<T>>, z.ZodUndefined]>;
    nullable: z.ZodUnion<[toZod<nonnullable<T>>, z.ZodNull]>;
    array: T extends Array<infer U> ? z.ZodArray<toZod<U>> : never;
    string: z.ZodString;
    bigint: z.ZodBigInt;
    number: z.ZodNumber;
    boolean: z.ZodBoolean;
    date: z.ZodDate;
    object: z.ZodObject<{
        [k in keyof T]: toZod<T[k]>;
    }, {
        strict: true;
    }, T>;
    rest: never;
}[zodKey<T>];
type zodKey<T> = isAny<T> extends true ? 'any' : equals<T, boolean> extends true ? 'boolean' : [undefined] extends [T] ? 'optional' : [null] extends [T] ? 'nullable' : T extends any[] ? 'array' : equals<T, string> extends true ? 'string' : equals<T, bigint> extends true ? 'bigint' : equals<T, number> extends true ? 'number' : equals<T, Date> extends true ? 'date' : T extends {
    [k: string]: any;
} ? 'object' : 'rest';

/**
 * ****************************************************************************.
 * TYPES
 * ****************************************************************************.
 */
/** Validate type (zod type wrappper) */
type Validate = typeof z$1;
type ValidateAnyType = ZodType<any, any, any>;
type ValidateErrorType = ZodError;
type ValidateInfer<O extends ValidateAnyType> = z$1.infer<O>;
type ValidateType<T> = ZodType<T>;
type ToObjectValidate<T extends object> = toZod<T>;
type ToValidate<T> = z$1.ZodType<T, Any, Any>;
/**
 * Creates a validation schema function for a given TypeScript type.
 *
 * @template                                       Type     - The expected TypeScript type for the validation schema.
 * @param    {(v: Validate) => ValidateType<Type>} schemaFn - A function that defines the validation schema.
 * @returns  {(v: Validate) => ValidateType<Type>}          - A function that returns the validation schema.
 * @example
 * import {validate} from '@dovenv/utils' // validate = Zod  wrapper
 * type User = { name: string}
 * const schemaFn = createValidateSchemaFn<User>((v) => v.object({ name: v.string().min(3) }));
 * const userSchema = schemaFn(validate);
 */
declare const createValidateSchemaFn: <Type>(schemaFn: (v: Validate) => ValidateType<Type>) => (v: Validate) => ValidateType<Type>;
/**
 * Creates and immediately returns a validation schema for a given TypeScript type.
 *
 * @template                                       Type     - The expected TypeScript type for the validation schema.
 * @param    {(v: Validate) => ValidateType<Type>} schemaFn - A function that defines the validation schema.
 * @returns  {ValidateType<Type>}                           - The resulting validation schema.
 * @example
 * type User = { name: string}
 * const userSchema = createValidateSchema<User>((v) => v.object({ name: v.string().min(3) }));
 */
declare const createValidateSchema: <Type>(schemaFn: (v: Validate) => ValidateType<Type>) => ValidateType<Type>;
/**
 * Converts a validation error into a pretty string.
 *
 * @param   {unknown} error - The error to convert.
 * @returns {string}        A pretty string representing the error.
 */
declare const formatValidationError: (error: unknown) => string;
/**
 * Validate error class.
 * The validation functions are a wrapper of `zod` functions.
 *
 * @see https://zod.dev/
 */
declare const ValidateError: z$1.core.$constructor<z$1.ZodError<unknown>, z$1.core.$ZodIssue[]>;
/**
 * Create schema validation from js.
 * The validation functions are a wrapper of `zod` functions.
 *
 * @see https://zod.dev/
 */
declare const validate: typeof z$1;
/**
 * Serializes and simplifies types into a JSON format.
 *
 */
declare const serializeValidation: typeof z$1.core.toJSONSchema;
declare const deserializeValidation: <R extends ValidateAnyType>(v: JsonSchema) => R;
/**
 * Utility class for data validation.
 * Most of the validation functions are a wrapper of `zod` functions.
 *
 * @see https://zod.dev/
 */
declare class Validation {
    Error: z$1.core.$constructor<z$1.ZodError<unknown>, z$1.core.$ZodIssue[]>;
    schema: typeof z$1;
    formatError: (error: unknown) => string;
    serialize: typeof z$1.core.toJSONSchema;
    deserialize: <R extends ValidateAnyType>(v: JsonSchema) => R;
    /**
     * Create a union of literal types from an array of strings.
     *
     * @param   {string[]}   values - The values of the union.
     * @returns {z.ZodUnion}        A union of literal types.
     * @example
     * const myUnion = createLiteralUnion( ['one', 'two', 'three'] )
     * // myUnion is a union of 'one', 'two', 'three'
     */
    createLiteralUnion<T extends string>(values: T[]): z$1.ZodUnion<[z$1.ZodLiteral<T>, ...z$1.ZodLiteral<T>[]]>;
}

type SchemaObject = Parameters<typeof compile>[0] | object;
type Zod2schema = {
    /**
     * The JSON Schema object to convert to a TypeScript type.
     * It can be directly passed as an object or as the first parameter of the `compile` function.
     */
    schema: ValidateAnyType;
    /**
     * Options for convert process.
     */
    opts?: Parameters<typeof serializeValidation>[1];
};
type Schema2tsProps = {
    /**
     * The name of the TypeScript type to be generated.
     * This will appear as the interface or type name in the output.
     */
    name: string;
    /**
     * The JSON Schema object to convert to a TypeScript type.
     * It can be directly passed as an object or as the first parameter of the `compile` function.
     */
    schema: SchemaObject;
    /**
     * Optional compilation options to customize the output TypeScript type.
     * These options are passed to the `json-schema-to-typescript` library.
     */
    opts?: Options$1;
};
type Schema2typeProps = Pick<Schema2tsProps, 'schema'> & {
    /**
     * Remove all `?` from the generated type.
     *
     * @default false
     */
    required?: boolean;
    /**
     * Remove all `[k: string]: unknown` from the generated type.
     *
     * @default false
     */
    noUnknownObject?: boolean;
};

/**
 * Converts a zod schema to a JSON schema.
 *
 * @param   {Zod2schema}      params - Options.
 * @returns {Promise<string>}        The JSON schema.
 * @example
 * const jsonSchema = await zod2schema({
 *   schema: z.object({
 *     foo: z.string(),
 *   }),
 *   opts: {
 *     // zodToJsonSchema options
 *   },
 * })
 */
declare const zod2schema: (params: Zod2schema) => Promise<zod_v4_core.ZodStandardJSONSchemaPayload<ValidateAnyType>>;
/**
 * JSON schema to zod type.
 *
 * @param   {Schema2zod}      params - Options.
 * @returns {Promise<string>}        - Zodtype in string.
 * @example
 * const zodSchema = await schema2zod({
 *   schema: {
 *     type: "object",
 *     ...
 *   }
 * })
 *
 * console.log(zodSchema)
 */
declare const schema2zod: <R extends ValidateAnyType>(v: json_schema_to_zod.JsonSchema) => R;
/**
 * Parses a JSON schema string into an object.
 *
 * @template          R      - The type of the object to be returned.
 * @param    {string} schema - The JSON schema string to parse.
 * @returns  {R}             - The parsed object.
 * @throws {SyntaxError} - If the input string is not a valid JSON.
 * @example
 * const obj = schema2object<{ foo: string }>('{"foo": "bar"}');
 * console.log(obj.foo); // Output: "bar"
 */
declare const schema2object: <R extends object>(schema: string) => R;
/**
 * JSON schema to typescript type string.
 *
 * Useful, for example, to display a schema in a readable way for the user.
 *
 * @param   {Schema2tsProps}  params - Options.
 * @returns {Promise<string>}
 *                                   ---.
 * @example
 * const tsString = await schema2ts({
 *   name: 'MySchemaType',
 *   schema: {
 *     type: "object",
 *     ...
 *   }
 * })
 *
 * console.log(tsString)
 */
declare const schema2ts: (params: Schema2tsProps) => Promise<string>;
/**
 * Converts a JSON schema to a TypeScript type string.
 *
 * @param   {Schema2typeProps} params                   - Options for conversion.
 * @param   {object}           params.schema            - The JSON schema to convert.
 * @param   {boolean}          [params.required]        - If true, removes optional marking from fields.
 * @param   {boolean}          [params.noUnknownObject] - If true, removes unknown object indexing from the result.
 * @returns {Promise<string>}                           - The TypeScript type string representation of the schema.
 *                                                      ---.
 * @example
 * const typeString = await schema2type({
 *   schema: {
 *     type: "object",
 *     ...
 *   },
 *   required: true,
 *   noUnknownObject: false
 * });
 *
 * console.log(typeString);
 */
declare const schema2type: (params: Schema2typeProps) => Promise<string>;
/**
 * Validate a data from a schema.
 *
 * This function accepts both `data` and `schema` as required parameters, which can either be
 * an object or a string. If a string is provided, it may represent a file path or a URL, and
 * the format can be one of the following: JSON, YAML, TOML, JS, INI, CSV, or XML.
 *
 * @param   {string | object} data   - The data to be validated. It can be a string representing a file path or URL,
 *                                   or an object containing the data to validate.
 * @param   {string | object} schema - The schema against which the data will be validated. It can be a string
 *                                   representing a file path or URL, or an object representing the schema.
 * @returns {Promise<object>}        - The validated JSON data.
 * @throws {ValidateSchemaError} - If the schema is invalid or the data does not conform to the schema.
 * @example import { validateSchema } from '@dovenv/utils'
 *
 * try {
 *   const validData = await validateSchema(
 *     '../../package.json',
 *     'https://json.schemastore.org/package.json'
 *   );
 *   console.log(validData);
 * } catch (error) {
 *     console.error('Validation failed:', error.message);
 * }
 */
declare const validateSchema: (data: string | object, schema: string | object) => Promise<object>;

/**
 * @see https://www.npmjs.com/package/browser-or-node
 */
declare const isBrowser: boolean;
declare const isNode: boolean;
declare const isWebWorker: boolean;
declare const isJsDom: boolean;
declare const isDeno: boolean;
declare const isBun: boolean;

declare const stdType: {
    readonly stdout: "stdout";
    readonly stderr: "stderr";
    readonly stdin: "stdin";
};
declare const consoleType: {
    readonly log: "log";
    readonly info: "info";
    readonly error: "error";
    readonly warn: "warn";
    readonly trace: "trace";
};

type StdType = ObjectValues<typeof stdType>;
type ConsoleType = ObjectValues<typeof consoleType>;
type onStdOpts = {
    /**
     * Function to transform the output before replacing it.
     *
     * @example
     * const fn = ( { data, type } ) => {
     *    return type === 'stderr' ? data.toUpperCase() : data
     * }
     */
    fn: (opts: {
        data: string;
        type: StdType;
    }) => string;
    /**
     * Processs object to replace output in..
     *
     * @default process
     */
    process?: NodeJS.Process;
    /**
     * Type of stream to replace output in.
     *
     * @default 'stdout'
     */
    type?: Prettify<StdType[] | StdType>;
};
type ReplaceStdOpts = Prettify<Omit<onStdOpts, 'fn'> & {
    /**
     * Params object containing key-value pairs where each key is a string to be replaced by its corresponding value in the output.
     *
     * @example {
     *   'error': 'warning'
     * }
     */
    params: Record<string, string>;
    /**
     * Function to transform the output before replacing it.
     *
     * @example
     * const transform = ( { data, type } ) => {
     *    return type === 'stderr' ? data.toUpperCase() : data
     * }
     */
    transform?: onStdOpts['fn'];
}>;
type onConsoleOpts = {
    /**
     * Function to transform the output before replacing it.
     *
     * @example
     * const fn = ( { data, type } ) => {
     *    return type === 'error' ? data.toUpperCase() : data
     * }
     */
    fn: (opts: {
        data: string;
        type: ConsoleType;
    }) => string;
    /**
     * Type of stream to replace output in.
     *
     * @default 'log'
     */
    type?: Prettify<ConsoleType[] | ConsoleType>;
};
type ReplaceConsoleOpts = Prettify<Omit<onConsoleOpts, 'fn'> & {
    /**
     * Params object containing key-value pairs where each key is a string to be replaced by its corresponding value in the output.
     *
     * @example {
     *   'error': 'warning'
     * }
     */
    params: Record<string, string>;
    /**
     * Function to transform the output before replacing it.
     *
     * @example
     * const transform = ( { data, type } ) => {
     *    return type === 'warm' ? data.toUpperCase() : data
     * }
     */
    transform?: onConsoleOpts['fn'];
}>;

/**
 * Replaces the output of `stdout` or `stderr` streams with a custom transformation function.
 *
 * @param   {onStdOpts} opts - Options for customizing the stream transformation.
 * @returns {object}         A Object with `start` and `stop` methods.
 * @example
 * import { onStd } from '@dovenv/utils'
 * const secretOut = onStd({
 *   type : 'stdout',
 *   fn : ( { data } ) => data.replace( /secret/g, '***' ),,
 * });
 *
 * secretOut.start();
 * // my code
 * secretOut.stop();
 */
declare const onStd: (opts: onStdOpts) => {
    start: () => void;
    stop: () => void;
};
/**
 * Replaces output in the specified stream (stdout, stderr, or stdin) by substituting
 * values based on the provided parameters.
 *
 * This function overrides the write method of the specified stream to replace occurrences
 * of specified strings in the output with replacement strings. It supports custom process
 * objects and stream types.
 *
 * ---.
 *
 * @param   {ReplaceStdOpts}            opts           - The options for replacing output.
 * @param   {ReplaceStdOpts['params']}  opts.params    - An object containing key-value pairs
 *                                                     where each key is a string to be replaced by its corresponding value in the output.
 * @param   {ReplaceStdOpts['proceso']} [opts.process] - An optional Node.js process object. Defaults to the global process.
 * @param   {ReplaceStdOpts['type']}    [opts.type]    - The type of stream to replace output for. Defaults to 'stdout'.
 * @returns {object}                                   A Object with `start` and `stop` methods.
 * @example
 * import { replaceConsole } from '@dovenv/utils'
 * const versionOut = replaceStd({
 *   params: {
 *     'v1.3.4': 'v2.1.9'
 *   },
 *   type: ['stderr']
 * });
 *
 * versionOut.start();
 * // my code
 * versionOut.stop();
 */
declare const replaceStd: (opts: ReplaceStdOpts) => {
    start: () => void;
    stop: () => void;
};

/**
 * Intercepts console methods and applies a transformation function to all arguments.
 *
 * Useful for replacing certain values in console output, such as API keys or other sensitive information.
 *
 * @param   {onConsoleOpts} opts - Options for the console interceptor.
 * @returns {object}             A Object with `start` and `stop` methods.
 * @example
 * import { onConsole } from '@dovenv/utils'
 * const secretOut = onConsole({
 *   type : ['log', 'warn'],
 *   fn : ( { data } ) => data.replace( /secret/g, '***' ),,
 * });
 *
 * secretOut.start();
 * // my code
 * secretOut.stop();
 */
declare const onConsole: (opts: onConsoleOpts) => {
    start: () => void;
    stop: () => void;
};
/**
 * Replaces values in console output using a set of parameters.
 *
 * @param   {ReplaceConsoleOpts} opts - Options for the console output replacer.
 * @returns {object}                  A Object with `start` and `stop` methods.
 * @example
 * import { replaceConsole } from '@dovenv/utils'
 * const versionOut = replaceConsole({
 *   params: {
 *     'v1.3.4': 'v2.1.9'
 *   },
 *   type: ['stderr']
 * });
 *
 * versionOut.start();
 * // mys code
 * versionOut.stop();
 */
declare const replaceConsole: (opts: ReplaceConsoleOpts) => {
    start: () => void;
    stop: () => void;
};

/**
 * Checks if the environment is a development environment.
 *
 * @returns {boolean} True if the environment is a development environment.
 */
declare const isDev: () => boolean;
/**
 * Suppresses deprecation warnings in the process.
 *
 * This function sets the `process.noDeprecation` property to `true`,.
 *
 * Note: This is not recommended for production environments, as it might
 * hide useful deprecation warnings that should be addressed.
 */
declare const rmDeprecationAlerts: () => void;
/**
 * Show/hide deprecation warnings in the process.
 *
 * This function sets the `process.noDeprecation` property to `true` | `false`
 * Note: This is not recommended for production environments, as it might
 * hide useful deprecation warnings that should be addressed.
 *
 * @returns {object} An object with `show` and `hide` methods.
 * @example
 * const { show, hide } = deprecatedAlerts()
 * hide()
 * // my code
 * show()
 */
declare const deprecatedAlerts: () => {
    show: () => void;
    hide: () => void;
};
/**
 * Registers an event listener that will be called when the Node.js process exits.
 *
 * @param {NodeJS.ExitListener} cb - The callback to be called when the process exits.
 */
declare const onExit: (cb: NodeJS.ExitListener) => void;
/**
 * Registers an event listener that will be called when the user sends an
 * interrupt signal (e.g., pressing Ctrl+C in the terminal).
 *
 * @param {NodeJS.ExitListener} cb - The callback to be called when the user
 *                                 sends an interrupt signal.
 */
declare const onCancel: (cb: NodeJS.ExitListener) => void;
/**
 * Terminates the Node.js process with exit code 130.
 *
 * This function is typically used to gracefully handle process termination,
 * such as when the user sends an interrupt signal (e.g., pressing Ctrl+C in the terminal).
 */
declare const cancel: () => never;

declare const getLocalPkgPath: (packageName: string) => string | undefined;
declare class RunLocalNodeBinError extends Error {
}
declare const getLocalNodeBinPath: ({ name, opts, }: {
    name: string;
    opts?: Parameters<typeof npmRunPathEnv>[0];
}) => Promise<string | undefined>;
/**
 * Runs a local Node binary in the current project.
 *
 * It uses the `PATH` and `npm-run-path` to locate the binary in the project's `node_modules/.bin`.
 *
 * @param   {object}          options        - Options object.
 * @param   {string}          options.name   - Name of the bin to run.
 * @param   {string[]}        options.args   - Args to pass to the bin.
 * @param   {object}          [options.opts] - Options object.
 * @returns {Promise<number>}                - Resolves with the exit code of the bin.
 * @throws  {Error} - If the bin exits with a non-zero code.
 */
declare const runLocalNodeBin: ({ name, args, opts, }: {
    name: string;
    args?: string[];
    opts?: Parameters<typeof npmRunPathEnv>[0];
}) => Promise<number>;
/**
 * Executes a command in the shell and waits for it to finish.
 *
 * @param   {string}        cmd - The command to execute.
 * @returns {Promise<void>}     - A promise that resolves when the command finishes successfully.
 * @throws {Error} - Throws an error if the command fails.
 */
declare const exec: (cmd: string) => Promise<void>;
/**
 * Executes a command in a child process and captures its output.
 *
 * @param   {string}                                      cmd - The command to execute.
 * @returns {Promise<{ stdout: string; stderr: string }>}     - A promise that resolves with the output of the command.
 * @throws {Error} - Throws an error if the command fails, along with its stdout and stderr.
 */
declare const execChild: (cmd: string) => Promise<{
    stdout: string;
    stderr: string;
}>;
type Log = {
    debug: (data: unknown) => void;
    info: (data: unknown) => void;
    success: (data: unknown) => void;
    warn: (data: unknown) => void;
    error: (data: unknown) => void;
    box: (data: string) => void;
};
type ExecProcessParams = {
    name: string;
    on: (context: {
        log: Log;
    }) => Promise<void>;
    onError?: (context: {
        log: Log;
        error: unknown;
    }) => Promise<void>;
    onExit?: (context: {
        log: Log;
    }) => Promise<void>;
    onSuccess?: (context: {
        log: Log;
    }) => Promise<void>;
};
/**
 * Executes a process with logging and error handling.
 *
 * @param   {object}        options             - Options for the process execution.
 * @param   {string}        options.name        - The name of the process, used in logs.
 * @param   {Function}      options.on          - The main function to execute the process. Receives an object with the `log` utility.
 * @param   {Function}      [options.onError]   - On success function.
 * @param   {Function}      [options.onSuccess] - Optional exit handling function for graceful exits. Receives an object with `log`.
 * @param   {Function}      [options.onExit]    - Optional exit handling function for graceful exits. Receives an object with `log`.
 * @returns {Promise<void>}                     - Resolves when the process execution completes.
 * @example
 * const onProcess = async ({ log }) => {
 *     log.info('Starting the process...');
 *     // Your process logic here
 *     log.success('Process completed successfully.');
 * };
 *
 * const onError = async ({ log, error }) => {
 *     log.error('An error occurred:', error);
 * };
 *
 * execProcess({
 *     name: 'MyProcess',
 *     on: onProcess,
 *     onError,
 * });
 */
declare const execProcess: (options: ExecProcessParams) => Promise<void>;
/**
 * Executes a command and captures its output.
 *
 * @param   {string}          command - The command to execute, including any arguments.
 * @returns {Promise<string>}         A promise that resolves with the captured output (stdout).
 * @throws Will reject with an error if the command fails.
 * @example
 * const [error, output] = await catchExecOutput('dovenv --help')
 * if (error) {
 *   console.error(error);
 * } else {
 *   await writeFile('dovenvHelp.txt', output)
 * }
 */
declare const catchExecOutput: <Res = string>(command: string) => Promise<[Error] | [undefined, Res]>;
/**
 * Execute a module from a given path.
 *
 * @param   {object}        params        - Parameters for module execution.
 * @param   {string}        params.module - The module to execute.
 * @param   {string[]}      [params.args] - The arguments to pass to the module.
 * @returns {Promise<void>}               A promise that resolves when the module has finished executing.
 * @throws Will reject with an error if the module fails to execute.
 * @example
 *
 * // Execute the `bin/index.mjs` file in the `@dovenv/utils` module
 * await execModulePath({
 *   module: {
 * 	  id: 'dovenv',
 * 	  path: ['dist','cli.mjs'],
 *   },
 *   args: ['--help']
 * })
 */
declare const execModulePath: ({ module, args, }: {
    module: Parameters<typeof getModulePath>[0];
    args?: string[];
}) => Promise<void>;
/**
 * Execute a module from a given path and capture its output.
 *
 * @param   {object}                                      params        - Parameters for module execution.
 * @param   {string}                                      params.module - The module to execute.
 * @param   {string[]}                                    [params.args] - The arguments to pass to the module.
 * @returns {Promise<{ stdout: string; stderr: string }>}               A promise that resolves with the captured output.
 * @throws Will reject with an error if the module fails to execute.
 * @example
 *
 * // Execute the `bin/index.mjs` file in the `dovenv` module and capture its output
 * const { stdout, stderr } = await execModulePathWithOutput({
 *   module: {
 * 	  id: 'dovenv',
 * 	  path: ['dist','cli.mjs'],
 *   },
 *   args: ['--help']
 * })
 * console.log('Output:', stdout)
 */
declare const execModulePathWithOutput: ({ module, args, }: {
    module: Parameters<typeof getModulePath>[0];
    args?: string[];
}) => Promise<{
    stdout: string;
    stderr: string;
}>;
declare const existsLocalBin: (binName: string) => Promise<boolean>;
declare const existsLocalBins: <Bin extends string>(binaries: Bin[]) => Promise<{ [key in Bin]: boolean; }>;

/**
 * Checks if a flag exists and the value matches one of the given values.
 *
 * @param   {string}                 v      - The key of the flag to check.
 * @param   {Record<string, string>} values - An object with values to check against the value of the flag.
 * @returns {string | undefined}            The value of the flag if it exists and matches one of the given values, or undefined.
 */
declare const getChoiceFlagValue: <VALUES>(v: string, values: Record<string, VALUES>) => VALUES | undefined;
/**
 * Gets the value of a flag passed to the process.
 *
 * @param   {string}             key - The key of the flag to get the value of.
 * @returns {string | undefined}     The value of the flag if it exists, or undefined.
 */
declare const getStringFlagValue: (key: string) => string | undefined;
/**
 * Gets the values of a flag passed to the process.
 *
 * @param   {string}               key - The key of the flag to get the values of.
 * @returns {string[] | undefined}     The values of the flag if it exists, or undefined.
 *                                     The values are returned as an array. If the flag appears multiple times, their values are concatenated.
 *                                     The flag can appear in two formats:
 *                                     - `--key=value1,value2,...` - The values are separated by commas.
 *                                     - `--key value1 value2 ...` - The values follow the flag in separate arguments.
 */
declare const getArrayFlagValue: (key: string) => string[] | undefined;
/**
 * Checks if a boolean flag exists in the process arguments.
 *
 * @param   {string}  v - The boolean flag to check for existence.
 * @returns {boolean}   True if the flag exists, false otherwise.
 */
declare const getBooleanFlagValue: (v: string) => boolean;
/**
 * Checks if a specific command exists in the process arguments.
 *
 * @param   {string}  v - The command to check for existence.
 * @returns {boolean}   True if the command exists in the process arguments; otherwise, false.
 */
declare const getCmd: (v: string) => boolean;
/**
 * Checks if there are additional command-line options provided.
 *
 * @returns {boolean} True if there are more than two arguments in the process.argv array, indicating the presence of options; otherwise, false.
 */
declare const existsOptions: () => boolean;

/**
 * Hides the first two arguments from the process.argv array.
 *
 * @returns {string[]} Array of arguments without the first two elements.
 * @example
 * import { hideBin } from '@dovenv/utils'
 * const args = hideBin( process.argv ) // removes the uneeded arguments
 * console.log( args )
 */
declare const hideBin: typeof hideBin$1;
/**
 * Create a cli interface.
 *
 * @param   {{argv: string[], fn: (cli: Argv) => Promise<Argv>}} options - Options object with argv and a function to setup the cli.
 * @returns {Promise<Argv>}                                              - Resolves with the cli interface.
 * @example
 * import { createCli, hideBin } from '@dovenv/utils'
 * const args = hideBin( process.argv ) // removes the uneeded arguments
 * const cli = await createCli({
 *   args : args,
 *   fn   : async cli => {
 *
 *     cli.command( 'build', 'Run the build process', async () => {
 *       // ...
 *     } ).command( 'dev', 'Run the dev server', async () => {
 *       // ...
 *     } ).command( 'preview', 'Run the preview server', async () => {
 *       // ...
 *     } ).demandCommand( 1, 'You need to specify a command (build, dev, or preview)' )
 *
 *     return cli
 *
 *   },
 * } )
 */
declare const createCli: ({ args, fn, }: {
    args: string[];
    fn: <Cli extends Argv>(cli: Cli) => Promise<Cli>;
}) => Promise<Argv<{}>>;

type AnimateProps = {
    frames: string[];
    interval?: number;
    clear?: boolean;
};

/**
 * Creates an animation function that can be started and stopped.
 *
 * @param   {object}   [options]          - Options for the animation.
 * @param   {string[]} [options.frames]   - Frames of the animation.
 * @param   {number}   [options.interval] - Interval in milliseconds between frames.
 * @param   {boolean}  [options.clear]    - Whether to clear the screen after stopping the animation.
 * @returns {object}                      - Object containing `start` and `stop` functions.
 */
declare const animate: ({ frames, interval, clear, }: AnimateProps) => {
    start: () => void;
    stop: () => void;
};

type PromptParams = Parameters<typeof Enquirer.prompt>[0];

type NumberPrompt = (opts: NumberParams) => Promise<number | symbol>;
type ClackPrompts = Prettify<typeof p & {
    number: NumberPrompt;
}>;
declare const promptLineMethods: {
    readonly message: "message";
    readonly info: "info";
    readonly success: "success";
    readonly step: "step";
    readonly warn: "warn";
    readonly warning: "warning";
    readonly error: "error";
};
type PromptLineMethod = typeof promptLineMethods[keyof typeof promptLineMethods];
/**
 * NUMBER.
 *
 */
type NumberParams = Prettify<p.TextOptions & {
    placeholder?: number;
    defaultValue?: number;
    errorText?: string;
}>;
/**
 * Parameters of the `table` function from the `@dovenv/utils` module.
 *
 * [See module](https://clippo.pigeonposse.com/guide/utils/style#table).
 */
type TableParams = Parameters<typeof table>;
/**
 * Parameters of the `columns` function from the `@dovenv/utils` module.
 *
 * [See module](https://clippo.pigeonposse.com/guide/utils/styles#columns).
 */
type ColumnsParams = Parameters<typeof columns>;
/**
 * Parameters of the `box` function from the `@dovenv/utils` module.
 *
 * [See module](https://clippo.pigeonposse.com/guide/utils/styles#box).
 */
type BoxParams = Parameters<typeof box>;
type PromptLineCustomProps = {
    table: (opts: {
        value: TableParams[0];
        opts?: TableParams[1];
        type?: PromptLineMethod;
    }) => void;
    box: (opts: {
        value: BoxParams[0];
        opts?: BoxParams[1];
        type?: PromptLineMethod;
    }) => void;
    columns: (opts: {
        value: ColumnsParams[0];
        opts?: ColumnsParams[1];
        type?: PromptLineMethod;
    }) => void;
};
/**
 * Props for canceling a prompt line, including functions from various modules.
 */
type PromptLineCancelProps = ClackPrompts & PromptLineCustomProps;
type PromptLineProps = Prettify<Omit<ClackPrompts, 'box'> & PromptLineCustomProps & {
    log: Prettify<ClackPrompts['log'] & {
        errorWithExit: (m: string) => void;
    }>;
}>;
/**
 * Props for executing a prompt line, extending `PromptLineCancelProps` with typePrompt.
 */
type PromptLineExecProps = PromptLineCancelProps & {
    typePrompt: <T>(props: PromptParams) => Promise<T>;
};
/**
 * Parameters for configuring a prompt line.
 */
type PromptLineParams<T> = {
    intro?: string;
    outro?: string;
    list: (prompt: PromptLineExecProps) => p.PromptGroup<T> | Promise<p.PromptGroup<T>>;
    onCancel?: (prompt: PromptLineCancelProps) => Promise<void>;
};

declare const promptLineCore: ClackPrompts;
declare const promptLine: PromptLineProps;
declare const promptLineEnquirer: (props: PromptParams, onCancel?: () => void) => Promise<unknown>;
/**
 *
 * Define a group of prompts to be displayed and return a results of objects within the group.
 *
 * @param   {PromptLineParams} params - PromptLine options .
 * @returns {Promise<object>}         - Object with answers.
 * @example
 * import { promptLineGroup } from "@dovenv/utils"
 *
 * const answers = await promptLineGroup({
 *     intro: 'Dovenv init',
 *     outro: 'Succesfully finished 🌈',
 *     onCancel: p => {
 *         p.cancel('canceled 💔')
 *         process.exit(0)
 *     },
 *     list: async p => ({
 *        name: () => p.text({
 *            message: 'What is your organization?',
 *            placeholder: 'PigeonPosse',
 *            defaultValue: 'PigeonPosse',
 *        }),
 *        age: () => p.number({
 *            message: 'What is your age?',
 *        }),
 *     })
 * })
 *
 * console.log(answers.name, answers.age)
 */
declare function promptLineGroup<T>(params: PromptLineParams<T>): Promise<{ [P in keyof p.PromptGroupAwaitedReturn<T>]: p.PromptGroupAwaitedReturn<T>[P]; }>;

/**
 * Ask questions to user with prompt function.
 *
 * @param   {PromptParams}    props - PromptOptions.
 * @returns {Promise<object>}       - Promise resolving to answers.
 * @see https://www.npmjs.com/package/enquirer
 * @example
 *
 * const answers = await promptGroup([
 *   {
 *     type: 'toggle',
 *     name: 'ready',
 *     message: 'Are you ready?',
 *     enabled: 'Yep',
 *     disabled: 'Nope',
 *   },
 *   {
 *     type: 'number',
 *     name: 'age',
 *     message: 'What is your age',
 *   },
 * ]);
 * console.log(answers.ready, answers.age)
 */
declare function promptGroup(props: PromptParams): Promise<object>;

declare const logger: consola.ConsolaInstance;
declare const spinner: typeof ora;

/**
 * Creates a performance tracker to measure elapsed time.
 *
 * @property {Function} stop       - Returns the elapsed time in seconds as a fixed-point number.
 * @property {Function} prettyStop - Returns the elapsed time formatted as a human-readable string.
 * @returns  {object}              An object containing methods to stop and retrieve the elapsed time.
 */
declare const performance: () => {
    /**
     * Calculates and returns the elapsed time in seconds.
     *
     * @returns {number} Elapsed time in seconds as a floating-point number.
     */
    stop: () => number;
    /**
     * Formats and returns the elapsed time as a human-readable string.
     *
     * @returns {string} Elapsed time formatted in milliseconds, seconds, or minutes.
     */
    prettyStop: () => string;
};
/**
 * Waits for the given number of milliseconds before resolving.
 *
 * @param   {number}        ms - The number of milliseconds to wait.
 * @returns {Promise<void>}    - A promise that resolves when the delay has finished.
 * @example
 * await delay( 1000 ); // waits 1 second
 */
declare const delay: (ms: number) => Promise<unknown>;
/**
 * Gets the current date and time as an object containing separate fields for year, month, day, hours, minutes, and seconds.
 *
 * @returns {{ year: string; month: string; day: string; hours: string; minutes: string; seconds: string }} - An object representing the current date and time.
 */
declare const getCurrentDateTime: () => {
    year: string;
    month: string;
    day: string;
    hours: string;
    minutes: string;
    seconds: string;
};
/**
 * Gets the current date and time in ISO 8601 format as a string.
 *
 * @returns {string} - The current date and time as an ISO 8601 string.
 */
declare const getCurrentDateTimeString: () => string;

/**
 * Downloads a directory from GitHub.
 *
 * @param   {string}        args         - An object containing the URL of the GitHub repo directory and the path to the output directory.
 * @param   {string}        args.input   - The URL of the GitHub repo directory.
 * @param   {string}        args.output  - The path to the output directory.
 * @param   {string}        [args.token] - The GitHub token for authentication.
 * @returns {Promise<void>}
 * @example
 *
 * await downloadGitHubPath({
 * 	input  : 'https://github.com/pigeonposse/backan/tree/main/docs',
 * 	output : './docs',
 * })
 */
declare const downloadGitHubPath: (args: {
    input: string;
    output: string;
    token?: string;
}) => Promise<void>;

/**
 * Checks if the user is authenticated to GitHub using the GitHub CLI.
 *
 * @returns {boolean} True if the user is authenticated, false otherwise.
 */
declare const isGitHubAuthenticated: () => boolean;
/**
 * Downloads a GitHub release asset using the GitHub CLI and optionally renames the final file.
 *
 * @param {object} options               - The options object.
 * @param {string} options.user          - The GitHub username.
 * @param {string} options.repo          - The GitHub project/repository name.
 * @param {string} options.outputPath    - The directory where the file should be saved.
 * @param {string} options.filename      - The name of the file to download.
 * @param {string} [options.version]     - The release version or 'latest' for the latest release.
 * @param {string} [options.newFilename] - The new name for the file after download (if applicable).
 */
declare const downloadGitHubRelease: ({ user, repo, outputPath, filename, newFilename, version, }: {
    user: string;
    repo: string;
    outputPath: string;
    filename: string;
    version?: string;
    newFilename?: string;
}) => Promise<void>;

type ParamFn = (arg: string) => Promise<string>;
type ParamsValue = string | number | Record<string, unknown> | unknown[] | unknown;
type Params = Record<string, ParamsValue>;
type Props = {
    /** Content to be replaced. */
    content: string;
    /**
     * Parameters.
     *
     * @example
     * const params = {
     *     name: 'Antonio',
     *     lastName : 'Resines'
     * }
     */
    params: Params;
    /**
     * Transform parameters insde placeholders.
     *
     * @example
     * const transform = async ( param: string ) => {
     *     if ( param === 'url' ) return 'https://pigeonposse.com',
     *     else if ( param === 'http://pigeonposse.com' ) return 'https://pigeonposse.com'
     *     return param
     * }
     */
    transform?: ParamFn;
    /** Options. */
    opts?: {
        /**
         * Throw an error if a placeholder is not found.
         *
         * @default false
         */
        throw?: boolean;
        /**
         * Throw an error if a parameter is not found.
         *
         * @default
         * {
         *   prefix : '{{',
         *   suffix : '}}',
         * }
         */
        mark?: {
            prefix: string;
            suffix: string;
        };
    };
};
/**
 * Replace placeholders in a string with their corresponding values.
 *
 * The function takes a string with placeholders, an object with parameter values,
 * and an optional custom parameter function.
 *
 * The function returns a Promise that resolves to the string with all placeholders
 * replaced.
 *
 * @param   {Props}              props             - Props for the function.
 * @param   {Props['content']}   props.content     - The string with placeholders.
 * @param   {Props['params']}    props.params      - An object with parameter values.
 * @param   {Props['transform']} [props.transform] - An optional custom parameter function.
 * @param   {Props['opts']}      [props.opts]      - Options to customize the behavior of the function.
 * @returns {Promise<string>}                      - A Promise that resolves to the string with all placeholders replaced.
 */
declare const replacePlaceholders: (props: Props) => Promise<string>;

/**
 * Gets the total number of characters and words in a given string.
 *
 * @param   {string}                           text - The string to analyze.
 * @returns {{ chars: number, words: number }}      - An object containing the total number of characters and words.
 * @example
 * const result = getCharsAndWords("Hello world!");
 * console.log(result.chars); // 12
 * console.log(result.words); // 2
 */
declare const getCharsAndWords: (text: string) => {
    chars: number;
    words: number;
};

/**
 * camelCase → kebab-case
 *
 * @param   {string} str - The string to convert.
 * @returns {string}     - The converted string.
 */
declare const camel2Kebab: (str: string) => string;
/**
 * camelCase → PascalCase
 *
 * @param   {string} str - The string to convert.
 * @returns {string}     - The converted string.
 */
declare const camel2Pascal: (str: string) => string;
/**
 * camelCase → snake_case
 *
 * @param   {string} str - The string to convert.
 * @returns {string}     - The converted string.
 */
declare const camel2Snake: (str: string) => string;
/**
 * kebab-case → camelCase
 *
 * @param   {string} str - The string to convert.
 * @returns {string}     - The converted string.
 */
declare const kebab2Camel: (str: string) => string;
/**
 * kebab-case → PascalCase
 *
 * @param   {string} str - The string to convert.
 * @returns {string}     - The converted string.
 */
declare const kebab2Pascal: (str: string) => string;
/**
 * kebab-case → snake_case
 *
 * @param   {string} str - The string to convert.
 * @returns {string}     - The converted string.
 */
declare const kebab2Snake: (str: string) => string;
/**
 * PascalCase → camelCase
 *
 * @param   {string} str - The string to convert.
 * @returns {string}     - The converted string.
 */
declare const pascal2Camel: (str: string) => string;
/**
 * PascalCase → kebab-case
 *
 * @param   {string} str - The string to convert.
 * @returns {string}     - The converted string.
 */
declare const pascal2Kebab: (str: string) => string;
/**
 * PascalCase → snake_case
 *
 * @param   {string} str - The string to convert.
 * @returns {string}     - The converted string.
 */
declare const pascal2Snake: (str: string) => string;
/**
 * snake_case → camelCase
 *
 * @param   {string} str - The string to convert.
 * @returns {string}     - The converted string.
 */
declare const snake2Camel: (str: string) => string;
/**
 * snake_case → kebab-case
 *
 * @param   {string} str - The string to convert.
 * @returns {string}     - The converted string.
 */
declare const snake2Kebab: (str: string) => string;
/**
 * snake_case → PascalCase
 *
 * @param   {string} str - The string to convert.
 * @returns {string}     - The converted string.
 */
declare const snake2Pascal: (str: string) => string;

/**
 * Fork of https://www.npmjs.com/package/ansi-escapes?activeTab=code
 */
declare const cursorTo: (x: number, y?: number) => string;
declare const cursorMove: (x: number, y?: number) => string;
declare const cursorUp: (count?: number) => string;
declare const cursorDown: (count?: number) => string;
declare const cursorForward: (count?: number) => string;
declare const cursorBackward: (count?: number) => string;
declare const cursorLeft = "\u001B[G";
declare const cursorSavePosition: string;
declare const cursorRestorePosition: string;
declare const cursorGetPosition = "\u001B[6n";
declare const cursorNextLine = "\u001B[E";
declare const cursorPrevLine = "\u001B[F";
declare const cursorHide = "\u001B[?25l";
declare const cursorShow = "\u001B[?25h";
declare const eraseLines: (count: number) => string;
declare const eraseEndLine = "\u001B[K";
declare const eraseStartLine = "\u001B[1K";
declare const eraseLine = "\u001B[2K";
declare const eraseDown = "\u001B[J";
declare const eraseUp = "\u001B[1J";
declare const eraseScreen = "\u001B[2J";
declare const scrollUp = "\u001B[S";
declare const scrollDown = "\u001B[T";
declare const clearScreen = "\u001Bc";
declare const clearTerminal: string;
declare const enterAlternativeScreen = "\u001B[?1049h";
declare const exitAlternativeScreen = "\u001B[?1049l";
declare const beep = "\u0007";
declare const link: (text: string, url: string) => string;
type ImageOptions = {
    width?: string | number | 'auto';
    height?: string | number | 'auto';
    preserveAspectRatio?: boolean;
};
declare const image: (data: Uint8Array, options?: ImageOptions) => string;
type AnnotationOptions = {
    length?: number;
    x?: number;
    y?: number;
    isHidden?: boolean;
};
declare const iTerm: {
    setCwd(cwd?: string): string;
    annotation(message: string, options?: AnnotationOptions): string;
};

type escape_AnnotationOptions = AnnotationOptions;
type escape_ImageOptions = ImageOptions;
declare const escape_beep: typeof beep;
declare const escape_clearScreen: typeof clearScreen;
declare const escape_clearTerminal: typeof clearTerminal;
declare const escape_cursorBackward: typeof cursorBackward;
declare const escape_cursorDown: typeof cursorDown;
declare const escape_cursorForward: typeof cursorForward;
declare const escape_cursorGetPosition: typeof cursorGetPosition;
declare const escape_cursorHide: typeof cursorHide;
declare const escape_cursorLeft: typeof cursorLeft;
declare const escape_cursorMove: typeof cursorMove;
declare const escape_cursorNextLine: typeof cursorNextLine;
declare const escape_cursorPrevLine: typeof cursorPrevLine;
declare const escape_cursorRestorePosition: typeof cursorRestorePosition;
declare const escape_cursorSavePosition: typeof cursorSavePosition;
declare const escape_cursorShow: typeof cursorShow;
declare const escape_cursorTo: typeof cursorTo;
declare const escape_cursorUp: typeof cursorUp;
declare const escape_enterAlternativeScreen: typeof enterAlternativeScreen;
declare const escape_eraseDown: typeof eraseDown;
declare const escape_eraseEndLine: typeof eraseEndLine;
declare const escape_eraseLine: typeof eraseLine;
declare const escape_eraseLines: typeof eraseLines;
declare const escape_eraseScreen: typeof eraseScreen;
declare const escape_eraseStartLine: typeof eraseStartLine;
declare const escape_eraseUp: typeof eraseUp;
declare const escape_exitAlternativeScreen: typeof exitAlternativeScreen;
declare const escape_iTerm: typeof iTerm;
declare const escape_image: typeof image;
declare const escape_link: typeof link;
declare const escape_scrollDown: typeof scrollDown;
declare const escape_scrollUp: typeof scrollUp;
declare namespace escape {
  export { escape_beep as beep, escape_clearScreen as clearScreen, escape_clearTerminal as clearTerminal, escape_cursorBackward as cursorBackward, escape_cursorDown as cursorDown, escape_cursorForward as cursorForward, escape_cursorGetPosition as cursorGetPosition, escape_cursorHide as cursorHide, escape_cursorLeft as cursorLeft, escape_cursorMove as cursorMove, escape_cursorNextLine as cursorNextLine, escape_cursorPrevLine as cursorPrevLine, escape_cursorRestorePosition as cursorRestorePosition, escape_cursorSavePosition as cursorSavePosition, escape_cursorShow as cursorShow, escape_cursorTo as cursorTo, escape_cursorUp as cursorUp, escape_enterAlternativeScreen as enterAlternativeScreen, escape_eraseDown as eraseDown, escape_eraseEndLine as eraseEndLine, escape_eraseLine as eraseLine, escape_eraseLines as eraseLines, escape_eraseScreen as eraseScreen, escape_eraseStartLine as eraseStartLine, escape_eraseUp as eraseUp, escape_exitAlternativeScreen as exitAlternativeScreen, escape_iTerm as iTerm, escape_image as image, escape_link as link, escape_scrollDown as scrollDown, escape_scrollUp as scrollUp };
  export type { escape_AnnotationOptions as AnnotationOptions, escape_ImageOptions as ImageOptions };
}

/**
 * Creates a regular expression to match ANSI escape codes.
 *
 * @param   {object}  options           - Optional configuration object.
 * @param   {boolean} options.onlyFirst - If true, the regex will stop after the first match.
 * @returns {RegExp}                    A regular expression for matching ANSI escape codes.
 *
 *                                      This function generates a regular expression that can be used to identify
 *                                      ANSI escape codes within a string. These codes are often used in terminal
 *                                      emulators to apply text formatting such as colors, styles, and hyperlinks.
 *                                      The regex pattern accommodates various ANSI sequences, including those
 *                                      terminated by BEL, ESC\, or 0x9c.
 * @example
 * ansiRegex().test('\u001B[4mcake\u001B[0m');
 * //=> true
 *
 * ansiRegex().test('cake');
 * //=> false
 *
 * '\u001B[4mcake\u001B[0m'.match(ansiRegex());
 * //=> ['\u001B[4m', '\u001B[0m']
 *
 * '\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
 * //=> ['\u001B[4m']
 *
 * '\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
 * //=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
 */
declare const ansiRegex: ({ onlyFirst }?: {
    onlyFirst?: boolean | undefined;
}) => RegExp;

type Align = 'left' | 'center' | 'right';
interface Options {
    /**
     * Aligns text to the left, center or right.
     *
     * @default 'center'
     */
    align?: Align;
    /**
     * Split text on newlines.
     */
    split?: string;
    /**
     * Padding character.
     */
    pad?: string;
}
/**
 * Aligns ANSI strings to the left, center or right.
 *
 * @param   {string|string[]} text   - The text to align.
 * @param   {object}          [opts] - Options object.
 * @returns {string|string[]}        The aligned text, or an array of strings if input is an array.
 */
declare const align: (text: string | string[], opts?: Options) => string | string[];

declare const align$1_align: typeof align;
declare namespace align$1 {
  export {
    align$1_align as align,
  };
}

/**
 * Fork from https://github.com/dmnd/dedent/blob/main/src/types.ts
 */
interface DedentOptions {
    escapeSpecialCharacters?: boolean;
    trimWhitespace?: boolean;
}
interface Dedent {
    (literals: string): string;
    (strings: TemplateStringsArray, ...values: unknown[]): string;
    withOptions: CreateDedent;
}
type CreateDedent = (options: DedentOptions) => Dedent;
/**
 * A string tag that strips indentation from multi-line strings.
 */
declare const dedent: Dedent;

/**
 * Defines the options for filtering empty lines.
 */
type RemoveEmptyLinesOptions = {
    /**
     * The maximum number of consecutive empty lines to allow.
     * - 0: Removes all consecutive empty lines (default).
     * - 1: Allows a single empty line between content.
     * - Any number N: Allows up to N empty lines.
     */
    maxConsecutive?: number;
    /**
     * Whether to remove leading empty lines.
     *
     * @default false
     */
    trimStart?: boolean;
    /**
     * Whether to remove trailing empty lines.
     *
     * @default false
     */
    trimEnd?: boolean;
};
/**
 * Removes lines from a multiline string based on specified conditions,
 * such as handling consecutive empty lines, leading, and trailing empty lines.
 *
 * @param   {string}                  text      - The input multiline string.
 * @param   {RemoveEmptyLinesOptions} [options] - Optional configuration for removing lines.
 * @returns {string}                            - The string with empty lines processed according to the options.
 */
declare const removeEmptyLines: (text: string, options?: RemoveEmptyLinesOptions) => string;

/**
 * Indents a given string by prefixing each line with a given prefix
 * (default is two spaces).
 *
 * @param   {string} v        - The string to indent.
 * @param   {string} [prefix] - The prefix to prepend to each line (default is two spaces).
 * @returns {string}          - The indented string.
 */
declare const indent: (v: string, prefix?: string) => string;
/**
 * Capitalizes the first letter of a word.
 *
 * @param   {string} s - The word to capitalize.
 * @returns {string}   - The capitalized word.
 */
declare const capitalize: (s: string) => string;
/**
 * Truncates a given string to a maximum length and adds an ellipsis (...) at the end.
 *
 * @param   {string} text       - The string to truncate.
 * @param   {number} maxLength  - The maximum length of the string.
 * @param   {string} [ellipsis] - The ellipsis to add at the end of the truncated string (default is '…').
 * @returns {string}            - The truncated string.
 */
declare const truncate: (text: string, maxLength: number, ellipsis?: string) => string;
declare const getMatch: typeof matcher;
declare const getStringType: (value: string) => "text" | "url" | "path";
/**
 * Joins the given URL parts into a single string.
 *
 * @param   {string[]} parts - The URL parts to join.
 * @returns {string}         - The joined URL string.
 */
declare const joinUrl: (...parts: string[]) => string;
/**
 * Converts an object to a JSON string.
 *
 * @param   {unknown} data - The data to convert to a string.
 * @returns {string}       - The JSON string representation of the data.
 */
declare const object2string: (data: unknown) => string;
/**
 * Generates a random UUID.
 *
 * @returns {string} - The generated UUID.
 */
declare const getRandomUUID: () => `${string}-${string}-${string}-${string}-${string}`;

type CommonObj = Record<string, unknown> | Record<string, unknown>[] | unknown[];

type CommonCSV = CommonObj;
declare const getObjectFromCSVFile: <Res extends CommonCSV = CommonCSV>(path: string) => Promise<Res>;
declare const getObjectFromCSVContent: <Res extends CommonCSV = CommonCSV>(content: string, options?: csv.DeserializeOptions) => Promise<Res>;

declare const getObjectFromINIFile: <Res extends CommonObj = CommonObj>(path: string) => Promise<Res>;
declare const getObjectFromINIContent: <Res extends CommonObj = CommonObj>(content: string) => Promise<Res>;

/**
 * Get object from a JavaScript file.
 *
 * @param   {string}                     path - Path to the JavaScript file.
 * @param   {string}                     part - The part of the module to import. Defaults to 'default'.
 * @returns {Promise<object | object[]>}      - The imported object.
 * @throws {Error} If there is an error importing the module.
 * @example import { getObjectFromJSFile } from "@dovenv/utils"
 *
 * const content = await getObjectFromJSFile('/my/file.js')
 * const part = await getObjectFromJSFile('/my/fs.js', 'path')
 * console.log(content, part)
 */
declare const getObjectFromJSFile: <Res extends CommonObj = CommonObj>(path: string, part?: string) => Promise<Res>;
declare const getObjectFromJSContent: <Res extends CommonObj = CommonObj>(content: string, part?: string) => Promise<Res>;

/**
 * Get object from a JSON file.
 *
 * @param   {string}                     path - Path to the JSON file.
 * @returns {Promise<object | object[]>}      - The parsed JSON object.
 * @throws {Error} If there is an error reading the JSON file.
 * @example import { getObjectFromJSONFile } from "@dovenv/utils"
 *
 * const object = await getObjectFromJSONFile('/my/file.json')
 * console.log( object )
 */
declare const getObjectFromJSONFile: <Res extends CommonObj = CommonObj>(path: string) => Promise<Res>;
declare const getObjectFromJSONContent: <Res extends CommonObj = CommonObj>(content: string) => Promise<Res>;
declare const json: {
    deserialize: <Res extends CommonObj = CommonObj>(content: string) => Promise<Res>;
    serialize: (content: object) => string;
    parser: <Res extends CommonObj = CommonObj>(content: string) => Promise<Res>;
    stringify: (content: object) => string;
};

/**
 * Get object from a TOML file.
 *
 * @param   {string}                     path - Path to the JSON file.
 * @returns {Promise<object | object[]>}      - The parsed JSON object.
 * @throws {Error} If there is an error reading the JSON file.
 * @example import { getObjectFromTOMLFile } from "@dovenv/utils"
 *
 * const objectFromTOML = await getObjectFromTOMLFile('/my/file.toml')
 * console.log(objectFromTOML)
 */
declare const getObjectFromTOMLFile: <Res extends CommonObj = CommonObj>(path: string) => Promise<Res>;
declare const getObjectFromTOMLContent: <Res extends CommonObj = CommonObj>(content: string) => Promise<Res>;

/**
 * Fetches and parses an XML file into a JavaScript object.
 *
 * @template                Res  - The expected return type of the parsed object.
 * @param    {string}       path - The file path of the XML file to be read and parsed.
 * @returns  {Promise<Res>}      - A promise that resolves to the parsed XML as an object.
 * @throws {Error} If there is an error reading or parsing the XML file.
 */
declare const getObjectFromXMLFile: <Res extends CommonObj = CommonObj>(path: string) => Promise<Res>;
/**
 * Parses an XML content string into a JavaScript object.
 *
 * @template                Res     - The expected return type of the parsed object.
 * @param    {string}       content - The XML content string to be parsed.
 * @returns  {Promise<Res>}         - A promise that resolves to the parsed XML as an object.
 * @throws {Error} If there is an error parsing the XML content.
 */
declare const getObjectFromXMLContent: <Res extends CommonObj = CommonObj>(content: string) => Promise<Res>;

/**
 * Get object from a YAML file.
 *
 * @param   {string}                     path - Path to the JSON file.
 * @returns {Promise<object | object[]>}      - The parsed JSON object.
 * @throws {Error} If there is an error reading the JSON file.
 * @example import { getObjectFromYAMLFile } from "@dovenv/utils"
 *
 * const object = await getObjectFromYAMLFile('/my/file.yaml')
 * console.log( object )
 */
declare const getObjectFromYAMLFile: <Res extends CommonObj = CommonObj>(path: string) => Promise<Res>;
declare const getObjectFromYAMLContent: <Res extends CommonObj = CommonObj>(content: string) => Promise<Res>;

/**
 * Creates a function to merge multiple configuration objects into a single configuration.
 *
 * @template            Config - The type of the configuration objects.
 * @param    {object}   [opts] - Optional merge options for `deepmergeCustom`.
 * @returns  {Function}        A function that accepts multiple configuration objects or arrays of configuration objects
 *                             and returns a single merged configuration object.
 * @example
 * const mergeConfig = createMergeDataFn<{ foo: string; bar: string }>()
 * const config1 = { foo: 'bar' }
 * const config2 = { bar: 'foo' }
 * const merged = mergeConfig( config1, config2 )
 * // or
 * const merged = mergeConfig( [ config1, config2 ] )
 * console.log( merged )
 */
declare const createMergeDataFn: <Config>(opts?: Parameters<typeof deepmergeCustom<Config>>[0]) => (...config: (Config | Config[])[]) => Config;

/**
 * Retrieve an object from a file specified by path.
 * Supports JSON, YAML, TOML, JS, INI, CSV, or XML formats.
 *
 * @param   {string}          path - Path to the file.
 * @returns {Promise<object>}      - The object retrieved from the file.
 * @throws {Error} If the file does not exist, or if the data is not an object.
 * @example import { getObjectFromFile } from "@dovenv/utils"
 *
 * const objectFromJSON = await getObjectFromFile('/my/file.json')
 * const objectFromYAML = await getObjectFromFile('/my/file.yaml')
 * const objectFromTOML = await getObjectFromFile('/my/file.toml')
 * const objectFromINI = await getObjectFromFile('/my/file.ini')
 * console.log(
 *   objectFromJSON,
 *   objectFromYAML,
 *   objectFromTOML,
 *   objectFromINI
 * )
 */
declare const getObjectFromFile: <Res extends CommonObj = CommonObj>(path: string) => Promise<Res>;
/**
 * Retrieve an object from a file without checking if is correct file extension.
 * Supports JSON, YAML, TOML, JS, INI, CSV, or XML formats.
 *
 * @param   {string}          path - Path to the file.
 * @returns {Promise<object>}      - The object retrieved from the file.
 * @throws {Error} If there is an error reading the file or if the data is not an object.
 * @example import { getObjectFromNonCheckFile } from "@dovenv/utils"
 *
 * const objectFromFile = await getObjectFromNonCheckFile('/my/file') // without extension
 * console.log(objectFromFile)
 */
declare const getObjectFromNonCheckFile: <Res extends CommonObj = CommonObj>(path: string) => Promise<Res>;
/**
 * Retrieve an object from a file specified by path and filename.
 * Supports JSON, YAML, TOML, JS, INI, CSV, or XML formats.
 *
 * @param   {string}                       path     - Path to the directory containing the file.
 * @param   {string}                       filename - Name of the file (without extension).
 * @returns { Promise<object | undefined>}          - The object retrieved from the file.
 * @throws {Error} If the file does not exist, or if the data is not an object.
 * @example import { getObjectFromPath } from "@dovenv/utils"
 *
 * const content = await getObjectFromPath('/my/directory', 'my-file-name')
 * console.log( content )
 */
declare const getObjectFromPath: <Res extends CommonObj = CommonObj>(path: string, filename: string) => Promise<Res>;
/**
 * Get object from JSON, YAML, TOML, JS, INI, CSV, or XML string.
 *
 * @param   {string} data - The string to parse.
 * @returns {object}      - The parsed object.
 * @throws {Error} If the data is not a valid object.
 * @example import { getObjectFromContent } from "@dovenv/utils"
 *
 * const jsonContent  = '{"name": "super8"}'
 * const yamlContent  = 'name: super8'
 * const tomlContent  = 'name = "super8"'
 * const object1      = await getObjectFromContent( jsonContent )
 * const object2      = await getObjectFromContent( yamlContent )
 * const object3      = await getObjectFromContent( tomlContent )
 *
 * console.log( object1, object2, object3 )
 */
declare const getObjectFromContent: <Res extends CommonObj = CommonObj>(data: string) => Promise<Res>;
/**
 * Retrieve an object from a URL.
 * Supports JSON, YAML, and TOML formats.
 *
 * @param   {string}          url - URL of the resource.
 * @returns {Promise<object>}     - The object retrieved from the URL.
 * @throws {Error} If there is an error fetching data from the URL or parsing the object.
 * @example import { getObjectFromUrl } from "@dovenv/utils"
 *
 * // from YAML url
 * const objectFromYamlUrl = await getObjectFromUrl( 'https://raw.githubusercontent.com/pigeonposse/super8/main/.pigeonposse.yml' )
 * // from JSON url
 * const objectFromJsonUrl = await getObjectFromUrl( 'https://raw.githubusercontent.com/pigeonposse/clippo/main/package.json')
 *
 * console.log( objectFromYamlUrl, objectFromJsonUrl )
 */
declare const getObjectFromUrl: <Res extends CommonObj = CommonObj>(url: string) => Promise<Res>;
/**
 * Retrieve an object from either a file specified by path or a URL.
 * Supports JSON, YAML, and TOML formats.
 *
 * @param   {string}          input - Path to a file or URL of the resource.
 * @returns {Promise<object>}       - The object retrieved from the file or URL.
 * @throws {Error} If there is an error fetching data or parsing the object.
 * @example import { getObjectFrom } from "@dovenv/utils"
 *
 * const objectFromYamlUrl = await getObjectFrom( 'https://raw.githubusercontent.com/pigeonposse/super8/main/.pigeonposse.yml' )
 * const objectFromJSON = await getObjectFrom('/my/file.json')
 *
 * console.log( objectFromYamlUrl, objectFromJSON )
 */
declare const getObjectFrom: <Res extends CommonObj = CommonObj>(input: string) => Promise<Res>;

type CardinalThemeColorizer = (value: string, info: {
    tokens: ReadonlyArray<{
        type: string;
        value: string;
    }>;
    tokenIndex: number;
}) => string;
interface CardinalThemeTokenRule {
    [key: string]: CardinalThemeColorizer | undefined;
    _default?: CardinalThemeColorizer | undefined;
}
type CardinalTheme = Record<string, CardinalThemeTokenRule | undefined> & {
    _default?: CardinalThemeColorizer | undefined;
};
type CardinalOptions = {
    /** used to optionally override the theme used to highlight */
    theme?: CardinalTheme | undefined;
    /** if `true` line numbers are included in the highlighted code */
    linenos?: boolean | undefined;
    /** sets line number of the first line when line numbers are printed */
    firstline?: number | undefined;
    /**
     * if true JSX syntax is supported, otherwise cardinal will raise an error when encountering JSX
     *
     * @default false
     */
    jsx?: boolean | undefined;
};
type TerminalRendererOptions = {
    code?: ChalkInstance | ((s: string) => string) | undefined;
    blockquote?: ChalkInstance | ((s: string) => string) | undefined;
    html?: ChalkInstance | ((s: string) => string) | undefined;
    heading?: ChalkInstance | ((s: string) => string) | undefined;
    firstHeading?: ChalkInstance | ((s: string) => string) | undefined;
    hr?: ChalkInstance | ((s: string) => string) | undefined;
    listitem?: ChalkInstance | ((s: string) => string) | undefined;
    table?: ChalkInstance | ((s: string) => string) | undefined;
    paragraph?: ChalkInstance | ((s: string) => string) | undefined;
    strong?: ChalkInstance | ((s: string) => string) | undefined;
    em?: ChalkInstance | ((s: string) => string) | undefined;
    codespan?: ChalkInstance | ((s: string) => string) | undefined;
    del?: ChalkInstance | ((s: string) => string) | undefined;
    link?: ChalkInstance | ((s: string) => string) | undefined;
    href?: ChalkInstance | ((s: string) => string) | undefined;
    text?: ChalkInstance | ((s: string) => string) | undefined;
    /** Formats the bulletpoints and numbers for lists */
    list?: ((body: string, ordered?: boolean) => string) | undefined;
    /** Reflow and print-out width. Only applicable when `reflowText` is true. */
    width?: number | undefined;
    reflowText?: boolean | undefined;
    /** Should it prefix headers? */
    showSectionPrefix?: boolean | undefined;
    /** Whether or not to undo marked escaping of enitities (" -> &quot; etc) */
    unescape?: boolean | undefined;
    /** Whether or not to show emojis */
    emoji?: boolean | undefined;
    tableOptions?: TableConstructorOptions;
    /** The size of tabs in number of spaces or as tab characters */
    tab?: number | undefined;
};

/**
 * Fork of https://github.com/mikaelbr/marked-terminal/blob/master/index.js
 */

declare function markedTerminal(options?: TerminalRendererOptions, highlightOptions?: CardinalOptions): {
    renderer: {};
    useNewRenderer: boolean;
};

type MdLink = {
    name: string;
    URL: string;
    imgURL?: string;
};
/**
 * Creates a Markdown link or image from a name and URL.
 *
 * @param   {string} name     - The name of the link.
 * @param   {string} URL      - The URL of the link.
 * @param   {string} [imgURL] - The URL of an image of the link. If 'img', the function will return an image link.
 * @returns {string}          - The constructed Markdown link or image.
 */
declare const createMdLink: ({ name, URL, imgURL, }: MdLink) => string;
/**
 * Constructs Markdown links or images from an array of links.
 *
 * @param   {Array<MdLink>} links - The links to construct.
 * @returns {string}              - The constructed Markdown string.
 */
declare const createMdLinks: (links: Array<MdLink>) => string;
type BadgeURL = {
    path: string;
    color?: string;
    style?: 'plastic' | 'flat' | 'flat-square' | 'for-the-badge' | 'social';
    host?: string;
    label?: string;
    labelColor?: string;
    logo?: string;
    logoColor?: string;
    logoSize?: string;
};
/**
 * Create shields.io URL.
 *
 * @see https://shields.io/badges/
 * @example
 * const badgeURL = createBadgeURL({path: 'badge/any_text-you_like-blue'})
 */
declare const createBadgeURL: (params: BadgeURL) => string;

/**
 * Retrieves the Markdown content from a given path or URL or string.
 *
 * - If the input is a path, reads the file content.
 * - If the input is a URL, fetches the content.
 * - If the input is a string, returns it directly.
 * ---.
 *
 * @param   {string}          path - The path or URL to retrieve the Markdown content from.
 * @returns {Promise<string>}      - A promise that resolves to the Markdown content as a string.
 */
declare const getMD: (path: string) => Promise<string>;
/**
 * Retrieves the HTML content from a given path or URL or string.
 *
 * - If the input is a path, reads the file content.
 * - If the input is a URL, fetches the content.
 * - If the input is a string, returns it directly.
 * ---.
 *
 * @param   {string}          path - The path or URL to retrieve the HTML content from.
 * @returns {Promise<string>}      - A promise that resolves to the HTML content as a string.
 */
declare const getHTML: (path: string) => Promise<string>;
/**
 * Converts Markdown input to HTML.
 *
 * - If the input is a path, reads the file and converts its content.
 * - If the input is a URL, fetches the content and converts it.
 * - if the input is a string, converts it directly.
 * ---.
 *
 * @param   {string} input - The Markdown input to convert.
 * @returns {string}       - The converted HTML string.
 */
declare const md2html: (input: string) => Promise<string>;
type Md2TerminalOpts = {
    /**
     * Optional Used to override default styling.
     *
     * @see https://github.com/mikaelbr/marked-terminal?tab=readme-ov-file#options
     */
    renderer?: Parameters<typeof markedTerminal>[0];
    /**
     * Options passed into cli-highlight. See readme there to see what options to pass.
     *
     * @see https://github.com/felixfbecker/cli-highlight
     */
    highlight?: Parameters<typeof markedTerminal>[1];
};
/**
 * Converts a Markdown input to a terminal formatted string.
 *
 * - If the input is a path, reads the file and converts its content.
 * - If the input is a URL, fetches the content and converts it.
 * - if the input is a string, converts it directly.
 * ---.
 *
 * @param   {string}          input - The Markdown string, path or URL to convert.
 * @param   {Md2TerminalOpts} opts  - Options.
 * @returns {Promise<string>}       - The converted string.
 */
declare const md2terminal: (input: string, opts?: Md2TerminalOpts) => Promise<string>;
/**
 * Converts HTML to Markdown.
 *
 * - If the input is a path, reads the file and converts its content.
 * - If the input is a URL, fetches the content and converts it.
 * - if the input is a string, converts it directly.
 * ---.
 *
 * @param   {string}          input - The HTML input to convert.
 * @returns {Promise<string>}       - The converted Markdown as a string.
 */
declare const html2md: (input: string) => Promise<string>;
/**
 * Converts HTML to a formatted string suitable for the terminal.
 *
 * - If the input is a path, reads the file and converts its content.
 * - If the input is a URL, fetches the content and converts it.
 * - if the input is a string, converts it directly.
 * ---.
 *
 * @param   {string}          input - The HTML input to convert.
 * @returns {Promise<string>}       - The formatted string.
 */
declare const html2terminal: (input: string) => Promise<string>;
declare const incrementMdHeaders: (content: string) => string;
/**
 * Parses the given Markdown string and returns an array of objects containing
 * the title, level and anchor for each header found.
 *
 * - If the input is a path, reads the file input.
 * - If the input is a URL, fetches the content.
 * - if the input is a string, gets it directly.
 * ---.
 *
 * @param   {string}            input - The Markdown input to parse.
 * @returns {Promise<object[]>}       - An array of objects with the following properties:
 *                                    - `level`: The header level (1-6).
 *                                    - `title`: The header title.
 *                                    - `anchor`: The header anchor.
 */
declare const getMDToc: (input: string) => Promise<{
    level: number;
    title: string;
    anchor: string;
}[]>;
type MdTocStringOpts = {
    /**
     * The Markdown content to be used for generating the Table of Contents.
     * This can be a string of Markdown content, a file, or a URL.
     *
     * @example
     * const markdown = '# Header 1\n## Header 2\n';
     */
    input: string;
    /**
     * The title for the Table of Contents. If not provided, the default value is 'Table of Contents'.
     *
     * @default undefined
     */
    title?: string;
    /**
     * If set to `true`, headers of level 1 (`#`) will be removed from the Table of Contents.
     *
     * @default false
     */
    removeH1?: boolean;
    /**
     * The maximum heading level to include in the Table of Contents.
     * If not provided, the TOC will include all heading levels.
     *
     * @default 6
     */
    maxHeadingLevel?: number;
};
/**
 * Creates a Markdown index from the given Markdown string.
 *
 * - If the input is a path, reads the file input.
 * - If the input is a URL, fetches the content.
 * - if the input is a string, gets it directly.
 * ---.
 *
 * @param   {string}          opts                   - Options.
 * @param   {string}          opts.input             - The Markdown input to create an index from.
 * @param   {string}          [opts.title]           - The title of the index.
 * @param   {boolean}         [opts.removeH1]        - If set to `true`, headers of level 1 (`#`) will be removed.
 * @param   {number}          [opts.maxHeadingLevel] - The maximum heading level to include in the Table of Contents.
 * @returns {Promise<string>}                        - The generated Markdown index as a string.
 */
declare const geMDTocString: (opts: MdTocStringOpts) => Promise<string>;

/**
 * Catches errors from a promise and returns a tuple indicating success or failure.
 *
 * @template                                     T       - The type of the resolved value of the promise.
 * @param    {Promise<T>}                        promise - The promise to handle errors for.
 * @returns  {Promise<[undefined, T] | [Error]>}         A promise that resolves to a tuple.
 *                                                       The tuple contains either `[undefined, T]` if the promise is resolved successfully,
 *                                                       or `[Error]` if an error occurs.
 */
declare const catchError: <T>(promise: Promise<T>) => Promise<[undefined, T] | [Error]>;
/**
 * A generic error class that extends the native `Error` class to include
 * additional contextual data.
 *
 * This class is useful for creating strongly-typed errors in TypeScript, allowing
 * you to provide structured data along with the error message for improved error handling.
 *
 * ---.
 *
 * @template M - The type of the error message. Defaults to `string`.
 * @template D - The type of the additional data associated with the error. Defaults to `undefined`.
 * @example
 * // Basic usage with a string message
 *
 * const error = new TypedError('Something went wrong');
 * console.error(error.message); // "Something went wrong"
 * @example
 * // Usage with additional data
 *
 * const error = new TypedError('Validation failed', { field: 'email', reason: 'invalid' });
 * console.error(error.message); // "Validation failed"
 * console.error(error.data); // { field: 'email', reason: 'invalid' }
 * @example
 * // Usage in a try-catch block
 *
 * try {
 *   throw new TypedError('Database connection failed', { host: 'localhost', port: 5432 });
 * } catch (err) {
 *   if (err instanceof TypedError) {
 *     console.error(`Error: ${err.message}`);
 *     console.error('Error Data:', err.data);
 *   }
 * }
 * @example
 * // Custom error class With TypeScript and specific data type
 *
 * const ERRORS = ['unexpected', 'validation', 'database'] as const;
 * class AppError extends TypedError<typeof ERRORS[number], { user: string }> {}
 *
 * const successError = new AppError( 'validation', { user: 'username' } );
 * const failError = new AppError( 'not-exist', { user: 'username' } );  // Must be fail because message not exist
 * const failError2 = new AppError( 'unexpected', { key: 'username' } ); // Must be fail because data not match
 */
declare class TypedError<M extends string = string, D = undefined> extends Error {
    data: D | undefined;
    constructor(message: M, data?: D);
}

declare const PKG_MANAGER: {
    readonly BUN: "bun";
    readonly NPM: "npm";
    readonly PNPM: "pnpm";
    readonly YARN: "yarn";
};
declare const RUNTIME: {
    readonly NODE: "node";
    readonly BUN: "bun";
    readonly DENO: "deno";
};

type WorkspaceParams = {
    pkg: PackageJSON;
};
type PackageName = string;
type PackageURL = string | URL;
type PackagePath = string;
type PackageContent = PackageJSON;
type PackageInput = PackagePath | PackageURL | PackageName | PackageContent;
type PackageManager = typeof PKG_MANAGER[keyof typeof PKG_MANAGER];
type Runtime = typeof RUNTIME[keyof typeof RUNTIME];
type PackageOpts = {
    remote?: PackageRemoteOpts;
};
type PackageRemoteOpts = {
    /**
     * Package version
     *
     * @default 'latest'
     */
    version: number | string;
    /**
     * Registry to get package from
     *
     * @default 'https://registry.npmjs.org'
     */
    registry?: string;
};
type PackageRepoUrlOpts = {
    /**
     * Returns url with directory if has one.
     *
     * @default true
     */
    dir: boolean;
};
type PackageManagerCmdsValue = {
    /** Audit package(s) */
    audit: string;
    /** Fix Audition package(s) */
    auditFix: string;
    /** Checks for outdated packages */
    outdated: string;
    /** Update dependencies */
    upDeps: string;
    /** Fetches a package from the registry without installing it as a dependency, hotloads it, and runs whatever default command binary it exposes. */
    exec: string;
    /** Install packages */
    install: string;
};
type PackageManagerCmds = Record<PackageManager, PackageManagerCmdsValue>;
type PackageData = {
    /** name of the package or basename to package.json */
    id: string;
    /** Directory of package */
    dir: string;
    /** Path to package.json */
    packagePath: string;
    /** Sanitized Repository URL */
    repoUrl?: string;
    /** Package.json content */
    content: PackageContent;
};
type WorkspaceOpts = {
    /**
     * Main package json
     */
    pkg?: PackageContent;
    /**
     * Workspace directory
     *
     * @default process.cwd()
     */
    wsDir?: string;
};

/**
 * Retrieves a package from the npm registry.
 *
 * @param   {PackageName}       input  - The name of the package you want to retrieve.
 * @param   {PackageRemoteOpts} [opts] - Options object.
 * @returns {object}                   The package object.
 * @throws If the package is not found.
 * @example
 * const pkg = await getPackageFromName('@dovenv/utils')
 * console.log(pkg)
 */
declare const getPackageFromName: (input: PackageName, opts?: PackageRemoteOpts) => Promise<PackageContent>;
/**
 * Retrieves a package from the npm registry.
 *
 * If the input is a URL, it extracts the package name from the path.
 * If the path starts with '/package/', the package name is the next part of the path.
 * Otherwise, the package name is the first part of the path.
 *
 * @param   {PackageURL}        input  - The name or URL of the package you want to retrieve.
 * @param   {PackageRemoteOpts} [opts] - Options object.
 * @returns {object}                   The package object.
 * @throws If the package is not found.
 * @example
 * const pkg = await getPackageFromUrl('https://registry.npmjs.org/@dovenv/utils')
 * console.log(pkg)
 *
 * // from npm web
 * const pkg = await getPackageFromUrl('https://www.npmjs.com/package/backan?activeTab=code')
 * console.log(pkg)
 */
declare const getPackageFromUrl: (input: PackageURL, opts?: PackageRemoteOpts) => Promise<PackageContent>;
/**
 * Returns the path to the package.json file for the given package path.
 *
 * If the given path is a directory, it appends 'package.json' to the path.
 * If the given path is a file, it returns the path as is.
 *
 * @param   {PackagePath} input - The path to the package. Supports directory paths or package.json file paths.
 * @returns {string}            The path to the package.json file.
 * @example
 * const pkgJsonPath = getPackageJsonPath('./packages/core/package.json')
 * console.log(pkgJsonPath)
 *
 * // from directory
 * const pkgJsonPath = getPackageJsonPath('./packages/core')
 * console.log(pkgJsonPath)
 */
declare const getPackageJsonPath: (input: PackagePath) => string;
/**
 * Retrieves a package from a local file path.
 *
 * @param   {PackagePath} input - The path to the package. Supoorts directory paths or package.json file paths.
 * @returns {object}            The package object.
 * @throws If the package is not found.
 * @example
 * const pkg = await getPackageFromPath('./packages/core/package.json')
 * console.log(pkg)
 *
 * // from directory
 * const pkg = await getPackageFromPath('./packages/core')
 * console.log(pkg)
 */
declare const getPackageFromPath: (input: PackagePath) => Promise<PackageContent>;
/**
 * Retrieves a package from either a file specified by path, a URL, or a package name.
 *
 * If the input is a URL, it retrieves the package from the npm registry.
 * If the input is a path, it retrieves the package from the file at the path or the package.json file in the directory.
 * If the input is a string, it retrieves the package from the npm registry with the given package name.
 *
 * @param   {PackageInput} input  - The package name, URL, or path to the package.
 * @param   {PackageOpts}  [opts] - Options object.
 * @returns {object}              The package object.
 * @throws If the package is not found.
 * @example
 * const pkg = await getPackage('@dovenv/core')
 * console.log(pkg)
 *
 * // from npm web
 * const pkg = await getPackage('https://www.npmjs.com/package/@dovenv/core')
 * console.log(pkg)
 *
 * // from directory
 * const pkg = await getPackage('./packages/core')
 * console.log(pkg)
 */
declare const getPackage: (input: PackageInput, opts?: PackageOpts) => Promise<PackageContent>;
declare const getPackageDataFromPath: (input: PackagePath) => Promise<PackageData>;
/**
 * Finds the closest package.json by traversing up the directory tree.
 *
 * @param   {string} [startDir] - Directory to start searching from.
 * @returns {string}            Absolute path to the closest package.json.
 * @throws {Error} If no package.json is found.
 */
declare const getClosestPackageJsonPath: (startDir?: string) => Promise<string>;
/**
 * Finds the closest package directory by traversing up the directory tree.
 *
 * @param   {string} [startDir] - Directory to start searching from.
 * @returns {string}            Absolute path to the closest package directory.
 */
declare const getClosestPackageDir: (startDir?: string) => Promise<string>;

declare class PackageManagerData {
    #private;
    /**
     * Default package manager
     */
    default: "npm";
    constructor({ pkg }: {
        pkg: PackageContent;
    });
    /**
     * Retrieves the active package manager name.
     *
     * This method returns the package manager in the following order of precedence:
     * - Development mode package manager, if specified.
     * - Production mode package manager, if specified.
     * - Default package manager.
     *
     * @returns {PackageManager} The name of the active package manager.
     */
    get value(): PackageManager;
    /**
     * Gets the package manager name.
     * Checks the "packageManager" property in the package.json.
     *
     * @returns {PackageManager} The package manager name.
     */
    get prod(): PackageManager | undefined;
    /**
     * Gets the package manager name in development mode.
     *
     * Checks the "devEngines.packageManager.name" property in the package.json.
     *
     * @returns {PackageManager | undefined} The package manager name.
     */
    get dev(): PackageManager | undefined;
    /**
     * Retrieves the command mappings for the package manager in production mode.
     *
     * The returned object contains commands for various package management tasks,
     * such as auditing, updating, installing, and executing packages, specifically
     * configured for production environments.
     *
     * @returns {PackageManagerCmdsValue | undefined} An object containing package manager commands for production mode, or undefined if no package manager is found.
     */
    get prodCmds(): PackageManagerCmdsValue | undefined;
    /**
     * Retrieves the command mappings for the package manager in development mode.
     *
     * The returned object contains commands for various package management tasks,
     * such as auditing, updating, installing, and executing packages, specifically
     * configured for development environments.
     *
     * @returns {PackageManagerCmdsValue | undefined} An object containing package manager commands for development mode, or undefined if no package manager is found.
     */
    get devCmds(): PackageManagerCmdsValue | undefined;
    /**
     * Retrieves the command mappings for the package manager.
     *
     * The returned object contains commands for various package management tasks,
     * such as auditing, updating, installing, and executing packages.
     *
     * @returns {PackageManagerCmdsValue} An object containing package manager commands.
     */
    get cmds(): PackageManagerCmdsValue;
}
declare const getPackageManagerFromContent: (input: PackageContent) => PackageManagerData;
declare const getPackageManagerFromUrl: (input: PackageURL, opts?: {
    pkg?: Parameters<typeof getPackageFromUrl>[1];
}) => Promise<PackageManagerData>;
declare const getPackageManagerFromPath: (input: PackagePath) => Promise<PackageManagerData>;
declare const getPackageManagerFromName: (input: PackageName, opts?: {
    pkg?: Parameters<typeof getPackageFromName>[1];
}) => Promise<PackageManagerData>;
declare const getPackageManager: (input: PackageInput, opts?: {
    pkg?: Parameters<typeof getPackage>[1];
}) => Promise<PackageManagerData>;
/**
 * Retrieves the package manager commands for the given package manager and monorepo mode.
 *
 * @param   {PackageManager} manager  - The package manager.
 * @param   {boolean}        monoRepo - Whether the workspace is a monorepo.
 * @returns {object}                  The package manager commands.
 */
declare const getPackageManagerCommands: (manager: PackageManager, monoRepo: boolean) => PackageManagerCmds[keyof PackageManagerCmds];

/**
 * Retrieves the repository URL from the given package JSON content.
 *
 * If the repository is an object with a 'url' property, and the 'dir' option is true,
 * the directory is appended to the URL.
 *
 * @param   {PackageContent}     input - The package JSON object containing repository information.
 * @param   {PackageRepoUrlOpts} opts  - Options for URL retrieval.
 * @returns {string | undefined}       The sanitized repository URL with optional directory, or undefined if not found.
 * @throws Will throw an error if there is an unexpected error retrieving the URL.
 * @example
 * const pkg = await getPackage('@dovenv/utils') // get package.json object
 * const repoUrl = await getPackageRepoUrlFromContent(pkg)
 * console.log(repoUrl)
 */
declare const getPackageRepoUrlFromContent: (input: PackageContent, opts?: PackageRepoUrlOpts) => string | undefined;
/**
 * Retrieves the repository URL for a package given its name.
 *
 * This function fetches the package JSON using the package name and extracts
 * the repository URL, optionally appending the directory if specified in the options.
 *
 * @param   {PackageName}                 input  - The name of the package to retrieve the repository URL for.
 * @param   {PackageRepoUrlOpts}          [opts] - Options for URL retrieval, including whether to append the directory.
 * @returns {Promise<string | undefined>}        A promise resolving to the sanitized repository URL with optional directory, or undefined if not found.
 * @throws  Will throw an error if there is an unexpected error retrieving the URL.
 * @example
 * const repoUrl = await getPackageRepoUrlFromName('@dovenv/utils')
 * console.log(repoUrl)
 */
declare const getPackageRepoUrlFromName: (input: PackageName, opts?: PackageRepoUrlOpts & {
    pkg?: PackageRemoteOpts;
}) => Promise<string | undefined>;
/**
 * Retrieves the repository URL for a package given its URL.
 *
 * This function fetches the package JSON using the package URL and extracts
 * the repository URL, optionally appending the directory if specified in the options.
 *
 * @param   {PackageURL}                  input  - The URL of the package to retrieve the repository URL for.
 * @param   {PackageRepoUrlOpts}          [opts] - Options for URL retrieval, including whether to append the directory.
 * @returns {Promise<string | undefined>}        A promise resolving to the sanitized repository URL with optional directory, or undefined if not found.
 * @throws  Will throw an error if there is an unexpected error retrieving the URL.
 * @example
 * const repoUrl = await getPackageRepoUrlFromUrl('https://registry.npmjs.org/@dovenv/utils')
 * console.log(repoUrl)
 */
declare const getPackageRepoUrlFromUrl: (input: PackageURL, opts?: PackageRepoUrlOpts & {
    pkg?: PackageRemoteOpts;
}) => Promise<string | undefined>;
/**
 * Retrieves the repository URL for a package given its file path.
 *
 * This function fetches the package JSON using the package path and extracts
 * the repository URL, optionally appending the directory if specified in the options.
 *
 * @param   {PackagePath}                 input  - The file path of the package to retrieve the repository URL for.
 * @param   {PackageRepoUrlOpts}          [opts] - Options for URL retrieval, including whether to append the directory.
 * @returns {Promise<string | undefined>}        A promise resolving to the sanitized repository URL with optional directory, or undefined if not found.
 * @throws  Will throw an error if there is an unexpected error retrieving the URL.
 * @example
 * const repoUrl = await getPackageRepoUrlFromPath('./packages/core')
 * console.log(repoUrl)
 */
declare const getPackageRepoUrlFromPath: (input: PackagePath, opts?: PackageRepoUrlOpts) => Promise<string | undefined>;
/**
 * Retrieves the repository URL for a package given its path, URL, name, or content.
 *
 * This function takes an input which can be a package path, URL, name, or content,
 * and returns the repository URL, optionally appending the directory if specified in the options.
 *
 * @param   {PackageInput}                input  - The package path, URL, name, or content to retrieve the repository URL for.
 * @param   {PackageRepoUrlOpts}          [opts] - Options for URL retrieval, including whether to append the directory.
 * @returns {Promise<string | undefined>}        A promise resolving to the sanitized repository URL with optional directory, or undefined if not found.
 * @throws  Will throw an error if there is an unexpected error retrieving the URL.
 * @example
 * const repoUrl = await getPackageRepoUrl('./packages/core')
 * console.log(repoUrl)
 *
 * // from npm web
 * const repoUrl = await getPackageRepoUrl('https://www.npmjs.com/package/@dovenv/utils')
 * console.log(repoUrl)
 *
 * // from package name
 * const repoUrl = await getPackageRepoUrl('@dovenv/utils')
 * console.log(repoUrl)
 *
 * // from package content
 * const pkg = await getPackage('@dovenv/utils')
 * const repoUrl = await getPackageRepoUrl(pkg)
 * console.log(repoUrl)
 */
declare const getPackageRepoUrl: (input: PackageInput, opts?: PackageRepoUrlOpts & {
    pkg?: PackageOpts;
}) => Promise<string | undefined>;

declare class RuntimeData {
    #private;
    /**
     * Default package Runtime
     */
    default: "node";
    constructor({ pkg }: {
        pkg: PackageContent;
    });
    /**
     * Gets the runtime of the current package.
     *
     * Checks the "engines.runtime.name" property in the package.json.
     *
     * @returns {Runtime} The runtime name.
     */
    get value(): Runtime;
    /**
     * Gets the runtime of the current package in production mode.
     *
     * Checks the "engines" property in the package.json.
     *
     * @returns {Runtime | undefined} The runtime name.
     */
    get prod(): Runtime | undefined;
    /**
     * Gets the runtime of the current package in development mode.
     *
     * Checks the "devEngines.runtime.name" property in the package.json.
     *
     * @returns {Runtime | undefined} The runtime name.
     */
    get dev(): Runtime | undefined;
}
declare const getPackageRuntimeFromContent: (input: PackageContent) => RuntimeData;
declare const getPackageRuntimeFromUrl: (input: PackageURL, opts?: {
    pkg?: Parameters<typeof getPackageFromUrl>[1];
}) => Promise<RuntimeData>;
declare const getPackageRuntimeFromPath: (input: PackagePath) => Promise<RuntimeData>;
declare const getPackageRuntimeFromName: (input: PackageName, opts?: {
    pkg?: Parameters<typeof getPackageFromName>[1];
}) => Promise<RuntimeData>;
declare const getPackageRuntime: (input: Parameters<typeof getPackage>[0], opts?: {
    pkg?: Parameters<typeof getPackage>[1];
}) => Promise<RuntimeData>;

/**
 * Retrieves the version of a package.
 *
 * This function takes an input which can be a package name, URL, or path,
 * and returns the version of the specified package.
 *
 * @param   {Parameters<typeof getPackage>[0]} input - The package identifier (name, URL, or path).
 * @returns {Promise<string>}                        A promise that resolves to the package version.
 * @throws  If the package is not found or an error occurs during retrieval.
 */
declare const getPackageVersion: (input: Parameters<typeof getPackage>[0]) => Promise<string | undefined>;

declare const getPackageWorkspacePaths: (opts: Required<WorkspaceOpts> & {
    manager?: PackageManager;
}) => Promise<string[]>;
declare class WorkspaceData {
    #private;
    packageManager: PackageManagerData;
    runtime: RuntimeData;
    constructor(opts?: WorkspaceOpts);
    /**
     * Determines if the current package is part of a monorepo.
     * Checks for the presence of the `workspaces` field in the package.json.
     *
     * @returns {boolean} True if the package is part of a monorepo, otherwise false.
     */
    get monorepo(): boolean;
    /**
     * Gets the paths of the packages in the workspace.
     * If the current package is part of a monorepo managed by pnpm, it reads the package paths from the "pnpm-workspace.yaml" file.
     * Otherwise, it reads the package paths from the "workspaces" field in the package.json.
     *
     * @returns {Promise<string[]>} An array of paths to the package.json files of the packages in the workspace.
     */
    getPackagePaths(): Promise<string[]>;
    /**
     * Retrieves an array of package data objects containing the package name, path to the package.json file, and the package data itself.
     *
     * @returns {Promise<PackageData[]>} An array of package data objects.
     */
    getPackagesData(): Promise<PackageData[]>;
}
declare const getWorkspaceUtils: (opts?: WorkspaceOpts) => WorkspaceData;

type MediaInput = URL | string | Buffer;

declare const getMediaInput: (input: MediaInput) => Promise<Buffer>;

/**
 * Extracts a color palette from a PNG image using pngjs.
 *
 * @param   {MediaInput}        input      - The image file path or buffer.
 * @param   {number}            colorCount - Number of colors to extract.
 * @returns {Promise<string[]>}            - Array of HEX color codes.
 */
declare const getMediaPalette: (input: MediaInput, colorCount?: number) => Promise<string[]>;

/**
 * Converts an image file to a Data URI.
 *
 * @param   {object}          opts        - Options.
 * @param   {string}          opts.input  - The path to the image file.
 * @param   {string}          [opts.type] - The MIME type to use for the Data URI. If not provided, the function will try to guess the type based on the file extension.
 * @returns {Promise<string>}             - A promise that resolves to the Data URI.
 * @example
 * const dataUri = await image2DataUri({ input: './logo.png' })
 */
declare const image2DataUri: (opts: {
    input: string;
    type?: string;
}) => Promise<string>;

export { LazyLoader, PackageManagerData, RunLocalNodeBinError, RuntimeData, TypedError, ValidateError, Validation, align$1 as align, animate, escape as ansiEscapes, ansiRegex, arePathsEqual, asciiFont, box, cache, camel2Kebab, camel2Pascal, camel2Snake, cancel, capitalize, catchError, catchExecOutput, chroma, color, colorConversion, columns, compress, compressDir, compressFile, compressFiles, copyDir, copyFile, createBadgeURL, createCli, createDir, createMdLink, createMdLinks, createMergeDataFn, createSymlink, createValidateSchema, createValidateSchemaFn, decompress, dedent, delay, deprecatedAlerts, deserializeValidation, downloadGitHubPath, downloadGitHubRelease, ensureDir, exec, execChild, execModulePath, execModulePathWithOutput, execProcess, existsDir, existsFile, existsLocalBin, existsLocalBins, existsOptions, existsPath, fetch2string, formatValidationError, geMDTocString, getAbsolutePath, getArch, getArrayFlagValue, getBaseName, getBooleanFlagValue, getCharsAndWords, getCharsAndWordsFrom, getCharsAndWordsFromContent, getCharsAndWordsFromPaths, getCharsAndWordsFromUrl, getChoiceFlagValue, getClosestPackageDir, getClosestPackageJsonPath, getCmd, getCountFromPaths, getCurrentDateTime, getCurrentDateTimeString, getCurrentDir, getDirName, getDirTree, getExtName, getFileText, getFilteredFileNames, getHTML, getLocalNodeBinPath, getLocalPkgPath, getMD, getMDToc, getMatch, getMediaInput, getMediaPalette, getModulePath, getObjectFrom, getObjectFromCSVContent, getObjectFromCSVFile, getObjectFromContent, getObjectFromFile, getObjectFromINIContent, getObjectFromINIFile, getObjectFromJSContent, getObjectFromJSFile, getObjectFromJSONContent, getObjectFromJSONFile, getObjectFromNonCheckFile, getObjectFromPath, getObjectFromTOMLContent, getObjectFromTOMLFile, getObjectFromUrl, getObjectFromXMLContent, getObjectFromXMLFile, getObjectFromYAMLContent, getObjectFromYAMLFile, getPackage, getPackageDataFromPath, getPackageFromName, getPackageFromPath, getPackageFromUrl, getPackageJsonPath, getPackageManager, getPackageManagerCommands, getPackageManagerFromContent, getPackageManagerFromName, getPackageManagerFromPath, getPackageManagerFromUrl, getPackageRepoUrl, getPackageRepoUrlFromContent, getPackageRepoUrlFromName, getPackageRepoUrlFromPath, getPackageRepoUrlFromUrl, getPackageRuntime, getPackageRuntimeFromContent, getPackageRuntimeFromName, getPackageRuntimeFromPath, getPackageRuntimeFromUrl, getPackageVersion, getPackageWorkspacePaths, getPaths, getPathsStream, getPathsStructure, getPathsTree, getPlatform, getRandomUUID, getStringFlagValue, getStringFrom, getStringType, getStringsFrom, getSystemEnvPaths, getTempDir, getWorkspaceUtils, gradient, hideBin, highlight, html2md, html2terminal, icon, image2DataUri, incrementMdHeaders, indent, isAbsolutePath, isBrowser, isBun, isDeno, isDev, isDirectory, isGitHubAuthenticated, isJsDom, isNode, isPath, isWebWorker, joinPath, joinUrl, json, kebab2Camel, kebab2Pascal, kebab2Snake, line, link$1 as link, localStorage, logger, md2html, md2terminal, normalizePath, object2string, onCancel, onConsole, onExit, onStd, open, openApp, pascal2Camel, pascal2Kebab, pascal2Snake, path2FileUrl, performance, promptGroup, promptLine, promptLineCore, promptLineEnquirer, promptLineGroup, promptLineMethods, readDir, readFile, readFiles, relativePath, removeDir, removeDirIfExist, removeEmptyLines, removeFile, removeFileIfExist, removePathIfExist, renamePath, renderAsciiFont, replaceConsole, replacePlaceholders, replaceStd, resolvePath, rmDeprecationAlerts, runLocalNodeBin, schema2object, schema2ts, schema2type, schema2zod, serializeValidation, setDirTree, snake2Camel, snake2Kebab, snake2Pascal, spinner, table, truncate, validate, validateHomeDir, validateSchema, writeFile, writeFileContent, zod2schema };
export type { Any, AnyArray, AssertEqual, BoxOptions, BoxParams, ClackPrompts, ColumnData, ColumnOpts, ColumnsParams, CreateDedent, Dedent, DedentOptions, DeepNonNullable, DeepPartial, DeepRequired, ExpectEqual, FontName, FunctionKeys, GradientColors, GradientOpts, HighlightOpts, MediaInput, NonFunctionKeys, NonUndefined, NumberParams, NumberPrompt, ObjectKeys, ObjectValues, PackageContent, PackageData, PackageInput, PackageJSON, PackageManager, PackageManagerCmds, PackageManagerCmdsValue, PackageName, PackageOpts, PackagePath, PackageRemoteOpts, PackageRepoUrlOpts, PackageURL, Prettify, PromptLineCancelProps, PromptLineCustomProps, PromptLineMethod, PromptLineParams, PromptLineProps, PromptParams, RemoveEmptyLinesOptions, ReturnAwaitedType, Runtime, TableData, TableOpts, TableParams, ToObjectValidate, ToValidate, Validate, ValidateAnyType, ValidateErrorType, ValidateInfer, ValidateType, WorkspaceOpts, WorkspaceParams };
