diff --git a/openlayers3/openlayers3.d.ts b/openlayers3/openlayers3.d.ts index d89c65ecc..7703a2d5e 100644 --- a/openlayers3/openlayers3.d.ts +++ b/openlayers3/openlayers3.d.ts @@ -1413,13 +1413,206 @@ declare module ol { } // NAMESPACES + + /** + * The animation static methods are designed to be used with the ol.Map#beforeRender method. + */ module animation { + + /** + * Generate an animated transition that will "bounce" the resolution as it approaches the final value. + * @param options Bounce options. + */ + //TODO: return ol.PreRenderFunction + function bounce(options: AnimationBounceOptions): any; + interface AnimationBounceOptions { + + /** + * The resolution to start the bounce from, typically map.getView().getResolution(). + */ + resolution: number; + + /** + * The start time of the animation. Default is immediately. + */ + start?: number; + + /** + * The duration of the animation in milliseconds. Default is 1000. + */ + duration?: number; + + /** + * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. + */ + // TODO: Check if it is an ol.easing function + easing: () => void; + } + + /** + * Generate an animated transition while updating the view center. + * @param options Pan options. + */ + //TODO: return ol.PreRenderFunction + function pan(options: AnimationPanOptions): any; + interface AnimationPanOptions { + + /** + * The resolution to start the bounce from, typically map.getView().getResolution(). + */ + source: ol.Coordinate; + + /** + * The start time of the animation. Default is immediately. + */ + start?: number; + + /** + * The duration of the animation in milliseconds. Default is 1000. + */ + duration?: number; + + /** + * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. + */ + // TODO: Check if it is an ol.easing function + easing: () => void; + } + + /** + * Generate an animated transition while updating the view rotation. + * @param options Rotate options. + */ + //TODO: return ol.PreRenderFunction + function rotate(options: AnimationRotateOptions): any; + interface AnimationRotateOptions { + + /** + * The rotation value (in radians) to begin rotating from, typically map.getView().getRotation(). If undefined then 0 is assumed. + */ + rotation?: number; + + /** + * The rotation center/anchor. The map rotates around the center of the view if unspecified. + */ + anchor?: ol.Coordinate; + + /** + * The start time of the animation. Default is immediately. + */ + start?: number; + + /** + * The duration of the animation in milliseconds. Default is 1000. + */ + duration?: number; + + /** + * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. + */ + // TODO: Check if it is an ol.easing function + easing: () => void; + } + + /** + * Generate an animated transition while updating the view resolution. + * @param options Zoom options. + */ + function pan(options: AnimationZoomOptions): any; + interface AnimationZoomOptions { + + /** + * The resolution to begin zooming from, typically map.getView().getResolution(). + */ + resolution: number; + + /** + * The start time of the animation. Default is immediately. + */ + start?: number; + + /** + * The duration of the animation in milliseconds. Default is 1000. + */ + duration?: number; + + /** + * The easing function to use. Can be an ol.easing or a custom function. Default is ol.easing.upAndDown. + */ + // TODO: Check if it is an ol.easing function + easing: () => void; + } } + /** + * Return the color as an array. This function maintains a cache of calculated arrays which means the result should not be modified. + */ module color { + + /** + * Return the color as an array. This function maintains a cache of calculated arrays which means the result should not be modified. + * @param color Color. + */ + function asArray(color: ol.Color): ol.Color; + function asArray(color: string): ol.Color; + + /** + * Return the color as an rgba string. + * @param color Color. + */ + function asString(color: ol.Color): string; + function asString(color: string): string; } module control { + + /** + * Set of controls included in maps by default. Unless configured otherwise, this returns a collection containing an instance of each of the following controls: ol.control.Zoom, ol.control.Rotate, ol.control.Attribution + * @param options Defaults options + * @returns Control.s + */ + function defaults(opt_options: ControlDefaultsOptions): ol.Collection