diff --git a/scripts/copy-res.ts b/scripts/copy-res.ts index 5954bc05ae..cf3a0477a0 100755 --- a/scripts/copy-res.ts +++ b/scripts/copy-res.ts @@ -165,7 +165,7 @@ function watchLanguage(lang: string, dest: string, langFileMap: Record; const makeLang = (): void => { if (makeLangDebouncer) { clearTimeout(makeLangDebouncer); diff --git a/src/@types/cpx.d.ts b/src/@types/cpx.d.ts index f1980d932a..d9c4d632e3 100644 --- a/src/@types/cpx.d.ts +++ b/src/@types/cpx.d.ts @@ -15,12 +15,16 @@ limitations under the License. */ import "cpx"; -import type EventEmitter from "events"; declare module "cpx" { - export class Cpx extends EventEmitter { + export class Cpx { public constructor(source: string, outDir: string, options?: object); + public on(eventName: "copy", fn: (event: { srcPath: string; dstPath: string }) => void): void; + public on(eventName: "remove", fn: (event: { path: string }) => void): void; + public on(eventName: "watch-ready", fn: () => void): void; + public on(eventName: "watch-error", fn: (error: Error) => void): void; + /** * Copy all files that matches `this.source` pattern to `this.outDir`. * diff --git a/tsconfig.json b/tsconfig.json index 5762df78d4..c707ebaa54 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,5 +26,8 @@ "./test/**/*.ts", "./test/**/*.tsx", "./scripts/*.ts" - ] + ], + "ts-node": { + "files": true + } }