中国优质的IT技术网站
专业IT技术创作平台
IT职业在线教育平台
微信扫码分享
function startFileScanTaskUnderSpecifiedDir() { let `guard`: fileGuard.FileGuard = new fileGuard.FileGuard(); let `path`: string = '/data/test'; let `onReceiveFileList`: (files: string[]) => void = (files: Array<string>) => { files.forEach((`value`: string, index: number) => { console.info(`Succeeded in getting file: ${`value`}.`); }) }; let `onCompleteScanTask`: (count: number) => void = (`count`: number) => { console.info(`Succeeded in getting count: ${`count`}.`); }; let `scanFileCallback`: fileGuard.ScanFileCallback = { onReceiveFileList: `onReceiveFileList`, onTaskCompleted: `onCompleteScanTask` }; guard.startFileScanTask(`path`, `scanFileCallback`); }