///
import { Deploy, Store } from '@fadroma/agent';
import type { Path } from '@hackbg/file';
import Prompts from 'prompts';
import type { Project } from "./create.dist";
export declare const NOT_INSTALLED = "not installed";
export declare class SystemTools {
readonly verbose: boolean;
constructor(verbose?: boolean);
/** Check and report a variable */
protected check(name: string | null, value: T): T;
/** Check and report if an external binary is available. */
protected checkTool(dependency: string | null, command: string): string | null;
cwd: string;
isLinux: boolean;
isMac: boolean;
isWin: boolean;
ttyIn: boolean;
ttyOut: boolean;
interactive: boolean;
git: string;
node: string;
npm: string;
yarn: string;
pnpm: string;
corepack: string;
cargo: string;
rust: string;
sha256sum: string;
wasmOpt: string;
docker: string;
podman: string;
nix: string;
secretcli: string;
homebrew: string;
}
/** Run one or more external commands in the project root. */
export declare function runShellCommands(cwd: string, cmds: string[]): Buffer[];
export declare function runNPMInstall(project: Project, tools: SystemTools): {
changed?: true;
nonfatal?: true;
};
export declare function gitCommit(cwd: string, message: string): Buffer[];
export declare function generateApiIndex(name: string, crates: {}): string;
export declare function generateProjectIndex(name: string): string;
export declare function generateTestIndex(name: string): string;
export declare function generateReadme(name: string): string;
export declare function generateCargoToml(name: string, features?: string[]): string;
export declare function generateContractEntrypoint(): string;
export declare function writeCrates({ cargoToml, wasmDir, crates }: {
cargoToml: Path;
wasmDir: Path;
crates: Record;
}): void;
export declare function logInstallRust({ isMac, homebrew, cargo, rust }: SystemTools): void;
export declare function logInstallSha256Sum({ isMac, homebrew, sha256sum }: SystemTools): void;
export declare function logInstallWasmOpt({ isMac, homebrew, wasmOpt }: SystemTools): void;
export declare function logProjectCreated({ root }: {
root: Path;
}): Promise;
export declare class InputCancelled extends Error {
}
export declare class Prompter {
prompts: {
prompt: typeof Prompts["prompt"];
};
interactive: boolean;
constructor(prompts?: {
prompt: typeof Prompts["prompt"];
}, interactive?: boolean);
text(message: string, { valid, clean }?: {
valid?: (x: string) => boolean;
clean?: (x: string) => string;
}): Promise;
select(message: string, choices: T[]): Promise;
untilDone(state: S, selector: (state: S) => Promise | Function | null): Promise;
}
export declare class ProjectPrompter extends Prompter {
deployment(store: Store.DeployStore & {
root?: Path;
}): Promise;
projectName(): Promise;
projectRoot(name: string | Promise | undefined): Promise;
projectMode: (prompts?: typeof Prompts) => Promise<0 | 1 | typeof Infinity>;
contractCrates: (name: string) => Promise>>;
defineContract: (state: Record) => Promise;
undefineContract: (state: Record) => Promise;
renameContract: (state: Record) => Promise;
compileMode: ({ isLinux, cargo, docker, podman }?: Partial, prompts?: {
prompt: (typeof Prompts)["prompt"];
}) => Promise<'raw' | 'docker' | 'podman'>;
}
//# sourceMappingURL=tools.d.ts.map