type Optional<T> = T | undefined;
export type DimensionModes = 'px' | '%' | 'fr' | 'fitContent' | 'gridUnit' | 'fillParent';
export type Dimension<Modes extends DimensionModes = DimensionModes> = {
    value: number;
    mode: Modes;
};
interface DimensionCache<Type extends object> {
    get(key: string): Type | undefined;
    set(key: string, dimension: Type): void;
    clear(): void;
}
export declare namespace Dimension {
    export const configure: {
        enableCaching: (c: DimensionCache<Dimension<DimensionModes>>) => void;
    };
    export function build<Mode extends DimensionModes>(dimension: Dimension<Mode>): Dimension<Mode>;
    export function build<Mode extends DimensionModes>(value: number, mode: Mode): Dimension<Mode>;
    export const gridUnit: (value: number) => Dimension<"gridUnit">;
    export const fitContent: (value: number) => Dimension<"fitContent">;
    export const fillParent: (value: number) => Dimension<"fillParent">;
    export const px: (value: number) => Dimension<"px">;
    export const percent: (value: number) => Dimension<"%">;
    interface DimensionBuilder<Mode1 extends DimensionModes, Mode2 extends DimensionModes> {
        asFirst: () => Dimension<Mode1>;
        asSecond: () => Dimension<Mode2>;
        as(mode: Mode1 | Mode2): Dimension<typeof mode>;
        value: number;
    }
    export function add(d: Dimension<'px'>, d2: Dimension<'px'>): DimensionBuilder<'px', 'px'>;
    export function add<M1 extends 'gridUnit' | 'fitContent' | 'fillParent', M2 extends 'gridUnit' | 'fitContent' | 'fillParent'>(d: Dimension<M1>, d2: Dimension<M2>): DimensionBuilder<M1, M2>;
    export function add<M1 extends 'gridUnit' | 'fitContent' | 'fillParent' | 'px', M2 extends 'gridUnit' | 'fitContent' | 'fillParent' | 'px'>(d: Dimension<M1>, d2: Dimension<M2>, parentSpace: number): DimensionBuilder<M1, M2>;
    export function minus(d: Dimension<'px'>, d2: Dimension<'px'>): DimensionBuilder<'px', 'px'>;
    export function minus<M1 extends 'gridUnit' | 'fitContent' | 'fillParent', M2 extends 'gridUnit' | 'fitContent' | 'fillParent'>(d: Dimension<M1>, d2: Dimension<M2>): DimensionBuilder<M1, M2>;
    export function minus<M1 extends 'gridUnit' | 'fitContent' | 'fillParent' | 'px', M2 extends 'gridUnit' | 'fitContent' | 'fillParent' | 'px'>(d: Dimension<M1>, d2: Dimension<M2>, parentSpace: number): DimensionBuilder<M1, M2>;
    export function min(d: Dimension<'px'>, d2: Dimension<'px'>): DimensionBuilder<'px', 'px'>;
    export function min<M1 extends 'gridUnit' | 'fitContent' | 'fillParent', M2 extends 'gridUnit' | 'fitContent' | 'fillParent'>(d: Dimension<M1>, d2: Dimension<M2>): DimensionBuilder<M1, M2>;
    export function min<M1 extends 'gridUnit' | 'fitContent' | 'fillParent' | 'px', M2 extends 'gridUnit' | 'fitContent' | 'fillParent' | 'px'>(d: Dimension<M1>, d2: Dimension<M2>, parentSpace: number): DimensionBuilder<M1, M2>;
    export function max(d: Dimension<'px'>, d2: Dimension<'px'>): DimensionBuilder<'px', 'px'>;
    export function max<M1 extends 'gridUnit' | 'fitContent' | 'fillParent', M2 extends 'gridUnit' | 'fitContent' | 'fillParent'>(d: Dimension<M1>, d2: Dimension<M2>): DimensionBuilder<M1, M2>;
    export function max<M1 extends 'gridUnit' | 'fitContent' | 'fillParent' | 'px', M2 extends 'gridUnit' | 'fitContent' | 'fillParent' | 'px'>(d: Dimension<M1>, d2: Dimension<M2>, parentSpace: number): DimensionBuilder<M1, M2>;
    export const toPx: <T extends Dimension<"gridUnit" | "px" | "fitContent" | "fillParent"> | undefined>(d: T, parentSpace: number) => T extends Dimension<"gridUnit" | "px" | "fitContent" | "fillParent"> ? Dimension<"px"> : Optional<Dimension<"px">>;
    export const toGridUnit: <T extends Dimension<"gridUnit" | "px" | "fitContent" | "fillParent"> | undefined>(d: T, parentSpace: number) => GridUnitBuilder<T>;
    export {};
}
declare class GridUnitBuilder<Input extends Dimension<'gridUnit' | 'fitContent' | 'px' | 'fillParent'> | undefined, Output = Input extends Dimension<'gridUnit' | 'fitContent' | 'px' | 'fillParent'> ? Dimension<'gridUnit' | 'fitContent' | 'fillParent'> : Optional<Dimension<'gridUnit' | 'fitContent' | 'fillParent'>>> {
    private dimension;
    private parentSpace;
    constructor(dimension: Input, parentSpace: number);
    roundDown(): Output;
    roundUp(): Output;
    raw(): Output;
}
export {};
//# sourceMappingURL=Dimension.d.ts.map