import type { Selectable } from 'kysely'; import type { Code, Did, NewTokenData, RefreshToken, TokenData, TokenId } from '@atproto/oauth-provider/store'; import type { AccountDb, Token } from '../db/index.js'; export declare function toTokenData(row: Selectable): TokenData; export declare const createQB: (db: AccountDb, tokenId: TokenId, data: TokenData, refreshToken?: RefreshToken) => import("kysely").InsertQueryBuilder; export declare const forRotateQB: (db: AccountDb, id: TokenId) => import("kysely").SelectQueryBuilder; export declare const findByQB: (db: AccountDb, search: { id?: number; did?: Did; code?: Code; tokenId?: TokenId; currentRefreshToken?: RefreshToken; }) => import("kysely").SelectQueryBuilder<{ account: import("kysely").Nullable; account_device: import("../db/index.js").AccountDevice; actor: import("../db/index.js").Actor; app_password: import("../db/index.js").AppPassword; authorization_request: import("../db/index.js").AuthorizationRequest; authorized_client: import("../db/schema/authorized-client.js").AuthorizedClient; device: import("../db/index.js").Device; email_token: import("../db/index.js").EmailToken; invite_code: import("../db/index.js").InviteCode; invite_code_use: import("../db/index.js").InviteCodeUse; lexicon: import("../db/index.js").Lexicon; refresh_token: import("../db/index.js").RefreshToken; repo_root: import("../db/index.js").RepoRoot; token: Token; used_refresh_token: import("../db/index.js").UsedRefreshToken; }, "account" | "actor" | "token", Partial> & { createdAt: string; deactivatedAt: string | null; deleteAfter: string | null; did: `did:${string}:${string}`; email: string | null; emailConfirmedAt: import("@atproto/syntax").DatetimeString | null; handle: `${string}.${string}` | null; invitesDisabled: 0 | 1 | null; takedownRef: string | null; } & { clientAuth: import("../../db/cast.js").JsonEncoded; clientId: string; code: `cod-${string}` | null; createdAt: `${string}T${string}Z`; currentRefreshToken: `ref-${string}` | null; details: import("../../db/cast.js").JsonEncoded<{ type: string; locations?: `${string}:${string}`[] | undefined; actions?: string[] | undefined; datatypes?: string[] | undefined; identifier?: string | undefined; privileges?: string[] | undefined; }[]> | null; deviceId: `dev-${string}` | null; did: `did:${string}:${string}`; expiresAt: `${string}T${string}Z`; id: number; parameters: import("../../db/cast.js").JsonEncoded<{ client_id: string; state?: string | undefined; redirect_uri?: "http://127.0.0.1" | `${string}.${string}:/${string}` | `http://127.0.0.1#${string}` | `http://127.0.0.1/${string}` | `http://127.0.0.1:${string}` | `http://127.0.0.1?${string}` | `http://[::1]${string}` | `https://${string}` | undefined; scope?: string | undefined; response_type: "code" | "code id_token" | "code id_token token" | "code token" | "id_token" | "id_token token" | "none" | "token"; code_challenge?: string | undefined; code_challenge_method?: "S256" | "plain" | undefined; dpop_jkt?: string | undefined; response_mode?: "form_post" | "fragment" | "query" | undefined; nonce?: string | undefined; max_age?: number | undefined; claims?: Partial>>> | undefined; login_hint?: string | undefined; ui_locales?: string | undefined; id_token_hint?: `${string}.${string}.${string}` | undefined; display?: "page" | "popup" | "touch" | "wap" | undefined; prompt?: "consent" | "create" | "login" | "none" | "select_account" | undefined; authorization_details?: { type: string; locations?: `${string}:${string}`[] | undefined; actions?: string[] | undefined; datatypes?: string[] | undefined; identifier?: string | undefined; privileges?: string[] | undefined; }[] | undefined; }>; scope: string | null; tokenId: `tok-${string}`; updatedAt: `${string}T${string}Z`; } & Partial>>; export declare const removeByDid: (db: AccountDb, did: Did) => Promise; export declare const rotateQB: (db: AccountDb, id: number, newTokenId: TokenId, newRefreshToken: RefreshToken, newData: NewTokenData) => import("kysely").UpdateQueryBuilder; export declare const removeQB: (db: AccountDb, tokenId: TokenId) => import("kysely").DeleteQueryBuilder; //# sourceMappingURL=token.d.ts.map