Skip to content

Commit

Permalink
fix: export SafeActionClient type to make it portable (#267) (#269)
Browse files Browse the repository at this point in the history
Includes the `SafeActionClient` into the types export to make the
inferred type of `createSafeActionClient` portable in order to avoid the
error [TS2742](https://typescript.tv/errors/#ts2742). It enables
declaring the action client in a shared package and import it in the
other apps or packages.

closes #64

Co-authored-by: Bruno Moreira <[email protected]>
  • Loading branch information
TheEdoRan and brunorodmoreira authored Sep 13, 2024
1 parent 495ecba commit 197ec51
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/next-safe-action/src/index.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,12 @@ export type InferServerError<T> = T extends
| SafeStateActionFn<infer ServerError, any, any, any, any, any>
? ServerError
: never;


/**
* Type of the core safe action client.
*/
export {
SafeActionClient
};

0 comments on commit 197ec51

Please sign in to comment.