
import * as path from "path";
import { IMAPFolderStatusNativeBinding } from "../types";
import { NodeTrustedMailcore2NativeBinding } from '../types/NodeTrustedMailcore2NativeBinding'

// tslint:disable-next-line: no-var-requires
let bindings: NodeTrustedMailcore2NativeBinding;
try {
    bindings = require(path.join(__dirname, "../../lib/binding/trusted_mailcore2.node"));
} catch(e) {
    bindings = require(path.join(__dirname, "../../lib/binding/trusted_mailcore2_no_crypto.node"));
}

// tslint:disable-next-line
const { IMAPFolderStatus: _IMAPFolderStatus } = bindings

/**
 *
 *
 * @class IMAPFolderStatus
 * @extends {bindings.IMAPFolderStatus}
 */
class IMAPFolderStatus extends bindings.IMAPFolderStatus {
    public handle: IMAPFolderStatusNativeBinding

    constructor() {
        super()

        const handle = new _IMAPFolderStatus();
        this.handle = handle;
    }

    /**
     * Get unseenCount
     *
     * @type {number}
     * @memberof IMAPFolderStatus
     */
    get unseenCount(): number {
        return this.handle.unseenCount;
    }

    /**
     * Set unseenCount
     *
     * @memberof IMAPFolderStatus
     */
    set unseenCount(count: number) {
        this.handle.unseenCount = count;
    }

    /**
     * Get messageCount
     *
     * @type {number}
     * @memberof IMAPFolderStatus
     */
    get messageCount(): number {
        return this.handle.messageCount;
    }

    /**
     * Set messageCount
     *
     * @memberof IMAPFolderStatus
     */
    set messageCount(count: number) {
        this.handle.messageCount = count;
    }

    /**
     * Get recentCount
     *
     * @type {number}
     * @memberof IMAPFolderStatus
     */
    get recentCount(): number {
        return this.handle.recentCount;
    }

    /**
     * Set recentCount
     *
     * @memberof IMAPFolderStatus
     */
    set recentCount(count: number) {
        this.handle.recentCount = count;
    }

    /**
     * Get uidNext
     *
     * @type {number}
     * @memberof IMAPFolderStatus
     */
    get uidNext(): number {
        return this.handle.uidNext;
    }

    /**
     * Set uidNext
     *
     * @memberof IMAPFolderStatus
     */
    set uidNext(uid: number) {
        this.handle.uidNext = uid;
    }

    /**
     * Get uidValidity
     *
     * @type {number}
     * @memberof IMAPFolderStatus
     */
    get uidValidity(): number {
        return this.handle.uidValidity;
    }

    /**
     * Set uidValidity
     *
     * @memberof IMAPFolderStatus
     */
    set uidValidity(uid: number) {
        this.handle.uidValidity = uid;
    }

    /**
     * Get highestModSeqValue
     *
     * @type {number}
     * @memberof IMAPFolderStatus
     */
    get highestModSeqValue(): number {
        return this.handle.highestModSeqValue;
    }

    /**
     * Set highestModSeqValue
     *
     * @memberof IMAPFolderStatus
     */
    set highestModSeqValue(mod: number) {
        this.handle.highestModSeqValue = mod;
    }

    public description(): string {
        return this.handle.description();
    }
}

export { IMAPFolderStatus }
