From d329cf5430b4580d07e3c43dec6f3a778810dcf1 Mon Sep 17 00:00:00 2001 From: "yohann.poli" Date: Mon, 5 Mar 2018 22:44:50 +0100 Subject: [PATCH 1/8] fix nw.js JSON type as any --- types/nw.js/index.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/types/nw.js/index.d.ts b/types/nw.js/index.d.ts index b4e941b0a7..93307f9e87 100644 --- a/types/nw.js/index.d.ts +++ b/types/nw.js/index.d.ts @@ -372,7 +372,7 @@ declare module NWJS_Helpers { * The paper size spec * example: 'mediaSize':{'name': 'CUSTOM', 'width_microns': 279400, 'height_microns': 215900, 'custom_display_name':'Letter', 'is_default': true} */ - mediaSize: JSON; + mediaSize: any; /** * Whether to print CSS backgrounds @@ -1072,9 +1072,9 @@ declare module NWJS_Helpers { * Enumerate the printers in the system. * * @param callback {function(dev_win?)} callback with the native window of the DevTools window. - * - (optional) printers {JSON[]} An array of JSON objects for the printer information. + * - (optional) printers {any[]} An array of json objects for the printer information. */ - getPrinters( callback: ( printers?: JSON[] ) => void ): void; + getPrinters( callback: ( printers?: any[] ) => void ): void; /** * Query the status of devtools window. @@ -1084,9 +1084,9 @@ declare module NWJS_Helpers { /** * Print the web contents in the window without the need for user’s interaction. * - * @param options {Object} Specify whether to close the window forcely and bypass close event. + * @param options {any | PrintOption} Specify whether to close the window forcely and bypass close event. */ - print( options: JSON | PrintOption ): void; + print( options: any | PrintOption ): void; /** * Set window's maximum size. @@ -1381,9 +1381,9 @@ declare namespace nw { dataPath: string; /** - * Get the JSON object of the manifest file. + * Get the json object of the manifest file. */ - manifest: JSON; + manifest: any; /** * Clear the HTTP cache in memory and the one on disk. This method call is synchronized. From f85d5b4341296ef83a1603fc6c8af431027e31c1 Mon Sep 17 00:00:00 2001 From: Budi Irawan Date: Tue, 6 Mar 2018 22:11:36 +1100 Subject: [PATCH 2/8] Add UpdateDocumentByQueryResponse elasticsearch --- types/elasticsearch/elasticsearch-tests.ts | 24 ++++++++++++++++++++++ types/elasticsearch/index.d.ts | 23 +++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/types/elasticsearch/elasticsearch-tests.ts b/types/elasticsearch/elasticsearch-tests.ts index 10c4659998..e21f84dc48 100644 --- a/types/elasticsearch/elasticsearch-tests.ts +++ b/types/elasticsearch/elasticsearch-tests.ts @@ -266,6 +266,30 @@ client.search({ } }); +client.updateByQuery({ + index: 'myIndex', + type: 'mytype', +}, (error, response) => { + const { + took, + timed_out, + updated, + deleted, + batches, + version_conflicts, + noops, + retries, + throttled_millis, + throttled_until_millis, + total, + failures + } = response; + + const { bulk, search } = retries; + + // ... +}); + client.indices.updateAliases({ body: { actions: [ diff --git a/types/elasticsearch/index.d.ts b/types/elasticsearch/index.d.ts index c6b05da9a0..e60e8d86c3 100644 --- a/types/elasticsearch/index.d.ts +++ b/types/elasticsearch/index.d.ts @@ -89,8 +89,8 @@ export class Client { termvectors(params: TermvectorsParams, callback: (error: any, response: any) => void): void; update(params: UpdateDocumentParams): Promise; update(params: UpdateDocumentParams, callback: (error: any, response: any) => void): void; - updateByQuery(params: UpdateDocumentByQueryParams): Promise; - updateByQuery(params: UpdateDocumentByQueryParams, callback: (error: any, response: any) => void): void; + updateByQuery(params: UpdateDocumentByQueryParams): Promise; + updateByQuery(params: UpdateDocumentByQueryParams, callback: (error: any, response: UpdateDocumentByQueryResponse) => void): void; close(): void; } @@ -785,6 +785,25 @@ export interface UpdateDocumentByQueryParams extends GenericParams { type: NameList; } +export interface UpdateDocumentByQueryResponse { + took: number; + timed_out: boolean; + updated: number; + deleted: number; + batches: number; + version_conflicts: number; + noops: number; + retries: { + bulk: number; + search: number; + }; + throttled_millis: number; + requests_per_second: number; + throttled_until_millis: number; + total: number; + failures: any[]; +} + export interface Cat { aliases(params: CatAliasesParams, callback: (error: any, response: any) => void): void; aliases(params: CatAliasesParams): Promise; From a3c4aadbeb3bdfcbdceb1c6e74a7e3142a3b2351 Mon Sep 17 00:00:00 2001 From: Chris Barth Date: Wed, 7 Mar 2018 10:25:21 -0500 Subject: [PATCH 3/8] Add typings for winston-syslog --- types/winston-syslog/index.d.ts | 25 ++++++++++++++ types/winston-syslog/tsconfig.json | 24 +++++++++++++ types/winston-syslog/tslint.json | 6 ++++ types/winston-syslog/winston-syslog-tests.ts | 36 ++++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 types/winston-syslog/index.d.ts create mode 100644 types/winston-syslog/tsconfig.json create mode 100644 types/winston-syslog/tslint.json create mode 100644 types/winston-syslog/winston-syslog-tests.ts diff --git a/types/winston-syslog/index.d.ts b/types/winston-syslog/index.d.ts new file mode 100644 index 0000000000..816274ded8 --- /dev/null +++ b/types/winston-syslog/index.d.ts @@ -0,0 +1,25 @@ +// Type definitions for winston-syslog 1.0 +// Project: https://github.com/indexzero/winston-syslog#readme +// Definitions by: Chris Barth +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as winston from "winston"; +export interface SyslogTransportOptions extends winston.GenericTextTransportOptions { + host?: string; + port?: number; + path?: string; + protocol?: string; + pid?: number; + facility?: string; + localhost?: string; + type?: string; + app_name?: string; + eol?: string; +} +export class Syslog extends winston.Transport implements winston.TransportInstance { +} +declare module "winston" { + interface Transports { + Syslog: Syslog; + } +} diff --git a/types/winston-syslog/tsconfig.json b/types/winston-syslog/tsconfig.json new file mode 100644 index 0000000000..e11a89c680 --- /dev/null +++ b/types/winston-syslog/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "winston-syslog-tests.ts" + ] +} \ No newline at end of file diff --git a/types/winston-syslog/tslint.json b/types/winston-syslog/tslint.json new file mode 100644 index 0000000000..1e30988418 --- /dev/null +++ b/types/winston-syslog/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-var-requires": false + } +} diff --git a/types/winston-syslog/winston-syslog-tests.ts b/types/winston-syslog/winston-syslog-tests.ts new file mode 100644 index 0000000000..ce83bbb918 --- /dev/null +++ b/types/winston-syslog/winston-syslog-tests.ts @@ -0,0 +1,36 @@ +import winston = require('winston'); +import { SyslogTransportOptions } from 'winston-syslog'; +require('winston-syslog').Syslog; + +const str = ""; +const bool = true; +const num = 1; +const obj: any = {}; + +const syslogOptions: SyslogTransportOptions = { + host: str, + port: num, + path: str, + protocol: str, + pid: num, + facility: str, + localhost: str, + type: str, + app_name: str, + eol: str, + json: bool, + colorize: bool, + colors: str, + prettyPrint: bool, + showLevel: bool, + label: str, + depth: num, +}; + +winston.add(winston.transports.Syslog, syslogOptions); + +const logger: winston.LoggerInstance = new (winston.Logger)({ + transports: [ + new (winston.transports.Syslog)(syslogOptions), + ] +}); From ce5502be72636585bf25d292958a25c5d79e9639 Mon Sep 17 00:00:00 2001 From: Olivier Sechet Date: Thu, 8 Mar 2018 00:09:14 +0100 Subject: [PATCH 4/8] Clean no-redundant-jsdoc lint --- types/openlayers/index.d.ts | 3600 ---------------------------------- types/openlayers/tslint.json | 3 +- 2 files changed, 1 insertion(+), 3602 deletions(-) diff --git a/types/openlayers/index.d.ts b/types/openlayers/index.d.ts index 333ee0f621..4454efdeb9 100644 --- a/types/openlayers/index.d.ts +++ b/types/openlayers/index.d.ts @@ -13,28 +13,17 @@ declare type GlobalObject = Object; -/** - * @namespace ol - */ declare module ol { /** * Error object thrown when an assertion failed. This is an ECMA-262 Error, * extended with a `code` property. * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error} - * @constructor - * @extends {Error} - * @implements {oli.AssertionError} - * @param {number} code Error code. */ class AssertionError extends Error { /** * Error object thrown when an assertion failed. This is an ECMA-262 Error, * extended with a `code` property. * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error} - * @constructor - * @extends {Error} - * @implements {oli.AssertionError} - * @param {number} code Error code. */ constructor(code: number); @@ -43,7 +32,6 @@ declare module ol { * {@link http://openlayers.org/en/latest/errors.html} (replace `latest` with * the version found in the OpenLayers script's header comment if a version * other than the latest is used). - * @type {number} * @api */ code: number; @@ -65,8 +53,6 @@ declare module ol { * ], * .. * - * @constructor - * @param {olx.AttributionOptions} options Attribution options. * @struct * @api stable */ @@ -87,8 +73,6 @@ declare module ol { * ], * .. * - * @constructor - * @param {olx.AttributionOptions} options Attribution options. * @struct * @api stable */ @@ -96,7 +80,6 @@ declare module ol { /** * Get the attribution markup. - * @return {string} The attribution HTML. * @api stable */ getHTML(): string; @@ -110,10 +93,7 @@ declare module ol { * Collection; they trigger events on the appropriate object, not on the * Collection as a whole. * - * @constructor - * @extends {ol.Object} * @fires ol.Collection.Event - * @param {!Array.=} opt_array Array. * @template T * @api stable */ @@ -126,10 +106,7 @@ declare module ol { * Collection; they trigger events on the appropriate object, not on the * Collection as a whole. * - * @constructor - * @extends {ol.Object} * @fires ol.Collection.Event - * @param {!Array.=} opt_array Array. * @template T * @api stable */ @@ -144,18 +121,14 @@ declare module ol { /** * Add elements to the collection. This pushes each item in the provided array * to the end of the collection. - * @param {!Array.} arr Array. - * @return {ol.Collection.} This collection. * @api stable */ extend(arr: T[]): ol.Collection; /** * Iterate over each element, calling the provided callback. - * @param {function(this: S, T, number, Array.): *} f The function to call * for every element. This function takes 3 arguments (the element, the * index and the array). The return value is ignored. - * @param {S=} opt_this The object to use as `this` in `f`. * @template S * @api stable */ @@ -166,22 +139,18 @@ declare module ol { * is mutated, no events will be dispatched by the collection, and the * collection's "length" property won't be in sync with the actual length * of the array. - * @return {!Array.} Array. * @api stable */ getArray(): T[]; /** * Get the element at the provided index. - * @param {number} index Index. - * @return {T} Element. * @api stable */ item(index: number): T; /** * Get the length of this collection. - * @return {number} The length of the array. * @observable * @api stable */ @@ -189,8 +158,6 @@ declare module ol { /** * Insert an element at the provided index. - * @param {number} index Index. - * @param {T} elem Element. * @api stable */ insertAt(index: number, elem: T): void; @@ -198,23 +165,18 @@ declare module ol { /** * Remove the last element of the collection and return it. * Return `undefined` if the collection is empty. - * @return {T|undefined} Element. * @api stable */ pop(): (T); /** * Insert the provided element at the end of the collection. - * @param {T} elem Element. - * @return {number} Length. * @api stable */ push(elem: T): number; /** * Remove the first occurrence of an element from the collection. - * @param {T} elem Element. - * @return {T|undefined} The removed element or undefined if none found. * @api stable */ remove(elem: T): (T); @@ -222,16 +184,12 @@ declare module ol { /** * Remove the element at the provided index and return it. * Return `undefined` if the collection does not contain this index. - * @param {number} index Index. - * @return {T|undefined} Value. * @api stable */ removeAt(index: number): (T); /** * Set the element at the provided index. - * @param {number} index Index. - * @param {T} elem Element. * @api stable */ setAt(index: number, elem: T): void; @@ -245,11 +203,6 @@ declare module ol { * Events emitted by {@link ol.Collection} instances are instances of this * type. * - * @constructor - * @extends {ol.events.Event} - * @implements {oli.Collection.Event} - * @param {ol.Collection.EventType} type Type. - * @param {*=} opt_element Element. */ class Event extends ol.events.Event { /** @@ -257,17 +210,11 @@ declare module ol { * Events emitted by {@link ol.Collection} instances are instances of this * type. * - * @constructor - * @extends {ol.events.Event} - * @implements {oli.Collection.Event} - * @param {ol.Collection.EventType} type Type. - * @param {*=} opt_element Element. */ constructor(type: ol.Collection.EventType, opt_element?: any); /** * The element that is added to or removed from the collection. - * @type {*} * @api stable */ element: any; @@ -279,23 +226,17 @@ declare module ol { * `rgb(r,g,b)` or `rgba(r,g,b,a)` format, or in hex `#rrggbb` or `#rgb` format. * Color names, like 'red', 'blue' or 'green', may also be used with the * Canvas renderer. - * - * @namespace ol.color */ 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 {ol.Color|string} color Color. - * @return {ol.Color} Color. * @api */ function asArray(color: (ol.Color | string)): ol.Color; /** * Return the color as an rgba string. - * @param {ol.Color|string} color Color. - * @return {string} Rgba string. * @api */ function asString(color: (ol.Color | string)): string; @@ -304,20 +245,14 @@ declare module ol { /** * An {@link ol.ColorLike} can be a color, gradient or pattern accepted by * [CanvasRenderingContext2D.fillStyle](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle). - * @namespace ol.colorlike */ module colorlike { /** - * @param {ol.Color|ol.ColorLike} color Color. - * @return {ol.ColorLike} The color as an ol.ColorLike * @api */ function asColorLike(color: (ol.Color | ol.ColorLike)): ol.ColorLike; } - /** - * @namespace ol.control - */ module control { /** * @classdesc @@ -326,9 +261,6 @@ declare module ol { * By default it will show in the bottom right portion of the map, but this can * be changed by using a css selector for `.ol-attribution`. * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.AttributionOptions=} opt_options Attribution options. * @api stable */ class Attribution extends ol.control.Control { @@ -338,32 +270,24 @@ declare module ol { * in the map. This control is one of the default controls included in maps. * By default it will show in the bottom right portion of the map, but this can * be changed by using a css selector for `.ol-attribution`. - * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.AttributionOptions=} opt_options Attribution options. * @api stable */ constructor(opt_options?: olx.control.AttributionOptions); /** * Update the attribution element. - * @param {ol.MapEvent} mapEvent Map event. - * @this {ol.control.Attribution} * @api */ static render(mapEvent: ol.MapEvent): void; /** * Return `true` if the attribution is collapsible, `false` otherwise. - * @return {boolean} True if the widget is collapsible. * @api stable */ getCollapsible(): boolean; /** * Set whether the attribution should be collapsible. - * @param {boolean} collapsible True if the widget is collapsible. * @api stable */ setCollapsible(collapsible: boolean): void; @@ -372,7 +296,6 @@ declare module ol { * Collapse or expand the attribution according to the passed parameter. Will * not do anything if the attribution isn't collapsible or if the current * collapsed state is already the one requested. - * @param {boolean} collapsed True if the widget is collapsed. * @api stable */ setCollapsed(collapsed: boolean): void; @@ -380,7 +303,6 @@ declare module ol { /** * Return `true` when the attribution is currently collapsed or `false` * otherwise. - * @return {boolean} True if the widget is collapsed. * @api stable */ getCollapsed(): boolean; @@ -409,10 +331,6 @@ declare module ol { * You can also extend this base for your own control class. See * examples/custom-controls for an example of how to do this. * - * @constructor - * @extends {ol.Object} - * @implements {oli.control.Control} - * @param {olx.control.ControlOptions} options Control options. * @api stable */ class Control extends ol.Object { @@ -439,17 +357,12 @@ declare module ol { * You can also extend this base for your own control class. See * examples/custom-controls for an example of how to do this. * - * @constructor - * @extends {ol.Object} - * @implements {oli.control.Control} - * @param {olx.control.ControlOptions} options Control options. * @api stable */ constructor(options: olx.control.ControlOptions); /** * Get the map associated with this control. - * @return {ol.Map} Map. * @api stable */ getMap(): ol.Map; @@ -458,7 +371,6 @@ declare module ol { * Remove the control from its current map and attach it to the new map. * Subclasses may set up event handlers to get notified about changes to * the map here. - * @param {ol.Map} map Map. * @api stable */ setMap(map: ol.Map): void; @@ -469,7 +381,6 @@ declare module ol { * after `setMap` is called on the control). If no `target` is set in the * options passed to the control constructor and if `setTarget` is not called * then the control is added to the map's overlay container. - * @param {Element|string} target Target. * @api */ setTarget(target: (Element | string)): void; @@ -487,9 +398,6 @@ declare module ol { * toggle the map in full screen mode. * * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.FullScreenOptions=} opt_options Options. * @api stable */ class FullScreen extends ol.control.Control { @@ -505,9 +413,6 @@ declare module ol { * toggle the map in full screen mode. * * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.FullScreenOptions=} opt_options Options. * @api stable */ constructor(opt_options?: olx.control.FullScreenOptions); @@ -521,8 +426,6 @@ declare module ol { * * {@link ol.control.Rotate} * * {@link ol.control.Attribution} * - * @param {olx.control.DefaultsOptions=} opt_options Defaults options. - * @return {ol.Collection.} Controls. * @api stable */ function defaults(opt_options?: olx.control.DefaultsOptions): ol.Collection; @@ -534,9 +437,6 @@ declare module ol { * By default the control is shown in the top right corner of the map, but this * can be changed by using the css selector `.ol-mouse-position`. * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.MousePositionOptions=} opt_options Mouse position * options. * @api stable */ @@ -548,9 +448,6 @@ declare module ol { * By default the control is shown in the top right corner of the map, but this * can be changed by using the css selector `.ol-mouse-position`. * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.MousePositionOptions=} opt_options Mouse position * options. * @api stable */ @@ -558,8 +455,6 @@ declare module ol { /** * Update the mouseposition element. - * @param {ol.MapEvent} mapEvent Map event. - * @this {ol.control.MousePosition} * @api */ static render(mapEvent: ol.MapEvent): void; @@ -567,7 +462,6 @@ declare module ol { /** * Return the coordinate format type used to render the current position or * undefined. - * @return {ol.CoordinateFormatType|undefined} The format to render the current * position in. * @observable * @api stable @@ -576,7 +470,6 @@ declare module ol { /** * Return the projection that is used to report the mouse position. - * @return {ol.proj.Projection|undefined} The projection to report mouse * position in. * @observable * @api stable @@ -585,7 +478,6 @@ declare module ol { /** * Set the coordinate format type used to render the current position. - * @param {ol.CoordinateFormatType} format The format to render the current * position in. * @observable * @api stable @@ -594,7 +486,6 @@ declare module ol { /** * Set the projection that is used to report the mouse position. - * @param {ol.proj.Projection} projection The projection to report mouse * position in. * @observable * @api stable @@ -605,40 +496,30 @@ declare module ol { /** * Create a new control with a map acting as an overview map for an other * defined map. - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.OverviewMapOptions=} opt_options OverviewMap options. * @api */ class OverviewMap extends ol.control.Control { /** * Create a new control with a map acting as an overview map for an other * defined map. - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.OverviewMapOptions=} opt_options OverviewMap options. * @api */ constructor(opt_options?: olx.control.OverviewMapOptions); /** * Update the overview map element. - * @param {ol.MapEvent} mapEvent Map event. - * @this {ol.control.OverviewMap} * @api */ static render(mapEvent: ol.MapEvent): void; /** * Return `true` if the overview map is collapsible, `false` otherwise. - * @return {boolean} True if the widget is collapsible. * @api stable */ getCollapsible(): boolean; /** * Set whether the overview map should be collapsible. - * @param {boolean} collapsible True if the widget is collapsible. * @api stable */ setCollapsible(collapsible: boolean): void; @@ -647,21 +528,18 @@ declare module ol { * Collapse or expand the overview map according to the passed parameter. Will * not do anything if the overview map isn't collapsible or if the current * collapsed state is already the one requested. - * @param {boolean} collapsed True if the widget is collapsed. * @api stable */ setCollapsed(collapsed: boolean): void; /** * Determine if the overview map is collapsed. - * @return {boolean} The overview map is collapsed. * @api stable */ getCollapsed(): boolean; /** * Return the overview map. - * @return {ol.Map} Overview map. * @api */ getOverviewMap(): ol.Map; @@ -673,9 +551,6 @@ declare module ol { * To style this control use css selector `.ol-rotate`. A `.ol-hidden` css * selector is added to the button when the rotation is 0. * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.RotateOptions=} opt_options Rotate options. * @api stable */ class Rotate extends ol.control.Control { @@ -685,17 +560,12 @@ declare module ol { * To style this control use css selector `.ol-rotate`. A `.ol-hidden` css * selector is added to the button when the rotation is 0. * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.RotateOptions=} opt_options Rotate options. * @api stable */ constructor(opt_options?: olx.control.RotateOptions); /** * Update the rotate control element. - * @param {ol.MapEvent} mapEvent Map event. - * @this {ol.control.Rotate} * @api */ static render(mapEvent: ol.MapEvent): void; @@ -711,9 +581,6 @@ declare module ol { * By default the scale line will show in the bottom left portion of the map, * but this can be changed by using the css selector `.ol-scale-line`. * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.ScaleLineOptions=} opt_options Scale line options. * @api stable */ class ScaleLine extends ol.control.Control { @@ -727,16 +594,12 @@ declare module ol { * By default the scale line will show in the bottom left portion of the map, * but this can be changed by using the css selector `.ol-scale-line`. * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.ScaleLineOptions=} opt_options Scale line options. * @api stable */ constructor(opt_options?: olx.control.ScaleLineOptions); /** * Return the units to use in the scale line. - * @return {ol.control.ScaleLine.Units|undefined} The units to use in the scale * line. * @observable * @api stable @@ -745,15 +608,12 @@ declare module ol { /** * Update the scale line element. - * @param {ol.MapEvent} mapEvent Map event. - * @this {ol.control.ScaleLine} * @api */ static render(mapEvent: ol.MapEvent): void; /** * Set the units to use in the scale line. - * @param {ol.control.ScaleLine.Units} units The units to use in the scale line. * @observable * @api stable */ @@ -762,7 +622,6 @@ declare module ol { module ScaleLine { /** - * @enum {string} * @api */ type Property = string; @@ -770,7 +629,6 @@ declare module ol { /** * Units for the scale line. Supported values are `'degrees'`, `'imperial'`, * `'nautical'`, `'metric'`, `'us'`. - * @enum {string} */ type Units = "degrees" | "imperial" | "nautical" | "metric" | "us"; } @@ -781,9 +639,6 @@ declare module ol { * This control is one of the default controls of a map. To style this control * use css selectors `.ol-zoom-in` and `.ol-zoom-out`. * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.ZoomOptions=} opt_options Zoom options. * @api stable */ class Zoom extends ol.control.Control { @@ -793,9 +648,6 @@ declare module ol { * This control is one of the default controls of a map. To style this control * use css selectors `.ol-zoom-in` and `.ol-zoom-out`. * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.ZoomOptions=} opt_options Zoom options. * @api stable */ constructor(opt_options?: olx.control.ZoomOptions); @@ -809,9 +661,6 @@ declare module ol { * * map.addControl(new ol.control.ZoomSlider()); * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.ZoomSliderOptions=} opt_options Zoom slider options. * @api stable */ class ZoomSlider extends ol.control.Control { @@ -823,17 +672,12 @@ declare module ol { * * map.addControl(new ol.control.ZoomSlider()); * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.ZoomSliderOptions=} opt_options Zoom slider options. * @api stable */ constructor(opt_options?: olx.control.ZoomSliderOptions); /** * Update the zoomslider element. - * @param {ol.MapEvent} mapEvent Map event. - * @this {ol.control.ZoomSlider} * @api */ static render(mapEvent: ol.MapEvent): void; @@ -844,9 +688,6 @@ declare module ol { * A button control which, when pressed, changes the map view to a specific * extent. To style this control use the css selector `.ol-zoom-extent`. * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.ZoomToExtentOptions=} opt_options Options. * @api stable */ class ZoomToExtent extends ol.control.Control { @@ -855,18 +696,12 @@ declare module ol { * A button control which, when pressed, changes the map view to a specific * extent. To style this control use the css selector `.ol-zoom-extent`. * - * @constructor - * @extends {ol.control.Control} - * @param {olx.control.ZoomToExtentOptions=} opt_options Options. * @api stable */ constructor(opt_options?: olx.control.ZoomToExtentOptions); } } - /** - * @namespace ol.coordinate - */ module coordinate { /** * Add `delta` to `coordinate`. `coordinate` is modified in place and returned @@ -878,9 +713,6 @@ declare module ol { * ol.coordinate.add(coord, [-2, 4]); * // coord is now [5.85, 51.983333] * - * @param {ol.Coordinate} coordinate Coordinate. - * @param {ol.Coordinate} delta Delta. - * @return {ol.Coordinate} The input coordinate adjusted by the given delta. * @api stable */ function add(coordinate: ol.Coordinate, delta: ol.Coordinate): ol.Coordinate; @@ -903,9 +735,7 @@ declare module ol { * var out = stringifyFunc(coord); * // out is now '7.85, 47.98' * - * @param {number=} opt_fractionDigits The number of digits to include * after the decimal point. Default is `0`. - * @return {ol.CoordinateFormatType} Coordinate format. * @api stable */ function createStringXY(opt_fractionDigits?: number): ol.CoordinateFormatType; @@ -929,12 +759,8 @@ declare module ol { * var out = ol.coordinate.format(coord, template, 2); * // out is now 'Coordinate is (7.85|47.98).' * - * @param {ol.Coordinate|undefined} coordinate Coordinate. - * @param {string} template A template string with `{x}` and `{y}` placeholders * that will be replaced by first and second coordinate values. - * @param {number=} opt_fractionDigits The number of digits to include * after the decimal point. Default is `0`. - * @return {string} Formatted coordinate. * @api stable */ function format(coordinate: (ol.Coordinate), template: string, opt_fractionDigits?: number): string; @@ -950,9 +776,6 @@ declare module ol { * ol.coordinate.rotate(coord, rotateRadians); * // coord is now [-47.983333, 7.85] * - * @param {ol.Coordinate} coordinate Coordinate. - * @param {number} angle Angle in radian. - * @return {ol.Coordinate} Coordinate. * @api stable */ function rotate(coordinate: ol.Coordinate, angle: number): ol.Coordinate; @@ -973,10 +796,7 @@ declare module ol { * var out = ol.coordinate.toStringHDMS(coord, 1); * // out is now '47° 58′ 60.0″ N 7° 50′ 60.0″ E' * - * @param {ol.Coordinate|undefined} coordinate Coordinate. - * @param {number=} opt_fractionDigits The number of digits to include * after the decimal point. Default is `0`. - * @return {string} Hemisphere, degrees, minutes and seconds. * @api stable */ function toStringHDMS(coordinate?: ol.Coordinate, opt_fractionDigits?: number): string; @@ -996,10 +816,7 @@ declare module ol { * var out = ol.coordinate.toStringXY(coord, 1); * // out is now '7.8, 48.0' * - * @param {ol.Coordinate|undefined} coordinate Coordinate. - * @param {number=} opt_fractionDigits The number of digits to include * after the decimal point. Default is `0`. - * @return {string} XY. * @api stable */ function toStringXY(coordinate?: ol.Coordinate, opt_fractionDigits?: number): string; @@ -1055,9 +872,6 @@ declare module ol { * * @see {@link http://www.w3.org/TR/orientation-event/} * - * @constructor - * @extends {ol.Object} - * @param {olx.DeviceOrientationOptions=} opt_options Options. * @api */ class DeviceOrientation extends ol.Object { @@ -1111,16 +925,12 @@ declare module ol { * * @see {@link http://www.w3.org/TR/orientation-event/} * - * @constructor - * @extends {ol.Object} - * @param {olx.DeviceOrientationOptions=} opt_options Options. * @api */ constructor(opt_options?: olx.DeviceOrientationOptions); /** * Rotation around the device z-axis (in radians). - * @return {number|undefined} The euler angle in radians of the device from the * standard Z axis. * @observable * @api @@ -1129,7 +939,6 @@ declare module ol { /** * Rotation around the device x-axis (in radians). - * @return {number|undefined} The euler angle in radians of the device from the * planar X axis. * @observable * @api @@ -1138,7 +947,6 @@ declare module ol { /** * Rotation around the device y-axis (in radians). - * @return {number|undefined} The euler angle in radians of the device from the * planar Y axis. * @observable * @api @@ -1147,7 +955,6 @@ declare module ol { /** * The heading of the device relative to north (in radians). - * @return {number|undefined} The heading of the device relative to north, in * radians, normalizing for different browser behavior. * @observable * @api @@ -1156,7 +963,6 @@ declare module ol { /** * Determine if orientation is being tracked. - * @return {boolean} Changes in device orientation are being tracked. * @observable * @api */ @@ -1164,7 +970,6 @@ declare module ol { /** * Enable or disable tracking of device orientation events. - * @param {boolean} tracking The status of tracking changes to alpha, beta and * gamma. If true, changes are tracked and reported immediately. * @observable * @api @@ -1174,49 +979,38 @@ declare module ol { /** * Objects that need to clean up after themselves. - * @constructor */ class Disposable { /** * Objects that need to clean up after themselves. - * @constructor */ constructor(); } /** * Easing functions for {@link ol.animation}. - * @namespace ol.easing */ module easing { /** * Start slow and speed up. - * @param {number} t Input between 0 and 1. - * @return {number} Output between 0 and 1. * @api */ function easeIn(t: number): number; /** * Start fast and slow down. - * @param {number} t Input between 0 and 1. - * @return {number} Output between 0 and 1. * @api */ function easeOut(t: number): number; /** * Start slow, speed up, and then slow down again. - * @param {number} t Input between 0 and 1. - * @return {number} Output between 0 and 1. * @api */ function inAndOut(t: number): number; /** * Maintain a constant speed over time. - * @param {number} t Input between 0 and 1. - * @return {number} Output between 0 and 1. * @api */ function linear(t: number): number; @@ -1225,8 +1019,6 @@ declare module ol { * Start slow, speed up, and at the very end slow down again. This has the * same general behavior as {@link ol.easing.inAndOut}, but the final slowdown * is delayed. - * @param {number} t Input between 0 and 1. - * @return {number} Output between 0 and 1. * @api */ function upAndDown(t: number): number; @@ -1243,20 +1035,13 @@ declare module ol { * this can be configured in the listener registration function. * Some classes have their own event type, which return additional * properties; see the specific event class page for details. - * - * @namespace ol.events */ module events { - /** - * @namespace ol.events.condition - */ module condition { /** * Return `true` if only the alt-key is pressed, `false` otherwise (e.g. when * additionally the shift-key is pressed). * - * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. - * @return {boolean} True if only the alt key is pressed. * @api stable */ function altKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean; @@ -1265,8 +1050,6 @@ declare module ol { * Return `true` if only the alt-key and shift-key is pressed, `false` otherwise * (e.g. when additionally the platform-modifier-key is pressed). * - * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. - * @return {boolean} True if only the alt and shift keys are pressed. * @api stable */ function altShiftKeysOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean; @@ -1274,9 +1057,6 @@ declare module ol { /** * Return always true. * - * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. - * @return {boolean} True. - * @function * @api stable */ function always(mapBrowserEvent: ol.MapBrowserEvent): boolean; @@ -1284,8 +1064,6 @@ declare module ol { /** * Return `true` if the event is a `click` event, `false` otherwise. * - * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. - * @return {boolean} True if the event is a map `click` event. * @api stable */ function click(mapBrowserEvent: ol.MapBrowserEvent): boolean; @@ -1293,9 +1071,6 @@ declare module ol { /** * Return always false. * - * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. - * @return {boolean} False. - * @function * @api stable */ function never(mapBrowserEvent: ol.MapBrowserEvent): boolean; @@ -1304,8 +1079,6 @@ declare module ol { * Return `true` if the browser event is a `pointermove` event, `false` * otherwise. * - * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. - * @return {boolean} True if the browser event is a `pointermove` event. * @api */ function pointerMove(mapBrowserEvent: ol.MapBrowserEvent): boolean; @@ -1313,8 +1086,6 @@ declare module ol { /** * Return `true` if the event is a map `singleclick` event, `false` otherwise. * - * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. - * @return {boolean} True if the event is a map `singleclick` event. * @api stable */ function singleClick(mapBrowserEvent: ol.MapBrowserEvent): boolean; @@ -1322,8 +1093,6 @@ declare module ol { /** * Return `true` if the event is a map `dblclick` event, `false` otherwise. * - * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. - * @return {boolean} True if the event is a map `dblclick` event. * @api stable */ function doubleClick(mapBrowserEvent: ol.MapBrowserEvent): boolean; @@ -1332,8 +1101,6 @@ declare module ol { * Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is * pressed. * - * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. - * @return {boolean} True only if there no modifier keys are pressed. * @api stable */ function noModifierKeys(mapBrowserEvent: ol.MapBrowserEvent): boolean; @@ -1343,8 +1110,6 @@ declare module ol { * ctrl-key otherwise) is pressed, `false` otherwise (e.g. when additionally * the shift-key is pressed). * - * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. - * @return {boolean} True if only the platform modifier key is pressed. * @api stable */ function platformModifierKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean; @@ -1353,8 +1118,6 @@ declare module ol { * Return `true` if only the shift-key is pressed, `false` otherwise (e.g. when * additionally the alt-key is pressed). * - * @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event. - * @return {boolean} True if only the shift key is pressed. * @api stable */ function shiftKeyOnly(mapBrowserEvent: ol.MapBrowserEvent): boolean; @@ -1363,8 +1126,6 @@ declare module ol { * Return `true` if the target element is not editable, i.e. not a ``-, * `