|
|
|
import nodefs = require('fs'); |
|
import { InputNode } from 'broccoli-node-api'; |
|
import { Options, Entry } from 'walk-sync'; |
|
declare class FSMerger { |
|
_dirList: FSMerger.Node[]; |
|
MAP: { |
|
[key: string]: FSMerger.FSMergerObject; |
|
} | null; |
|
PREFIXINDEXMAP: { |
|
[key: number]: FSMerger.FSMergerObject; |
|
}; |
|
LIST: FSMerger.FSMergerObject[]; |
|
_atList: FSMerger[]; |
|
fs: FSMerger.FS; |
|
constructor(trees: FSMerger.Node[] | FSMerger.Node); |
|
readFileSync(filePath: string, options?: { |
|
encoding?: string | null; |
|
flag?: string; |
|
} | string | null): FSMerger.FileContent | undefined; |
|
at(index: number): FSMerger; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
relativePathTo(absolutePath: string): { |
|
relativePath: string; |
|
at: number; |
|
} | null; |
|
_generateMap(): void; |
|
readFileMeta(filePath: string, options?: FSMerger.FileMetaOption): FSMerger.FileMeta | undefined; |
|
readdirSync(dirPath: string, options?: { |
|
encoding?: string | null; |
|
withFileTypes?: false; |
|
} | string | null): string[] | Buffer[]; |
|
readdir(dirPath: string, options: { |
|
encoding?: string | null; |
|
withFileTypes?: false; |
|
} | string | undefined | null, callback: (err: NodeJS.ErrnoException | null, files?: string[] | Buffer[]) => void): void; |
|
entries(dirPath?: string, options?: Options): Entry[]; |
|
} |
|
export = FSMerger; |
|
declare namespace FSMerger { |
|
type FS = Pick<typeof nodefs, 'readFileSync' | 'readdirSync' | 'readdir' | 'existsSync' | 'lstatSync' | 'statSync'> & Pick<FSMerger, 'at' | 'readFileMeta' | 'entries' | 'relativePathTo'>; |
|
type FSMergerObject = { |
|
root: string; |
|
absRootWithSep: string; |
|
prefix: string | undefined; |
|
getDestinationPath: Function | undefined; |
|
}; |
|
type FileContent = string | Buffer | null; |
|
type FileMeta = { |
|
path: string; |
|
prefix: string | undefined; |
|
getDestinationPath: Function | undefined; |
|
}; |
|
type FileMetaOption = { |
|
basePath: string; |
|
}; |
|
type Node = FSMergerObject | InputNode; |
|
} |
|
|