Skip to content

Commit c18791c

Browse files
authoredOct 5, 2022
Fix incorrect options type to WatchOptions (#51064)
1 parent b0795e9 commit c18791c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed
 

‎src/compiler/watchPublic.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ namespace ts {
6161
onWatchStatusChange?(diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number): void;
6262

6363
/** Used to watch changes in source files, missing files needed to update the program or config file */
64-
watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: CompilerOptions): FileWatcher;
64+
watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
6565
/** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */
66-
watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: CompilerOptions): FileWatcher;
66+
watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
6767
/** If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together */
6868
setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
6969
/** If provided, will be used to reset existing delayed compilation */

‎tests/baselines/reference/api/tsserverlibrary.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5399,9 +5399,9 @@ declare namespace ts {
53995399
/** If provided, called with Diagnostic message that informs about change in watch status */
54005400
onWatchStatusChange?(diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number): void;
54015401
/** Used to watch changes in source files, missing files needed to update the program or config file */
5402-
watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: CompilerOptions): FileWatcher;
5402+
watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
54035403
/** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */
5404-
watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: CompilerOptions): FileWatcher;
5404+
watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
54055405
/** If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together */
54065406
setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
54075407
/** If provided, will be used to reset existing delayed compilation */

‎tests/baselines/reference/api/typescript.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5399,9 +5399,9 @@ declare namespace ts {
53995399
/** If provided, called with Diagnostic message that informs about change in watch status */
54005400
onWatchStatusChange?(diagnostic: Diagnostic, newLine: string, options: CompilerOptions, errorCount?: number): void;
54015401
/** Used to watch changes in source files, missing files needed to update the program or config file */
5402-
watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: CompilerOptions): FileWatcher;
5402+
watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number, options?: WatchOptions): FileWatcher;
54035403
/** Used to watch resolved module's failed lookup locations, config file specs, type roots where auto type reference directives are added */
5404-
watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: CompilerOptions): FileWatcher;
5404+
watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean, options?: WatchOptions): FileWatcher;
54055405
/** If provided, will be used to set delayed compilation, so that multiple changes in short span are compiled together */
54065406
setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
54075407
/** If provided, will be used to reset existing delayed compilation */

0 commit comments

Comments
 (0)