import type { Database, SQLQueryBindings } from "bun:sqlite";
import type { Logger as SlogLogger } from "../internal/compat/slog.js";
import type { Cron } from "../tools/cron/cron.js";
import type { SelectQuery } from "../tools/dbx/select_query.js";
import type { System } from "../tools/filesystem/filesystem.js";
import type { Hook } from "../tools/hook/hook.js";
import type { TaggedHook } from "../tools/hook/tagged.js";
import type { Mailer } from "../tools/mailer/mailer.js";
import type { SqlExpr } from "../tools/search/types.js";
import type { Broker } from "../tools/subscriptions/broker.js";
import type { AuthOrigin } from "./auth_origin_model.js";
import type { Collection } from "./collection_model.js";
import type { Model } from "./db_model.js";
import type { TableInfoRow } from "./db_table.js";
import type { RequestInfo } from "./event_request.js";
import type { BatchRequestEvent } from "./event_request_batch.js";
import type { BackupEvent, BootstrapEvent, CollectionRequestEvent, CollectionsImportRequestEvent, CollectionsListRequestEvent, CollectionEvent, CollectionErrorEvent, FileDownloadRequestEvent, FileTokenRequestEvent, MailerEvent, MailerRecordEvent, ModelErrorEvent, ModelEvent, RealtimeConnectRequestEvent, RealtimeMessageEvent, RealtimeSubscribeRequestEvent, ServeEvent, RecordAuthRefreshRequestEvent, RecordAuthRequestEvent, RecordAuthWithOAuth2RequestEvent, RecordAuthWithOTPRequestEvent, RecordAuthWithPasswordRequestEvent, RecordConfirmEmailChangeRequestEvent, RecordConfirmPasswordResetRequestEvent, RecordConfirmVerificationRequestEvent, RecordCreateOTPRequestEvent, RecordEnrichEvent, RecordErrorEvent, RecordEvent, RecordRequestEvent, RecordRequestEmailChangeRequestEvent, RecordRequestPasswordResetRequestEvent, RecordRequestVerificationRequestEvent, RecordsListRequestEvent, SettingsListRequestEvent, SettingsReloadEvent, SettingsUpdateRequestEvent, TerminateEvent } from "./events.js";
import type { ExternalAuth } from "./external_auth_model.js";
import type { Field } from "./field.js";
import type { FieldsList } from "./fields_list.js";
import type { Log } from "./log_model.js";
import type { LogsStatsItem } from "./log_query.js";
import type { MFA } from "./mfa_model.js";
import type { OTP } from "./otp_model.js";
import type { Record as RecordModel } from "./record_model.js";
import type { RecordQueryFilter } from "./record_query.js";
import type { RecordQuery } from "./record_query.js";
import type { ExpandFetchFunc } from "./record_query_expand.js";
import type { Settings } from "./settings_model.js";
import type { Store } from "./store.js";
import type { DryRunViewResult } from "./view.js";
export type Logger = SlogLogger;
export interface App {
    dataDir(): string;
    DataDir(): string;
    encryptionEnv(): string;
    settings(): Settings;
    store(): Store<string, unknown>;
    Cron(): Cron;
    IsDev(): boolean;
    SubscriptionsBroker(): Broker;
    isBootstrapped(): boolean;
    bootstrap(): void;
    bootstrapAsync?(): Promise<void>;
    resetBootstrapState(): void;
    db(): Database;
    ConcurrentDB(): Database;
    concurrentDB(): Database;
    NonconcurrentDB(): Database;
    nonconcurrentDB(): Database;
    AuxDB(): Database;
    auxDB(): Database;
    auxDb(): Database;
    AuxConcurrentDB(): Database;
    auxConcurrentDB(): Database;
    AuxNonconcurrentDB(): Database;
    auxNonconcurrentDB(): Database;
    TxInfo(): {
        OnComplete: (fn: (txErr: Error | null) => Error | null) => void;
    } | null;
    auxHasTable(name: string): boolean;
    AuxHasTable(name: string): boolean;
    reloadSettings(): Error | null;
    reloadSettingsAsync?(): Promise<Error | null>;
    ReloadSettings(): Error | null;
    ReloadSettingsAsync?(): Promise<Error | null>;
    runSystemMigrations(): void;
    runAppMigrations(): void;
    runAllMigrations(): void;
    NewMailClient(): Mailer;
    NewFilesystem(): System;
    NewFilesystemAsync?(): Promise<System>;
    NewBackupsFilesystem(): System;
    NewBackupsFilesystemAsync?(): Promise<System>;
    CreateBackup(ctx: unknown, name: string): Promise<Error | null>;
    RestoreBackup(ctx: unknown, name: string): Promise<Error | null>;
    Restart(): Error | null;
    RestartAsync?(): Promise<Error | null>;
    Save(model: Model): Promise<Error | null>;
    SaveNoValidate(model: Model): Promise<Error | null>;
    SaveWithContext(ctx: unknown, model: Model): Promise<Error | null>;
    SaveNoValidateWithContext(ctx: unknown, model: Model): Promise<Error | null>;
    SaveSync(model: Model): Error | null;
    SaveNoValidateSync(model: Model): Error | null;
    SaveWithContextSync(ctx: unknown, model: Model): Error | null;
    SaveNoValidateWithContextSync(ctx: unknown, model: Model): Error | null;
    AuxSave(model: Model): Promise<Error | null>;
    AuxSaveNoValidate(model: Model): Promise<Error | null>;
    AuxSaveWithContext(ctx: unknown, model: Model): Promise<Error | null>;
    AuxSaveNoValidateWithContext(ctx: unknown, model: Model): Promise<Error | null>;
    AuxSaveSync(model: Model): Error | null;
    AuxSaveNoValidateSync(model: Model): Error | null;
    AuxSaveWithContextSync(ctx: unknown, model: Model): Error | null;
    AuxSaveNoValidateWithContextSync(ctx: unknown, model: Model): Error | null;
    Delete(model: Model): Promise<Error | null>;
    DeleteWithContext(ctx: unknown, model: Model): Promise<Error | null>;
    DeleteSync(model: Model): Error | null;
    DeleteWithContextSync(ctx: unknown, model: Model): Error | null;
    AuxDelete(model: Model): Promise<Error | null>;
    AuxDeleteWithContext(ctx: unknown, model: Model): Promise<Error | null>;
    AuxDeleteSync(model: Model): Error | null;
    AuxDeleteWithContextSync(ctx: unknown, model: Model): Error | null;
    Validate(model: Model): Promise<Error | null>;
    ValidateWithContext(ctx: unknown, model: Model): Promise<Error | null>;
    ValidateSync(model: Model): Error | null;
    TruncateCollection(collection: Collection): Promise<Error | null>;
    ImportCollectionsByMarshaledJSON(rawSliceOfMaps: string | Uint8Array, deleteMissing: boolean): Promise<Error | null>;
    ImportCollections(toImport: Array<Record<string, unknown>>, deleteMissing: boolean): Promise<Error | null>;
    ImportCollectionsByMarshaledJSONSync(rawSliceOfMaps: string | Uint8Array, deleteMissing: boolean): Error | null;
    ImportCollectionsSync(toImport: Array<Record<string, unknown>>, deleteMissing: boolean): Error | null;
    RunInTransaction(fn: (txApp: App) => Error | null | Promise<Error | null>): Promise<Error | null>;
    AuxRunInTransaction(fn: (txApp: App) => Error | null | Promise<Error | null>): Promise<Error | null>;
    RunInTransactionSync(fn: (txApp: App) => Error | null): Error | null;
    AuxRunInTransactionSync(fn: (txApp: App) => Error | null): Error | null;
    RunInTransactionAsync(fn: (txApp: App) => Promise<Error | null> | Error | null): Promise<Error | null>;
    IsTransactional(): boolean;
    UnsafeWithoutHooks(): App;
    ForMigrations(): App;
    forMigrations(): App;
    Logger(): Logger;
    ModelQuery(model: {
        TableName: () => string;
    }): SelectQuery;
    AuxModelQuery(model: {
        TableName: () => string;
    }): SelectQuery;
    CollectionQuery(): SelectQuery;
    LogQuery(): SelectQuery;
    FindLogById(id: string): Log;
    LogsStats(expr: SqlExpr | null): LogsStatsItem[];
    DeleteOldLogs(createdBefore: Date): Error | null;
    RecordQuery(collectionModelOrIdentifier: Collection | string | null | undefined): RecordQuery;
    findCollectionById(id: string): Collection | null;
    findCollectionByNameOrIdOrNull(identifier: string): Collection | null;
    findCollectionByNameOrId(identifier: string): Collection;
    FindCollectionByNameOrId(identifier: string): Collection;
    FindCachedCollectionByNameOrId(identifier: string): Collection;
    FindAllCollections(...collectionTypes: string[]): Collection[];
    ReloadCachedCollections(): Error | null;
    FindCollectionReferences(collection: Collection, ...excludeIds: string[]): Map<Collection, Field[]>;
    FindCachedCollectionReferences(collection: Collection, ...excludeIds: string[]): Map<Collection, Field[]>;
    HasTable(name: string): boolean;
    TableColumns(tableName: string): string[];
    TableIndexes(tableName: string): Record<string, string>;
    DeleteTable(dangerousTableName: string): Error | null;
    Vacuum(): Error | null;
    AuxVacuum(): Error | null;
    IsCollectionNameUnique(name: string, excludeId?: string): boolean;
    findRecordByIdOrNull(collection: Collection, id: string, rule?: SqlExpr | null): RecordModel | null;
    findRecordById(collectionModelOrIdentifier: Collection | string, id: string, ...filters: Array<RecordQueryFilter | null | undefined>): RecordModel;
    FindRecordById(collectionModelOrIdentifier: Collection | string, id: string, ...filters: Array<RecordQueryFilter | null | undefined>): RecordModel;
    FindRecordByViewFile(viewCollectionModelOrIdentifier: Collection | string, fileFieldName: string, filename: string): RecordModel;
    FindRecordsByIds(collectionModelOrIdentifier: Collection | string, ids: string[], ...filters: Array<RecordQueryFilter | null | undefined>): RecordModel[];
    FindAllRecords(collectionModelOrIdentifier: Collection | string, ...exprs: Array<SqlExpr | Record<string, unknown> | null | undefined>): RecordModel[];
    FindFirstRecordByData(collectionModelOrIdentifier: Collection | string, key: string, value: unknown): RecordModel;
    FindRecordsByFilter(collectionModelOrIdentifier: Collection | string, filter: string, sort: string, limit: number, offset: number, ...params: Array<Record<string, unknown>>): RecordModel[];
    FindFirstRecordByFilter(collectionModelOrIdentifier: Collection | string, filter: string, ...params: Array<Record<string, unknown>>): RecordModel;
    CountRecords(collectionModelOrIdentifier: Collection | string, ...exprs: Array<SqlExpr | Record<string, unknown> | null | undefined>): number;
    ExpandRecord(record: RecordModel, expands: string[], optFetchFunc?: ExpandFetchFunc | null): Record<string, Error>;
    ExpandRecords(records: RecordModel[], expands: string[], optFetchFunc?: ExpandFetchFunc | null): Record<string, Error>;
    CanAccessRecord(record: RecordModel, requestInfo: RequestInfo, accessRule: string | null): [boolean, Error | null];
    FindAuthRecordByToken(token: string, ...validTypes: string[]): RecordModel;
    FindAuthRecordByEmail(collectionModelOrIdentifier: Collection | string, email: string): RecordModel;
    FindAllExternalAuthsByRecord(authRecord: RecordModel): ExternalAuth[];
    FindAllExternalAuthsByCollection(collection: Collection): ExternalAuth[];
    FindFirstExternalAuthByExpr(expr: SqlExpr | Record<string, unknown>): ExternalAuth;
    DeleteAllExternalAuthsByRecord(authRecord: RecordModel): Promise<Error | null>;
    FindAllOTPsByRecord(authRecord: RecordModel): OTP[];
    FindAllOTPsByCollection(collection: Collection): OTP[];
    FindOTPById(id: string): OTP;
    DeleteAllOTPsByRecord(authRecord: RecordModel): Promise<Error | null>;
    DeleteExpiredOTPs(): Promise<Error | null>;
    FindAllMFAsByRecord(authRecord: RecordModel): MFA[];
    FindAllMFAsByCollection(collection: Collection): MFA[];
    FindMFAById(id: string): MFA;
    DeleteAllMFAsByRecord(authRecord: RecordModel): Promise<Error | null>;
    DeleteExpiredMFAs(): Promise<Error | null>;
    FindAllAuthOriginsByRecord(authRecord: RecordModel): AuthOrigin[];
    FindAllAuthOriginsByCollection(collection: Collection): AuthOrigin[];
    FindAuthOriginById(id: string): AuthOrigin;
    FindAuthOriginByRecordAndFingerprint(authRecord: RecordModel, fingerprint: string): AuthOrigin;
    DeleteAllAuthOriginsByRecord(authRecord: RecordModel): Promise<Error | null>;
    findFirstRecordByFilterOrNull(collectionModelOrIdentifier: Collection | string, filter: string, ...params: SQLQueryBindings[]): RecordModel | null;
    findFirstRecordByFilter(collectionModelOrIdentifier: Collection | string, filter: string, ...params: Array<Record<string, unknown>>): RecordModel;
    findAuthRecordByToken(token: string, ...validTypes: string[]): RecordModel;
    OnBootstrap(): Hook<BootstrapEvent>;
    OnServe(): Hook<ServeEvent>;
    OnTerminate(): Hook<TerminateEvent>;
    OnCollectionsListRequest(): Hook<CollectionsListRequestEvent>;
    OnCollectionViewRequest(): Hook<CollectionRequestEvent>;
    OnCollectionCreateRequest(): Hook<CollectionRequestEvent>;
    OnCollectionUpdateRequest(): Hook<CollectionRequestEvent>;
    OnCollectionDeleteRequest(): Hook<CollectionRequestEvent>;
    OnCollectionsImportRequest(): Hook<CollectionsImportRequestEvent>;
    OnBatchRequest(): Hook<BatchRequestEvent>;
    OnSettingsListRequest(): Hook<SettingsListRequestEvent>;
    OnSettingsUpdateRequest(): Hook<SettingsUpdateRequestEvent>;
    OnModelCreate(tags?: string[]): TaggedHook<ModelEvent>;
    OnModelCreateExecute(tags?: string[]): TaggedHook<ModelEvent>;
    OnModelAfterCreateSuccess(tags?: string[]): TaggedHook<ModelEvent>;
    OnModelAfterCreateError(tags?: string[]): TaggedHook<ModelErrorEvent>;
    OnModelUpdate(tags?: string[]): TaggedHook<ModelEvent>;
    OnModelUpdateExecute(tags?: string[]): TaggedHook<ModelEvent>;
    OnModelAfterUpdateSuccess(tags?: string[]): TaggedHook<ModelEvent>;
    OnModelAfterUpdateError(tags?: string[]): TaggedHook<ModelErrorEvent>;
    OnModelValidate(tags?: string[]): TaggedHook<ModelEvent>;
    OnModelDelete(tags?: string[]): TaggedHook<ModelEvent>;
    OnModelDeleteExecute(tags?: string[]): TaggedHook<ModelEvent>;
    OnModelAfterDeleteSuccess(tags?: string[]): TaggedHook<ModelEvent>;
    OnModelAfterDeleteError(tags?: string[]): TaggedHook<ModelErrorEvent>;
    OnRecordValidate(tags?: string[]): TaggedHook<RecordEvent>;
    OnRecordCreate(tags?: string[]): TaggedHook<RecordEvent>;
    OnRecordCreateExecute(tags?: string[]): TaggedHook<RecordEvent>;
    OnRecordAfterCreateSuccess(tags?: string[]): TaggedHook<RecordEvent>;
    OnRecordAfterCreateError(tags?: string[]): TaggedHook<RecordErrorEvent>;
    OnRecordUpdate(tags?: string[]): TaggedHook<RecordEvent>;
    OnRecordUpdateExecute(tags?: string[]): TaggedHook<RecordEvent>;
    OnRecordAfterUpdateSuccess(tags?: string[]): TaggedHook<RecordEvent>;
    OnRecordAfterUpdateError(tags?: string[]): TaggedHook<RecordErrorEvent>;
    OnRecordDelete(tags?: string[]): TaggedHook<RecordEvent>;
    OnRecordDeleteExecute(tags?: string[]): TaggedHook<RecordEvent>;
    OnRecordAfterDeleteSuccess(tags?: string[]): TaggedHook<RecordEvent>;
    OnRecordAfterDeleteError(tags?: string[]): TaggedHook<RecordErrorEvent>;
    OnRecordEnrich(tags?: string[]): TaggedHook<RecordEnrichEvent>;
    OnRecordAuthWithPasswordRequest(tags?: string[]): TaggedHook<RecordAuthWithPasswordRequestEvent>;
    OnRecordAuthWithOAuth2Request(tags?: string[]): TaggedHook<RecordAuthWithOAuth2RequestEvent>;
    OnRecordAuthWithOTPRequest(tags?: string[]): TaggedHook<RecordAuthWithOTPRequestEvent>;
    OnRecordsListRequest(tags?: string[]): TaggedHook<RecordsListRequestEvent>;
    OnRecordViewRequest(tags?: string[]): TaggedHook<RecordRequestEvent>;
    OnRecordCreateRequest(tags?: string[]): TaggedHook<RecordRequestEvent>;
    OnRecordUpdateRequest(tags?: string[]): TaggedHook<RecordRequestEvent>;
    OnRecordDeleteRequest(tags?: string[]): TaggedHook<RecordRequestEvent>;
    OnRecordAuthRequest(tags?: string[]): TaggedHook<RecordAuthRequestEvent>;
    OnRecordAuthRefreshRequest(tags?: string[]): TaggedHook<RecordAuthRefreshRequestEvent>;
    OnRecordCreateOTPRequest(tags?: string[]): TaggedHook<RecordCreateOTPRequestEvent>;
    OnRecordRequestOTPRequest(tags?: string[]): TaggedHook<RecordCreateOTPRequestEvent>;
    OnRecordRequestPasswordResetRequest(tags?: string[]): TaggedHook<RecordRequestPasswordResetRequestEvent>;
    OnRecordConfirmPasswordResetRequest(tags?: string[]): TaggedHook<RecordConfirmPasswordResetRequestEvent>;
    OnRecordRequestVerificationRequest(tags?: string[]): TaggedHook<RecordRequestVerificationRequestEvent>;
    OnRecordConfirmVerificationRequest(tags?: string[]): TaggedHook<RecordConfirmVerificationRequestEvent>;
    OnRecordRequestEmailChangeRequest(tags?: string[]): TaggedHook<RecordRequestEmailChangeRequestEvent>;
    OnRecordConfirmEmailChangeRequest(tags?: string[]): TaggedHook<RecordConfirmEmailChangeRequestEvent>;
    OnSettingsReload(): Hook<SettingsReloadEvent>;
    OnBackupCreate(): Hook<BackupEvent>;
    OnBackupRestore(): Hook<BackupEvent>;
    OnFileDownloadRequest(tags?: string[]): TaggedHook<FileDownloadRequestEvent>;
    OnFileTokenRequest(tags?: string[]): TaggedHook<FileTokenRequestEvent>;
    OnMailerSend(): Hook<MailerEvent>;
    OnMailerRecordAuthAlertSend(tags?: string[]): TaggedHook<MailerRecordEvent>;
    OnMailerRecordPasswordResetSend(tags?: string[]): TaggedHook<MailerRecordEvent>;
    OnMailerRecordVerificationSend(tags?: string[]): TaggedHook<MailerRecordEvent>;
    OnMailerRecordEmailChangeSend(tags?: string[]): TaggedHook<MailerRecordEvent>;
    OnMailerRecordOTPSend(tags?: string[]): TaggedHook<MailerRecordEvent>;
    OnRealtimeConnectRequest(): Hook<RealtimeConnectRequestEvent>;
    OnRealtimeMessageSend(): Hook<RealtimeMessageEvent>;
    OnRealtimeSubscribeRequest(): Hook<RealtimeSubscribeRequestEvent>;
    OnCollectionValidate(tags?: string[]): TaggedHook<CollectionEvent>;
    OnCollectionCreate(tags?: string[]): TaggedHook<CollectionEvent>;
    OnCollectionCreateExecute(tags?: string[]): TaggedHook<CollectionEvent>;
    OnCollectionAfterCreateSuccess(tags?: string[]): TaggedHook<CollectionEvent>;
    OnCollectionAfterCreateError(tags?: string[]): TaggedHook<CollectionErrorEvent>;
    OnCollectionUpdate(tags?: string[]): TaggedHook<CollectionEvent>;
    OnCollectionUpdateExecute(tags?: string[]): TaggedHook<CollectionEvent>;
    OnCollectionAfterUpdateSuccess(tags?: string[]): TaggedHook<CollectionEvent>;
    OnCollectionAfterUpdateError(tags?: string[]): TaggedHook<CollectionErrorEvent>;
    OnCollectionDelete(tags?: string[]): TaggedHook<CollectionEvent>;
    OnCollectionDeleteExecute(tags?: string[]): TaggedHook<CollectionEvent>;
    OnCollectionAfterDeleteSuccess(tags?: string[]): TaggedHook<CollectionEvent>;
    OnCollectionAfterDeleteError(tags?: string[]): TaggedHook<CollectionErrorEvent>;
    onBootstrap(): Hook<BootstrapEvent>;
    onServe(): Hook<ServeEvent>;
    onTerminate(): Hook<TerminateEvent>;
    onCollectionsListRequest(): Hook<CollectionsListRequestEvent>;
    onCollectionViewRequest(): Hook<CollectionRequestEvent>;
    onCollectionCreateRequest(): Hook<CollectionRequestEvent>;
    onCollectionUpdateRequest(): Hook<CollectionRequestEvent>;
    onCollectionDeleteRequest(): Hook<CollectionRequestEvent>;
    onCollectionsImportRequest(): Hook<CollectionsImportRequestEvent>;
    onBatchRequest(): Hook<BatchRequestEvent>;
    onSettingsListRequest(): Hook<SettingsListRequestEvent>;
    onSettingsUpdateRequest(): Hook<SettingsUpdateRequestEvent>;
    onModelCreate(...tags: string[]): TaggedHook<ModelEvent>;
    onModelCreateExecute(...tags: string[]): TaggedHook<ModelEvent>;
    onModelAfterCreateSuccess(...tags: string[]): TaggedHook<ModelEvent>;
    onModelAfterCreateError(...tags: string[]): TaggedHook<ModelErrorEvent>;
    onModelUpdate(...tags: string[]): TaggedHook<ModelEvent>;
    onModelUpdateExecute(...tags: string[]): TaggedHook<ModelEvent>;
    onModelAfterUpdateSuccess(...tags: string[]): TaggedHook<ModelEvent>;
    onModelAfterUpdateError(...tags: string[]): TaggedHook<ModelErrorEvent>;
    onModelValidate(...tags: string[]): TaggedHook<ModelEvent>;
    onModelDelete(...tags: string[]): TaggedHook<ModelEvent>;
    onModelDeleteExecute(...tags: string[]): TaggedHook<ModelEvent>;
    onModelAfterDeleteSuccess(...tags: string[]): TaggedHook<ModelEvent>;
    onModelAfterDeleteError(...tags: string[]): TaggedHook<ModelErrorEvent>;
    onRecordValidate(...tags: string[]): TaggedHook<RecordEvent>;
    onRecordCreate(...tags: string[]): TaggedHook<RecordEvent>;
    onRecordCreateExecute(...tags: string[]): TaggedHook<RecordEvent>;
    onRecordAfterCreateSuccess(...tags: string[]): TaggedHook<RecordEvent>;
    onRecordAfterCreateError(...tags: string[]): TaggedHook<RecordErrorEvent>;
    onRecordUpdate(...tags: string[]): TaggedHook<RecordEvent>;
    onRecordUpdateExecute(...tags: string[]): TaggedHook<RecordEvent>;
    onRecordAfterUpdateSuccess(...tags: string[]): TaggedHook<RecordEvent>;
    onRecordAfterUpdateError(...tags: string[]): TaggedHook<RecordErrorEvent>;
    onRecordDelete(...tags: string[]): TaggedHook<RecordEvent>;
    onRecordDeleteExecute(...tags: string[]): TaggedHook<RecordEvent>;
    onRecordAfterDeleteSuccess(...tags: string[]): TaggedHook<RecordEvent>;
    onRecordAfterDeleteError(...tags: string[]): TaggedHook<RecordErrorEvent>;
    onRecordEnrich(...tags: string[]): TaggedHook<RecordEnrichEvent>;
    onRecordAuthWithPasswordRequest(...tags: string[]): TaggedHook<RecordAuthWithPasswordRequestEvent>;
    onRecordAuthWithOAuth2Request(...tags: string[]): TaggedHook<RecordAuthWithOAuth2RequestEvent>;
    onRecordAuthWithOTPRequest(...tags: string[]): TaggedHook<RecordAuthWithOTPRequestEvent>;
    onRecordsListRequest(...tags: string[]): TaggedHook<RecordsListRequestEvent>;
    onRecordViewRequest(...tags: string[]): TaggedHook<RecordRequestEvent>;
    onRecordCreateRequest(...tags: string[]): TaggedHook<RecordRequestEvent>;
    onRecordUpdateRequest(...tags: string[]): TaggedHook<RecordRequestEvent>;
    onRecordDeleteRequest(...tags: string[]): TaggedHook<RecordRequestEvent>;
    onRecordAuthRequest(...tags: string[]): TaggedHook<RecordAuthRequestEvent>;
    onRecordAuthRefreshRequest(...tags: string[]): TaggedHook<RecordAuthRefreshRequestEvent>;
    onRecordCreateOTPRequest(...tags: string[]): TaggedHook<RecordCreateOTPRequestEvent>;
    onRecordRequestOTPRequest(...tags: string[]): TaggedHook<RecordCreateOTPRequestEvent>;
    onRecordRequestPasswordResetRequest(...tags: string[]): TaggedHook<RecordRequestPasswordResetRequestEvent>;
    onRecordConfirmPasswordResetRequest(...tags: string[]): TaggedHook<RecordConfirmPasswordResetRequestEvent>;
    onRecordRequestVerificationRequest(...tags: string[]): TaggedHook<RecordRequestVerificationRequestEvent>;
    onRecordConfirmVerificationRequest(...tags: string[]): TaggedHook<RecordConfirmVerificationRequestEvent>;
    onRecordRequestEmailChangeRequest(...tags: string[]): TaggedHook<RecordRequestEmailChangeRequestEvent>;
    onRecordConfirmEmailChangeRequest(...tags: string[]): TaggedHook<RecordConfirmEmailChangeRequestEvent>;
    onSettingsReload(): Hook<SettingsReloadEvent>;
    onBackupCreate(): Hook<BackupEvent>;
    onBackupRestore(): Hook<BackupEvent>;
    onFileDownloadRequest(...tags: string[]): TaggedHook<FileDownloadRequestEvent>;
    onFileTokenRequest(...tags: string[]): TaggedHook<FileTokenRequestEvent>;
    onMailerSend(): Hook<MailerEvent>;
    onMailerRecordAuthAlertSend(...tags: string[]): TaggedHook<MailerRecordEvent>;
    onMailerRecordPasswordResetSend(...tags: string[]): TaggedHook<MailerRecordEvent>;
    onMailerRecordVerificationSend(...tags: string[]): TaggedHook<MailerRecordEvent>;
    onMailerRecordEmailChangeSend(...tags: string[]): TaggedHook<MailerRecordEvent>;
    onMailerRecordOTPSend(...tags: string[]): TaggedHook<MailerRecordEvent>;
    onRealtimeConnectRequest(): Hook<RealtimeConnectRequestEvent>;
    onRealtimeMessageSend(): Hook<RealtimeMessageEvent>;
    onRealtimeSubscribeRequest(): Hook<RealtimeSubscribeRequestEvent>;
    onCollectionValidate(...tags: string[]): TaggedHook<CollectionEvent>;
    onCollectionCreate(...tags: string[]): TaggedHook<CollectionEvent>;
    onCollectionCreateExecute(...tags: string[]): TaggedHook<CollectionEvent>;
    onCollectionAfterCreateSuccess(...tags: string[]): TaggedHook<CollectionEvent>;
    onCollectionAfterCreateError(...tags: string[]): TaggedHook<CollectionErrorEvent>;
    onCollectionUpdate(...tags: string[]): TaggedHook<CollectionEvent>;
    onCollectionUpdateExecute(...tags: string[]): TaggedHook<CollectionEvent>;
    onCollectionAfterUpdateSuccess(...tags: string[]): TaggedHook<CollectionEvent>;
    onCollectionAfterUpdateError(...tags: string[]): TaggedHook<CollectionErrorEvent>;
    onCollectionDelete(...tags: string[]): TaggedHook<CollectionEvent>;
    onCollectionDeleteExecute(...tags: string[]): TaggedHook<CollectionEvent>;
    onCollectionAfterDeleteSuccess(...tags: string[]): TaggedHook<CollectionEvent>;
    onCollectionAfterDeleteError(...tags: string[]): TaggedHook<CollectionErrorEvent>;
    DeleteView(dangerousViewName: string): Error | null;
    SaveView(dangerousViewName: string, dangerousSelectQuery: string): Promise<Error | null>;
    SaveViewSync(dangerousViewName: string, dangerousSelectQuery: string): Error | null;
    CreateViewFields(dangerousSelectQuery: string): Promise<FieldsList>;
    CreateViewFieldsSync(dangerousSelectQuery: string): FieldsList;
    DryRunView(dangerousSelectQuery: string, sampleSize: number): Promise<DryRunViewResult>;
    TableInfo(tableName: string): TableInfoRow[];
    SyncRecordTableSchema(newCollection: Collection, oldCollection: Collection | null): Promise<Error | null>;
    SyncRecordTableSchemaSync(newCollection: Collection, oldCollection: Collection | null): Error | null;
    cron: App["Cron"];
    isDev: App["IsDev"];
    subscriptionsBroker: App["SubscriptionsBroker"];
    logger: App["Logger"];
    modelQuery: App["ModelQuery"];
    auxModelQuery: App["AuxModelQuery"];
    collectionQuery: App["CollectionQuery"];
    logQuery: App["LogQuery"];
    findLogById: App["FindLogById"];
    logsStats: App["LogsStats"];
    deleteOldLogs: App["DeleteOldLogs"];
    txInfo: App["TxInfo"];
    newMailClient: App["NewMailClient"];
    newFilesystem: App["NewFilesystem"];
    newFilesystemAsync: NonNullable<App["NewFilesystemAsync"]>;
    newBackupsFilesystem: App["NewBackupsFilesystem"];
    newBackupsFilesystemAsync: NonNullable<App["NewBackupsFilesystemAsync"]>;
    createBackup: App["CreateBackup"];
    restoreBackup: App["RestoreBackup"];
    restart: App["Restart"];
    restartAsync: NonNullable<App["RestartAsync"]>;
    save: App["Save"];
    saveNoValidate: App["SaveNoValidate"];
    saveWithContext: App["SaveWithContext"];
    saveNoValidateWithContext: App["SaveNoValidateWithContext"];
    saveSync: App["SaveSync"];
    saveNoValidateSync: App["SaveNoValidateSync"];
    saveWithContextSync: App["SaveWithContextSync"];
    saveNoValidateWithContextSync: App["SaveNoValidateWithContextSync"];
    auxSave: App["AuxSave"];
    auxSaveNoValidate: App["AuxSaveNoValidate"];
    auxSaveWithContext: App["AuxSaveWithContext"];
    auxSaveNoValidateWithContext: App["AuxSaveNoValidateWithContext"];
    auxSaveSync: App["AuxSaveSync"];
    auxSaveNoValidateSync: App["AuxSaveNoValidateSync"];
    auxSaveWithContextSync: App["AuxSaveWithContextSync"];
    auxSaveNoValidateWithContextSync: App["AuxSaveNoValidateWithContextSync"];
    delete: App["Delete"];
    deleteWithContext: App["DeleteWithContext"];
    deleteSync: App["DeleteSync"];
    deleteWithContextSync: App["DeleteWithContextSync"];
    auxDelete: App["AuxDelete"];
    auxDeleteWithContext: App["AuxDeleteWithContext"];
    auxDeleteSync: App["AuxDeleteSync"];
    auxDeleteWithContextSync: App["AuxDeleteWithContextSync"];
    validate: App["Validate"];
    validateWithContext: App["ValidateWithContext"];
    validateSync: App["ValidateSync"];
    runInTransaction: App["RunInTransaction"];
    runInTransactionSync: App["RunInTransactionSync"];
    runInTransactionAsync: App["RunInTransactionAsync"];
    auxRunInTransaction: App["AuxRunInTransaction"];
    auxRunInTransactionSync: App["AuxRunInTransactionSync"];
    isTransactional: App["IsTransactional"];
    unsafeWithoutHooks: App["UnsafeWithoutHooks"];
    recordQuery: App["RecordQuery"];
    findAllCollections: App["FindAllCollections"];
    reloadCachedCollections: App["ReloadCachedCollections"];
    findCachedCollectionByNameOrId: App["FindCachedCollectionByNameOrId"];
    findCollectionReferences: App["FindCollectionReferences"];
    findCachedCollectionReferences: App["FindCachedCollectionReferences"];
    hasTable: App["HasTable"];
    findRecordByViewFile: App["FindRecordByViewFile"];
    findRecordsByIds: App["FindRecordsByIds"];
    findAllRecords: App["FindAllRecords"];
    findFirstRecordByData: App["FindFirstRecordByData"];
    findRecordsByFilter: App["FindRecordsByFilter"];
    countRecords: App["CountRecords"];
    expandRecord: App["ExpandRecord"];
    expandRecords: App["ExpandRecords"];
    canAccessRecord: App["CanAccessRecord"];
    findAuthRecordByEmail: App["FindAuthRecordByEmail"];
    findAllExternalAuthsByRecord: App["FindAllExternalAuthsByRecord"];
    findAllExternalAuthsByCollection: App["FindAllExternalAuthsByCollection"];
    findFirstExternalAuthByExpr: App["FindFirstExternalAuthByExpr"];
    deleteAllExternalAuthsByRecord: App["DeleteAllExternalAuthsByRecord"];
    findAllOTPsByRecord: App["FindAllOTPsByRecord"];
    findAllOTPsByCollection: App["FindAllOTPsByCollection"];
    findOTPById: App["FindOTPById"];
    deleteAllOTPsByRecord: App["DeleteAllOTPsByRecord"];
    deleteExpiredOTPs: App["DeleteExpiredOTPs"];
    findAllMFAsByRecord: App["FindAllMFAsByRecord"];
    findAllMFAsByCollection: App["FindAllMFAsByCollection"];
    findMFAById: App["FindMFAById"];
    deleteAllMFAsByRecord: App["DeleteAllMFAsByRecord"];
    deleteExpiredMFAs: App["DeleteExpiredMFAs"];
    findAllAuthOriginsByRecord: App["FindAllAuthOriginsByRecord"];
    findAllAuthOriginsByCollection: App["FindAllAuthOriginsByCollection"];
    findAuthOriginById: App["FindAuthOriginById"];
    findAuthOriginByRecordAndFingerprint: App["FindAuthOriginByRecordAndFingerprint"];
    deleteAllAuthOriginsByRecord: App["DeleteAllAuthOriginsByRecord"];
    truncateCollection: App["TruncateCollection"];
    importCollectionsByMarshaledJSON: App["ImportCollectionsByMarshaledJSON"];
    importCollectionsByMarshaledJSONSync: App["ImportCollectionsByMarshaledJSONSync"];
    importCollections: App["ImportCollections"];
    importCollectionsSync: App["ImportCollectionsSync"];
    syncRecordTableSchema: App["SyncRecordTableSchema"];
    syncRecordTableSchemaSync: App["SyncRecordTableSchemaSync"];
    deleteView: App["DeleteView"];
    saveView: App["SaveView"];
    saveViewSync: App["SaveViewSync"];
    createViewFields: App["CreateViewFields"];
    createViewFieldsSync: App["CreateViewFieldsSync"];
    dryRunView: App["DryRunView"];
    tableInfo: App["TableInfo"];
    tableColumns: App["TableColumns"];
    tableIndexes: App["TableIndexes"];
    deleteTable: App["DeleteTable"];
    vacuum: App["Vacuum"];
    auxVacuum: App["AuxVacuum"];
    isCollectionNameUnique: App["IsCollectionNameUnique"];
}
export declare function bootstrapIfNeededAsync(app: App): Promise<void>;
export declare function newFilesystemAsync(app: App): Promise<System>;
export declare function newBackupsFilesystemAsync(app: App): Promise<System>;
