import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs"; import type { ColumnBaseConfig } from "../../column.cjs"; import { entityKind } from "../../entity.cjs"; import { type Equal } from "../../utils.cjs"; import { SQLiteColumn, SQLiteColumnBuilder } from "./common.cjs"; type BlobMode = 'buffer' | 'json' | 'bigint'; export type SQLiteBigIntBuilderInitial = SQLiteBigIntBuilder<{ name: TName; dataType: 'bigint'; columnType: 'SQLiteBigInt'; data: bigint; driverParam: Buffer; enumValues: undefined; }>; export declare class SQLiteBigIntBuilder> extends SQLiteColumnBuilder { static readonly [entityKind]: string; constructor(name: T['name']); } export declare class SQLiteBigInt> extends SQLiteColumn { static readonly [entityKind]: string; getSQLType(): string; mapFromDriverValue(value: Buffer | Uint8Array | ArrayBuffer): bigint; mapToDriverValue(value: bigint): Buffer; } export type SQLiteBlobJsonBuilderInitial = SQLiteBlobJsonBuilder<{ name: TName; dataType: 'json'; columnType: 'SQLiteBlobJson'; data: unknown; driverParam: Buffer; enumValues: undefined; }>; export declare class SQLiteBlobJsonBuilder> extends SQLiteColumnBuilder { static readonly [entityKind]: string; constructor(name: T['name']); } export declare class SQLiteBlobJson> extends SQLiteColumn { static readonly [entityKind]: string; getSQLType(): string; mapFromDriverValue(value: Buffer | Uint8Array | ArrayBuffer): T['data']; mapToDriverValue(value: T['data']): Buffer; } export type SQLiteBlobBufferBuilderInitial = SQLiteBlobBufferBuilder<{ name: TName; dataType: 'buffer'; columnType: 'SQLiteBlobBuffer'; data: Buffer; driverParam: Buffer; enumValues: undefined; }>; export declare class SQLiteBlobBufferBuilder> extends SQLiteColumnBuilder { static readonly [entityKind]: string; constructor(name: T['name']); } export declare class SQLiteBlobBuffer> extends SQLiteColumn { static readonly [entityKind]: string; getSQLType(): string; } export interface BlobConfig { mode: TMode; } /** * It's recommended to use `text('...', { mode: 'json' })` instead of `blob` in JSON mode, because it supports JSON functions: * >All JSON functions currently throw an error if any of their arguments are BLOBs because BLOBs are reserved for a future enhancement in which BLOBs will store the binary encoding for JSON. * * https://www.sqlite.org/json1.html */ export declare function blob(): SQLiteBlobJsonBuilderInitial<''>; export declare function blob(config?: BlobConfig): Equal extends true ? SQLiteBigIntBuilderInitial<''> : Equal extends true ? SQLiteBlobBufferBuilderInitial<''> : SQLiteBlobJsonBuilderInitial<''>; export declare function blob(name: TName, config?: BlobConfig): Equal extends true ? SQLiteBigIntBuilderInitial : Equal extends true ? SQLiteBlobBufferBuilderInitial : SQLiteBlobJsonBuilderInitial; export {};