From c0cfb707ae09c838961636172b217866ebf16623 Mon Sep 17 00:00:00 2001 From: Nick Hudkins Date: Fri, 7 Nov 2025 09:48:25 -0500 Subject: [PATCH] fix(types): incorrect use in typescript --- packages/metro/types/Bundler.d.ts | 2 +- packages/metro/types/DeltaBundler/Worker.d.ts | 2 +- packages/metro/types/IncrementalBundler.d.ts | 18 ++++++++---------- packages/metro/types/index.d.ts | 2 +- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/packages/metro/types/Bundler.d.ts b/packages/metro/types/Bundler.d.ts index 12d51b73a1..5552aa4130 100644 --- a/packages/metro/types/Bundler.d.ts +++ b/packages/metro/types/Bundler.d.ts @@ -33,7 +33,7 @@ export default class Bundler { transformOptions: TransformOptions, /** Optionally provide the file contents, this can be used to provide virtual contents for a file. */ fileBuffer?: Buffer, - ): Promise>; + ): Promise; ready(): Promise; } diff --git a/packages/metro/types/DeltaBundler/Worker.d.ts b/packages/metro/types/DeltaBundler/Worker.d.ts index d114bc8c24..8f7ec9b5a2 100644 --- a/packages/metro/types/DeltaBundler/Worker.d.ts +++ b/packages/metro/types/DeltaBundler/Worker.d.ts @@ -34,7 +34,7 @@ export interface TransformerConfig { } interface Data { - readonly result: TransformResult; + readonly result: TransformResult; readonly sha1: string; readonly transformFileStartLogEntry: LogEntry; readonly transformFileEndLogEntry: LogEntry; diff --git a/packages/metro/types/IncrementalBundler.d.ts b/packages/metro/types/IncrementalBundler.d.ts index a6de0160f7..5bb1e5e3ad 100644 --- a/packages/metro/types/IncrementalBundler.d.ts +++ b/packages/metro/types/IncrementalBundler.d.ts @@ -22,10 +22,10 @@ import {ResolverInputOptions} from './shared/types'; export type RevisionId = string; -export type OutputGraph = Graph; +export type OutputGraph = Graph; export interface OtherOptions { - readonly onProgress: DeltaBundlerOptions['onProgress']; + readonly onProgress: DeltaBundlerOptions['onProgress']; readonly shallow: boolean; } @@ -34,7 +34,7 @@ export interface GraphRevision { readonly date: Date; readonly graphId: GraphId; readonly graph: OutputGraph; - readonly prepend: ReadonlyArray>; + readonly prepend: ReadonlyArray; } export interface IncrementalBundlerOptions { @@ -48,7 +48,7 @@ export default class IncrementalBundler { end(): void; getBundler(): Bundler; - getDeltaBundler(): DeltaBundler; + getDeltaBundler(): DeltaBundler; getRevision(revisionId: RevisionId): Promise | null; getRevisionByGraphId(graphId: GraphId): Promise | null; @@ -64,16 +64,14 @@ export default class IncrementalBundler { transformOptions: TransformInputOptions, resolverOptions: ResolverInputOptions, otherOptions?: OtherOptions, - ): Promise>; + ): Promise; buildGraph( entryFile: string, transformOptions: TransformInputOptions, resolverOptions: ResolverInputOptions, otherOptions?: OtherOptions, - ): Promise< - Readonly<{graph: OutputGraph; prepend: ReadonlyArray>}> - >; + ): Promise}>>; initializeGraph( entryFile: string, @@ -81,7 +79,7 @@ export default class IncrementalBundler { resolverOptions: ResolverInputOptions, otherOptions?: OtherOptions, ): Promise<{ - delta: DeltaResult; + delta: DeltaResult; revision: GraphRevision; }>; @@ -89,7 +87,7 @@ export default class IncrementalBundler { revision: GraphRevision, reset: boolean, ): Promise<{ - delta: DeltaResult; + delta: DeltaResult; revision: GraphRevision; }>; diff --git a/packages/metro/types/index.d.ts b/packages/metro/types/index.d.ts index 7259d57088..7296c19e3c 100644 --- a/packages/metro/types/index.d.ts +++ b/packages/metro/types/index.d.ts @@ -154,7 +154,7 @@ export function runBuild( export function buildGraph( config: ConfigT, options: BuildGraphOptions, -): Promise>; +): Promise; type BuildCommandOptions = Record | null; type ServeCommandOptions = Record | null;