import type { Selectable } from 'kysely'; import type * as Db from '../Db.js'; import type * as db_Schema from '../Schema.js'; /** Columns of the `users` table, derived from `Schema.User`. */ export type Table = db_Schema.User; /** A stored user row. */ export type Record = Selectable; /** * Reads a user by id (`usr_…`). * * @param db - The database. * @param id - The user id. * @returns The record, or `undefined` when absent. */ export declare function get(db: Db.Db, id: string): Promise; /** * Reads users by id for operational identity displays. * * @param db - The database. * @param ids - User ids to read. * @returns Matching user records. */ export declare function listByIds(db: Db.Db, ids: readonly string[]): Promise; /** * Reads a user by wallet address (compared lowercase). * * @param db - The database. * @param address - The wallet address. * @returns The record, or `undefined` when absent. */ export declare function getByAddress(db: Db.Db, address: string): Promise; /** * Inserts a user for `address` when absent and returns the stored record. * Existing users are returned unchanged, so repeated sign-ins are idempotent. * * @param db - The database. * @param input - The user to ensure. * @returns The stored record. */ export declare function upsertByAddress(db: Db.Db, input: upsertByAddress.Input): Promise; export declare namespace upsertByAddress { /** Fields accepted when ensuring a user. */ type Input = { /** Wallet address that signed in (stored lowercase). */ address: string; }; } /** * Sets a user's verified email, bumping `updatedAt`. * * @param db - The database. * @param id - The user id (`usr_…`). * @param email - The verified email. */ export declare function setEmail(db: Db.Db, id: string, email: string): Promise; //# sourceMappingURL=users.d.ts.map