import { IMAPMessage } from "../imap/IMAPMessage";
import { IMAPFolderNativeBinding } from ".";
import { AuthType } from "../enums/AuthType";
import { ConnectionType } from "../enums/ConnectionType";
import { IMAPFolderStatusNativeBinding } from "./IMAPFolderStatusNativeBinding";
import { DataNativeBinding } from "./DataNativeBinding";
import { IMAPSyncResultNativeBinding } from "./IMAPSyncResultNativeBinding";
import { MessageFlag } from "../enums/MessageFlag";
import { IMAPStoreFlagsRequestKind } from "../enums/IMAPStoreFlagsRequestKind";
import { IMAPMessageNativeBinding } from "./IMAPMessageNativeBinding";

export declare class IMAPSessionNativeBinding {
    get hostname(): string;
    set hostname(hostname: string);
    get port(): number;
    set port(port: number);
    get username(): string;
    set username(username: string);
    get password(): string;
    set password(password: string);
    get checkCertificateEnabled(): boolean;
    set checkCertificateEnabled(isEnabled: boolean);
    get OAuth2Token(): string;
    set OAuth2Token(OAuth2Token: string);
    get authType(): AuthType;
    set authType(authType: AuthType);
    get connectionType(): ConnectionType;
    set connectionType(connectionType: ConnectionType);
    set strictGost(value: Boolean);
    get strictGost(): Boolean;
    checkAccount(from: string): Promise<number>;
    disconnect(): void;
    disconnectAsync(done: (error: string | Error | undefined | null, result: number) => void): void;
    isDisconnected(): boolean;
    loginIfNeeded(): number;
    loginIfNeededAsync(done: (error: string | Error | undefined | null, result: number) => void): void;
    connectIfNeeded(): number;
    connectIfNeededAsync(done: (error: string | Error | undefined | null, result: number) => void): void;
    createFolder(folder: string): number;
    createSpecialFolder(folder: string, flag: number): number;
    deleteFolder(folder: string): number;
    renameFolder(folder: string, folderOther: string): number;
    subscribeFolder(folder: string): number;
    unsubscribeFolder(folder: string): number;
    fetchSubscribedFolders(): IMAPFolderNativeBinding[];
    fetchAllFolders(): IMAPFolderNativeBinding[];
    fetchAllFoldersAsync(done: (error: string | Error | undefined | null, folders: IMAPFolderNativeBinding[]) => void): void;
    folderStatus(folder: string): IMAPFolderStatusNativeBinding;
    folderStatusAsync(
        folder: string,
        done: (error: string | Error | undefined | null, status: IMAPFolderStatusNativeBinding) => void
    ): void;
    fetchMessagesByUID(folder: string, rangeStart?: number, rangeEnd?: number): IMAPMessage[];
    fetchMessagesByUIDAsync(
        folder: string,
        rangeStart: number,
        rangeEnd: number,
        done: (error: string | Error | undefined | null, messages: IMAPMessageNativeBinding[]) => void
    ): Promise<IMAPMessage[]>;
    moveMessages(folder: string, uidSet: number, destFolder: string): number;
    moveMessagesAsync(
        folder: string,
        uidSet: number,
        destFolder: string,
        done: (error: string | Error | undefined | null, result: number) => void
    ): void;
    fetchMessageByUID(folder: string, uid: number): DataNativeBinding;
    fetchMessageByUIDAsync(
        folder: string,
        uid: number,
        done: (error: string | Error | undefined | null, hdata: DataNativeBinding) => void
    ): void;
    fetchMessageByNumber(folder: string, messageNumber: number): DataNativeBinding;
    get isQResyncEnabled(): boolean;
    syncMessagesByUID(
        folder: string,
        modseq: number,
        rangeStart?: number,
        rangeEnd?: number
    ): IMAPSyncResultNativeBinding | undefined;
    syncMessagesByUIDAsync(
        folder: string,
        modseq: number,
        done: (error: string | Error | undefined | null, result: IMAPSyncResultNativeBinding | undefined) => void,
    ): void;
    storeFlagsByUID(folder: string, uidSet: number, requestKind: IMAPStoreFlagsRequestKind, flags: MessageFlag): number;
    storeFlagsByUIDAsync(
        folder: string,
        uidSet: number,
        requestKind: IMAPStoreFlagsRequestKind,
        flags: MessageFlag,
        done: (error: string | Error | undefined | null, result: number) => void
    ): void;
    storeFlagsByNumber(folder: string, uidSet: number, requestKind: IMAPStoreFlagsRequestKind, flags: MessageFlag): number;
    appendMessage(folder: string, mdata: DataNativeBinding, flags: MessageFlag): number;
    appendMessageAsync(
        folder: string,
        mdata: DataNativeBinding,
        flags: MessageFlag,
        done: (error: string | Error | undefined | null, result: number) => void
    ): void;
    copyMessages(folder: string, destFolder: string, locationStart: number, length?: number): number;
    expunge(folder: string): number;
    expungeAsync(
        folder: string,
        done: (error: string | Error | undefined | null, result: number) => void
    ): Promise<number>;
    get capabilityMove(): boolean;
    get capabilityCreateSpecialUse(): boolean;
}

export declare interface IMAPSessionNativeBindingObject {
    new(): IMAPSessionNativeBinding
    strError(errorCode: number): string
}
