Skip to content
Open
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
2 changes: 1 addition & 1 deletion packages/metro/types/Bundler.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TransformResultWithSource<void>>;
): Promise<TransformResultWithSource>;

ready(): Promise<void>;
}
2 changes: 1 addition & 1 deletion packages/metro/types/DeltaBundler/Worker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface TransformerConfig {
}

interface Data {
readonly result: TransformResult<void>;
readonly result: TransformResult;
readonly sha1: string;
readonly transformFileStartLogEntry: LogEntry;
readonly transformFileEndLogEntry: LogEntry;
Expand Down
18 changes: 8 additions & 10 deletions packages/metro/types/IncrementalBundler.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import {ResolverInputOptions} from './shared/types';

export type RevisionId = string;

export type OutputGraph = Graph<void>;
export type OutputGraph = Graph;

export interface OtherOptions {
readonly onProgress: DeltaBundlerOptions<void>['onProgress'];
readonly onProgress: DeltaBundlerOptions['onProgress'];
readonly shallow: boolean;
}

Expand All @@ -34,7 +34,7 @@ export interface GraphRevision {
readonly date: Date;
readonly graphId: GraphId;
readonly graph: OutputGraph;
readonly prepend: ReadonlyArray<Module<void>>;
readonly prepend: ReadonlyArray<Module>;
}

export interface IncrementalBundlerOptions {
Expand All @@ -48,7 +48,7 @@ export default class IncrementalBundler {

end(): void;
getBundler(): Bundler;
getDeltaBundler(): DeltaBundler<void>;
getDeltaBundler(): DeltaBundler;
getRevision(revisionId: RevisionId): Promise<GraphRevision> | null;
getRevisionByGraphId(graphId: GraphId): Promise<GraphRevision> | null;

Expand All @@ -64,32 +64,30 @@ export default class IncrementalBundler {
transformOptions: TransformInputOptions,
resolverOptions: ResolverInputOptions,
otherOptions?: OtherOptions,
): Promise<ReadOnlyDependencies<void>>;
): Promise<ReadOnlyDependencies>;

buildGraph(
entryFile: string,
transformOptions: TransformInputOptions,
resolverOptions: ResolverInputOptions,
otherOptions?: OtherOptions,
): Promise<
Readonly<{graph: OutputGraph; prepend: ReadonlyArray<Module<void>>}>
>;
): Promise<Readonly<{graph: OutputGraph; prepend: ReadonlyArray<Module>}>>;

initializeGraph(
entryFile: string,
transformOptions: TransformInputOptions,
resolverOptions: ResolverInputOptions,
otherOptions?: OtherOptions,
): Promise<{
delta: DeltaResult<void>;
delta: DeltaResult;
revision: GraphRevision;
}>;

updateGraph(
revision: GraphRevision,
reset: boolean,
): Promise<{
delta: DeltaResult<void>;
delta: DeltaResult;
revision: GraphRevision;
}>;

Expand Down
2 changes: 1 addition & 1 deletion packages/metro/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export function runBuild(
export function buildGraph(
config: ConfigT,
options: BuildGraphOptions,
): Promise<ReadOnlyGraph<void>>;
): Promise<ReadOnlyGraph>;

type BuildCommandOptions = Record<string, unknown> | null;
type ServeCommandOptions = Record<string, unknown> | null;
Expand Down