Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/buck-worker-tool/src/profiling.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function getInspectorSession() {
return currentInspectorSession;
}

export async function startProfiling() {
export async function startProfiling(): Promise<void> {
if (isProfiling) {
return;
}
Expand All @@ -36,7 +36,9 @@ export async function startProfiling() {
isProfiling = true;
}

export async function stopProfilingAndWrite(workerName: ?string) {
export async function stopProfilingAndWrite(
workerName: ?string,
): Promise<void> {
if (!isProfiling) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/buck-worker-tool/types/profiling.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @noformat
* @oncall react_native
* @generated SignedSource<<ae98ee20cb59420ad8aa343e7ce31e8d>>
* @generated SignedSource<<09802f56d759b9edc8e6453a35bed569>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/buck-worker-tool/src/profiling.js
Expand All @@ -15,7 +15,7 @@
* yarn run build-ts-defs (OSS)
*/

export declare function startProfiling(): void;
export declare function startProfiling(): Promise<void>;
export declare function stopProfilingAndWrite(
workerName: null | undefined | string,
): void;
): Promise<void>;
6 changes: 4 additions & 2 deletions packages/metro-file-map/src/Watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ export class Watcher extends EventEmitter {
return delta;
}

async watch(onChange: (change: WatcherBackendChangeEvent) => void) {
async watch(
onChange: (change: WatcherBackendChangeEvent) => void,
): Promise<void> {
const {extensions, ignorePatternForWatch, useWatchman} = this.#options;

// WatchmanWatcher > NativeWatcher > FallbackWatcher
Expand Down Expand Up @@ -268,7 +270,7 @@ export class Watcher extends EventEmitter {
resolveHealthCheck();
}

async close() {
async close(): Promise<void> {
await Promise.all(this.#backends.map(watcher => watcher.stopWatching()));
this.#activeWatcher = null;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/metro-file-map/src/watchers/NativeWatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default class NativeWatcher extends AbstractWatcher {
}
}

async _handleEvent(event: string, relativePath: string) {
async _handleEvent(event: string, relativePath: string): Promise<void> {
const absolutePath = path.resolve(this.root, relativePath);
if (this.doIgnore(relativePath)) {
debug(
Expand Down
6 changes: 3 additions & 3 deletions packages/metro-file-map/types/Watcher.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*
* @noformat
* @generated SignedSource<<25fee66c7d26ad53cdd5bbab454fe50b>>
* @generated SignedSource<<b8a3ed0b37fb0e12a72fe8587de79466>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro-file-map/src/Watcher.js
Expand Down Expand Up @@ -68,7 +68,7 @@ export declare class Watcher extends EventEmitter {
subpath: string,
currentFileSystem: CrawlerOptions['previousState']['fileSystem'],
): Promise<CrawlResult>;
watch(onChange: (change: WatcherBackendChangeEvent) => void): void;
close(): void;
watch(onChange: (change: WatcherBackendChangeEvent) => void): Promise<void>;
close(): Promise<void>;
checkHealth(timeout: number): Promise<HealthCheckResult>;
}
4 changes: 2 additions & 2 deletions packages/metro-file-map/types/watchers/NativeWatcher.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*
* @noformat
* @generated SignedSource<<b68c5620efd3f5bec83279059d0d1b4e>>
* @generated SignedSource<<99faac6446a910cc70728424f342908c>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro-file-map/src/watchers/NativeWatcher.js
Expand Down Expand Up @@ -50,6 +50,6 @@ declare class NativeWatcher extends AbstractWatcher {
* End watching.
*/
stopWatching(): Promise<void>;
_handleEvent(event: string, relativePath: string): void;
_handleEvent(event: string, relativePath: string): Promise<void>;
}
export default NativeWatcher;
2 changes: 1 addition & 1 deletion packages/metro/src/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export default class Server {
this._nextBundleBuildNumber = 1;
}

async end() {
async end(): Promise<void> {
if (!this._isEnded) {
await this._bundler.end();
this._isEnded = true;
Expand Down
2 changes: 1 addition & 1 deletion packages/metro/src/node-haste/DependencyGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export default class DependencyGraph extends EventEmitter {
return this._haste;
}

async end() {
async end(): Promise<void> {
await this.ready();
await this._haste.end();
}
Expand Down
4 changes: 2 additions & 2 deletions packages/metro/types/Server.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @noformat
* @oncall react_native
* @generated SignedSource<<03b526801403adb05b3b0f6c25b25ed5>>
* @generated SignedSource<<58a8bc4229ee86a5c93af2ea51195b97>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro/src/Server.js
Expand Down Expand Up @@ -120,7 +120,7 @@ declare class Server {
_fetchTimings: Array<FetchTiming>;
_activeFetchCount: number;
constructor(config: ConfigT, options?: ServerOptions);
end(): void;
end(): Promise<void>;
getBundler(): IncrementalBundler;
getCreateModuleId(): (path: string) => number;
_serializeGraph(
Expand Down
4 changes: 2 additions & 2 deletions packages/metro/types/node-haste/DependencyGraph.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @noformat
* @oncall react_native
* @generated SignedSource<<13f1483d2a732241f8d9eae463399b0e>>
* @generated SignedSource<<0ae2c74336868865b420d900a230cea7>>
*
* This file was translated from Flow by scripts/generateTypeScriptDefinitions.js
* Original file: packages/metro/src/node-haste/DependencyGraph.js
Expand Down Expand Up @@ -70,7 +70,7 @@ declare class DependencyGraph extends EventEmitter {
mixedPath: string,
): Promise<{content?: Buffer; sha1: string}>;
getWatcher(): EventEmitter;
end(): void;
end(): Promise<void>;
/** Given a search context, return a list of file paths matching the query. */
matchFilesWithContext(
from: string,
Expand Down
Loading