interface ParsedArguments { [key: string]: any; /** * The project directory for the generated application. */ projectDirectory?: string; /** * Initialize as a TypeScript project. */ typescript?: boolean; /** * Explicitly tell the CLI to bootstrap the app using npm */ useNpm?: boolean; /** * Explicitly tell the CLI to bootstrap the app using pnpm */ usePnpm?: boolean; /** * A template to bootstrap the app with. You can use a template name * from the official Gpkg repo or a GitHub URL. The URL can use * any branch and/or subdirectory */ template?: boolean | string; /** * In a rare case, your GitHub URL might contain a branch name with * a slash (e.g. bug/fix-1) and the path to the template (e.g. foo/bar). * In this case, you must specify the path to the template separately: * --template-path foo/bar */ templatePath?: string; } declare type RepoInfo = { username: string; name: string; branch: string; filePath: string; }; declare function isUrlOk(url: string): Promise; declare function getRepoInfo(url: URL, templatePath?: string): Promise; declare function hasRepo({ username, name, branch, filePath }: RepoInfo): Promise; declare function hasTemplate(name: string): Promise; declare function downloadAndExtractRepo(root: string, { username, name, branch, filePath }: RepoInfo): Promise; declare function downloadAndExtractTemplate(root: string, name: string): Promise; declare type PackageManager = 'npm' | 'pnpm' | 'yarn'; declare function getPkgManager(): PackageManager; declare function tryGitInit(root: string): boolean; interface InstallArgs { /** * Indicate whether to install packages using npm, pnpm or Yarn. */ packageManager: PackageManager; /** * Indicate whether there is an active Internet connection. */ isOnline: boolean; /** * Indicate whether the given dependencies are devDependencies. */ devDependencies?: boolean; } /** * Spawn a package manager installation with either Yarn or NPM. * * @returns A Promise that resolves once the installation is finished. */ declare function install(root: string, dependencies: string[] | null, { packageManager, isOnline, devDependencies }: InstallArgs): Promise; declare function isFolderEmpty(root: string, name: string): boolean; declare function getOnline(): Promise; declare function isWriteable(directory: string): Promise; declare function makeDir(root: string, options?: { recursive: boolean; }): Promise; declare function notifyUpdate(): Promise; declare function validateNpmName(name: string): { valid: boolean; problems?: string[]; }; declare class DownloadError extends Error { } declare function createProject({ name, projectPath, packageManager, template, templatePath, }: { name: string; projectPath: string; packageManager: PackageManager; template?: string; templatePath?: string; }): Promise; export { DownloadError, PackageManager, ParsedArguments, RepoInfo, createProject, downloadAndExtractRepo, downloadAndExtractTemplate, getOnline, getPkgManager, getRepoInfo, hasRepo, hasTemplate, install, isFolderEmpty, isUrlOk, isWriteable, makeDir, notifyUpdate, tryGitInit, validateNpmName };