import type { App } from "./app.js";
import { JSONRaw, DateTime } from "../tools/types/index.js";
import { AuthAlertConfig, EmailTemplate, MFAConfig, OAuth2Config, OTPConfig, PasswordAuthConfig, TokenConfigValue } from "./collection_model_auth_options.js";
import { FieldsList } from "./fields_list.js";
export declare const CollectionNameSuperusers = "_superusers";
export declare const CollectionTypeBase = "base";
export declare const CollectionTypeAuth = "auth";
export declare const CollectionTypeView = "view";
export type CollectionField = {
    name: string;
    type: string;
    system: boolean;
    hidden: boolean;
    raw: Record<string, unknown>;
};
export type CollectionRow = {
    id: string;
    name: string;
    system: number | boolean;
    type: string;
    fields: string;
    indexes: string;
    listRule: string | null;
    viewRule: string | null;
    createRule: string | null;
    updateRule: string | null;
    deleteRule: string | null;
    options: string;
    created?: string;
    updated?: string;
};
export type CollectionInit = {
    id?: string;
    name?: string;
    type?: string;
    system?: boolean;
    fields?: CollectionField[];
    Fields?: FieldsList;
    indexes?: string[];
    listRule?: string | null;
    viewRule?: string | null;
    createRule?: string | null;
    updateRule?: string | null;
    deleteRule?: string | null;
    options?: Record<string, unknown> | null;
    created?: DateTime | string | null;
    updated?: DateTime | string | null;
};
export declare class Collection {
    #private;
    id: string;
    name: string;
    type: string;
    system: boolean;
    fields: CollectionField[];
    Fields: FieldsList;
    indexes: string[];
    listRule: string | null;
    viewRule: string | null;
    createRule: string | null;
    updateRule: string | null;
    deleteRule: string | null;
    created: DateTime;
    updated: DateTime;
    RawOptions: JSONRaw;
    AuthRule: string | null;
    ManageRule: string | null;
    AuthAlert: AuthAlertConfig;
    OAuth2: OAuth2Config;
    PasswordAuth: PasswordAuthConfig;
    MFA: MFAConfig;
    OTP: OTPConfig;
    AuthToken: TokenConfigValue;
    PasswordResetToken: TokenConfigValue;
    EmailChangeToken: TokenConfigValue;
    VerificationToken: TokenConfigValue;
    FileToken: TokenConfigValue;
    VerificationTemplate: EmailTemplate;
    ResetPasswordTemplate: EmailTemplate;
    ConfirmEmailChangeTemplate: EmailTemplate;
    ViewQuery: string;
    constructor(values?: CollectionInit);
    get Id(): string;
    set Id(value: string);
    get Name(): string;
    set Name(value: string);
    get Type(): string;
    set Type(value: string);
    get System(): boolean;
    set System(value: boolean);
    get ListRule(): string | null;
    set ListRule(value: string | null);
    get ViewRule(): string | null;
    set ViewRule(value: string | null);
    get CreateRule(): string | null;
    set CreateRule(value: string | null);
    get UpdateRule(): string | null;
    set UpdateRule(value: string | null);
    get DeleteRule(): string | null;
    set DeleteRule(value: string | null);
    get Created(): DateTime;
    set Created(value: DateTime);
    get Updated(): DateTime;
    set Updated(value: DateTime);
    get options(): Record<string, unknown>;
    set options(value: Record<string, unknown> | null);
    SafeOptions(): Record<string, unknown>;
    TableName(): string;
    BaseFilesPath(): string;
    IsBase(): boolean;
    IsAuth(): boolean;
    IsView(): boolean;
    isAuth(): boolean;
    isView(): boolean;
    isNew(): boolean;
    IsNew(): boolean;
    markNew(value?: boolean): void;
    LastSavedPK(): string;
    PK(): string;
    MarkAsNew(): void;
    MarkAsNotNew(): void;
    IntegrityChecks(enable: boolean): void;
    integrityChecksEnabled(): boolean;
    PostScan(): Error | null;
    unmarshalRawOptions(): Error | null;
    UnmarshalJSON(raw: string | Record<string, unknown>): Error | null;
    MarshalJSON(): string;
    toJSON(): Record<string, unknown>;
    String(): string;
    DBExport(): Record<string, unknown>;
    GetIndex(name: string): string;
    AddIndex(name: string, unique: boolean, columnsExpr: string, optWhereExpr: string): void;
    RemoveIndex(name: string): void;
    idChecksum(): string;
    initDefaultId(): void;
    updateGeneratedIdIfExists(app: App): void;
    setDefaultAuthOptions(): void;
    unsetMissingOAuth2MappedFields(): void;
    initDefaultFields(): void;
    initIdField(): void;
    initPasswordField(): void;
    initTokenKeyField(): void;
    initEmailField(): void;
    initEmailVisibilityField(): void;
    initVerifiedField(): void;
    fieldIndexName(field: string): string;
    private baseJSON;
    private copyFrom;
    private applyOptions;
    private applyAuthOptions;
    private rawOptions;
    private rawAuthOptions;
    private safeAuthOptions;
}
export declare function NewCollection(type: string, name: string, id?: string): Collection;
export declare function NewBaseCollection(name: string, id?: string): Collection;
export declare function NewAuthCollection(name: string, id?: string): Collection;
export declare function NewViewCollection(name: string, id?: string): Collection;
export declare function parseCollectionFields(raw: unknown): CollectionField[];
export declare function normalizeCollectionFields(collection: Collection): void;
export declare function collectionFromRow(row: CollectionRow): Collection;
export declare function applyCollectionData(collection: Collection, data: Record<string, unknown>): void;
