@tsbb/typescript
Version:
TSBB is a zero-config CLI that helps you develop, test, and publish modern TypeScript project.
45 lines (44 loc) • 1.38 kB
TypeScript
import ts from 'typescript';
import fs from 'fs-extra';
export * from './utils.js';
export * from './log.js';
export interface CopyFilesOptions {
isWatch?: boolean;
/**
* @example `/path/to/dir/<root>/<lib>`
*/
outputDir?: string;
/**
* @example `/path/to/dir/<root>`
*/
currentDir?: string;
/**
* @example ['src', 'demo']
*/
rootDirsRelative?: string[];
onFilesChange?: (eventName: 'all' | 'raw' | 'error' | 'ready' | 'add' | 'change' | 'addDir' | 'unlink' | 'unlinkDir', path: string, stats?: fs.Stats) => void;
onError?: (error: any) => void;
onReady?: () => void;
}
export interface TsCompileOptions {
watch?: boolean;
/**
* Exit the compile as soon as the compile fails(default: true).
* @default `true`
*/
bail?: boolean;
emitDeclarationOnly?: boolean;
/**
* @default true
*/
isCopyFiles?: boolean;
outDir?: string;
onWriteFile?: (path: string, data: string, sourceFilePath: string, writeByteOrderMark?: boolean) => void;
onCopyFiles?: (entry: string[], options: CopyFilesOptions) => void;
}
export declare const findConfigFile: () => string | undefined;
export declare const readConfigFile: (tsConfigPath: string) => {
config?: any;
error?: ts.Diagnostic;
};
export default function compile(options?: TsCompileOptions): Promise<void>;