create-lemon
Version:
The Elegant Bundler for Libraries
58 lines • 1.37 kB
text/typescript
//#region src/types/option.d.ts
/**
* The template to use.
* @default 'ts'
*/
type Template = 'lemon-react' | 'lemon-uniapp' | 'lemon-vue' | 'react' | 'ts' | 'unplugin' | 'vscode' | 'vue';
/**
* Options for create-lemon.
*/
interface Options {
/**
* The name of the project.
* @default 'my-project'
*/
name?: string;
/**
* The template to use.
* @default 'ts'
*/
template?: Template;
/**
* Whether to force initialize the project.
* @default false
*/
force?: boolean;
/**
* Whether to suppress non-error logs.
* @default false
*/
silent?: boolean;
/**
* Whether to print debug messages to the console.
* @default false
*/
debug?: boolean;
}
/**
* Template data.
*/
interface TemplateData {
label: string;
hint: string;
value: Template;
path: string;
url: {
github: string;
};
}
//#endregion
//#region src/types/index.d.ts
type Overwrite<T, U> = Omit<T, keyof U> & U;
type AwaitAble<T> = Promise<T> | T;
type MarkPartial<T, K extends keyof T> = Omit<Required<T>, K> & Partial<Pick<T, K>>;
type ArrayAble<T> = T | T[];
type DirectoryTraverse = (dir: string, dirCallback: (dir: string) => void, fileCallback: (file: string) => void) => void;
//#endregion
export { ArrayAble, AwaitAble, DirectoryTraverse, MarkPartial, Options, Overwrite, Template, TemplateData };