import Point from './point';
import type { Callback } from '../types/callback';
/**
 * @module util
 * @private
 */
/**
 * Given a value `t` that varies between 0 and 1, return
 * an interpolation function that eases between 0 and 1 in a pleasing
 * cubic in-out fashion.
 *
 * @private
 */
export declare function easeCubicInOut(t: number): number;
/**
 * Given given (x, y), (x1, y1) control points for a bezier curve,
 * return a function that interpolates along that curve.
 *
 * @param p1x control point 1 x coordinate
 * @param p1y control point 1 y coordinate
 * @param p2x control point 2 x coordinate
 * @param p2y control point 2 y coordinate
 * @private
 */
export declare function bezier(p1x: number, p1y: number, p2x: number, p2y: number): (t: number) => number;
/**
 * A default bezier-curve powered easing function with
 * control points (0.25, 0.1) and (0.25, 1)
 *
 * @private
 */
export declare const ease: (t: number) => number;
/**
 * constrain n to the given range via min + max
 *
 * @param n value
 * @param min the minimum value to be returned
 * @param max the maximum value to be returned
 * @returns the clamped value
 * @private
 */
export declare function clamp(n: number, min: number, max: number): number;
/**
 * constrain n to the given range, excluding the minimum, via modular arithmetic
 *
 * @param n value
 * @param min the minimum value to be returned, exclusive
 * @param max the maximum value to be returned, inclusive
 * @returns constrained number
 * @private
 */
export declare function wrap(n: number, min: number, max: number): number;
export declare function asyncAll<Item, Result>(array: Array<Item>, fn: (item: Item, fnCallback: Callback<Result>) => void, callback: Callback<Array<Result>>): void;
export declare function keysDifference<S, T>(obj: {
    [key: string]: S;
}, other: {
    [key: string]: T;
}): Array<string>;
/**
 * Given a destination object and optionally many source objects,
 * copy all properties from the source objects into the destination.
 * The last source object given overrides properties from previous
 * source objects.
 *
 * @param dest destination object
 * @param sources sources from which properties are pulled
 * @private
 */
export declare function extend(dest: any, ...sources: Array<any>): any;
/**
 * Given an object and a number of properties as strings, return version
 * of that object with only those properties.
 *
 * @param src the object
 * @param properties an array of property names chosen
 * to appear on the resulting object.
 * @returns object with limited properties.
 * @example
 * var foo = { name: 'Charlie', age: 10 };
 * var justName = pick(foo, ['name']);
 * // justName = { name: 'Charlie' }
 * @private
 */
export declare function pick(src: any, properties: Array<string>): any;
/**
 * Return a unique numeric id, starting at 1 and incrementing with
 * each call.
 *
 * @returns unique numeric id.
 * @private
 */
export declare function uniqueId(): number;
/**
 * Return a random UUID (v4). Taken from: https://gist.github.com/jed/982883
 * @private
 */
export declare function uuid(): string;
/**
 * Return whether a given value is a power of two
 * @private
 */
export declare function isPowerOfTwo(value: number): boolean;
/**
 * Return the next power of two, or the input value if already a power of two
 * @private
 */
export declare function nextPowerOfTwo(value: number): number;
/**
 * Validate a string to match UUID(v4) of the
 * form: xxxxxxxx-xxxx-4xxx-[89ab]xxx-xxxxxxxxxxxx
 * @param str string to validate.
 * @private
 */
export declare function validateUuid(str?: string | null): boolean;
/**
 * Given an array of member function names as strings, replace all of them
 * with bound versions that will always refer to `context` as `this`. This
 * is useful for classes where otherwise event bindings would reassign
 * `this` to the evented object or some other value: this lets you ensure
 * the `this` value always.
 *
 * @param fns list of member function names
 * @param context the context value
 * @example
 * function MyClass() {
 *   bindAll(['ontimer'], this);
 *   this.name = 'Tom';
 * }
 * MyClass.prototype.ontimer = function() {
 *   alert(this.name);
 * };
 * var myClass = new MyClass();
 * setTimeout(myClass.ontimer, 100);
 * @private
 */
export declare function bindAll(fns: Array<string>, context: any): void;
/**
 * Create an object by mapping all the values of an existing object while
 * preserving their keys.
 *
 * @private
 */
export declare function mapObject(input: any, iterator: Function, context?: any): any;
/**
 * Create an object by filtering out values of an existing object.
 *
 * @private
 */
export declare function filterObject(input: any, iterator: Function, context?: any): any;
import deepEqual from '../style-spec/util/deep_equal';
export { deepEqual };
/**
 * Deeply clones two objects.
 *
 * @private
 */
export declare function clone<T>(input: T): T;
/**
 * Check if two arrays have at least one common element.
 *
 * @private
 */
export declare function arraysIntersect<T>(a: Array<T>, b: Array<T>): boolean;
export declare function warnOnce(message: string): void;
/**
 * Indicates if the provided Points are in a counter clockwise (true) or clockwise (false) order
 *
 * @private
 * @returns true for a counter clockwise set of points
 */
export declare function isCounterClockwise(a: Point, b: Point, c: Point): boolean;
/**
 * Returns the signed area for the polygon ring.  Positive areas are exterior rings and
 * have a clockwise winding.  Negative areas are interior rings and have a counter clockwise
 * ordering.
 *
 * @private
 * @param ring Exterior or interior ring
 */
export declare function calculateSignedArea(ring: Array<Point>): number;
/**
 * Detects closed polygons, first + last point are equal
 *
 * @private
 * @param points array of points
 * @return true if the points are a closed polygon
 */
export declare function isClosedPolygon(points: Array<Point>): boolean;
/**
 * Converts spherical coordinates to cartesian coordinates.
 *
 * @private
 * @param spherical Spherical coordinates, in [radial, azimuthal, polar]
 * @return cartesian coordinates in [x, y, z]
 */
export declare function sphericalToCartesian([r, azimuthal, polar]: [number, number, number]): {
    x: number;
    y: number;
    z: number;
};
/**
 *  Returns true if the when run in the web-worker context.
 *
 * @private
 * @returns {boolean}
 */
export declare function isWorker(): boolean;
/**
 * Parses data from 'Cache-Control' headers.
 *
 * @private
 * @param cacheControl Value of 'Cache-Control' header
 * @return object containing parsed header info.
 */
export declare function parseCacheControl(cacheControl: string): any;
/**
 * Returns true when run in WebKit derived browsers.
 * This is used as a workaround for a memory leak in Safari caused by using Transferable objects to
 * transfer data between WebWorkers and the main thread.
 * https://github.com/mapbox/mapbox-gl-js/issues/8771
 *
 * This should be removed once the underlying Safari issue is fixed.
 *
 * @private
 * @param scope {WindowOrWorkerGlobalScope} Since this function is used both on the main thread and WebWorker context,
 *      let the calling scope pass in the global scope object.
 * @returns {boolean}
 */
export declare function isSafari(scope: any): boolean;
export declare function storageAvailable(type: string): boolean;
export declare function b64EncodeUnicode(str: string): string;
export declare function b64DecodeUnicode(str: string): string;
//# sourceMappingURL=util.d.ts.map