import { Kysely } from "kysely"; import { Database } from "./db"; import { SessionCleanupParams } from "@authhero/adapter-interfaces"; /** * Create a scoped session cleanup function that can filter by tenant and/or user. * This is designed for lazy cleanup after login session creation. * * The refreshTokens.create and refreshTokens.update adapter methods bump the * parent login_sessions.expires_at_ts in the same transaction whenever a refresh * token's validity is extended. Likewise, silent auth bumps it when a session is * refreshed. This invariant means we can delete expired login_sessions * independently without expensive subqueries to check for active children. * * Records are deleted only after they have been expired for the grace period (1 week). */ export declare function createSessionCleanup(db: Kysely): (params?: SessionCleanupParams) => Promise;