import type { GMPFunctions } from './functions';
import { Float } from './float';
import { Rational } from './rational';
declare type IntegerFactoryReturn = ReturnType<typeof getIntegerContext>['Integer'];
export interface IntegerFactory extends IntegerFactoryReturn {
}
declare type IntegerReturn = ReturnType<IntegerFactoryReturn>;
export interface Integer extends IntegerReturn {
}
declare type AllTypes = Integer | Rational | Float | number;
declare type OutputType<T> = T extends number ? Integer : T extends Integer ? Integer : T extends Rational ? Rational : T extends Float ? Float : never;
export declare enum DivMode {
    CEIL = 0,
    FLOOR = 1,
    TRUNCATE = 2
}
export declare function getIntegerContext(gmp: GMPFunctions, ctx: any): {
    Integer: (num?: string | number | Integer | Uint8Array, radix?: number) => {
        mpz_t: number;
        type: string;
        add<T extends AllTypes>(val: T): OutputType<T>;
        sub<T_1 extends AllTypes>(val: T_1): OutputType<T_1>;
        mul<T_2 extends AllTypes>(val: T_2): OutputType<T_2>;
        neg(): Integer;
        abs(): Integer;
        div<T_3 extends AllTypes>(val: T_3, mode?: DivMode): OutputType<T_3>;
        pow(exp: Rational | Integer | number, mod?: Integer | number): Integer;
        sqrt(): Integer;
        nthRoot(nth: number): Integer;
        factorial(): Integer;
        doubleFactorial(): Integer;
        isPrime(reps?: number): boolean | 'probably-prime';
        nextPrime(): Integer;
        gcd(val: Integer | number): Integer;
        lcm(val: Integer | number): Integer;
        complement1(): Integer;
        complement2(): Integer;
        and(val: Integer | number): Integer;
        or(val: Integer | number): Integer;
        xor(val: Integer | number): Integer;
        shiftLeft(val: number): Integer;
        shiftRight(val: number): Integer;
        /** Sets the value of bit i to 1. The least significant bit is number 0 */
        setBit(i: number): Integer;
        /** Sets the value of multiple bits to 1. The least significant bit is number 0 */
        setBits(indices: number[]): Integer;
        /** Sets the value of bit i to 0. The least significant bit is number 0 */
        clearBit(index: number): Integer;
        /** Sets the value of multiple bits to 0. The least significant bit is number 0 */
        clearBits(indices: number[]): Integer;
        /** Inverts the value of bit i. The least significant bit is number 0 */
        flipBit(index: number): Integer;
        /** Inverts the value of multiple bits. The least significant bit is number 0 */
        flipBits(indices: number[]): Integer;
        getBit(index: number): number;
        msbPosition(): number;
        /** Works similarly to JS Array.slice() but on bits. The least significant bit is number 0 */
        sliceBits(start?: number, end?: number): Integer;
        /** Creates new integer with the copy of binary representation of num to position offset. Optionally bitCount can be used to zero-pad the number to a specific number of bits. The least significant bit is number 0 */
        writeTo(num: Integer, offset?: number, bitCount?: number): any;
        isEqual(val: AllTypes): boolean;
        lessThan(val: AllTypes): boolean;
        lessOrEqual(val: AllTypes): boolean;
        greaterThan(val: AllTypes): boolean;
        greaterOrEqual(val: AllTypes): boolean;
        sign(): number;
        toNumber(): number;
        /** Exports integer into an Uint8Array. Sign is ignored. */
        toBuffer(littleEndian?: boolean): Uint8Array;
        toString(radix?: number): string;
    };
    isInteger: (val: any) => boolean;
    destroy: () => void;
};
export {};
