@tarojs/cli
Version:
cli tool for taro
46 lines (45 loc) • 1.48 kB
TypeScript
import Creator from './creator';
export interface IPageConf {
projectDir: string;
projectName: string;
npm: string;
template: string;
description?: string;
pageName: string;
date?: string;
framework: 'react' | 'preact' | 'nerv' | 'vue' | 'vue3';
css: 'none' | 'sass' | 'stylus' | 'less';
typescript?: boolean;
compiler?: 'webpack4' | 'webpack5' | 'vite';
isCustomTemplate?: boolean;
customTemplatePath?: string;
}
interface IPageArgs extends IPageConf {
modifyCustomTemplateConfig: TGetCustomTemplate;
}
interface ITemplateInfo {
css: 'none' | 'sass' | 'stylus' | 'less';
typescript?: boolean;
compiler?: 'webpack4' | 'webpack5' | 'vite';
template?: string;
}
type TCustomTemplateInfo = Omit<ITemplateInfo & {
isCustomTemplate?: boolean;
customTemplatePath?: string;
}, 'template'>;
export type TSetCustomTemplateConfig = (customTemplateConfig: TCustomTemplateInfo) => void;
type TGetCustomTemplate = (cb: TSetCustomTemplateConfig) => Promise<void>;
export default class Page extends Creator {
rootPath: string;
conf: IPageConf;
private modifyCustomTemplateConfig;
constructor(args: IPageArgs);
getPkgPath(): string;
getPkgTemplateInfo(): any;
setCustomTemplateConfig(customTemplateConfig: TCustomTemplateInfo): void;
setTemplateConfig(templateInfo: ITemplateInfo): void;
fetchTemplates(): Promise<void>;
create(): Promise<void>;
write(): void;
}
export {};