Comparing version 0.39.2 to 0.40.0
@@ -51,2 +51,13 @@ declare global { | ||
declare global { | ||
interface Object { | ||
/** | ||
* Determines whether an object has a property with the specified name. | ||
* @param o An object. | ||
* @param v A property name. | ||
*/ | ||
hasOwn(o: object, v: PropertyKey): boolean; | ||
} | ||
} | ||
export {}; | ||
declare global { | ||
interface PromiseConstructor { | ||
@@ -65,13 +76,2 @@ /** | ||
declare global { | ||
interface Object { | ||
/** | ||
* Determines whether an object has a property with the specified name. | ||
* @param o An object. | ||
* @param v A property name. | ||
*/ | ||
hasOwn(o: object, v: PropertyKey): boolean; | ||
} | ||
} | ||
export {}; | ||
declare global { | ||
interface Error { | ||
@@ -89,1 +89,2 @@ cause?: unknown; | ||
export {}; | ||
//# sourceMappingURL=_dnt.polyfills.d.ts.map |
@@ -13,2 +13,3 @@ /// <reference types="node" /> | ||
prototype: ReadableStream<any>; | ||
from<T>(iterable: Iterable<T> | AsyncIterable<T>): ReadableStream<T>; | ||
}; | ||
@@ -28,1 +29,2 @@ WritableStream: { | ||
}; | ||
//# sourceMappingURL=_dnt.shims.d.ts.map |
/// <reference types="node" /> | ||
import "./_dnt.polyfills.js"; | ||
import { CommandBuilder } from "./src/command.js"; | ||
import { Delay, DelayIterator, symbols } from "./src/common.js"; | ||
import { ConfirmOptions, MultiSelectOptions, ProgressBar, ProgressOptions, PromptOptions, SelectOptions } from "./src/console/mod.js"; | ||
import type { TemplateExpr } from "./src/command.js"; | ||
import { type Delay, type DelayIterator, symbols } from "./src/common.js"; | ||
import { type ConfirmOptions, type MultiSelectOptions, ProgressBar, type ProgressOptions, type PromptOptions, type SelectOptions } from "./src/console/mod.js"; | ||
import { createPath, Path } from "./src/path.js"; | ||
import { RequestBuilder } from "./src/request.js"; | ||
import { createPath, Path } from "./src/path.js"; | ||
import { outdent } from "./src/vendor/outdent.js"; | ||
export type { Delay, DelayIterator } from "./src/common.js"; | ||
@@ -14,7 +16,7 @@ export { TimeoutError } from "./src/common.js"; | ||
export { PathRef }; | ||
export { CommandBuilder, CommandChild, CommandResult, KillSignal, KillSignalController, type KillSignalListener, type TemplateExpr, } from "./src/command.js"; | ||
export type { CommandContext, CommandHandler, CommandPipeReader, CommandPipeWriter } from "./src/command_handler.js"; | ||
export type { ConfirmOptions, MultiSelectOption, MultiSelectOptions, ProgressBar, ProgressOptions, PromptInputMask, PromptOptions, SelectOptions, } from "./src/console/mod.js"; | ||
export type { ExpandGlobOptions, PathSymlinkOptions, SymlinkOptions, WalkEntry, WalkOptions } from "./src/path.js"; | ||
export { CommandBuilder, CommandChild, CommandResult, KillSignal, KillSignalController, type KillSignalListener, } from "./src/command.js"; | ||
export type { CommandContext, CommandHandler, CommandPipeReader, CommandPipeWriter } from "./src/command_handler.js"; | ||
export type { Closer, Reader, ShellPipeReaderKind, ShellPipeWriterKind, WriterSync } from "./src/pipes.js"; | ||
export type { ConfirmOptions, MultiSelectOption, MultiSelectOptions, ProgressBar, ProgressOptions, PromptInputMask, PromptOptions, SelectOptions, } from "./src/console/mod.js"; | ||
export { RequestBuilder, RequestResponse } from "./src/request.js"; | ||
@@ -63,3 +65,3 @@ export type { CdChange, ContinueExecuteResult, EnvChange, ExecuteResult, ExitExecuteResult, SetEnvVarChange, SetShellVarChange, UnsetVarChange, } from "./src/result.js"; | ||
export interface $Template { | ||
(strings: TemplateStringsArray, ...exprs: any[]): CommandBuilder; | ||
(strings: TemplateStringsArray, ...exprs: TemplateExpr[]): CommandBuilder; | ||
} | ||
@@ -70,3 +72,3 @@ /** | ||
*/ | ||
type Outdent = typeof import("./src/deps.js").outdent; | ||
type Outdent = typeof outdent; | ||
/** | ||
@@ -76,3 +78,3 @@ * `which` from the https://deno.land/x/which module. | ||
*/ | ||
type Which = typeof import("./src/deps.js").which; | ||
type Which = typeof import("./deps/jsr.io/@david/which/0.3.0/mod.js").which; | ||
/** | ||
@@ -82,3 +84,3 @@ * `whichSync` from the https://deno.land/x/which module. | ||
*/ | ||
type WhichSync = typeof import("./src/deps.js").whichSync; | ||
type WhichSync = typeof import("./deps/jsr.io/@david/which/0.3.0/mod.js").whichSync; | ||
/** Collection of built-in properties that come with a `$`. */ | ||
@@ -436,3 +438,3 @@ export interface $BuiltInProperties<TExtras extends ExtrasObject = {}> { | ||
*/ | ||
raw(strings: TemplateStringsArray, ...exprs: any[]): CommandBuilder; | ||
raw(strings: TemplateStringsArray, ...exprs: TemplateExpr[]): CommandBuilder; | ||
/** | ||
@@ -504,1 +506,2 @@ * Does the provided action until it succeeds (does not throw) | ||
export default $; | ||
//# sourceMappingURL=mod.d.ts.map |
@@ -1,4 +0,4 @@ | ||
import { ExecuteResult } from "./result.js"; | ||
import type { KillSignal } from "./command.js"; | ||
import { Reader } from "./pipes.js"; | ||
import type { Reader } from "./pipes.js"; | ||
import type { ExecuteResult } from "./result.js"; | ||
/** Used to read from stdin. */ | ||
@@ -26,1 +26,2 @@ export type CommandPipeReader = "inherit" | "null" | Reader; | ||
export type CommandHandler = (context: CommandContext) => Promise<ExecuteResult> | ExecuteResult; | ||
//# sourceMappingURL=command_handler.d.ts.map |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import * as dntShim from "../_dnt.shims.js"; | ||
import { CommandHandler } from "./command_handler.js"; | ||
import { Buffer } from "../deps/jsr.io/@std/io/0.221.0/buffer.js"; | ||
import type { CommandHandler } from "./command_handler.js"; | ||
import { Box, LoggerTreeBox } from "./common.js"; | ||
import { Delay } from "./common.js"; | ||
import { Buffer } from "./deps.js"; | ||
import { PipedBuffer, Reader, ShellPipeReaderKind, ShellPipeWriterKind } from "./pipes.js"; | ||
import type { Delay } from "./common.js"; | ||
import { Path } from "./path.js"; | ||
import { PipedBuffer, type Reader, type ShellPipeReaderKind, type ShellPipeWriterKind } from "./pipes.js"; | ||
import { StreamFds } from "./shell.js"; | ||
type BufferStdio = "inherit" | "null" | "streamed" | Buffer; | ||
type StreamKind = "stdout" | "stderr" | "combined"; | ||
declare class Deferred<T> { | ||
@@ -192,3 +193,3 @@ #private; | ||
*/ | ||
quiet(kind?: "stdout" | "stderr" | "both"): CommandBuilder; | ||
quiet(kind?: StreamKind | "both"): CommandBuilder; | ||
/** | ||
@@ -211,5 +212,6 @@ * Specifies a timeout for the command. The command will exit with | ||
*/ | ||
bytes(): Promise<Uint8Array>; | ||
bytes(kind: StreamKind): Promise<Uint8Array>; | ||
/** | ||
* Sets stdout as quiet, spawns the command, and gets stdout as a string without the last newline. | ||
* Sets the provided stream (stdout by default) as quiet, spawns the command, and gets the stream as a string without the last newline. | ||
* Can be used to get stdout, stderr, or both. | ||
* | ||
@@ -222,7 +224,7 @@ * Shorthand for: | ||
*/ | ||
text(): Promise<string>; | ||
text(kind?: StreamKind): Promise<string>; | ||
/** Gets the text as an array of lines. */ | ||
lines(): Promise<string[]>; | ||
lines(kind?: StreamKind): Promise<string[]>; | ||
/** | ||
* Sets stdout as quiet, spawns the command, and gets stdout as JSON. | ||
* Sets stream (stdout by default) as quiet, spawns the command, and gets stream as JSON. | ||
* | ||
@@ -235,3 +237,3 @@ * Shorthand for: | ||
*/ | ||
json<TResult = any>(): Promise<TResult>; | ||
json<TResult = any>(kind?: Exclude<StreamKind, "combined">): Promise<TResult>; | ||
/** @internal */ | ||
@@ -341,4 +343,14 @@ [getRegisteredCommandNamesSymbol](): string[]; | ||
export declare function getSignalAbortCode(signal: dntShim.Deno.Signal): number | undefined; | ||
export declare function template(strings: TemplateStringsArray, exprs: any[]): CommandBuilderStateCommand; | ||
export declare function templateRaw(strings: TemplateStringsArray, exprs: any[]): CommandBuilderStateCommand; | ||
export declare function template(strings: TemplateStringsArray, exprs: TemplateExpr[]): CommandBuilderStateCommand; | ||
export declare function templateRaw(strings: TemplateStringsArray, exprs: TemplateExpr[]): CommandBuilderStateCommand; | ||
export type TemplateExpr = string | number | boolean | Path | Uint8Array | CommandResult | { | ||
toString(): string; | ||
} | (string | number | boolean | Path | { | ||
toString(): string; | ||
})[] | dntShim.ReadableStream<Uint8Array> | { | ||
[readable: symbol]: () => dntShim.ReadableStream<Uint8Array>; | ||
} | (() => dntShim.ReadableStream<Uint8Array>) | { | ||
[writable: symbol]: () => dntShim.WritableStream<Uint8Array>; | ||
} | dntShim.WritableStream<Uint8Array> | (() => dntShim.WritableStream<Uint8Array>); | ||
export {}; | ||
//# sourceMappingURL=command.d.ts.map |
@@ -7,1 +7,2 @@ export interface ArgKind { | ||
export declare function bailUnsupported(arg: ArgKind): never; | ||
//# sourceMappingURL=args.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
interface CatFlags { | ||
@@ -9,1 +9,2 @@ paths: string[]; | ||
export {}; | ||
//# sourceMappingURL=cat.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function cdCommand(context: CommandContext): Promise<ExecuteResult>; | ||
//# sourceMappingURL=cd.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function cpCommand(context: CommandContext): Promise<ExecuteResult>; | ||
@@ -25,1 +25,2 @@ interface PathWithSpecified { | ||
export {}; | ||
//# sourceMappingURL=cp_mv.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function echoCommand(context: CommandContext): ExecuteResult | Promise<ExecuteResult>; | ||
//# sourceMappingURL=echo.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function exitCommand(context: CommandContext): ExecuteResult | Promise<ExecuteResult>; | ||
//# sourceMappingURL=exit.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function exportCommand(context: CommandContext): ExecuteResult; | ||
//# sourceMappingURL=export.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function mkdirCommand(context: CommandContext): Promise<ExecuteResult>; | ||
@@ -10,1 +10,2 @@ interface MkdirFlags { | ||
export {}; | ||
//# sourceMappingURL=mkdir.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function printEnvCommand(context: CommandContext): ExecuteResult | Promise<ExecuteResult>; | ||
//# sourceMappingURL=printenv.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function pwdCommand(context: CommandContext): ExecuteResult | Promise<ExecuteResult>; | ||
@@ -9,1 +9,2 @@ interface PwdFlags { | ||
export {}; | ||
//# sourceMappingURL=pwd.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function rmCommand(context: CommandContext): Promise<ExecuteResult>; | ||
@@ -12,1 +12,2 @@ interface RmFlags { | ||
export {}; | ||
//# sourceMappingURL=rm.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import { type ExecuteResult } from "../result.js"; | ||
export declare function sleepCommand(context: CommandContext): Promise<ExecuteResult>; | ||
//# sourceMappingURL=sleep.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function testCommand(context: CommandContext): Promise<ExecuteResult>; | ||
//# sourceMappingURL=test.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
export declare function touchCommand(context: CommandContext): Promise<import("../result.js").ExecuteResult>; | ||
@@ -8,1 +8,2 @@ interface TouchFlags { | ||
export {}; | ||
//# sourceMappingURL=touch.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function unsetCommand(context: CommandContext): ExecuteResult | Promise<ExecuteResult>; | ||
//# sourceMappingURL=unset.d.ts.map |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import * as dntShim from "../_dnt.shims.js"; | ||
import { Reader } from "./pipes.js"; | ||
export declare const symbols: { | ||
import type { Reader } from "./pipes.js"; | ||
interface Symbols { | ||
/** Use this symbol to enable the provided object to be written to in | ||
@@ -20,3 +20,3 @@ * an output redirect within a template literal expression. | ||
*/ | ||
writable: symbol; | ||
readonly writable: symbol; | ||
/** Use this symbol to enable the provided object to be read from in | ||
@@ -36,4 +36,5 @@ * an input redirect within a template literal expression. | ||
*/ | ||
readable: symbol; | ||
}; | ||
readonly readable: symbol; | ||
} | ||
export declare const symbols: Symbols; | ||
/** A timeout error. */ | ||
@@ -95,1 +96,3 @@ export declare class TimeoutError extends Error { | ||
export declare function errorToString(err: unknown): string; | ||
export {}; | ||
//# sourceMappingURL=common.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { SelectionOptions } from "./utils.js"; | ||
import { type SelectionOptions } from "./utils.js"; | ||
/** Options for showing confirming a yes or no question. */ | ||
@@ -20,1 +20,2 @@ export interface ConfirmOptions { | ||
export declare function innerConfirm(opts: ConfirmOptions): Pick<SelectionOptions<boolean | undefined>, "render" | "onKey">; | ||
//# sourceMappingURL=confirm.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { ConsoleSize, TextItem } from "./utils.js"; | ||
import { type ConsoleSize, type TextItem } from "./utils.js"; | ||
export declare enum LoggerRefreshItemKind { | ||
@@ -15,1 +15,2 @@ ProgressBars = 0, | ||
export { logger }; | ||
//# sourceMappingURL=logger.d.ts.map |
@@ -12,1 +12,2 @@ export { confirm, maybeConfirm } from "./confirm.js"; | ||
export type { SelectOptions } from "./select.js"; | ||
//# sourceMappingURL=mod.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { SelectionOptions } from "./utils.js"; | ||
import { type SelectionOptions } from "./utils.js"; | ||
/** Single options within a multi-select option. */ | ||
@@ -24,1 +24,2 @@ export interface MultiSelectOption { | ||
export declare function innerMultiSelect(opts: MultiSelectOptions): Pick<SelectionOptions<number[] | undefined>, "render" | "onKey">; | ||
//# sourceMappingURL=multiSelect.d.ts.map |
export declare function humanDownloadSize(byteCount: number, totalBytes: number): string; | ||
//# sourceMappingURL=format.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { ConsoleSize, TextItem } from "../utils.js"; | ||
import { type ConsoleSize, type TextItem } from "../utils.js"; | ||
export interface RenderIntervalProgressBar { | ||
@@ -9,1 +9,2 @@ render(size: ConsoleSize): TextItem[]; | ||
export declare function isShowingProgressBars(): boolean; | ||
//# sourceMappingURL=interval.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { ConsoleSize, TextItem } from "../utils.js"; | ||
import { type ConsoleSize, type TextItem } from "../utils.js"; | ||
export { isShowingProgressBars } from "./interval.js"; | ||
@@ -55,1 +55,2 @@ /** Options for showing progress. */ | ||
export declare function renderProgressBar(state: RenderState, size: ConsoleSize | undefined): TextItem[]; | ||
//# sourceMappingURL=mod.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { SelectionOptions } from "./utils.js"; | ||
import { type SelectionOptions } from "./utils.js"; | ||
/** Options for showing an input where the user enters a value. */ | ||
@@ -35,1 +35,2 @@ export interface PromptOptions { | ||
export declare function innerPrompt(opts: PromptOptions): Pick<SelectionOptions<string | undefined>, "render" | "onKey">; | ||
//# sourceMappingURL=prompt.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { SelectionOptions } from "./utils.js"; | ||
import { type SelectionOptions } from "./utils.js"; | ||
/** Options for showing a selection that only has one result. */ | ||
@@ -19,1 +19,2 @@ export interface SelectOptions { | ||
export declare function innerSelect(opts: SelectOptions): Pick<SelectionOptions<number | undefined>, "render" | "onKey">; | ||
//# sourceMappingURL=select.d.ts.map |
@@ -38,1 +38,2 @@ export declare enum Keys { | ||
}; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -8,1 +8,2 @@ export declare const wasmInstance: { | ||
}; | ||
//# sourceMappingURL=mod.d.ts.map |
@@ -62,1 +62,2 @@ /** | ||
export function isInstantiated(): boolean; | ||
//# sourceMappingURL=rs_lib.generated.d.ts.map |
@@ -8,3 +8,3 @@ /// <reference types="node" /> | ||
*/ | ||
type DenoStdExpandGlobOptions = import("./deps.js").ExpandGlobOptions; | ||
type DenoStdExpandGlobOptions = import("../deps/jsr.io/@std/fs/0.221.0/expand_glob.js").ExpandGlobOptions; | ||
export type ExpandGlobOptions = DenoStdExpandGlobOptions; | ||
@@ -15,3 +15,3 @@ /** | ||
*/ | ||
type DenoStdWalkOptions = import("./deps.js").WalkOptions; | ||
type DenoStdWalkOptions = import("../deps/jsr.io/@std/fs/0.221.0/walk.js").WalkOptions; | ||
export type WalkOptions = DenoStdWalkOptions; | ||
@@ -274,22 +274,28 @@ /** @internal */ | ||
ensureFileSync(): this; | ||
/** | ||
* Copies the file to the specified destination path. | ||
/** Copies a file or directory to the provided destination. | ||
* @returns The destination file path. | ||
*/ | ||
copyFile(destinationPath: string | URL | Path): Promise<Path>; | ||
/** | ||
* Copies the file to the destination path synchronously. | ||
copy(destinationPath: string | URL | Path, options?: { | ||
overwrite?: boolean; | ||
}): Promise<Path>; | ||
/** Copies a file or directory to the provided destination synchronously. | ||
* @returns The destination file path. | ||
*/ | ||
copyFileSync(destinationPath: string | URL | Path): Path; | ||
copySync(destinationPath: string | URL | Path, options?: { | ||
overwrite?: boolean; | ||
}): Path; | ||
/** | ||
* Copies the file to the specified directory. | ||
* Copies the file or directory to the specified directory. | ||
* @returns The destination file path. | ||
*/ | ||
copyFileToDir(destinationDirPath: string | URL | Path): Promise<Path>; | ||
copyToDir(destinationDirPath: string | URL | Path, options?: { | ||
overwrite?: boolean; | ||
}): Promise<Path>; | ||
/** | ||
* Copies the file to the specified directory synchronously. | ||
* Copies the file or directory to the specified directory synchronously. | ||
* @returns The destination file path. | ||
*/ | ||
copyFileToDirSync(destinationDirPath: string | URL | Path): Path; | ||
copyToDirSync(destinationDirPath: string | URL | Path, options?: { | ||
overwrite?: boolean; | ||
}): Path; | ||
/** | ||
@@ -328,1 +334,2 @@ * Moves the file or directory returning a promise that resolves to | ||
export {}; | ||
//# sourceMappingURL=path.d.ts.map |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import * as dntShim from "../_dnt.shims.js"; | ||
import { type FsFileWrapper, Path } from "./path.js"; | ||
import { Buffer } from "./deps.js"; | ||
import { Buffer } from "../deps/jsr.io/@std/io/0.221.0/buffer.js"; | ||
import type { CommandBuilder, KillSignal } from "./command.js"; | ||
import type { FsFileWrapper, Path } from "./path.js"; | ||
import type { RequestBuilder } from "./request.js"; | ||
import type { CommandBuilder, KillSignal } from "./command.js"; | ||
/** `Deno.Reader` stream. */ | ||
@@ -97,1 +97,2 @@ export interface Reader { | ||
export declare function pipeReadableToWriterSync(readable: dntShim.ReadableStream<Uint8Array>, writer: ShellPipeWriter, signal: AbortSignal | KillSignal): Promise<void>; | ||
//# sourceMappingURL=pipes.d.ts.map |
@@ -6,4 +6,4 @@ /// <reference types="node" /> | ||
import * as dntShim from "../_dnt.shims.js"; | ||
import { Delay } from "./common.js"; | ||
import { ProgressBar } from "./console/mod.js"; | ||
import { type Delay } from "./common.js"; | ||
import type { ProgressBar } from "./console/mod.js"; | ||
import { Path } from "./path.js"; | ||
@@ -232,1 +232,2 @@ interface RequestBuilderState { | ||
export {}; | ||
//# sourceMappingURL=request.d.ts.map |
@@ -69,1 +69,2 @@ /** Result of executing a custom command. */ | ||
} | ||
//# sourceMappingURL=result.d.ts.map |
@@ -20,1 +20,2 @@ /// <reference types="node" /> | ||
export type SpawnCommand = (path: string, options: SpawnCommandOptions) => SpawnedChildProcess; | ||
//# sourceMappingURL=process.common.d.ts.map |
@@ -1,2 +0,3 @@ | ||
import { SpawnCommand } from "./process.common.js"; | ||
import type { SpawnCommand } from "./process.common.js"; | ||
export declare const spawnCommand: SpawnCommand; | ||
//# sourceMappingURL=process.node.d.ts.map |
@@ -1,5 +0,5 @@ | ||
import { KillSignal } from "./command.js"; | ||
import { CommandContext, CommandHandler, type CommandPipeReader } from "./command_handler.js"; | ||
import { PipeWriter, Reader, ShellPipeWriter } from "./pipes.js"; | ||
import { EnvChange, ExecuteResult } from "./result.js"; | ||
import type { KillSignal } from "./command.js"; | ||
import type { CommandContext, CommandHandler, CommandPipeReader } from "./command_handler.js"; | ||
import { type PipeWriter, type Reader, ShellPipeWriter } from "./pipes.js"; | ||
import { type EnvChange, type ExecuteResult } from "./result.js"; | ||
export interface SequentialList { | ||
@@ -168,2 +168,6 @@ items: SequentialListItem[]; | ||
export declare function spawn(list: SequentialList, opts: SpawnOpts): Promise<number>; | ||
export declare function whichFromContext(commandName: string, context: { | ||
getVar(key: string): string | undefined; | ||
}): Promise<string | undefined>; | ||
export {}; | ||
//# sourceMappingURL=shell.d.ts.map |
@@ -34,1 +34,2 @@ declare const defaultOutdent: Outdent; | ||
export { defaultOutdent as outdent }; | ||
//# sourceMappingURL=outdent.d.ts.map |
{ | ||
"name": "dax-sh", | ||
"version": "0.39.2", | ||
"version": "0.40.0", | ||
"description": "Cross platform shell tools inspired by zx.", | ||
@@ -33,2 +33,2 @@ "repository": { | ||
"_generatedBy": "dnt@dev" | ||
} | ||
} |
# dax | ||
[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/dax/mod.ts) | ||
[![NPM Version](https://img.shields.io/npm/v/dax-sh.svg?style=flat)](http://www.npmjs.com/package/dax-sh) | ||
[![JSR](https://jsr.io/badges/@david/dax)](https://jsr.io/@david/dax) | ||
[![npm Version](https://img.shields.io/npm/v/dax-sh.svg?style=flat)](http://www.npmjs.com/package/dax-sh) | ||
@@ -23,2 +23,17 @@ <img src="src/assets/logo.svg" height="150px" alt="dax logo"> | ||
## Install | ||
Deno: | ||
```sh | ||
# or skip and import directly from `jsr:@david/dax@<version>` | ||
deno add @david/dax | ||
``` | ||
Node: | ||
```sh | ||
npm install dax-sh | ||
``` | ||
## Executing commands | ||
@@ -28,3 +43,3 @@ | ||
#!/usr/bin/env -S deno run --allow-all | ||
import $ from "https://deno.land/x/dax/mod.ts"; | ||
import $ from "@david/dax"; // "dax-sh" in Node | ||
@@ -45,4 +60,2 @@ // run a command | ||
Note: Above instructions are for Deno. For Node.js, install via `npm install --save-dev dax-sh` then import via `import $ from "dax-sh";`. | ||
### Getting output | ||
@@ -78,2 +91,9 @@ | ||
Get stderr's text: | ||
```ts | ||
const result = await $`deno eval "console.error(1)"`.text("stderr"); | ||
console.log(result); // 1 | ||
``` | ||
Working with a lower level result that provides more details: | ||
@@ -96,6 +116,6 @@ | ||
```ts | ||
const result = await $`deno eval 'console.log(1); console.error(2); console.log(3);'` | ||
.captureCombined(); | ||
const text = await $`deno eval 'console.log(1); console.error(2); console.log(3);'` | ||
.text("combined"); | ||
console.log(result.combined); // 1\n2\n3\n | ||
console.log(text); // 1\n2\n3\n | ||
``` | ||
@@ -860,2 +880,3 @@ | ||
- [`printenv`](https://man7.org/linux/man-pages/man1/printenv.1.html) - Print all or part of environment | ||
- `which` - Resolves the path to an executable (`-a` flag is not supported at this time) | ||
- More to come. Will try to get a similar list as https://deno.land/manual/tools/task_runner#built-in-commands | ||
@@ -862,0 +883,0 @@ |
@@ -51,2 +51,13 @@ declare global { | ||
declare global { | ||
interface Object { | ||
/** | ||
* Determines whether an object has a property with the specified name. | ||
* @param o An object. | ||
* @param v A property name. | ||
*/ | ||
hasOwn(o: object, v: PropertyKey): boolean; | ||
} | ||
} | ||
export {}; | ||
declare global { | ||
interface PromiseConstructor { | ||
@@ -65,13 +76,2 @@ /** | ||
declare global { | ||
interface Object { | ||
/** | ||
* Determines whether an object has a property with the specified name. | ||
* @param o An object. | ||
* @param v A property name. | ||
*/ | ||
hasOwn(o: object, v: PropertyKey): boolean; | ||
} | ||
} | ||
export {}; | ||
declare global { | ||
interface Error { | ||
@@ -89,1 +89,2 @@ cause?: unknown; | ||
export {}; | ||
//# sourceMappingURL=_dnt.polyfills.d.ts.map |
@@ -13,2 +13,3 @@ /// <reference types="node" /> | ||
prototype: ReadableStream<any>; | ||
from<T>(iterable: Iterable<T> | AsyncIterable<T>): ReadableStream<T>; | ||
}; | ||
@@ -28,1 +29,2 @@ WritableStream: { | ||
}; | ||
//# sourceMappingURL=_dnt.shims.d.ts.map |
/// <reference types="node" /> | ||
import "./_dnt.polyfills.js"; | ||
import { CommandBuilder } from "./src/command.js"; | ||
import { Delay, DelayIterator, symbols } from "./src/common.js"; | ||
import { ConfirmOptions, MultiSelectOptions, ProgressBar, ProgressOptions, PromptOptions, SelectOptions } from "./src/console/mod.js"; | ||
import type { TemplateExpr } from "./src/command.js"; | ||
import { type Delay, type DelayIterator, symbols } from "./src/common.js"; | ||
import { type ConfirmOptions, type MultiSelectOptions, ProgressBar, type ProgressOptions, type PromptOptions, type SelectOptions } from "./src/console/mod.js"; | ||
import { createPath, Path } from "./src/path.js"; | ||
import { RequestBuilder } from "./src/request.js"; | ||
import { createPath, Path } from "./src/path.js"; | ||
import { outdent } from "./src/vendor/outdent.js"; | ||
export type { Delay, DelayIterator } from "./src/common.js"; | ||
@@ -14,7 +16,7 @@ export { TimeoutError } from "./src/common.js"; | ||
export { PathRef }; | ||
export { CommandBuilder, CommandChild, CommandResult, KillSignal, KillSignalController, type KillSignalListener, type TemplateExpr, } from "./src/command.js"; | ||
export type { CommandContext, CommandHandler, CommandPipeReader, CommandPipeWriter } from "./src/command_handler.js"; | ||
export type { ConfirmOptions, MultiSelectOption, MultiSelectOptions, ProgressBar, ProgressOptions, PromptInputMask, PromptOptions, SelectOptions, } from "./src/console/mod.js"; | ||
export type { ExpandGlobOptions, PathSymlinkOptions, SymlinkOptions, WalkEntry, WalkOptions } from "./src/path.js"; | ||
export { CommandBuilder, CommandChild, CommandResult, KillSignal, KillSignalController, type KillSignalListener, } from "./src/command.js"; | ||
export type { CommandContext, CommandHandler, CommandPipeReader, CommandPipeWriter } from "./src/command_handler.js"; | ||
export type { Closer, Reader, ShellPipeReaderKind, ShellPipeWriterKind, WriterSync } from "./src/pipes.js"; | ||
export type { ConfirmOptions, MultiSelectOption, MultiSelectOptions, ProgressBar, ProgressOptions, PromptInputMask, PromptOptions, SelectOptions, } from "./src/console/mod.js"; | ||
export { RequestBuilder, RequestResponse } from "./src/request.js"; | ||
@@ -63,3 +65,3 @@ export type { CdChange, ContinueExecuteResult, EnvChange, ExecuteResult, ExitExecuteResult, SetEnvVarChange, SetShellVarChange, UnsetVarChange, } from "./src/result.js"; | ||
export interface $Template { | ||
(strings: TemplateStringsArray, ...exprs: any[]): CommandBuilder; | ||
(strings: TemplateStringsArray, ...exprs: TemplateExpr[]): CommandBuilder; | ||
} | ||
@@ -70,3 +72,3 @@ /** | ||
*/ | ||
type Outdent = typeof import("./src/deps.js").outdent; | ||
type Outdent = typeof outdent; | ||
/** | ||
@@ -76,3 +78,3 @@ * `which` from the https://deno.land/x/which module. | ||
*/ | ||
type Which = typeof import("./src/deps.js").which; | ||
type Which = typeof import("./deps/jsr.io/@david/which/0.3.0/mod.js").which; | ||
/** | ||
@@ -82,3 +84,3 @@ * `whichSync` from the https://deno.land/x/which module. | ||
*/ | ||
type WhichSync = typeof import("./src/deps.js").whichSync; | ||
type WhichSync = typeof import("./deps/jsr.io/@david/which/0.3.0/mod.js").whichSync; | ||
/** Collection of built-in properties that come with a `$`. */ | ||
@@ -436,3 +438,3 @@ export interface $BuiltInProperties<TExtras extends ExtrasObject = {}> { | ||
*/ | ||
raw(strings: TemplateStringsArray, ...exprs: any[]): CommandBuilder; | ||
raw(strings: TemplateStringsArray, ...exprs: TemplateExpr[]): CommandBuilder; | ||
/** | ||
@@ -504,1 +506,2 @@ * Does the provided action until it succeeds (does not throw) | ||
export default $; | ||
//# sourceMappingURL=mod.d.ts.map |
@@ -1,4 +0,4 @@ | ||
import { ExecuteResult } from "./result.js"; | ||
import type { KillSignal } from "./command.js"; | ||
import { Reader } from "./pipes.js"; | ||
import type { Reader } from "./pipes.js"; | ||
import type { ExecuteResult } from "./result.js"; | ||
/** Used to read from stdin. */ | ||
@@ -26,1 +26,2 @@ export type CommandPipeReader = "inherit" | "null" | Reader; | ||
export type CommandHandler = (context: CommandContext) => Promise<ExecuteResult> | ExecuteResult; | ||
//# sourceMappingURL=command_handler.d.ts.map |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import * as dntShim from "../_dnt.shims.js"; | ||
import { CommandHandler } from "./command_handler.js"; | ||
import { Buffer } from "../deps/jsr.io/@std/io/0.221.0/buffer.js"; | ||
import type { CommandHandler } from "./command_handler.js"; | ||
import { Box, LoggerTreeBox } from "./common.js"; | ||
import { Delay } from "./common.js"; | ||
import { Buffer } from "./deps.js"; | ||
import { PipedBuffer, Reader, ShellPipeReaderKind, ShellPipeWriterKind } from "./pipes.js"; | ||
import type { Delay } from "./common.js"; | ||
import { Path } from "./path.js"; | ||
import { PipedBuffer, type Reader, type ShellPipeReaderKind, type ShellPipeWriterKind } from "./pipes.js"; | ||
import { StreamFds } from "./shell.js"; | ||
type BufferStdio = "inherit" | "null" | "streamed" | Buffer; | ||
type StreamKind = "stdout" | "stderr" | "combined"; | ||
declare class Deferred<T> { | ||
@@ -192,3 +193,3 @@ #private; | ||
*/ | ||
quiet(kind?: "stdout" | "stderr" | "both"): CommandBuilder; | ||
quiet(kind?: StreamKind | "both"): CommandBuilder; | ||
/** | ||
@@ -211,5 +212,6 @@ * Specifies a timeout for the command. The command will exit with | ||
*/ | ||
bytes(): Promise<Uint8Array>; | ||
bytes(kind: StreamKind): Promise<Uint8Array>; | ||
/** | ||
* Sets stdout as quiet, spawns the command, and gets stdout as a string without the last newline. | ||
* Sets the provided stream (stdout by default) as quiet, spawns the command, and gets the stream as a string without the last newline. | ||
* Can be used to get stdout, stderr, or both. | ||
* | ||
@@ -222,7 +224,7 @@ * Shorthand for: | ||
*/ | ||
text(): Promise<string>; | ||
text(kind?: StreamKind): Promise<string>; | ||
/** Gets the text as an array of lines. */ | ||
lines(): Promise<string[]>; | ||
lines(kind?: StreamKind): Promise<string[]>; | ||
/** | ||
* Sets stdout as quiet, spawns the command, and gets stdout as JSON. | ||
* Sets stream (stdout by default) as quiet, spawns the command, and gets stream as JSON. | ||
* | ||
@@ -235,3 +237,3 @@ * Shorthand for: | ||
*/ | ||
json<TResult = any>(): Promise<TResult>; | ||
json<TResult = any>(kind?: Exclude<StreamKind, "combined">): Promise<TResult>; | ||
/** @internal */ | ||
@@ -341,4 +343,14 @@ [getRegisteredCommandNamesSymbol](): string[]; | ||
export declare function getSignalAbortCode(signal: dntShim.Deno.Signal): number | undefined; | ||
export declare function template(strings: TemplateStringsArray, exprs: any[]): CommandBuilderStateCommand; | ||
export declare function templateRaw(strings: TemplateStringsArray, exprs: any[]): CommandBuilderStateCommand; | ||
export declare function template(strings: TemplateStringsArray, exprs: TemplateExpr[]): CommandBuilderStateCommand; | ||
export declare function templateRaw(strings: TemplateStringsArray, exprs: TemplateExpr[]): CommandBuilderStateCommand; | ||
export type TemplateExpr = string | number | boolean | Path | Uint8Array | CommandResult | { | ||
toString(): string; | ||
} | (string | number | boolean | Path | { | ||
toString(): string; | ||
})[] | dntShim.ReadableStream<Uint8Array> | { | ||
[readable: symbol]: () => dntShim.ReadableStream<Uint8Array>; | ||
} | (() => dntShim.ReadableStream<Uint8Array>) | { | ||
[writable: symbol]: () => dntShim.WritableStream<Uint8Array>; | ||
} | dntShim.WritableStream<Uint8Array> | (() => dntShim.WritableStream<Uint8Array>); | ||
export {}; | ||
//# sourceMappingURL=command.d.ts.map |
@@ -7,1 +7,2 @@ export interface ArgKind { | ||
export declare function bailUnsupported(arg: ArgKind): never; | ||
//# sourceMappingURL=args.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
interface CatFlags { | ||
@@ -9,1 +9,2 @@ paths: string[]; | ||
export {}; | ||
//# sourceMappingURL=cat.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function cdCommand(context: CommandContext): Promise<ExecuteResult>; | ||
//# sourceMappingURL=cd.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function cpCommand(context: CommandContext): Promise<ExecuteResult>; | ||
@@ -25,1 +25,2 @@ interface PathWithSpecified { | ||
export {}; | ||
//# sourceMappingURL=cp_mv.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function echoCommand(context: CommandContext): ExecuteResult | Promise<ExecuteResult>; | ||
//# sourceMappingURL=echo.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function exitCommand(context: CommandContext): ExecuteResult | Promise<ExecuteResult>; | ||
//# sourceMappingURL=exit.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function exportCommand(context: CommandContext): ExecuteResult; | ||
//# sourceMappingURL=export.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function mkdirCommand(context: CommandContext): Promise<ExecuteResult>; | ||
@@ -10,1 +10,2 @@ interface MkdirFlags { | ||
export {}; | ||
//# sourceMappingURL=mkdir.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function printEnvCommand(context: CommandContext): ExecuteResult | Promise<ExecuteResult>; | ||
//# sourceMappingURL=printenv.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function pwdCommand(context: CommandContext): ExecuteResult | Promise<ExecuteResult>; | ||
@@ -9,1 +9,2 @@ interface PwdFlags { | ||
export {}; | ||
//# sourceMappingURL=pwd.d.ts.map |
@@ -1,3 +0,3 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function rmCommand(context: CommandContext): Promise<ExecuteResult>; | ||
@@ -12,1 +12,2 @@ interface RmFlags { | ||
export {}; | ||
//# sourceMappingURL=rm.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import { type ExecuteResult } from "../result.js"; | ||
export declare function sleepCommand(context: CommandContext): Promise<ExecuteResult>; | ||
//# sourceMappingURL=sleep.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function testCommand(context: CommandContext): Promise<ExecuteResult>; | ||
//# sourceMappingURL=test.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
export declare function touchCommand(context: CommandContext): Promise<import("../result.js").ExecuteResult>; | ||
@@ -8,1 +8,2 @@ interface TouchFlags { | ||
export {}; | ||
//# sourceMappingURL=touch.d.ts.map |
@@ -1,3 +0,4 @@ | ||
import { CommandContext } from "../command_handler.js"; | ||
import { ExecuteResult } from "../result.js"; | ||
import type { CommandContext } from "../command_handler.js"; | ||
import type { ExecuteResult } from "../result.js"; | ||
export declare function unsetCommand(context: CommandContext): ExecuteResult | Promise<ExecuteResult>; | ||
//# sourceMappingURL=unset.d.ts.map |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import * as dntShim from "../_dnt.shims.js"; | ||
import { Reader } from "./pipes.js"; | ||
export declare const symbols: { | ||
import type { Reader } from "./pipes.js"; | ||
interface Symbols { | ||
/** Use this symbol to enable the provided object to be written to in | ||
@@ -20,3 +20,3 @@ * an output redirect within a template literal expression. | ||
*/ | ||
writable: symbol; | ||
readonly writable: symbol; | ||
/** Use this symbol to enable the provided object to be read from in | ||
@@ -36,4 +36,5 @@ * an input redirect within a template literal expression. | ||
*/ | ||
readable: symbol; | ||
}; | ||
readonly readable: symbol; | ||
} | ||
export declare const symbols: Symbols; | ||
/** A timeout error. */ | ||
@@ -95,1 +96,3 @@ export declare class TimeoutError extends Error { | ||
export declare function errorToString(err: unknown): string; | ||
export {}; | ||
//# sourceMappingURL=common.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { SelectionOptions } from "./utils.js"; | ||
import { type SelectionOptions } from "./utils.js"; | ||
/** Options for showing confirming a yes or no question. */ | ||
@@ -20,1 +20,2 @@ export interface ConfirmOptions { | ||
export declare function innerConfirm(opts: ConfirmOptions): Pick<SelectionOptions<boolean | undefined>, "render" | "onKey">; | ||
//# sourceMappingURL=confirm.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { ConsoleSize, TextItem } from "./utils.js"; | ||
import { type ConsoleSize, type TextItem } from "./utils.js"; | ||
export declare enum LoggerRefreshItemKind { | ||
@@ -15,1 +15,2 @@ ProgressBars = 0, | ||
export { logger }; | ||
//# sourceMappingURL=logger.d.ts.map |
@@ -12,1 +12,2 @@ export { confirm, maybeConfirm } from "./confirm.js"; | ||
export type { SelectOptions } from "./select.js"; | ||
//# sourceMappingURL=mod.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { SelectionOptions } from "./utils.js"; | ||
import { type SelectionOptions } from "./utils.js"; | ||
/** Single options within a multi-select option. */ | ||
@@ -24,1 +24,2 @@ export interface MultiSelectOption { | ||
export declare function innerMultiSelect(opts: MultiSelectOptions): Pick<SelectionOptions<number[] | undefined>, "render" | "onKey">; | ||
//# sourceMappingURL=multiSelect.d.ts.map |
export declare function humanDownloadSize(byteCount: number, totalBytes: number): string; | ||
//# sourceMappingURL=format.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { ConsoleSize, TextItem } from "../utils.js"; | ||
import { type ConsoleSize, type TextItem } from "../utils.js"; | ||
export interface RenderIntervalProgressBar { | ||
@@ -9,1 +9,2 @@ render(size: ConsoleSize): TextItem[]; | ||
export declare function isShowingProgressBars(): boolean; | ||
//# sourceMappingURL=interval.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { ConsoleSize, TextItem } from "../utils.js"; | ||
import { type ConsoleSize, type TextItem } from "../utils.js"; | ||
export { isShowingProgressBars } from "./interval.js"; | ||
@@ -55,1 +55,2 @@ /** Options for showing progress. */ | ||
export declare function renderProgressBar(state: RenderState, size: ConsoleSize | undefined): TextItem[]; | ||
//# sourceMappingURL=mod.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { SelectionOptions } from "./utils.js"; | ||
import { type SelectionOptions } from "./utils.js"; | ||
/** Options for showing an input where the user enters a value. */ | ||
@@ -35,1 +35,2 @@ export interface PromptOptions { | ||
export declare function innerPrompt(opts: PromptOptions): Pick<SelectionOptions<string | undefined>, "render" | "onKey">; | ||
//# sourceMappingURL=prompt.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { SelectionOptions } from "./utils.js"; | ||
import { type SelectionOptions } from "./utils.js"; | ||
/** Options for showing a selection that only has one result. */ | ||
@@ -19,1 +19,2 @@ export interface SelectOptions { | ||
export declare function innerSelect(opts: SelectOptions): Pick<SelectionOptions<number | undefined>, "render" | "onKey">; | ||
//# sourceMappingURL=select.d.ts.map |
@@ -38,1 +38,2 @@ export declare enum Keys { | ||
}; | ||
//# sourceMappingURL=utils.d.ts.map |
@@ -8,1 +8,2 @@ export declare const wasmInstance: { | ||
}; | ||
//# sourceMappingURL=mod.d.ts.map |
@@ -62,1 +62,2 @@ /** | ||
export function isInstantiated(): boolean; | ||
//# sourceMappingURL=rs_lib.generated.d.ts.map |
@@ -8,3 +8,3 @@ /// <reference types="node" /> | ||
*/ | ||
type DenoStdExpandGlobOptions = import("./deps.js").ExpandGlobOptions; | ||
type DenoStdExpandGlobOptions = import("../deps/jsr.io/@std/fs/0.221.0/expand_glob.js").ExpandGlobOptions; | ||
export type ExpandGlobOptions = DenoStdExpandGlobOptions; | ||
@@ -15,3 +15,3 @@ /** | ||
*/ | ||
type DenoStdWalkOptions = import("./deps.js").WalkOptions; | ||
type DenoStdWalkOptions = import("../deps/jsr.io/@std/fs/0.221.0/walk.js").WalkOptions; | ||
export type WalkOptions = DenoStdWalkOptions; | ||
@@ -274,22 +274,28 @@ /** @internal */ | ||
ensureFileSync(): this; | ||
/** | ||
* Copies the file to the specified destination path. | ||
/** Copies a file or directory to the provided destination. | ||
* @returns The destination file path. | ||
*/ | ||
copyFile(destinationPath: string | URL | Path): Promise<Path>; | ||
/** | ||
* Copies the file to the destination path synchronously. | ||
copy(destinationPath: string | URL | Path, options?: { | ||
overwrite?: boolean; | ||
}): Promise<Path>; | ||
/** Copies a file or directory to the provided destination synchronously. | ||
* @returns The destination file path. | ||
*/ | ||
copyFileSync(destinationPath: string | URL | Path): Path; | ||
copySync(destinationPath: string | URL | Path, options?: { | ||
overwrite?: boolean; | ||
}): Path; | ||
/** | ||
* Copies the file to the specified directory. | ||
* Copies the file or directory to the specified directory. | ||
* @returns The destination file path. | ||
*/ | ||
copyFileToDir(destinationDirPath: string | URL | Path): Promise<Path>; | ||
copyToDir(destinationDirPath: string | URL | Path, options?: { | ||
overwrite?: boolean; | ||
}): Promise<Path>; | ||
/** | ||
* Copies the file to the specified directory synchronously. | ||
* Copies the file or directory to the specified directory synchronously. | ||
* @returns The destination file path. | ||
*/ | ||
copyFileToDirSync(destinationDirPath: string | URL | Path): Path; | ||
copyToDirSync(destinationDirPath: string | URL | Path, options?: { | ||
overwrite?: boolean; | ||
}): Path; | ||
/** | ||
@@ -328,1 +334,2 @@ * Moves the file or directory returning a promise that resolves to | ||
export {}; | ||
//# sourceMappingURL=path.d.ts.map |
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import * as dntShim from "../_dnt.shims.js"; | ||
import { type FsFileWrapper, Path } from "./path.js"; | ||
import { Buffer } from "./deps.js"; | ||
import { Buffer } from "../deps/jsr.io/@std/io/0.221.0/buffer.js"; | ||
import type { CommandBuilder, KillSignal } from "./command.js"; | ||
import type { FsFileWrapper, Path } from "./path.js"; | ||
import type { RequestBuilder } from "./request.js"; | ||
import type { CommandBuilder, KillSignal } from "./command.js"; | ||
/** `Deno.Reader` stream. */ | ||
@@ -97,1 +97,2 @@ export interface Reader { | ||
export declare function pipeReadableToWriterSync(readable: dntShim.ReadableStream<Uint8Array>, writer: ShellPipeWriter, signal: AbortSignal | KillSignal): Promise<void>; | ||
//# sourceMappingURL=pipes.d.ts.map |
@@ -6,4 +6,4 @@ /// <reference types="node" /> | ||
import * as dntShim from "../_dnt.shims.js"; | ||
import { Delay } from "./common.js"; | ||
import { ProgressBar } from "./console/mod.js"; | ||
import { type Delay } from "./common.js"; | ||
import type { ProgressBar } from "./console/mod.js"; | ||
import { Path } from "./path.js"; | ||
@@ -232,1 +232,2 @@ interface RequestBuilderState { | ||
export {}; | ||
//# sourceMappingURL=request.d.ts.map |
@@ -69,1 +69,2 @@ /** Result of executing a custom command. */ | ||
} | ||
//# sourceMappingURL=result.d.ts.map |
@@ -20,1 +20,2 @@ /// <reference types="node" /> | ||
export type SpawnCommand = (path: string, options: SpawnCommandOptions) => SpawnedChildProcess; | ||
//# sourceMappingURL=process.common.d.ts.map |
@@ -1,2 +0,3 @@ | ||
import { SpawnCommand } from "./process.common.js"; | ||
import type { SpawnCommand } from "./process.common.js"; | ||
export declare const spawnCommand: SpawnCommand; | ||
//# sourceMappingURL=process.node.d.ts.map |
@@ -1,5 +0,5 @@ | ||
import { KillSignal } from "./command.js"; | ||
import { CommandContext, CommandHandler, type CommandPipeReader } from "./command_handler.js"; | ||
import { PipeWriter, Reader, ShellPipeWriter } from "./pipes.js"; | ||
import { EnvChange, ExecuteResult } from "./result.js"; | ||
import type { KillSignal } from "./command.js"; | ||
import type { CommandContext, CommandHandler, CommandPipeReader } from "./command_handler.js"; | ||
import { type PipeWriter, type Reader, ShellPipeWriter } from "./pipes.js"; | ||
import { type EnvChange, type ExecuteResult } from "./result.js"; | ||
export interface SequentialList { | ||
@@ -168,2 +168,6 @@ items: SequentialListItem[]; | ||
export declare function spawn(list: SequentialList, opts: SpawnOpts): Promise<number>; | ||
export declare function whichFromContext(commandName: string, context: { | ||
getVar(key: string): string | undefined; | ||
}): Promise<string | undefined>; | ||
export {}; | ||
//# sourceMappingURL=shell.d.ts.map |
@@ -34,1 +34,2 @@ declare const defaultOutdent: Outdent; | ||
export { defaultOutdent as outdent }; | ||
//# sourceMappingURL=outdent.d.ts.map |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
1879256
689
1031
2
33684