Skip to content

Commit

Permalink
fix: hints missing from WrakerApp when using plugin with type extension
Browse files Browse the repository at this point in the history
  • Loading branch information
josselinonduty committed Sep 28, 2024
1 parent a2e6438 commit 541a19e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/server/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ type ExtractExtension<Extensions> = Extensions extends WrakerAppPlugin<
? Extensions
: never;

type ExtendedWrakerApp<T extends WrakerAppPlugin<any, any>[] = []> =
WrakerApp &
(T extends [] ? {} : UnionToIntersection<ExtractExtension<T[number]>>);
type ExtendedWrakerApp<T extends WrakerAppPlugin<any, any>[]> = WrakerApp &
UnionToIntersection<ExtractExtension<T[number]>>;

export function defineWrakerApp<T extends WrakerAppPlugin<any, any>[] = []>(
options?: Partial<WrakerAppOptions>
): ExtendedWrakerApp<T> {
options?: Omit<Partial<WrakerAppOptions>, "plugins"> & {
plugins?: T;
}
) {
return new WrakerApp(options) as ExtendedWrakerApp<T>;
}

Expand Down

0 comments on commit 541a19e

Please sign in to comment.