import { InferFieldsInputClient } from "../db/field.mjs"; import { StripEmptyObjects, UnionToIntersection } from "../types/helper.mjs"; import { InferRoutes } from "./path-to-object.mjs"; import { Session as Session$1, User as User$1 } from "../types/models.mjs"; import { Auth } from "../types/auth.mjs"; import { BetterAuthClientOptions as BetterAuthClientOptions$1, BetterAuthClientPlugin, ClientAtomListener as ClientAtomListener$1, ClientStore as ClientStore$1 } from "@better-auth/core"; import { DBFieldAttribute, InferDBFieldsOutput } from "@better-auth/core/db"; //#region src/client/types.d.ts type ClientPluginError = { readonly code: K; message: string; }; type InferPluginEndpoints = Plugins extends Array ? UnionToIntersection ? Endpoints : {} : {} : {}> : {}; type InferClientAPI = InferRoutes ? Omit> & InferPluginEndpoints : Auth["api"], O>; type InferActions = (O["plugins"] extends Array ? UnionToIntersection infer Actions) ? Actions : {} : {}> : {}) & InferRoutes ? Plugin extends { endpoints?: infer Endpoints; } ? Endpoints extends Record ? Endpoints : {} : {} : {} : {}, O>; type InferErrorCodes = O["plugins"] extends Array ? UnionToIntersection : never } : {} : {}> : {}; /** * signals are just used to recall a computed value. * as a convention they start with "$" */ type IsSignal = T extends `$${infer _}` ? true : false; type InferSessionFromClient = StripEmptyObjects>>; type InferUserFromClient = StripEmptyObjects>>; type InferAdditionalFromClient = Options["plugins"] extends Array ? Plugin extends { $InferServerPlugin?: infer ServerPlugin; } ? ServerPlugin extends { schema?: infer Schema; } ? Schema extends Record ? Fields extends Record ? Format extends "input" ? InferFieldsInputClient : InferDBFieldsOutput : {} : {} : {} : {} : {}; type SessionQueryParams = { disableCookieCache?: boolean | undefined; disableRefresh?: boolean | undefined; }; //#endregion export { type BetterAuthClientOptions$1 as BetterAuthClientOptions, type BetterAuthClientPlugin, type ClientAtomListener$1 as ClientAtomListener, type ClientStore$1 as ClientStore, InferActions, InferAdditionalFromClient, InferClientAPI, InferErrorCodes, InferSessionFromClient, InferUserFromClient, IsSignal, SessionQueryParams };