import '../../../globals.js';
/**
 * General utility functions for Scenery
 *
 * @author Jonathan Olson <jonathan.olson@colorado.edu>
 */
import Bounds2 from '../../../dot/js/Bounds2.js';
import Matrix3 from '../../../dot/js/Matrix3.js';
import Transform3 from '../../../dot/js/Transform3.js';
declare const Utils: {
    /**
     * Prepares a DOM element for use with applyPreparedTransform(). Applies some CSS styles that are required, but
     * that we don't want to set while animating.
     */
    prepareForTransform(element: HTMLElement | SVGElement): void;
    /**
     * Applies the CSS transform of the matrix to the element, with optional forcing of acceleration.
     * NOTE: prepareForTransform should be called at least once on the element before this method is used.
     */
    applyPreparedTransform(matrix: Matrix3, element: HTMLElement | SVGElement): void;
    /**
     * Applies a CSS transform value string to a DOM element.
     * NOTE: prepareForTransform should be called at least once on the element before this method is used.
     */
    setTransform(transformString: string, element: HTMLElement | SVGElement): void;
    /**
     * Removes a CSS transform from a DOM element.
     */
    unsetTransform(element: HTMLElement | SVGElement): void;
    /**
     * Ensures that window.requestAnimationFrame and window.cancelAnimationFrame use a native implementation if possible,
     * otherwise using a simple setTimeout internally. See https://github.com/phetsims/scenery/issues/426
     */
    polyfillRequestAnimationFrame(): void;
    /**
     * Returns the relative size of the context's backing store compared to the actual Canvas. For example, if it's 2,
     * the backing store has 2x2 the amount of pixels (4 times total).
     *
     * @returns The backing store pixel ratio.
     */
    backingStorePixelRatio(context: CanvasRenderingContext2D | WebGLRenderingContext): number;
    /**
     * Returns the scaling factor that needs to be applied for handling a HiDPI Canvas
     * See see http://developer.apple.com/library/safari/#documentation/AudioVideo/Conceptual/HTML-canvas-guide/SettingUptheCanvas/SettingUptheCanvas.html#//apple_ref/doc/uid/TP40010542-CH2-SW5
     * And it's updated based on http://www.html5rocks.com/en/tutorials/canvas/hidpi/
     */
    backingScale(context: CanvasRenderingContext2D | WebGLRenderingContext): number;
    /**
     * Whether the native Canvas HTML5 API supports the 'filter' attribute (similar to the CSS/SVG filter attribute).
     */
    supportsNativeCanvasFilter(): boolean;
    /**
     * Whether we can handle arbitrary filters in Canvas by manipulating the ImageData returned. If we have a backing
     * store pixel ratio that is non-1, we'll be blurring out things during that operation, which would be unacceptable.
     */
    supportsImageDataCanvasFilter(): boolean;
    /**
     * Given a data snapshot and transform, calculate range on how large / small the bounds can be. It's
     * very conservative, with an effective 1px extra range to allow for differences in anti-aliasing
     * for performance concerns, this does not support skews / rotations / anything but translation and scaling
     */
    scanBounds(imageData: ImageData, resolution: number, transform: Transform3): {
        minBounds: Bounds2;
        maxBounds: Bounds2;
    };
    /**
     * Measures accurate bounds of a function that draws things to a Canvas.
     */
    canvasAccurateBounds(renderToContext: (context: CanvasRenderingContext2D) => void, options?: {
        precision?: number;
        resolution?: number;
        initialScale?: number;
    }): Bounds2 & {
        minBounds: Bounds2;
        maxBounds: Bounds2;
        isConsistent: boolean;
        precision: number;
    };
    /**
     * Finds the smallest power of 2 that is at least as large as n.
     *
     * @returns The smallest power of 2 that is greater than or equal n
     */
    toPowerOf2(n: number): number;
    /**
     * Creates and compiles a GLSL Shader object in WebGL.
     */
    createShader(gl: WebGLRenderingContext, source: string, type: number): WebGLShader;
    applyWebGLContextDefaults(gl: WebGLRenderingContext): void;
    /**
     * Set whether webgl should be enabled, see docs for webglEnabled
     */
    setWebGLEnabled(_webglEnabled: boolean): void;
    /**
     * Check to see whether webgl is supported, using the same strategy as mrdoob and pixi.js
     *
     * @param [extensions] - A list of WebGL extensions that need to be supported
     */
    checkWebGLSupport(extensions?: string[]): boolean;
    /**
     * Check to see whether IE11 has proper clearStencil support (required for three.js to work well).
     */
    checkIE11StencilSupport(): boolean;
    /**
     * Whether WebGL (with decent performance) is supported by the platform
     */
    readonly isWebGLSupported: boolean;
    /**
     * Triggers a loss of a WebGL context, with a delayed restoration.
     *
     * NOTE: Only use this for debugging. Should not be called normally.
     */
    loseContext(gl: WebGLRenderingContext): void;
    /**
     * Creates a string useful for working around https://github.com/phetsims/collision-lab/issues/177.
     */
    safariEmbeddingMarkWorkaround(str: string): string;
};
export default Utils;
//# sourceMappingURL=Utils.d.ts.map