From 73458f0dff04e6dd7ec262852c0e67e43d811c10 Mon Sep 17 00:00:00 2001 From: Dimitris Klouvas Date: Tue, 28 Nov 2023 15:43:36 +0200 Subject: [PATCH] fix(types): Add NavigationOptions in retheme --- packages/types/src/clerk.retheme.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/types/src/clerk.retheme.ts b/packages/types/src/clerk.retheme.ts index 7a3a3e9b88b..6cd8dea7cfa 100644 --- a/packages/types/src/clerk.retheme.ts +++ b/packages/types/src/clerk.retheme.ts @@ -498,14 +498,15 @@ export type BuildUrlWithAuthParams = { // TODO: Make sure Isomorphic Clerk navigate can work with the correct type: // (to: string) => Promise -export type CustomNavigation = (to: string) => Promise | void; +export type CustomNavigation = (to: string, options?: NavigateOptions) => Promise | void; export type ClerkThemeOptions = DeepSnakeToCamel>; export interface ClerkOptions { appearance?: Appearance; localization?: LocalizationResource; - navigate?: (to: string) => Promise | unknown; + routerPush?: (to: string) => Promise | unknown; + routerReplace?: (to: string) => Promise | unknown; polling?: boolean; selectInitialSession?: (client: ClientResource) => ActiveSessionResource | null; /** Controls if ClerkJS will load with the standard browser setup using Clerk cookies */ @@ -539,6 +540,10 @@ export interface ClerkOptions { sdkMetadata?: SDKMetadata; } +export interface NavigateOptions { + replace?: boolean; +} + export interface Resources { client: ClientResource; session?: ActiveSessionResource | null;