File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2,18 +2,20 @@ import { getEndpoints, router } from "./api";
22import { init } from "./init" ;
33import type { BetterAuthOptions } from "./types/options" ;
44import type {
5- InferErrorCodes ,
65 InferPluginErrorCodes ,
76 InferPluginTypes ,
87 InferSession ,
98 InferUser ,
9+ PreserveJSDoc ,
1010 PrettifyDeep ,
1111} from "./types" ;
1212import { getBaseURL } from "./utils/url" ;
1313import type { FilterActions , InferAPI } from "./types/api" ;
1414import { BASE_ERROR_CODES } from "./error/codes" ;
1515
16- export const betterAuth = < O extends BetterAuthOptions > ( options : O ) => {
16+ export const betterAuth = < O extends BetterAuthOptions > (
17+ options : PreserveJSDoc < O > ,
18+ ) => {
1719 const authContext = init ( options ) ;
1820 const { api } = getEndpoints ( authContext , options ) ;
1921 const errorCodes = options . plugins ?. reduce ( ( acc , plugin ) => {
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ export type LiteralNumber = 0 | (number & Record<never, never>);
66export type OmitId < T extends { id : unknown } > = Omit < T , "id" > ;
77
88export type Prettify < T > = Omit < T , never > ;
9+ export type PreserveJSDoc < T > = {
10+ [ K in keyof T ] : T [ K ] ;
11+ } & { } ;
912export type PrettifyDeep < T > = {
1013 [ K in keyof T ] : T [ K ] extends ( ...args : any [ ] ) => any
1114 ? T [ K ]
You can’t perform that action at this time.
0 commit comments