import { AppConfig, App, Page, PluginObject } from '@vuepress/core'; import { FSWatcher } from 'chokidar'; /** * Type of `dev` command function */ type BuildCommand = (sourceDir?: string, commandOptions?: BuildCommandOptions) => Promise; /** * CLI options of `build` command */ interface BuildCommandOptions { dest?: string; temp?: string; cache?: string; debug?: boolean; config?: string; cleanTemp?: boolean; cleanCache?: boolean; } declare const createBuild: (defaultAppConfig: Partial) => BuildCommand; /** * Type of `dev` command function */ type DevCommand = (sourceDir?: string, commandOptions?: DevCommandOptions) => Promise; /** * CLI options of `dev` command */ interface DevCommandOptions { port?: number; host?: string; temp?: string; cache?: string; debug?: boolean; open?: boolean; config?: string; cleanTemp?: boolean; cleanCache?: boolean; watch?: boolean; } declare const createDev: (defaultAppConfig: Partial) => DevCommand; /** * Event handler for page add event * * Returns the added page */ declare const handlePageAdd: (app: App, filePath: string) => Promise; /** * Event handler for page change event * * Returns the old page and the new page tuple */ declare const handlePageChange: (app: App, filePath: string) => Promise<[Page, Page] | null>; /** * Event handler for page unlink event * * Returns the removed page */ declare const handlePageUnlink: (app: App, filePath: string) => Promise; /** * Watch page files and deps, return file watchers */ declare const watchPageFiles: (app: App) => FSWatcher[]; declare const watchUserConfigFile: ({ userConfigPath, userConfigDependencies, restart, }: { userConfigPath: string; userConfigDependencies: string[]; restart: () => Promise; }) => FSWatcher[]; declare const info: () => Promise; /** * User config type of vuepress * * It will be transformed to `AppConfig` by cli */ type UserConfig = Partial & Omit; declare const defineUserConfig: (config: UserConfig) => UserConfig; /** * Load user config file */ declare const loadUserConfig: (userConfigPath?: string) => Promise<{ userConfig: UserConfig; userConfigDependencies: string[]; }>; /** * Resolve app config according to: * * - default options * - user config file * - cli options */ declare const resolveAppConfig: ({ defaultAppConfig, cliAppConfig, userConfig, }: { defaultAppConfig: Partial; cliAppConfig: Partial; userConfig: Partial; }) => AppConfig | null; /** * Resolve app config according to command options of cli */ declare const resolveCliAppConfig: (sourceDir: string, commandOptions: Partial, cwd?: string) => Partial & Pick; /** * Resolve conventional user config file path */ declare const resolveUserConfigConventionalPath: (source: string, cwd?: string) => string | undefined; /** * Resolve file path of user config */ declare const resolveUserConfigPath: (config: string, cwd?: string) => string; /** * Transform user config to a vuepress plugin */ declare const transformUserConfigToPlugin: (userConfig: UserConfig, source: string, cwd?: string) => PluginObject; /** * Vuepress cli */ declare const cli: (defaultAppConfig?: Partial) => void; export { type BuildCommand, type BuildCommandOptions, type DevCommand, type DevCommandOptions, type UserConfig, cli, createBuild, createDev, defineUserConfig, handlePageAdd, handlePageChange, handlePageUnlink, info, loadUserConfig, resolveAppConfig, resolveCliAppConfig, resolveUserConfigConventionalPath, resolveUserConfigPath, transformUserConfigToPlugin, watchPageFiles, watchUserConfigFile };