Skip to content

Commit 382b7e7

Browse files
committed
Allow setting ResolveType to pass to show method
1 parent f146959 commit 382b7e7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,13 +282,14 @@ export function useModal<
282282
ComponentProps extends NiceModalArgs<T>,
283283
PreparedProps extends Partial<ComponentProps> = {} | ComponentProps,
284284
RemainingProps = Omit<ComponentProps, keyof PreparedProps> & Partial<ComponentProps>,
285+
ResolveType = unknown
285286
>(
286287
modal: T,
287288
args?: PreparedProps,
288289
): Omit<NiceModalHandler, 'show'> & {
289290
show: Partial<RemainingProps> extends RemainingProps
290-
? (args?: RemainingProps) => Promise<unknown>
291-
: (args: RemainingProps) => Promise<unknown>;
291+
? (args?: RemainingProps) => Promise<ResolveType>
292+
: (args: RemainingProps) => Promise<ResolveType>;
292293
};
293294
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
294295
export function useModal(modal?: any, args?: any): any {

0 commit comments

Comments
 (0)