文件操作 - update.d.mts
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/c12/dist/update.d.mts
编辑文件内容
import * as magicast from 'magicast'; /** * @experimental Update a config file or create a new one. */ declare function updateConfig(opts: UpdateConfigOptions): Promise<UpdateConfigResult>; interface UpdateConfigResult { configFile?: string; created?: boolean; } type MaybePromise<T> = T | Promise<T>; type MagicAstOptions = Exclude<Parameters<(typeof magicast)["parseModule"]>[1], undefined>; interface UpdateConfigOptions { /** * Current working directory */ cwd: string; /** * Config file name */ configFile: string; /** * Extension used for new config file. */ createExtension?: string; /** * Magicast options */ magicast?: MagicAstOptions; /** * Update function. */ onUpdate?: (config: any) => MaybePromise<void>; /** * Handle default config creation. * * Tip: you can use this option as a hook to prompt users about config creation. * * Context object: * - path: determined full path to the config file * * Returns types: * - string: custom config template * - true: write the template * - false: abort the operation */ onCreate?: (ctx: { configFile: string; }) => MaybePromise<string | boolean>; } export { type UpdateConfigOptions, type UpdateConfigResult, updateConfig };
修改文件时间
将文件时间修改为当前时间的前一年
删除文件