import { Field } from "./field";
export declare abstract class DataType<Dtype extends DataTypeName = any> {
    readonly __dtype: Dtype;
    abstract readonly variant: DataTypeName;
    protected identity: string;
    protected get inner(): null | any[];
    equals(other: DataType): boolean;
    /** Null type */
    static get Null(): Null;
    /** `true` and `false`. */
    static get Bool(): Bool;
    /** An `i8` */
    static get Int8(): Int8;
    /** An `i16` */
    static get Int16(): Int16;
    /** An `i32` */
    static get Int32(): Int32;
    /** An `i64` */
    static get Int64(): Int64;
    /** An `u8` */
    static get UInt8(): UInt8;
    /** An `u16` */
    static get UInt16(): UInt16;
    /** An `u32` */
    static get UInt32(): UInt32;
    /** An `u64` */
    static get UInt64(): UInt64;
    /** A `f32` */
    static get Float32(): Float32;
    /** A `f64` */
    static get Float64(): Float64;
    static get Date(): Date;
    /** Time of day type */
    static get Time(): Time;
    /** Type for wrapping arbitrary JS objects */
    static get Object(): Object_;
    /** A categorical encoding of a set of strings  */
    static get Categorical(): Categorical;
    /** An ordered categorical with a fixed set of categories */
    static Enum(categories: string[]): Enum;
    /** Decimal type */
    static Decimal(precision?: number, scale?: number): Decimal;
    /**
     * Calendar date and time type
     * @param timeUnit any of 'ms' | 'ns' | 'us'
     * @param timeZone timezone string as defined by Intl.DateTimeFormat `America/New_York` for example.
     */
    static Datetime(timeUnit?: TimeUnit | "ms" | "ns" | "us", timeZone?: string | null | undefined): Datetime;
    static Duration(timeUnit: TimeUnit | "ms" | "ns" | "us"): Duration;
    /**
     * Nested list/array type
     *
     * @param inner The `DataType` of values within the list
     *
     */
    static List(inner: DataType): List;
    /**
     * List of fixed length
     * This is called `Array` in other polars implementations, but `Array` is widely used in JS, so we use `FixedSizeList` instead.
     *
     */
    static FixedSizeList(inner: DataType, listSize: number): FixedSizeList;
    /**
     * Struct type
     */
    static Struct(fields: Field[]): DataType;
    static Struct(fields: {
        [key: string]: DataType;
    }): DataType;
    /** A variable-length UTF-8 encoded string whose offsets are represented as `i64`. */
    static get Utf8(): Utf8;
    static get String(): String;
    toString(): string;
    toJSON(): {
        [x: string]: {
            [x: string]: any;
        };
    } | {
        [x: string]: DataTypeName;
    };
    asFixedSizeList(): (this & FixedSizeList) | null;
}
export declare class Null extends DataType<"Null"> {
    __dtype: "Null";
    readonly variant = "Null";
}
export declare class Bool extends DataType<"Bool"> {
    __dtype: "Bool";
    readonly variant = "Bool";
}
export declare class Int8 extends DataType<"Int8"> {
    __dtype: "Int8";
    readonly variant = "Int8";
}
export declare class Int16 extends DataType<"Int16"> {
    __dtype: "Int16";
    readonly variant = "Int16";
}
export declare class Int32 extends DataType<"Int32"> {
    __dtype: "Int32";
    readonly variant = "Int32";
}
export declare class Int64 extends DataType<"Int64"> {
    __dtype: "Int64";
    readonly variant = "Int64";
}
export declare class UInt8 extends DataType<"UInt8"> {
    __dtype: "UInt8";
    readonly variant = "UInt8";
}
export declare class UInt16 extends DataType<"UInt16"> {
    __dtype: "UInt16";
    readonly variant = "UInt16";
}
export declare class UInt32 extends DataType<"UInt32"> {
    __dtype: "UInt32";
    readonly variant = "UInt32";
}
export declare class UInt64 extends DataType<"UInt64"> {
    __dtype: "UInt64";
    readonly variant = "UInt64";
}
export declare class Float32 extends DataType<"Float32"> {
    __dtype: "Float32";
    readonly variant = "Float32";
}
export declare class Float64 extends DataType<"Float64"> {
    __dtype: "Float64";
    readonly variant = "Float64";
}
export declare class Date extends DataType<"Date"> {
    __dtype: "Date";
    readonly variant = "Date";
}
export declare class Time extends DataType<"Time"> {
    __dtype: "Time";
    readonly variant = "Time";
}
export declare class Object_ extends DataType<"Object"> {
    __dtype: "Object";
    readonly variant = "Object";
}
export declare class Utf8 extends DataType<"Utf8"> {
    __dtype: "Utf8";
    readonly variant = "Utf8";
}
export declare class String extends DataType<"String"> {
    __dtype: "String";
    readonly variant = "String";
}
export declare class Categorical extends DataType<"Categorical"> {
    __dtype: "Categorical";
    readonly variant = "Categorical";
}
export declare class Enum extends DataType<"Enum"> {
    private readonly _categories;
    __dtype: "Enum";
    readonly variant = "Enum";
    constructor(_categories: string[]);
    get categories(): string[];
    get inner(): string[][];
    equals(other: DataType): boolean;
    toString(): string;
    toJSON(): any;
}
export declare class Decimal extends DataType<"Decimal"> {
    __dtype: "Decimal";
    readonly variant = "Decimal";
    private precision;
    private scale;
    constructor(precision?: number, scale?: number);
    get inner(): (number | null)[];
    equals(other: DataType): boolean;
    toJSON(): {
        [x: string]: {
            Decimal: {
                precision: number | null;
                scale: number | null;
            };
        };
    };
}
/**
 * Datetime type
 */
export declare class Datetime extends DataType<"Datetime"> {
    private timeUnit;
    private timeZone?;
    __dtype: "Datetime";
    readonly variant = "Datetime";
    constructor(timeUnit?: TimeUnit | "ms" | "ns" | "us", timeZone?: string | null | undefined);
    get inner(): (string | null | undefined)[];
    equals(other: DataType): boolean;
}
export declare class Duration extends DataType<"Duration"> {
    private timeUnit;
    __dtype: "Duration";
    readonly variant = "Duration";
    constructor(timeUnit?: TimeUnit | "ms" | "ns" | "us");
    get inner(): (TimeUnit | "ms" | "ns" | "us")[];
    equals(other: Duration): boolean;
}
export declare class List extends DataType<"List"> {
    protected __inner: DataType;
    __dtype: "List";
    readonly variant = "List";
    constructor(__inner: DataType);
    get inner(): DataType<any>[];
    equals(other: DataType): boolean;
}
export declare class FixedSizeList extends DataType<"FixedSizeList"> {
    protected __inner: DataType;
    protected listSize: number;
    __dtype: "FixedSizeList";
    readonly variant = "FixedSizeList";
    constructor(__inner: DataType, listSize: number);
    get inner(): [DataType, number];
    equals(other: DataType): boolean;
    toJSON(): {
        [x: string]: {
            FixedSizeList: {
                type: {
                    [x: string]: {
                        [x: string]: any;
                    };
                } | {
                    [x: string]: DataTypeName;
                };
                size: number;
            };
        };
    };
}
export declare class Struct extends DataType<"Struct"> {
    __dtype: "Struct";
    readonly variant = "Struct";
    private fields;
    constructor(inner: {
        [name: string]: DataType;
    } | Field[]);
    get inner(): Field[];
    equals(other: DataType): boolean;
    toJSON(): any;
}
/**
 * Datetime time unit
 */
export declare enum TimeUnit {
    Nanoseconds = "ns",
    Microseconds = "us",
    Milliseconds = "ms"
}
/**
 * @ignore
 * Timeunit namespace
 */
export declare namespace TimeUnit {
    function from(s: "ms" | "ns" | "us"): TimeUnit;
}
/**
 * Datatype namespace
 */
export declare namespace DataType {
    type Categorical = import(".").Categorical;
    type Enum = import(".").Enum;
    type Int8 = import(".").Int8;
    type Int16 = import(".").Int16;
    type Int32 = import(".").Int32;
    type Int64 = import(".").Int64;
    type UInt8 = import(".").UInt8;
    type UInt16 = import(".").UInt16;
    type UInt32 = import(".").UInt32;
    type UInt64 = import(".").UInt64;
    type Float32 = import(".").Float32;
    type Float64 = import(".").Float64;
    type Bool = import(".").Bool;
    type Utf8 = import(".").Utf8;
    type String = import(".").String;
    type List = import(".").List;
    type FixedSizeList = import(".").FixedSizeList;
    type Date = import(".").Date;
    type Datetime = import(".").Datetime;
    type Time = import(".").Time;
    type Duration = import(".").Duration;
    type Object = import(".").Object_;
    type Null = import(".").Null;
    type Struct = import(".").Struct;
    type Decimal = import(".").Decimal;
    /**
     * deserializes a datatype from the serde output of rust polars `DataType`
     * @param dtype dtype object
     */
    function deserialize(dtype: any): DataType;
}
export type DataTypeName = "Null" | "Bool" | "Int8" | "Int16" | "Int32" | "Int64" | "UInt8" | "UInt16" | "UInt32" | "UInt64" | "Float32" | "Float64" | "Decimal" | "Date" | "Datetime" | "Time" | "Duration" | "Object" | "Utf8" | "String" | "Categorical" | "Enum" | "List" | "FixedSizeList" | "Struct";
export type JsType = number | boolean | string;
export type DTypeToJs<T> = T extends DataType.Decimal ? bigint : T extends DataType.Float64 ? number : T extends DataType.Float32 ? number : T extends DataType.Int64 ? bigint : T extends DataType.Int32 ? number : T extends DataType.Int16 ? number : T extends DataType.Int8 ? number : T extends DataType.Bool ? boolean : T extends DataType.Utf8 ? string : T extends DataType.String ? string : never;
export type DTypeToJsLoose<T> = T extends DataType.Decimal ? number | bigint : T extends DataType.Float64 ? number | bigint : T extends DataType.Float32 ? number | bigint : T extends DataType.Int64 ? number | bigint : T extends DataType.Int32 ? number | bigint : T extends DataType.Int16 ? number | bigint : T extends DataType.Int8 ? number | bigint : T extends DataType.Bool ? boolean : T extends DataType.Utf8 ? string : T extends DataType.String ? string : never;
export type DtypeToJsName<T> = T extends DataType.Decimal ? "Decimal" : T extends DataType.Float64 ? "Float64" : T extends DataType.Float32 ? "Float32" : T extends DataType.Int64 ? "Int64" : T extends DataType.Int32 ? "Int32" : T extends DataType.Int16 ? "Int16" : T extends DataType.Int8 ? "Int8" : T extends DataType.UInt64 ? "UInt64" : T extends DataType.UInt32 ? "UInt32" : T extends DataType.UInt16 ? "UInt16" : T extends DataType.UInt8 ? "UInt8" : T extends DataType.Bool ? "Bool" : T extends DataType.Utf8 ? "Utf8" : never;
