/// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// /// import type * as t from '~/types/session'; export declare class SessionError extends Error { code: string; constructor(message: string, code?: string); } /** Default refresh token expiry: 7 days in milliseconds */ export declare const DEFAULT_REFRESH_TOKEN_EXPIRY: number; export declare function createSessionMethods(mongoose: typeof import('mongoose')): { findSession: (params: t.SessionSearchParams, options?: t.SessionQueryOptions) => Promise; SessionError: typeof SessionError; deleteSession: (params: t.DeleteSessionParams) => Promise<{ deletedCount?: number; }>; createSession: (userId: string, options?: t.CreateSessionOptions) => Promise; updateExpiration: (session: t.ISession | string, newExpiration?: Date, options?: t.UpdateExpirationOptions) => Promise; countActiveSessions: (userId: string) => Promise; generateRefreshToken: (session: t.ISession) => Promise; deleteAllUserSessions: (userId: string | { userId: string; }, options?: t.DeleteAllSessionsOptions) => Promise<{ deletedCount?: number; }>; }; export type SessionMethods = ReturnType;