import "../migrations/index.js";
import "./fields_register.js";
import type { Database, SQLQueryBindings } from "bun:sqlite";
import type { SqlExpr } from "../tools/search/types.js";
import type { App, Logger } from "./app.js";
import type { Model } from "./db_model.js";
import type { RequestInfo } from "./event_request.js";
import type { BatchRequestEvent } from "./event_request_batch.js";
import { Cron } from "../tools/cron/cron.js";
import { SelectQuery } from "../tools/dbx/select_query.js";
import { Hook } from "../tools/hook/hook.js";
import { NewTaggedHook } from "../tools/hook/tagged.js";
import { Sendmail } from "../tools/mailer/sendmail.js";
import { SMTPClient } from "../tools/mailer/smtp.js";
import { Broker } from "../tools/subscriptions/broker.js";
import { AuthOrigin } from "./auth_origin_model.js";
import { LocalAutocertCacheDirName, LocalBackupsDirName, LocalStorageDirName, LocalTempDirName } from "./base_paths.js";
import { Collection } from "./collection_model.js";
import { TxAppInfo } from "./db_tx.js";
import { BackupEvent, BootstrapEvent, ServeEvent, TerminateEvent, SettingsListRequestEvent, SettingsReloadEvent, SettingsUpdateRequestEvent, type CollectionErrorEvent, type CollectionEvent, type CollectionRequestEvent, type CollectionsImportRequestEvent, type CollectionsListRequestEvent, type FileDownloadRequestEvent, type FileTokenRequestEvent, type MailerRecordEvent, type RealtimeConnectRequestEvent, type RealtimeMessageEvent, type RealtimeSubscribeRequestEvent, type RecordAuthRefreshRequestEvent, type RecordAuthRequestEvent, type RecordAuthWithOAuth2RequestEvent, type RecordAuthWithOTPRequestEvent, type RecordAuthWithPasswordRequestEvent, type RecordConfirmEmailChangeRequestEvent, type RecordConfirmPasswordResetRequestEvent, type RecordConfirmVerificationRequestEvent, type RecordCreateOTPRequestEvent, type RecordEnrichEvent, type RecordErrorEvent, type RecordEvent, type RecordRequestEvent, type RecordsListRequestEvent, type RecordRequestEmailChangeRequestEvent, type RecordRequestPasswordResetRequestEvent, type RecordRequestVerificationRequestEvent } from "./events.js";
import { MailerEvent, ModelErrorEvent, ModelEvent } from "./events.js";
import { ExternalAuth } from "./external_auth_model.js";
import { type Field } from "./field.js";
import { FieldsList } from "./fields_list.js";
import { Log } from "./log_model.js";
import { type LogsStatsItem } from "./log_query.js";
import { MFA } from "./mfa_model.js";
import { OTP } from "./otp_model.js";
import { Record as RecordModel } from "./record_model.js";
import { RecordQuery, type RecordQueryFilter } from "./record_query.js";
import { type ExpandFetchFunc } from "./record_query_expand.js";
import { Settings } from "./settings_model.js";
import { Store } from "./store.js";
export type BaseAppConfig = {
    dataDir?: string;
    encryptionEnv?: string;
    isDev?: boolean;
};
export { LocalAutocertCacheDirName, LocalBackupsDirName, LocalStorageDirName, LocalTempDirName };
export declare class BaseApp implements App {
    #private;
    cron: BaseApp["Cron"];
    isDev: BaseApp["IsDev"];
    subscriptionsBroker: BaseApp["SubscriptionsBroker"];
    logger: BaseApp["Logger"];
    modelQuery: BaseApp["ModelQuery"];
    auxModelQuery: BaseApp["AuxModelQuery"];
    collectionQuery: BaseApp["CollectionQuery"];
    logQuery: BaseApp["LogQuery"];
    findLogById: BaseApp["FindLogById"];
    logsStats: BaseApp["LogsStats"];
    deleteOldLogs: BaseApp["DeleteOldLogs"];
    txInfo: BaseApp["TxInfo"];
    newMailClient: BaseApp["NewMailClient"];
    newFilesystem: BaseApp["NewFilesystem"];
    newFilesystemAsync: NonNullable<BaseApp["NewFilesystemAsync"]>;
    newBackupsFilesystem: BaseApp["NewBackupsFilesystem"];
    newBackupsFilesystemAsync: NonNullable<BaseApp["NewBackupsFilesystemAsync"]>;
    createBackup: BaseApp["CreateBackup"];
    restoreBackup: BaseApp["RestoreBackup"];
    restart: BaseApp["Restart"];
    restartAsync: NonNullable<BaseApp["RestartAsync"]>;
    save: BaseApp["Save"];
    saveNoValidate: BaseApp["SaveNoValidate"];
    saveWithContext: BaseApp["SaveWithContext"];
    saveNoValidateWithContext: BaseApp["SaveNoValidateWithContext"];
    saveSync: BaseApp["SaveSync"];
    saveNoValidateSync: BaseApp["SaveNoValidateSync"];
    saveWithContextSync: BaseApp["SaveWithContextSync"];
    saveNoValidateWithContextSync: BaseApp["SaveNoValidateWithContextSync"];
    auxSave: BaseApp["AuxSave"];
    auxSaveNoValidate: BaseApp["AuxSaveNoValidate"];
    auxSaveWithContext: BaseApp["AuxSaveWithContext"];
    auxSaveNoValidateWithContext: BaseApp["AuxSaveNoValidateWithContext"];
    auxSaveSync: BaseApp["AuxSaveSync"];
    auxSaveNoValidateSync: BaseApp["AuxSaveNoValidateSync"];
    auxSaveWithContextSync: BaseApp["AuxSaveWithContextSync"];
    auxSaveNoValidateWithContextSync: BaseApp["AuxSaveNoValidateWithContextSync"];
    delete: BaseApp["Delete"];
    deleteWithContext: BaseApp["DeleteWithContext"];
    deleteSync: BaseApp["DeleteSync"];
    deleteWithContextSync: BaseApp["DeleteWithContextSync"];
    auxDelete: BaseApp["AuxDelete"];
    auxDeleteWithContext: BaseApp["AuxDeleteWithContext"];
    auxDeleteSync: BaseApp["AuxDeleteSync"];
    auxDeleteWithContextSync: BaseApp["AuxDeleteWithContextSync"];
    validate: BaseApp["Validate"];
    validateWithContext: BaseApp["ValidateWithContext"];
    validateSync: BaseApp["ValidateSync"];
    runInTransaction: BaseApp["RunInTransaction"];
    runInTransactionSync: BaseApp["RunInTransactionSync"];
    runInTransactionAsync: BaseApp["RunInTransactionAsync"];
    auxRunInTransaction: BaseApp["AuxRunInTransaction"];
    auxRunInTransactionSync: BaseApp["AuxRunInTransactionSync"];
    isTransactional: BaseApp["IsTransactional"];
    unsafeWithoutHooks: BaseApp["UnsafeWithoutHooks"];
    recordQuery: BaseApp["RecordQuery"];
    findAllCollections: BaseApp["FindAllCollections"];
    reloadCachedCollections: BaseApp["ReloadCachedCollections"];
    findCachedCollectionByNameOrId: BaseApp["FindCachedCollectionByNameOrId"];
    findCollectionReferences: BaseApp["FindCollectionReferences"];
    findCachedCollectionReferences: BaseApp["FindCachedCollectionReferences"];
    hasTable: BaseApp["HasTable"];
    findRecordByViewFile: BaseApp["FindRecordByViewFile"];
    findRecordsByIds: BaseApp["FindRecordsByIds"];
    findAllRecords: BaseApp["FindAllRecords"];
    findFirstRecordByData: BaseApp["FindFirstRecordByData"];
    findRecordsByFilter: BaseApp["FindRecordsByFilter"];
    countRecords: BaseApp["CountRecords"];
    expandRecord: BaseApp["ExpandRecord"];
    expandRecords: BaseApp["ExpandRecords"];
    canAccessRecord: BaseApp["CanAccessRecord"];
    findAuthRecordByEmail: BaseApp["FindAuthRecordByEmail"];
    findAllExternalAuthsByRecord: BaseApp["FindAllExternalAuthsByRecord"];
    findAllExternalAuthsByCollection: BaseApp["FindAllExternalAuthsByCollection"];
    findFirstExternalAuthByExpr: BaseApp["FindFirstExternalAuthByExpr"];
    deleteAllExternalAuthsByRecord: BaseApp["DeleteAllExternalAuthsByRecord"];
    findAllOTPsByRecord: BaseApp["FindAllOTPsByRecord"];
    findAllOTPsByCollection: BaseApp["FindAllOTPsByCollection"];
    findOTPById: BaseApp["FindOTPById"];
    deleteAllOTPsByRecord: BaseApp["DeleteAllOTPsByRecord"];
    deleteExpiredOTPs: BaseApp["DeleteExpiredOTPs"];
    findAllMFAsByRecord: BaseApp["FindAllMFAsByRecord"];
    findAllMFAsByCollection: BaseApp["FindAllMFAsByCollection"];
    findMFAById: BaseApp["FindMFAById"];
    deleteAllMFAsByRecord: BaseApp["DeleteAllMFAsByRecord"];
    deleteExpiredMFAs: BaseApp["DeleteExpiredMFAs"];
    findAllAuthOriginsByRecord: BaseApp["FindAllAuthOriginsByRecord"];
    findAllAuthOriginsByCollection: BaseApp["FindAllAuthOriginsByCollection"];
    findAuthOriginById: BaseApp["FindAuthOriginById"];
    findAuthOriginByRecordAndFingerprint: BaseApp["FindAuthOriginByRecordAndFingerprint"];
    deleteAllAuthOriginsByRecord: BaseApp["DeleteAllAuthOriginsByRecord"];
    truncateCollection: BaseApp["TruncateCollection"];
    importCollectionsByMarshaledJSON: BaseApp["ImportCollectionsByMarshaledJSON"];
    importCollectionsByMarshaledJSONSync: BaseApp["ImportCollectionsByMarshaledJSONSync"];
    importCollections: BaseApp["ImportCollections"];
    importCollectionsSync: BaseApp["ImportCollectionsSync"];
    syncRecordTableSchema: BaseApp["SyncRecordTableSchema"];
    syncRecordTableSchemaSync: BaseApp["SyncRecordTableSchemaSync"];
    deleteView: BaseApp["DeleteView"];
    saveView: BaseApp["SaveView"];
    saveViewSync: BaseApp["SaveViewSync"];
    createViewFields: BaseApp["CreateViewFields"];
    createViewFieldsSync: BaseApp["CreateViewFieldsSync"];
    dryRunView: BaseApp["DryRunView"];
    tableInfo: BaseApp["TableInfo"];
    tableColumns: BaseApp["TableColumns"];
    tableIndexes: BaseApp["TableIndexes"];
    deleteTable: BaseApp["DeleteTable"];
    vacuum: BaseApp["Vacuum"];
    auxVacuum: BaseApp["AuxVacuum"];
    isCollectionNameUnique: BaseApp["IsCollectionNameUnique"];
    constructor(config?: BaseAppConfig);
    private resetHooks;
    dataDir(): string;
    DataDir(): string;
    encryptionEnv(): string;
    EncryptionEnv(): string;
    settings(): Settings;
    store(): Store<string, unknown>;
    Cron(): Cron;
    IsDev(): boolean;
    SubscriptionsBroker(): Broker;
    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;
    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>;
    OnRealtimeConnectRequest(): Hook<RealtimeConnectRequestEvent>;
    OnRealtimeMessageSend(): Hook<RealtimeMessageEvent>;
    OnRealtimeSubscribeRequest(): Hook<RealtimeSubscribeRequestEvent>;
    OnSettingsListRequest(): Hook<SettingsListRequestEvent>;
    OnSettingsUpdateRequest(): Hook<SettingsUpdateRequestEvent>;
    OnModelCreate(tags?: string[]): ReturnType<typeof NewTaggedHook<ModelEvent>>;
    OnModelCreateExecute(tags?: string[]): ReturnType<typeof NewTaggedHook<ModelEvent>>;
    OnModelAfterCreateSuccess(tags?: string[]): ReturnType<typeof NewTaggedHook<ModelEvent>>;
    OnModelAfterCreateError(tags?: string[]): ReturnType<typeof NewTaggedHook<ModelErrorEvent>>;
    OnModelUpdate(tags?: string[]): ReturnType<typeof NewTaggedHook<ModelEvent>>;
    OnModelUpdateExecute(tags?: string[]): ReturnType<typeof NewTaggedHook<ModelEvent>>;
    OnModelAfterUpdateSuccess(tags?: string[]): ReturnType<typeof NewTaggedHook<ModelEvent>>;
    OnModelAfterUpdateError(tags?: string[]): ReturnType<typeof NewTaggedHook<ModelErrorEvent>>;
    OnModelValidate(tags?: string[]): ReturnType<typeof NewTaggedHook<ModelEvent>>;
    OnModelDelete(tags?: string[]): ReturnType<typeof NewTaggedHook<ModelEvent>>;
    OnModelDeleteExecute(tags?: string[]): ReturnType<typeof NewTaggedHook<ModelEvent>>;
    OnModelAfterDeleteSuccess(tags?: string[]): ReturnType<typeof NewTaggedHook<ModelEvent>>;
    OnModelAfterDeleteError(tags?: string[]): ReturnType<typeof NewTaggedHook<ModelErrorEvent>>;
    OnRecordValidate(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordEvent>>;
    OnRecordCreate(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordEvent>>;
    OnRecordCreateExecute(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordEvent>>;
    OnRecordAfterCreateSuccess(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordEvent>>;
    OnRecordAfterCreateError(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordErrorEvent>>;
    OnRecordUpdate(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordEvent>>;
    OnRecordUpdateExecute(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordEvent>>;
    OnRecordAfterUpdateSuccess(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordEvent>>;
    OnRecordAfterUpdateError(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordErrorEvent>>;
    OnRecordDelete(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordEvent>>;
    OnRecordDeleteExecute(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordEvent>>;
    OnRecordAfterDeleteSuccess(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordEvent>>;
    OnRecordAfterDeleteError(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordErrorEvent>>;
    OnRecordEnrich(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordEnrichEvent>>;
    OnRecordAuthWithPasswordRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordAuthWithPasswordRequestEvent>>;
    OnRecordAuthWithOAuth2Request(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordAuthWithOAuth2RequestEvent>>;
    OnRecordAuthWithOTPRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordAuthWithOTPRequestEvent>>;
    OnRecordsListRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordsListRequestEvent>>;
    OnRecordViewRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordRequestEvent>>;
    OnRecordCreateRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordRequestEvent>>;
    OnRecordUpdateRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordRequestEvent>>;
    OnRecordDeleteRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordRequestEvent>>;
    OnRecordAuthRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordAuthRequestEvent>>;
    OnRecordAuthRefreshRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordAuthRefreshRequestEvent>>;
    OnRecordCreateOTPRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordCreateOTPRequestEvent>>;
    OnRecordRequestOTPRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordCreateOTPRequestEvent>>;
    OnRecordRequestPasswordResetRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordRequestPasswordResetRequestEvent>>;
    OnRecordConfirmPasswordResetRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordConfirmPasswordResetRequestEvent>>;
    OnRecordRequestVerificationRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordRequestVerificationRequestEvent>>;
    OnRecordConfirmVerificationRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordConfirmVerificationRequestEvent>>;
    OnRecordRequestEmailChangeRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordRequestEmailChangeRequestEvent>>;
    OnRecordConfirmEmailChangeRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<RecordConfirmEmailChangeRequestEvent>>;
    OnSettingsReload(): Hook<SettingsReloadEvent>;
    OnBackupCreate(): Hook<BackupEvent>;
    OnBackupRestore(): Hook<BackupEvent>;
    OnFileDownloadRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<FileDownloadRequestEvent>>;
    OnFileTokenRequest(tags?: string[]): ReturnType<typeof NewTaggedHook<FileTokenRequestEvent>>;
    OnMailerSend(): Hook<MailerEvent>;
    OnMailerRecordAuthAlertSend(tags?: string[]): ReturnType<typeof NewTaggedHook<MailerRecordEvent>>;
    OnMailerRecordPasswordResetSend(tags?: string[]): ReturnType<typeof NewTaggedHook<MailerRecordEvent>>;
    OnMailerRecordVerificationSend(tags?: string[]): ReturnType<typeof NewTaggedHook<MailerRecordEvent>>;
    OnMailerRecordEmailChangeSend(tags?: string[]): ReturnType<typeof NewTaggedHook<MailerRecordEvent>>;
    OnMailerRecordOTPSend(tags?: string[]): ReturnType<typeof NewTaggedHook<MailerRecordEvent>>;
    OnCollectionValidate(tags?: string[]): ReturnType<typeof NewTaggedHook<CollectionEvent>>;
    OnCollectionCreate(tags?: string[]): ReturnType<typeof NewTaggedHook<CollectionEvent>>;
    OnCollectionCreateExecute(tags?: string[]): ReturnType<typeof NewTaggedHook<CollectionEvent>>;
    OnCollectionAfterCreateSuccess(tags?: string[]): ReturnType<typeof NewTaggedHook<CollectionEvent>>;
    OnCollectionAfterCreateError(tags?: string[]): ReturnType<typeof NewTaggedHook<CollectionErrorEvent>>;
    OnCollectionUpdate(tags?: string[]): ReturnType<typeof NewTaggedHook<CollectionEvent>>;
    OnCollectionUpdateExecute(tags?: string[]): ReturnType<typeof NewTaggedHook<CollectionEvent>>;
    OnCollectionAfterUpdateSuccess(tags?: string[]): ReturnType<typeof NewTaggedHook<CollectionEvent>>;
    OnCollectionAfterUpdateError(tags?: string[]): ReturnType<typeof NewTaggedHook<CollectionErrorEvent>>;
    OnCollectionDelete(tags?: string[]): ReturnType<typeof NewTaggedHook<CollectionEvent>>;
    OnCollectionDeleteExecute(tags?: string[]): ReturnType<typeof NewTaggedHook<CollectionEvent>>;
    OnCollectionAfterDeleteSuccess(tags?: string[]): ReturnType<typeof NewTaggedHook<CollectionEvent>>;
    OnCollectionAfterDeleteError(tags?: string[]): ReturnType<typeof NewTaggedHook<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>;
    onRealtimeConnectRequest(): Hook<RealtimeConnectRequestEvent>;
    onRealtimeMessageSend(): Hook<RealtimeMessageEvent>;
    onRealtimeSubscribeRequest(): Hook<RealtimeSubscribeRequestEvent>;
    onSettingsListRequest(): Hook<SettingsListRequestEvent>;
    onSettingsUpdateRequest(): Hook<SettingsUpdateRequestEvent>;
    onModelCreate(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<ModelEvent>;
    onModelCreateExecute(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<ModelEvent>;
    onModelAfterCreateSuccess(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<ModelEvent>;
    onModelAfterCreateError(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<ModelErrorEvent>;
    onModelUpdate(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<ModelEvent>;
    onModelUpdateExecute(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<ModelEvent>;
    onModelAfterUpdateSuccess(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<ModelEvent>;
    onModelAfterUpdateError(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<ModelErrorEvent>;
    onModelValidate(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<ModelEvent>;
    onModelDelete(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<ModelEvent>;
    onModelDeleteExecute(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<ModelEvent>;
    onModelAfterDeleteSuccess(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<ModelEvent>;
    onModelAfterDeleteError(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<ModelErrorEvent>;
    onRecordValidate(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordEvent>;
    onRecordCreate(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordEvent>;
    onRecordCreateExecute(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordEvent>;
    onRecordAfterCreateSuccess(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordEvent>;
    onRecordAfterCreateError(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordErrorEvent>;
    onRecordUpdate(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordEvent>;
    onRecordUpdateExecute(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordEvent>;
    onRecordAfterUpdateSuccess(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordEvent>;
    onRecordAfterUpdateError(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordErrorEvent>;
    onRecordDelete(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordEvent>;
    onRecordDeleteExecute(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordEvent>;
    onRecordAfterDeleteSuccess(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordEvent>;
    onRecordAfterDeleteError(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordErrorEvent>;
    onRecordEnrich(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordEnrichEvent>;
    onRecordAuthWithPasswordRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordAuthWithPasswordRequestEvent>;
    onRecordAuthWithOAuth2Request(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordAuthWithOAuth2RequestEvent>;
    onRecordAuthWithOTPRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordAuthWithOTPRequestEvent>;
    onRecordsListRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordsListRequestEvent>;
    onRecordViewRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordRequestEvent>;
    onRecordCreateRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordRequestEvent>;
    onRecordUpdateRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordRequestEvent>;
    onRecordDeleteRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordRequestEvent>;
    onRecordAuthRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordAuthRequestEvent>;
    onRecordAuthRefreshRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordAuthRefreshRequestEvent>;
    onRecordCreateOTPRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordCreateOTPRequestEvent>;
    onRecordRequestOTPRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordCreateOTPRequestEvent>;
    onRecordRequestPasswordResetRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordRequestPasswordResetRequestEvent>;
    onRecordConfirmPasswordResetRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordConfirmPasswordResetRequestEvent>;
    onRecordRequestVerificationRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordRequestVerificationRequestEvent>;
    onRecordConfirmVerificationRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordConfirmVerificationRequestEvent>;
    onRecordRequestEmailChangeRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordRequestEmailChangeRequestEvent>;
    onRecordConfirmEmailChangeRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<RecordConfirmEmailChangeRequestEvent>;
    onSettingsReload(): Hook<SettingsReloadEvent>;
    onBackupCreate(): Hook<BackupEvent>;
    onBackupRestore(): Hook<BackupEvent>;
    onFileDownloadRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<FileDownloadRequestEvent>;
    onFileTokenRequest(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<FileTokenRequestEvent>;
    onMailerSend(): Hook<MailerEvent>;
    onMailerRecordAuthAlertSend(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<MailerRecordEvent>;
    onMailerRecordPasswordResetSend(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<MailerRecordEvent>;
    onMailerRecordVerificationSend(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<MailerRecordEvent>;
    onMailerRecordEmailChangeSend(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<MailerRecordEvent>;
    onMailerRecordOTPSend(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<MailerRecordEvent>;
    onCollectionValidate(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<CollectionEvent>;
    onCollectionCreate(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<CollectionEvent>;
    onCollectionCreateExecute(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<CollectionEvent>;
    onCollectionAfterCreateSuccess(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<CollectionEvent>;
    onCollectionAfterCreateError(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<CollectionErrorEvent>;
    onCollectionUpdate(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<CollectionEvent>;
    onCollectionUpdateExecute(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<CollectionEvent>;
    onCollectionAfterUpdateSuccess(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<CollectionEvent>;
    onCollectionAfterUpdateError(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<CollectionErrorEvent>;
    onCollectionDelete(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<CollectionEvent>;
    onCollectionDeleteExecute(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<CollectionEvent>;
    onCollectionAfterDeleteSuccess(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<CollectionEvent>;
    onCollectionAfterDeleteError(...tags: string[]): import("../tools/hook/tagged.js").TaggedHook<CollectionErrorEvent>;
    isBootstrapped(): boolean;
    bootstrap(): void;
    bootstrapAsync(): Promise<void>;
    private initLogger;
    private getLogWriter;
    private initDevSqlLogger;
    resetBootstrapState(): void;
    IsTransactional(): boolean;
    private cloneWithSharedState;
    UnsafeWithoutHooks(): App;
    ForMigrations(): App;
    forMigrations(): App;
    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(): TxAppInfo | null;
    auxHasTable(name: string): boolean;
    AuxHasTable(name: string): boolean;
    runAllMigrations(): void;
    runSystemMigrations(): void;
    runAppMigrations(): void;
    reloadSettings(): Error | null;
    reloadSettingsAsync(): Promise<Error | null>;
    ReloadSettings(): Error | null;
    ReloadSettingsAsync(): Promise<Error | null>;
    NewMailClient(): Sendmail | SMTPClient;
    RecordQuery(collectionModelOrIdentifier: Collection | string | null | undefined): RecordQuery;
    ExpandRecord(record: RecordModel, expands: string[], optFetchFunc?: ExpandFetchFunc | null): Record<string, Error>;
    ExpandRecords(records: RecordModel[], expands: string[], optFetchFunc?: ExpandFetchFunc | null): Record<string, Error>;
    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;
    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;
    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>;
    findAuthRecordByToken(token: string, ...validTypes: string[]): RecordModel;
    findAuthRecordByTokenWithTypes(token: string, validTypes?: string[]): RecordModel;
    FindAllCollections(...collectionTypes: string[]): Collection[];
    ReloadCachedCollections(): Error | null;
    FindCollectionByNameOrId(identifier: string): Collection;
    findCollectionByNameOrId(identifier: string): Collection;
    FindCachedCollectionReferences(collection: Collection, ...excludeIds: string[]): Map<Collection, Field[]>;
    FindCollectionReferences(collection: Collection, ...excludeIds: string[]): Map<Collection, Field[]>;
    findCollectionById(id: string): Collection | null;
    findCollectionByNameOrIdOrNull(identifier: string): Collection | null;
    FindCachedCollectionByNameOrId(identifier: string): Collection;
    findRecordByIdOrNull(collection: Collection, id: string, rule?: SqlExpr | null): RecordModel | null;
    findFirstRecordByFilterOrNull(collectionOrIdentifier: Collection | string, filter: string, ...params: SQLQueryBindings[]): RecordModel | null;
    NewFilesystem(): import("../tools/filesystem/filesystem.js").System;
    NewFilesystemAsync(): Promise<import("../tools/filesystem/filesystem.js").System>;
    NewBackupsFilesystem(): import("../tools/filesystem/filesystem.js").System;
    NewBackupsFilesystemAsync(): Promise<import("../tools/filesystem/filesystem.js").System>;
    CreateBackup(ctx: unknown, name: string): Promise<Error | null>;
    RestoreBackup(ctx: unknown, name: string): Promise<Error | null>;
    Restart(): Error | null;
    RestartAsync(): Promise<Error | null>;
    private resolveRestartExecPath;
    private buildRestartArgv;
    private buildRestartEnvv;
    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;
    private withDatabase;
    private withDatabaseSync;
    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;
    private runRecordInterceptors;
    private runRecordInterceptorsSync;
    private saveModel;
    private saveModelSync;
    private saveGenericModel;
    private saveGenericModelSync;
    Validate(model: Model): Promise<Error | null>;
    ValidateWithContext(ctx: unknown, model: Model): Promise<Error | null>;
    ValidateSync(model: Model): Error | null;
    Delete(model: Model): Promise<Error | null>;
    DeleteSync(model: Model): Error | null;
    RunInTransaction(fn: (txApp: App) => Error | null | Promise<Error | null>): Promise<Error | null>;
    RunInTransactionSync(fn: (txApp: App) => Error | null): Error | null;
    AuxRunInTransaction(fn: (txApp: App) => Error | null | Promise<Error | null>): Promise<Error | null>;
    AuxRunInTransactionSync(fn: (txApp: App) => Error | null): Error | null;
    RunInTransactionAsync(fn: (txApp: App) => Promise<Error | null> | Error | null): Promise<Error | null>;
    DeleteWithContext(_ctx: unknown, model: Model): Promise<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;
    TruncateCollection(collection: Collection): Promise<Error | null>;
    ImportCollectionsByMarshaledJSON(rawSliceOfMaps: string | Uint8Array, deleteMissing: boolean): Promise<Error | null>;
    ImportCollectionsByMarshaledJSONSync(rawSliceOfMaps: string | Uint8Array, deleteMissing: boolean): Error | null;
    ImportCollections(toImport: Array<Record<string, unknown>>, deleteMissing: boolean): Promise<Error | null>;
    ImportCollectionsSync(toImport: Array<Record<string, unknown>>, deleteMissing: boolean): Error | null;
    SyncRecordTableSchema(newCollection: Collection, oldCollection: Collection | null): Promise<Error | null>;
    SyncRecordTableSchemaSync(newCollection: Collection, oldCollection: Collection | null): Error | null;
    private validateRecord;
    private validateRecordAsync;
    private hasAsyncRecordValidator;
    private onRecordSaveExecute;
    private handleRecordDeleteExecute;
    private persistRecord;
    private persistRecordSync;
    private persistGenericModel;
    private persistGenericModelSync;
    private deleteRecord;
    private deleteRecordSync;
    private deleteGenericModel;
    private deleteGenericModelSync;
    private saveSettings;
    private prepareCollectionForSave;
    private saveCollection;
    private saveCollectionSync;
    private deleteCollection;
    private validateCollection;
    private validateCollectionSync;
    private syncRecordTableSchemaInternal;
    private syncRecordTableSchemaSyncInternal;
    private registerBaseHooks;
    private registerAutobackupHooks;
    private registerSettingsHooks;
    private registerCollectionHooks;
    private registerRecordHooks;
    private registerSuperuserHooks;
    private registerOTPHooks;
    private registerMFAHooks;
    private registerExternalAuthHooks;
    private registerAuthOriginHooks;
    private registerNotifyWatcherHooks;
    SaveView(dangerousViewName: string, dangerousSelectQuery: string): Promise<Error | null>;
    SaveViewSync(dangerousViewName: string, dangerousSelectQuery: string): Error | null;
    DeleteView(dangerousViewName: string): Error | null;
    CreateViewFields(dangerousSelectQuery: string): Promise<FieldsList>;
    CreateViewFieldsSync(dangerousSelectQuery: string): FieldsList;
    DryRunView(dangerousSelectQuery: string, sampleSize: number): Promise<import("./view.js").DryRunViewResult>;
    TableInfo(tableName: string): import("./db_table.js").TableInfoRow[];
    TableColumns(tableName: string): string[];
    TableIndexes(tableName: string): Record<string, string>;
    DeleteTable(dangerousTableName: string): Error | null;
    HasTable(name: string): boolean;
    Vacuum(): Error | null;
    AuxVacuum(): Error | null;
    IsCollectionNameUnique(name: string, excludeId?: string): boolean;
}
