Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/nice-pans-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@clerk/types": patch
---

fix(types): Change return type of SetActiveNavigate to allow void or Promise
Comment on lines +1 to +5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify consistency with the actual type change across the repo.

Ensure the exported type is exactly void | Promise<void> (not Promise<unknown>) everywhere it’s declared or re-exported.


🏁 Script executed:

#!/bin/bash
# Verify SetActiveNavigate declaration(s) and references align with the changeset.

# 1) Locate the type definition(s)
rg -nP -C2 --type=ts 'export\s+type\s+SetActiveNavigate\b.*='

# 2) Show the return type in context
rg -nP -C3 --type=ts '(SetActiveNavigate|navigate\s*:\s*\(\{?\s*session)' | sed -n '1,200p'

# 3) Check for Promise<unknown> vs Promise<void> usage nearby
rg -nP --type=ts 'Promise<unknown>|Promise<void>'

# 4) Confirm no other packages declare their own SetActiveNavigate that would also need a changeset
rg -nP --type=ts '\bSetActiveNavigate\b' -g '!node_modules/**'

Length of output: 38291


Change SetActiveNavigate return type to void | Promise

In packages/types/src/clerk.ts line 123, update

export type SetActiveNavigate = ({ session }: { session: SessionResource }) => void | Promise<unknown>;

to

export type SetActiveNavigate = ({ session }: { session: SessionResource }) => void | Promise<void>;

and ensure all imports/uses (e.g. useCheckout.ts, SignInFuture, SignUpFuture, clerk-js checkout) and related tests align with the new Promise<void> signature.

🤖 Prompt for AI Agents
In .changeset/nice-pans-jog.md lines 1-5: update the type in
packages/types/src/clerk.ts (around line 123) from Promise<unknown> to
Promise<void> for SetActiveNavigate so its signature becomes ({ session }: {
session: SessionResource }) => void | Promise<void>; then update all usages and
imports (e.g., useCheckout.ts, SignInFuture, SignUpFuture, clerk-js checkout) to
return either void or Promise<void> (adjust async functions to return/resolve
with no value) and update related tests to expect/await Promise<void> results or
to not assert on returned value.

2 changes: 1 addition & 1 deletion packages/types/src/clerk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export type SDKMetadata = {
export type ListenerCallback = (emission: Resources) => void;
export type UnsubscribeCallback = () => void;
export type BeforeEmitCallback = (session?: SignedInSessionResource | null) => void | Promise<any>;
export type SetActiveNavigate = ({ session }: { session: SessionResource }) => Promise<unknown>;
export type SetActiveNavigate = ({ session }: { session: SessionResource }) => void | Promise<unknown>;

export type SignOutCallback = () => void | Promise<any>;

Expand Down