/** Kitten command-line interface (CLI): init command. Copyright ⓒ 2026-present, Aral Balkan Small Technology Foundation License: AGPL version 3.0. */ import childProcess from 'node:child_process'; import type { ServerOptions } from '../index.ts'; /** Kitten init command. */ export default function init(language: typeof Init.JS | typeof Init.TS, options: ServerOptions): void; /** Helper for initialising type-safe Kitten projects. */ export declare class Init { static RESOURCES_BASE_PATH: string; static JAVASCRIPT: 'JavaScript'; static TYPESCRIPT: 'TypeScript'; static JS: 'js'; static TS: 'ts'; static JSCONFIG_FILE_NAME: 'jsconfig.json'; static TSCONFIG_FILE_NAME: 'tsconfig.json'; static GLOBALS_FILE_NAME: 'globals.d.ts'; static PACKAGE_JSON_FILE_NAME: 'package.json'; static README_FILE_NAME: 'README.md'; static CHANGE_LOG_FILE_NAME: string; static GIT_IGNORE_FILE_NAME: '.gitignore'; static LICENSE_FILE_NAME: 'LICENSE'; static INDEX_PAGE_FILE_NAME: 'index.page'; static GLOBALS_D_TS_TEMPLATE: `import '@small-web/kitten-types' export {} `; static GIT_IGNORE_TEMPLATE: `node_modules/ .DS_Store `; language: "js" | "ts"; languagePretty: "JavaScript" | "TypeScript"; configFileName: "jsconfig.json" | "tsconfig.json"; isJs: boolean; isTs: boolean; projectFolder: string; childProcessOptions: childProcess.ExecSyncOptions; constructor(language: typeof Init.JS | typeof Init.TS | undefined, options: ServerOptions & { typesOnly?: boolean; }); /** Returns /file-name for file-name. */ projectFolderSlash(fileName: string): string; /** Generic method that calls a callback to handle creating a file if it doesn’t already exist. */ addFileIfNecessary(fileName: string, createFile: (fileName: string) => void): void; /** Returns contents of the file with passed file name from the resources folder. */ file(fileName: string): string; /** Copies template file from resources folder to the project folder. */ copyTheTemplateVerbatim(fileName: string): void; /** Adds typecheck script to package.json if it doesn’t already exist. */ addTypecheckScriptToPackageJsonFile(): boolean; /** Initialises an npm module with an AGPL v3.0 license, if necessary. */ npmInitIfNecessary(): void; /** Installs TypeScript 7 as a dev dependency. */ installTypeScriptAsDevDependency(): void; /** Installs latest @small-web/kitten-types as a dev dependency. */ installKittenTypes(): void; /** Adds either a jsconfig.json or a tsconfig.json file to the project. */ addConfigfileIfNecessary(): void; /** Adds globals.d.ts file to project folder if one doesn’t already exist. */ addGlobalTypeDeclarationsFileIfNecessary(): void; /** Adds license file to project folder if one doesn’t already exist. */ addLicenseIfNecessary(): void; /** Adds readme file to project folder if one doesn’t already exist. */ addReadmeIfNecessary(): void; /** Adds change log file to project folder if one doesn’t already exist. */ addChangelogIfNecessary(): void; /** Adds .gitignore file to project folder if one doesn’t already exist. */ addGitIgnoreIfNecessary(): void; /** Adds a sample index.page.(js|ts) under src/ if one doesn’t already exist so the person can run kitten and have it work. */ addIndexPageIfNecessary(): void; }