@mail-core/cli
Version:
Инструментарий для написания cli-скриптов
28 lines (27 loc) • 1.07 kB
TypeScript
export declare enum PkgScopeStatus {
installed = "installed",
unchanged = "unchanged",
updated = "updated"
}
export declare type PkgScopeProps = Record<string, any>;
export declare type PkgScopeRaw<P extends PkgScopeProps> = {
name: string;
version: string;
props?: P;
};
export declare type PkgScope<P extends PkgScopeProps> = {
name: string;
version: string;
props: P;
status: PkgScopeStatus;
};
export declare type InitPkgScopeOptions<P extends PkgScopeProps> = {
name: string;
handler: (scope: PkgScopeRaw<P>, oldVersion?: string) => Promise<P>;
__dirname: string;
ROOT_DIR?: string;
};
export declare function initPackageJsonScope<P extends PkgScopeProps>(options: InitPkgScopeOptions<P>): Promise<PkgScope<P>>;
export declare function readPackageJsonScope<P extends PkgScopeProps>(__dirname: string, name: string): PkgScopeRaw<P> | undefined;
export declare function removePackageJsonScope(__dirname: string, name: string): void;
export declare function removePackageJsonAllScopes(__dirname: string): void;