import { IFilePartItem } from '@guanghechen/filepart'; interface IFileSplitter { /** * File part code prefix. */ readonly partCodePrefix: string; /** * Calculate the name of parts of sourcefile respectively. * * @param filepath * @param parts * @returns */ calcPartFilepaths(filepath: string, parts: IFilePartItem[]): string[]; /** * Split file with part descriptions. */ split(filepath: string, parts: IFilePartItem[], outputFilepath?: string): Promise; /** * Merge files * * @param inputFilepaths * @param outputFilepath */ merge(inputFilepaths: string[], outputFilepath: string): Promise; } interface IProps { /** * The suffix name of a file part. */ readonly partCodePrefix?: string; } /** * Inspired by https://github.com/tomvlk/node-split-file. */ declare class FileSplitter implements IFileSplitter { #private; readonly partCodePrefix: string; constructor(options?: IProps); calcPartFilepaths(filepath: string, parts: IFilePartItem[]): string[]; split(filepath: string, parts: IFilePartItem[], outputFilepath?: string): Promise; merge(inputFilepaths: string[], outputFilepath: string): Promise; } declare const fileSplitter: FileSplitter; export { FileSplitter, fileSplitter }; export type { IFileSplitter };