Skip to content

Commit

Permalink
refactor: extract types
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Feb 9, 2025
1 parent 96fd10e commit 6541e10
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ export interface PluginContext<T> {
log: (message: any, transferList?: TransferListItem[]) => void
}

export type ResolveFn = (
source: string,
importer?: string,
options?: ResolveMeta,
) => Promise<ResolvedId | null>

export interface Plugin<T = any> {
buildStart?: (context: PluginContext<T>) => Awaitable<void>
resolveId?: (
this: {
resolve: (
source: string,
importer?: string,
options?: ResolveMeta,
) => Promise<ResolvedId | null>
},
this: { resolve: ResolveFn },
source: string,
importer: string | undefined,
options: ResolveMeta,
Expand Down

0 comments on commit 6541e10

Please sign in to comment.