From b6c343f2b39ea4f6a61ddd23abea390f455f4301 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 31 Mar 2017 11:01:26 -0700 Subject: [PATCH] Apply new lint rules to yet more packages (#15548) * Apply new lint rules to yet more packages * Fix leaflet lint --- .../bittorrent-protocol-tests.ts | 2 +- types/bittorrent-protocol/index.d.ts | 18 +- types/body-parser/index.d.ts | 4 +- .../bootstrap.v3.datetimepicker-tests.ts | 2 +- types/bootstrap.v3.datetimepicker/index.d.ts | 296 ++++----- types/camelcase-keys/camelcase-keys-tests.ts | 6 +- types/chunked-dc/index.d.ts | 10 +- types/clipboard/index.d.ts | 6 +- types/code/code-tests.ts | 2 +- types/code/index.d.ts | 2 +- types/codependency/codependency-tests.ts | 17 +- types/codependency/index.d.ts | 4 +- types/coinstring/coinstring-tests.ts | 58 +- types/colors/index.d.ts | 72 +-- types/colors/safe.d.ts | 2 +- types/connect-ensure-login/index.d.ts | 88 +-- .../convert-source-map-tests.ts | 4 +- types/convert-source-map/index.d.ts | 7 +- types/csv-stringify/csv-stringify-tests.ts | 1 - types/csv-stringify/index.d.ts | 1 - types/currency-formatter/currencies.d.ts | 2 +- .../currency-formatter-tests.ts | 1 - types/decay/decay-tests.ts | 2 +- types/deepmerge/deepmerge-tests.ts | 2 +- types/deepmerge/index.d.ts | 4 +- types/detect-port/detect-port-tests.ts | 3 +- .../discontinuous-range-tests.ts | 2 +- types/discontinuous-range/index.d.ts | 3 +- types/dropkickjs/dropkickjs-tests.ts | 52 +- types/dropkickjs/index.d.ts | 10 +- types/duplexer2/duplexer2-tests.ts | 6 +- types/freeport/freeport-tests.ts | 4 +- types/geojson/geojson-tests.ts | 3 - types/geojson/index.d.ts | 229 ++++--- types/geolib/index.d.ts | 3 +- types/geopattern/geopattern-tests.ts | 2 +- types/gettext.js/gettext.js-tests.ts | 4 +- types/gettext.js/index.d.ts | 24 +- types/gsap/gsap-tests.ts | 2 +- types/handsontable/index.d.ts | 568 +++++++++--------- types/har-format/index.d.ts | 1 - types/hoek/hoek-tests.ts | 5 +- types/hoek/index.d.ts | 7 +- types/in-range/in-range-tests.ts | 2 +- types/is-archive/is-archive-tests.ts | 2 +- types/is-array/is-array-tests.ts | 2 +- types/is-binary-path/is-binary-path-tests.ts | 2 +- types/is-compressed/is-compressed-tests.ts | 2 +- types/is-path-cwd/index.d.ts | 2 +- types/is-path-cwd/is-path-cwd-tests.ts | 2 +- .../is-relative-url/is-relative-url-tests.ts | 2 +- types/is-root-path/is-root-path-tests.ts | 2 +- types/is-text-path/is-text-path-tests.ts | 2 +- types/is-windows/is-windows-tests.ts | 2 +- types/jump.js/index.d.ts | 2 +- types/keycloak-js/index.d.ts | 14 +- types/leaflet-draw/leaflet-draw-tests.ts | 12 +- types/leaflet-fullscreen/index.d.ts | 2 +- .../leaflet-fullscreen-tests.ts | 4 +- types/leaflet/index.d.ts | 10 +- types/loopback-boot/index.d.ts | 4 +- types/loopback-boot/loopback-boot-tests.ts | 2 +- types/lorem-ipsum/index.d.ts | 2 +- types/ltx/index.d.ts | 2 +- types/lz-string/index.d.ts | 100 +-- types/math3d/index.d.ts | 2 +- types/mem/index.d.ts | 2 +- types/memoizee/index.d.ts | 6 +- types/meteor-collection-hooks/index.d.ts | 12 +- .../meteor-collection-hooks-tests.ts | 2 +- types/msgpack-lite/index.d.ts | 42 +- types/msgpack-lite/msgpack-lite-tests.ts | 36 +- types/nanoscroller/index.d.ts | 138 ++--- types/openfin/index.d.ts | 152 +++-- types/openfin/v15/tslint.json | 9 +- types/openfin/v16/tslint.json | 16 +- .../path-is-absolute-tests.ts | 2 +- types/payment/payment-tests.ts | 8 +- types/pbf/pbf-tests.ts | 4 +- types/pikaday-time/index.d.ts | 10 +- types/pikaday-time/pikaday-time-tests.ts | 8 +- types/pixi.js/index.d.ts | 4 +- types/plotly.js/index.d.ts | 295 +++++---- types/plotly.js/plotly.js-tests.ts | 2 +- types/proj4/index.d.ts | 22 +- types/proj4/proj4-tests.ts | 2 +- types/pulltorefreshjs/index.d.ts | 111 ++-- .../pulltorefreshjs/pulltorefreshjs-tests.ts | 2 +- types/query-string/index.d.ts | 61 +- types/range-parser/index.d.ts | 8 +- types/raw-body/index.d.ts | 6 +- types/readline-sync/index.d.ts | 6 +- types/redux-action/redux-action-tests.ts | 1 - types/redux-actions/redux-actions-tests.ts | 4 +- .../redux-persist-transform-encrypt-tests.ts | 22 +- .../redux-persist-transform-filter-tests.ts | 14 +- types/restify-plugins/index.d.ts | 10 +- types/rx-core-binding/index.d.ts | 38 +- types/rx-core/index.d.ts | 12 +- types/rx-lite-async/index.d.ts | 8 +- types/rx-lite-backpressure/index.d.ts | 40 +- types/rx-lite-coincidence/index.d.ts | 34 +- types/rx-lite-time/index.d.ts | 4 +- types/rx-lite/index.d.ts | 204 +++---- types/safe-regex/safe-regex-tests.ts | 2 +- types/semantic-ui/index.d.ts | 238 ++++---- types/semver-diff/index.d.ts | 2 +- types/semver/semver-tests.ts | 41 +- types/serialize-javascript/index.d.ts | 6 +- types/sheetify/sheetify-tests.ts | 6 +- types/shipit-utils/shipit-utils-tests.ts | 6 +- types/shipit/index.d.ts | 16 +- types/simple-oauth2/simple-oauth2-tests.ts | 8 +- types/slug/slug-tests.ts | 4 +- 114 files changed, 1727 insertions(+), 1678 deletions(-) diff --git a/types/bittorrent-protocol/bittorrent-protocol-tests.ts b/types/bittorrent-protocol/bittorrent-protocol-tests.ts index f5f6b4649f..c32b2af368 100644 --- a/types/bittorrent-protocol/bittorrent-protocol-tests.ts +++ b/types/bittorrent-protocol/bittorrent-protocol-tests.ts @@ -7,7 +7,7 @@ class TestExtension implements Protocol.Extension { } net.createServer(socket => { - var wire = new Protocol(); + const wire = new Protocol(); wire.use(TestExtension); diff --git a/types/bittorrent-protocol/index.d.ts b/types/bittorrent-protocol/index.d.ts index 6d838a90f5..b5ef1a4a44 100644 --- a/types/bittorrent-protocol/index.d.ts +++ b/types/bittorrent-protocol/index.d.ts @@ -10,30 +10,30 @@ import * as stream from 'stream'; declare const BittorrentProtocol: BittorrentProtocol.BittorrentProtocol; declare namespace BittorrentProtocol { - export interface BittorrentProtocol { + interface BittorrentProtocol { new (): Wire; (): Wire; } - export interface ExtensionConstructor { + interface ExtensionConstructor { new (wire: Wire): Extension; } - export interface Extension { - onHandshake?: (infoHash: string, peerId: string, extensions: { [name: string]: boolean }) => void; - onExtendedHandshake?: (handshake: { [key: string]: any }) => void; - onMessage?: (buf: Buffer) => void; + interface Extension { + onHandshake?(infoHash: string, peerId: string, extensions: { [name: string]: boolean }): void; + onExtendedHandshake?(handshake: { [key: string]: any }): void; + onMessage?(buf: Buffer): void; name: string; } - export interface Request { + interface Request { piece: number; offset: number; length: number; - callback: () => void; + callback(): void; } - export interface Wire extends stream.Duplex { + interface Wire extends stream.Duplex { readonly peerId: string; // remote peer id (hex string) readonly peerIdBuffer: Buffer; // remote peer id (Buffer) readonly type: 'webrtc' | 'tcpIncoming' | 'tcpOutgoing' | 'webSeed'; // connection type diff --git a/types/body-parser/index.d.ts b/types/body-parser/index.d.ts index 2b17b20ed4..54a9b463ed 100644 --- a/types/body-parser/index.d.ts +++ b/types/body-parser/index.d.ts @@ -17,11 +17,11 @@ declare namespace bodyParser { inflate?: boolean; limit?: number | string; type?: string | string[] | ((req: Request) => any); - verify?: (req: Request, res: Response, buf: Buffer, encoding: string) => void; + verify?(req: Request, res: Response, buf: Buffer, encoding: string): void; } interface OptionsJson extends Options { - reviever?: (key: string, value: any) => any; + reviever?(key: string, value: any): any; strict?: boolean; } diff --git a/types/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts b/types/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts index 70c8f8a586..9f2b780f44 100644 --- a/types/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts +++ b/types/bootstrap.v3.datetimepicker/bootstrap.v3.datetimepicker-tests.ts @@ -157,7 +157,7 @@ function inputParser(inputDate: string | Date | moment.Moment) { return moment(); } } -}; +} function test_parseInputDate() { let undef: undefined; diff --git a/types/bootstrap.v3.datetimepicker/index.d.ts b/types/bootstrap.v3.datetimepicker/index.d.ts index 653135057d..7b54c57dae 100644 --- a/types/bootstrap.v3.datetimepicker/index.d.ts +++ b/types/bootstrap.v3.datetimepicker/index.d.ts @@ -19,11 +19,11 @@ export as namespace BootstrapV3DatetimePicker; type InputParser = (input: string | Date | moment.Moment) => moment.Moment; export interface Datetimepicker { - /**Clears the datepicker by setting the value to null */ + /** Clears the datepicker by setting the value to null */ clear(): void; - /**Returns the component's model current date, a moment object or null if not set. */ + /** Returns the component's model current date, a moment object or null if not set. */ date(): moment.Moment; - /**Takes string, Date, moment, null parameter and sets the components model current moment to it. + /** Takes string, Date, moment, null parameter and sets the components model current moment to it. * Passing a null value unsets the components model current moment. * Parsing of the newDate parameter is made using moment library with the options.format and options.useStrict components configuration. * Throws: @@ -33,32 +33,34 @@ export interface Datetimepicker { * - dp.change - In case newDate is different from current moment */ date(date: moment.Moment | Date | string | null): void; - /**Destroys the widget and removes all attached event listeners */ + /** Destroys the widget and removes all attached event listeners */ destroy(): void; - /**Disables the input element, the component is attached to, by adding a disabled="true" attribute to it. If the widget was visible before that call it is hidden. + /** Disables the input element, the component is attached to, by adding a disabled="true" attribute to it. If the widget was visible before that call it is hidden. * Emits: * - dp.hide - if the widget was visible before that call */ disable(): void; - /**Enables the input element, the component is attached to, by removing disabled attribute from it. */ + /** Enables the input element, the component is attached to, by removing disabled attribute from it. */ enable(): void; - /**Hides the widget + /** Hides the widget * Emits: * - dp.hide - if the widget was visible before that call */ hide(): void; - /**Returns the components current options object. - * Note that the changing the values of the returned object does not change the components actual configuration. */ + /** + * Returns the components current options object. + * Note that the changing the values of the returned object does not change the components actual configuration. + */ options(): DatetimepickerOptions; - /**Takes an object variable with option key:value properties and configures the component. Use this to update multiple options on the component. */ + /** Takes an object variable with option key:value properties and configures the component. Use this to update multiple options on the component. */ options(options: DatetimepickerOptions): void; - /**Shows the widget + /** Shows the widget * Emits: * - dp.show - if the widget was hidden before that call * - dp.change - if the widget is opened for the first time and the useCurrent is set to true or to a granularity value and the input element the component is attached to has an empty value */ show(): void; - /**Shows or hides the widget + /** Shows or hides the widget * Emits: * - dp.hide - if the widget is hidden after the toggle call * - dp.show - if the widget is show after the toggle call @@ -70,97 +72,108 @@ export interface Datetimepicker { //// Below are the getters/setters for the properties of the 'options(): DatetimepickerOptions' //// //////////////////////////////////////////////////////////////////////////////////////////////////// - /**Returns the options.allowInputToggle option. */ + /** Returns the options.allowInputToggle option. */ allowInputToggle(): boolean; - /**If true, the picker will show on textbox focus and icon click when used in a button group */ + /** If true, the picker will show on textbox focus and icon click when used in a button group */ allowInputToggle(value: boolean): void; - /**Returns the current options.calendarWeeks option configuration */ + /** Returns the current options.calendarWeeks option configuration */ calendarWeeks(): boolean; - /**Set if the week numbers will appear to the left on the days view */ + /** Set if the week numbers will appear to the left on the days view */ calendarWeeks(value: boolean): void; - /**Returns the options.collapse option configuration */ + /** Returns the options.collapse option configuration */ collapse(): boolean; - /**If set to false the picker will display similar to sideBySide except vertical. */ + /** If set to false the picker will display similar to sideBySide except vertical. */ collapse(value: boolean): void; - /**Returns the options.daysOfWeekDisabled configuration + /** + * Returns the options.daysOfWeekDisabled configuration * IMPORTANT! Throws exception if not set explicitly https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1459 - */ + */ daysOfWeekDisabled(): number[]; - /**Takes an [ Number:0 to 6 ] and disallow the user to select weekdays that exist in this array. + /** Takes an [ Number:0 to 6 ] and disallow the user to select weekdays that exist in this array. * This has lower priority over the options.minDate, options.maxDate, options.disabledDates and options.enabledDates configuration settings. * Emits: * - dp.change - if the currently selected moment falls in the values passed on the daysOfWeek parameter. * - dp.error - if the currently selected moment falls in the values passed on the daysOfWeek parameter. */ daysOfWeekDisabled(days: number[]): void; - /**Returns the options.dayViewHeaderFormat option. */ + /** Returns the options.dayViewHeaderFormat option. */ dayViewHeaderFormat(): string; - /**Used to customize the header of the day view. */ + /** Used to customize the header of the day view. */ dayViewHeaderFormat(value: string): void; - /**Returns a moment with the options.defaultDate option configuration or false if not set */ + /** Returns a moment with the options.defaultDate option configuration or false if not set */ defaultDate(): moment.Moment | boolean; - /**Will set the picker's inital date. + /** + * Will set the picker's inital date. * If a boolean:false value is passed the options.defaultDate parameter is cleared. * Throws: * - TypeError - if the provided date doesn't pass validation, including disabledDates, enabledDates, minDate, maxDate, and daysOfWeekDisabled * - TypeError - if the provided date cannot be parsed by momentjs */ defaultDate(date: string | Date | moment.Moment | boolean): void; - /**Returns the options.disabledDates option. + /** + * Returns the options.disabledDates option. * NOTES: probably should be: disabledDates(): boolean | Array; see: DatetimepickerOptions - */ + */ disabledDates(): boolean | any; - /**Takes an array of values and disallows the user to select those days. + /** + * Takes an array of values and disallows the user to select those days. * Setting this takes precedence over options.minDate, options.maxDate configuration. * Also calling this function removes the configuration of options.enabledDates if such exist. * Note: These values are matched with Day granularity. */ disabledDates(dates: boolean | Array): void; - /**Returns the options.disabledHours option. + /** + * Returns the options.disabledHours option. * NOTES: probably should be: disabledHours(): boolean | number[]; see: DatetimepickerOptions - */ + */ disabledHours(): boolean | any; - /**Must be in 24 hour format. Will disallow hour selections (much like disabledTimeIntervals) but will affect all days. - * Like en/disabledDates, the en/disabledHours options are mutually exclusive and will reset one of the options back to false. */ + /** + * Must be in 24 hour format. Will disallow hour selections (much like disabledTimeIntervals) but will affect all days. + * Like en/disabledDates, the en/disabledHours options are mutually exclusive and will reset one of the options back to false. + */ disabledHours(value: boolean | number[]): void; - /**Returns the options.disabledTimeIntervals option, or... not exactly + /** Returns the options.disabledTimeIntervals option, or... not exactly * IMPORTANT! Creates an object from the options.disabledTimeIntervals with the keys being numbers, the values being the moment arrays. * eg { "0": [, ], "1": [...] } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1498 */ disabledTimeIntervals(): boolean | moment.Moment[][]; - /**Disables time selection between the given moments + /** Disables time selection between the given moments * eg: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]] */ disabledTimeIntervals(value: boolean | moment.Moment[][]): void; - /**Returns the options.enabledDates option + /** + * Returns the options.enabledDates option * NOTES: probably should be: enabledDates(): boolean | Array; see: DatetimepickerOptions - */ + */ enabledDates(): boolean | any; - /**Takes an array of values and allows the user to select only from those days. + /** Takes an array of values and allows the user to select only from those days. * Setting this takes precedence over options.minDate, options.maxDate configuration. * Also calling this function removes the configuration of options.disabledDates if such exist. * Note: These values are matched with Day granularity. */ enabledDates(dates: boolean | Array): void; - /**Returns the options.enabledHours option. + /** + * Returns the options.enabledHours option. * NOTES: probably should be: enabledHours(): boolean | number[]; see: DatetimepickerOptions - */ + */ enabledHours(): boolean | any; - /**Must be in 24 hour format. Will allow hour selections (much like enabledTimeIntervals) but will affect all days. - * Like en/disabledDates, the en/disabledHours options are mutually exclusive and will reset one of the options back to false. */ + /** + * Must be in 24 hour format. Will allow hour selections (much like enabledTimeIntervals) but will affect all days. + * Like en/disabledDates, the en/disabledHours options are mutually exclusive and will reset one of the options back to false. + */ enabledHours(value: boolean | number[]): void; - /**Returns a boolean or array with the options.extraFormats option configuration */ + /** Returns a boolean or array with the options.extraFormats option configuration */ extraFormats(): boolean | Array; - /**Takes an array of valid input moment format options, or boolean:false */ + /** Takes an array of valid input moment format options, or boolean:false */ extraFormats(formats: boolean | Array): void; - /**Returns the options.focusOnShow option. */ + /** Returns the options.focusOnShow option. */ focusOnShow(): boolean; - /**If false, the textbox will not be given focus when the picker is shown */ + /** If false, the textbox will not be given focus when the picker is shown */ focusOnShow(value: boolean): void; - /**Returns the component's options.format string */ + /** Returns the component's options.format string */ format(): boolean | string | moment.MomentBuiltinFormat; - /**Takes a moment.js format string and sets the components options.format. + /** Takes a moment.js format string and sets the components options.format. * This is used for displaying and also for parsing input strings either from the input element the component is attached to or the date() function. * The parameter can also be a boolean:false in which case the format is set to the locale's L LT. * Note: this is also used to determine if the TimePicker sub component will display the hours in 12 or 24 format. (if "a" or "h" exists in the passed string then a 12 hour mode is set) @@ -168,40 +181,41 @@ export interface Datetimepicker { * - TypeError - if format is boolean:true */ format(format: boolean | string | moment.MomentBuiltinFormat): void; - /**Returns options.icons */ + /** Returns options.icons */ icons(): Icons; - /**Takes an Object of strings. + /** Takes an Object of strings. * Throws: * - TypeError - if icons parameter is not an Object */ icons(icons: Icons): void; - /**Returns the options.ignoreReadonly option. */ + /** Returns the options.ignoreReadonly option. */ ignoreReadonly(): boolean; - /**Set this to true to allow the picker to be used even if the input field is readonly. This will not bypass the disabled property */ + /** Set this to true to allow the picker to be used even if the input field is readonly. This will not bypass the disabled property */ ignoreReadonly(value: boolean): void; - /**Returns the options.inline option. */ + /** Returns the options.inline option. */ inline(): boolean; - /**Used to customize the header of the day view. */ + /** Used to customize the header of the day view. */ inline(value: boolean): void; - /**Returns the options.keepInvalid option. */ + /** Returns the options.keepInvalid option. */ keepInvalid(): boolean; - /**If true, invalid dates will not be reverted to a previous selection or changed. */ + /** If true, invalid dates will not be reverted to a previous selection or changed. */ keepInvalid(value: boolean): void; - /**Returns a string variable with the currently set options.keyBinds option. */ + /** Returns a string variable with the currently set options.keyBinds option. */ keyBinds(): any; - /**Allows for several keyBinding functions to be specified for ease of access or accessibility. For defaults see {@link http://eonasdan.github.io/bootstrap-datetimepicker/Options/#keybinds}. - */ + /** + * Allows for several keyBinding functions to be specified for ease of access or accessibility. For defaults see {@link http://eonasdan.github.io/bootstrap-datetimepicker/Options/#keybinds}. + */ keyBinds(value: any): void; - /**Returns the currently set locale of the options.locale */ + /** Returns the currently set locale of the options.locale */ locale(): string; - /**Takes a string of any valid moment locale e.g. de for German. + /** Takes a string of any valid moment locale e.g. de for German. * Throws: * - TypeError - if the locale is not loaded via a separate script or moment-with-locale */ locale(newLocale: string): void; - /**Returns the currently set moment of the options.maxDate or false if not set */ + /** Returns the currently set moment of the options.maxDate or false if not set */ maxDate(): moment.Moment | boolean; - /**Takes a parameter and disallows the user to select a moment that is after that moment. + /** Takes a parameter and disallows the user to select a moment that is after that moment. * If a boolean:false value is passed options.maxDate is cleared and there is no restriction to the maximum moment the user can select. * Note: If the parameter is before the currently selected moment the currently selected moment changes to maxDate * Throws: @@ -213,9 +227,9 @@ export interface Datetimepicker { * - dp.error - if the new maxDate is after currently selected moment */ maxDate(date: moment.Moment | Date | string | boolean): void; - /**Returns the currently set moment of the options.minDate or false if not set */ + /** Returns the currently set moment of the options.minDate or false if not set */ minDate(): moment.Moment | boolean; - /**Takes a parameter and disallows the user to select a moment that is before that moment. + /** Takes a parameter and disallows the user to select a moment that is before that moment. * If a boolean:false value is passed the options.minDate parameter is cleared and there is no restriction to the miminum moment the user can select. * Note: If the parameter is after the currently selected moment the currently selected moment changes to minDate parameter * Throws: @@ -227,31 +241,31 @@ export interface Datetimepicker { * - dp.error - if the new minDate is after currently selected moment */ minDate(date: moment.Moment | Date | string | boolean): void; - /**Returns the options.parseInputDate option */ + /** Returns the options.parseInputDate option */ parseInputDate(): InputParser | undefined; - /**Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". + /** Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". * {@link http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#parseinputdate} */ parseInputDate(value: InputParser): void; - /**Returns the options.showClear option. */ + /** Returns the options.showClear option. */ showClear(): boolean; - /**Set if the clear date button will appear on the widget */ + /** Set if the clear date button will appear on the widget */ showClear(value: boolean): void; - /**Returns the options.showClose option. */ + /** Returns the options.showClose option. */ showClose(): boolean; - /**If true, an icon will be displayed on the toolbar that will hide the picker */ + /** If true, an icon will be displayed on the toolbar that will hide the picker */ showClose(value: boolean): void; - /**Returns the options.showTodayButton option. */ + /** Returns the options.showTodayButton option. */ showTodayButton(): boolean; - /**Set if the Today button will appear on the widget */ + /** Set if the Today button will appear on the widget */ showTodayButton(value: boolean): void; - /**Returns a boolean of the options.sideBySide. */ + /** Returns a boolean of the options.sideBySide. */ sideBySide(): boolean; - /**If sideBySide is true and the time picker is used, both components will display side by side instead of collapsing. */ + /** If sideBySide is true and the time picker is used, both components will display side by side instead of collapsing. */ sideBySide(value: boolean): void; - /**Returns a number with the options.stepping option configuration */ + /** Returns a number with the options.stepping option configuration */ stepping(): number; - /**This will be the amount the up/down arrows move the minute value with a time picker. */ + /** This will be the amount the up/down arrows move the minute value with a time picker. */ stepping(step: number): void; /** Returns a string of options.timeZone */ timeZone(): string | null; @@ -260,24 +274,24 @@ export interface Datetimepicker { * - TypeError - if tooltips parameter is not a string or null */ timeZone(timeZone: string | null): void; - /**Returns the options.toolbarplacement option. */ + /** Returns the options.toolbarplacement option. */ toolbarPlacement(): string; - /**Changes the placement of the toolbar where the today, clear, component switch icon are located. + /** Changes the placement of the toolbar where the today, clear, component switch icon are located. * See valid values at DatetimepickerOptions.toolbarplacement * Throws: * - TypeError - if the parameter is not a valid value */ toolbarPlacement(value: string): void; - /**Returns the options.tooltips option */ + /** Returns the options.tooltips option */ tooltips(): Tooltips; - /**Sets the tooltips for icons. + /** Sets the tooltips for icons. * Throws: * - TypeError - if tooltips parameter is not an Object */ tooltips(value: Tooltips): void; - /**Returns the options.useCurrent option configuration */ + /** Returns the options.useCurrent option configuration */ useCurrent(): boolean | string; - /**Takes a boolean or string. + /** Takes a boolean or string. * If a boolean true is passed and the components model moment is not set (either through setDate or through a valid value on the input element the component is attached to) * then the first time the user opens the datetimepicker widget the value is initialized to the current moment of the action. * If a false boolean is passed then no initialization happens on the input element. @@ -287,28 +301,28 @@ export interface Datetimepicker { * Note: If the options.defaultDate is set or the input element the component is attached to has already a value that takes precedence and the functionality of useCurrent is not triggered! */ useCurrent(value: boolean | string): void; - /**Returns the options.useStrict */ + /** Returns the options.useStrict */ useStrict(): boolean; - /**If useStrict is true, momentjs parsing rules will be stricter when determining if a date is valid or not. */ + /** If useStrict is true, momentjs parsing rules will be stricter when determining if a date is valid or not. */ useStrict(value: boolean): void; - /**Returns the options.viewDate option. */ + /** Returns the options.viewDate option. */ viewDate(): boolean | moment.Moment; - /**This will change the viewDate without changing or setting the selected date. */ + /** This will change the viewDate without changing or setting the selected date. */ viewDate(value: string | Date | moment.Moment | boolean): void; - /**Returns the options.viewMode. */ + /** Returns the options.viewMode. */ viewMode(): string; - /**Takes a string. See valid values at DatetimepickerOptions.viewMode + /** Takes a string. See valid values at DatetimepickerOptions.viewMode * Throws: * - TypeError - if the parameter is not a string or not a valid value */ viewMode(value: string): void; - /**Returns a $(element) variable with the currently set options.widgetParent option. */ + /** Returns a $(element) variable with the currently set options.widgetParent option. */ widgetParent(): string | JQuery | null; - /**Takes a string or $(element) value. */ + /** Takes a string or $(element) value. */ widgetParent(widgetParent: string | JQuery | null): void; - /**Returns the options.widgetPositioning object */ + /** Returns the options.widgetPositioning object */ widgetPositioning(): WidgetPositioningOptions; - /**WidgetPositioning defines where the dropdown with the widget will appear relative to the input element the component is attached to. + /** WidgetPositioning defines where the dropdown with the widget will appear relative to the input element the component is attached to. * "auto" is the default value for both horizontal and vertical keys and it tries to automatically place the dropdown in a position that is visible to the user. * Usually you should not override those options unless you have a special need in your layout. */ @@ -316,91 +330,91 @@ export interface Datetimepicker { } export interface DatetimepickerOptions { - /**If true, the picker will show on textbox focus and icon click when used in a button group + /** If true, the picker will show on textbox focus and icon click when used in a button group * @default: false */ allowInputToggle?: boolean; - /**Shows the week of the year to the left of first day of the week. + /** Shows the week of the year to the left of first day of the week. * @default: false */ calendarWeeks?: boolean; - /**Using a Bootstraps collapse to switch between date/time pickers. + /** Using a Bootstraps collapse to switch between date/time pickers. * @default: true */ collapse?: boolean; - /**Disables the section of days of the week, e.g. weekends. + /** Disables the section of days of the week, e.g. weekends. * Accepts: array of numbers from 0-6 * @default: false */ daysOfWeekDisabled?: number[] | boolean; - /**Changes the heading of the datepicker when in "days" view. + /** Changes the heading of the datepicker when in "days" view. * @default: "MMMM YYYY" */ dayViewHeaderFormat?: string; - /**Will cause the date picker to stay open after a blur event. + /** Will cause the date picker to stay open after a blur event. * @default: false */ debug?: boolean; - /**Sets the picker default date/time. Overrides useCurrent + /** Sets the picker default date/time. Overrides useCurrent * @default: false */ defaultDate?: boolean | moment.Moment | Date | string; - /**Disables selection of dates in the array, e.g. holidays + /** Disables selection of dates in the array, e.g. holidays * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true. * eg disabledDates = ["2010-10-10"]; -> disabledDated will be { "2010-01-01": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ disabledDates?: boolean | Array | any; - /**Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days + /** Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true. * eg disabledHours = [0, 1]; -> disabledHours will be { "0": true, "1": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ disabledHours?: boolean | number[] | any; - /**Disables time selection between the given moments + /** Disables time selection between the given moments * eg: [[moment({ h: 0 }), moment({ h: 8 })], [moment({ h: 18 }), moment({ h: 24 })]] * @default: false */ disabledTimeIntervals?: boolean | moment.Moment[][]; - /**Disables selection of dates NOT in the array, e.g. holidays + /** Disables selection of dates NOT in the array, e.g. holidays * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the dates, values being true. * eg enabledDates = ["2010-10-10"]; -> enabledDated will be { "2010-01-01": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ enabledDates?: boolean | Array | any; - /**Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days + /** Will allow or disallow hour selections (much like disabledTimeIntervals) but will affect all days * @default: false * IMPORTANT! The getter returns an Object NOT an Array, with keys being the hours, values being true. * eg enabledHours = [0, 1]; -> enabledHours will be { "0": true, "1": true } * https://github.com/Eonasdan/bootstrap-datetimepicker/issues/1499 */ enabledHours?: boolean | number[]; - /**Allows for several input formats to be valid. See: https://github.com/Eonasdan/bootstrap-datetimepicker/pull/666 + /** Allows for several input formats to be valid. See: https://github.com/Eonasdan/bootstrap-datetimepicker/pull/666 * @default: false */ extraFormats?: boolean | Array; - /**If false, the textbox will not be given focus when the picker is shown + /** If false, the textbox will not be given focus when the picker is shown * @default: true */ focusOnShow?: boolean; - /**See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker. + /** See momentjs' docs for valid formats. Format also dictates what components are shown, e.g. MM/dd/YYYY will not display the time picker. * @default: false */ format?: boolean | string | moment.MomentBuiltinFormat; - /**Change the default icons for the pickers functions. */ + /** Change the default icons for the pickers functions. */ icons?: Icons; - /**Allow date picker show event to fire even when the associated input element has the readonly="readonly"property. + /** Allow date picker show event to fire even when the associated input element has the readonly="readonly"property. * @default: false */ ignoreReadonly?: boolean; - /**Will display the picker inline without the need of a input field. This will also hide borders and shadows. + /** Will display the picker inline without the need of a input field. This will also hide borders and shadows. * @default: false */ inline?: boolean; - /**Allows for custom events to fire on keyboard press. + /** Allows for custom events to fire on keyboard press. * eg: keybinds: { * up: (widget) => console.log(widget), * "control up": (widget) => console.log(widget) @@ -408,52 +422,52 @@ export interface DatetimepickerOptions { * The widget parameter is false, if the datepicker is closed. */ keyBinds?: { [key: string]: (widget: boolean | JQuery) => void }; - /**Will cause the date picker to not revert or overwrite invalid dates. + /** Will cause the date picker to not revert or overwrite invalid dates. * @default: false */ keepInvalid?: boolean; - /**Will cause the date picker to stay open after selecting a date if no time components are being used. + /** Will cause the date picker to stay open after selecting a date if no time components are being used. * @default: false */ keepOpen?: boolean; - /**See momentjs for valid locales. You must include moment-with-locales.js or a local js file. + /** See momentjs for valid locales. You must include moment-with-locales.js or a local js file. * @default: moment.locale() */ locale?: string; - /**Prevents date/time selections after this date. + /** Prevents date/time selections after this date. * maxDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected. * @default: false */ maxDate?: boolean | moment.Moment | Date | string; - /**Prevents date/time selections before this date. + /** Prevents date/time selections before this date. * minDate will override defaultDate and useCurrent if either of these settings are the same day since both options are invalid according to the rules you've selected. * @default: false */ minDate?: boolean | moment.Moment | Date | string; - /**Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". + /** Allows custom input formatting For example: the user can enter "yesterday"" or "30 days ago". * {@link http://eonasdan.github.io/bootstrap-datetimepicker/Functions/#parseinputdate} */ parseInputDate?: InputParser; - /**Show the "Clear" button in the icon toolbar. + /** Show the "Clear" button in the icon toolbar. * Clicking the "Clear" button will set the calendar to null. * @default: false */ showClear?: boolean; - /**Show the "Close" button in the icon toolbar. + /** Show the "Close" button in the icon toolbar. * Clicking the "Close" button will call hide() * @default: false */ showClose?: boolean; - /**Show the "Today" button in the icon toolbar. + /** Show the "Today" button in the icon toolbar. * Clicking the "Today" button will set the calendar view and set the date to now. * @default: false */ showTodayButton?: boolean; - /**Shows the picker side by side when using the time and date together. + /** Shows the picker side by side when using the time and date together. * @default: false */ sideBySide?: boolean; - /**Number of minutes the up/down arrow's will move the minutes value in the time picker + /** Number of minutes the up/down arrow's will move the minutes value in the time picker * @default: 1 */ stepping?: number; @@ -462,30 +476,30 @@ export interface DatetimepickerOptions { * @default: "" */ timeZone?: string | null; - /**Changes the placement of the icon toolbar. + /** Changes the placement of the icon toolbar. * @default: "default" */ toolbarPlacement?: "default" | "top" | "bottom"; - /**This will change the tooltips over each icon to a custom string */ + /** This will change the tooltips over each icon to a custom string */ tooltips?: Tooltips; - /**On show, will set the picker to the current date/time + /** On show, will set the picker to the current date/time * @default: true */ useCurrent?: boolean; - /**Defines if moment should use strict date parsing when considering a date to be valid + /** Defines if moment should use strict date parsing when considering a date to be valid * @default: false */ useStrict?: boolean; - /**This will change the viewDate without changing or setting the selected date. + /** This will change the viewDate without changing or setting the selected date. * @default: false */ viewDate?: boolean | moment.Moment | Date | string; - /**The default view to display when the picker is shown. + /** The default view to display when the picker is shown. * Note: To limit the picker to selecting, for instance the year and month, use format: MM/YYYY * @default: "days" */ viewMode?: "decades" | "years" | "months" | "days"; - /**On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: "relative" + /** On picker show, places the widget at the identifier (string) or jQuery object if the element has css position: "relative" * @default: null */ widgetParent?: string | JQuery | null; @@ -493,23 +507,23 @@ export interface DatetimepickerOptions { } export interface Icons { - /**default: "glyphicon glyphicon-trash" */ + /** default: "glyphicon glyphicon-trash" */ clear?: string; - /**default: "glyphicon glyphicon-remove" */ + /** default: "glyphicon glyphicon-remove" */ close?: string; - /**default: "glyphicon glyphicon-calendar" */ + /** default: "glyphicon glyphicon-calendar" */ date?: string; - /**default: "glyphicon glyphicon-time" */ + /** default: "glyphicon glyphicon-time" */ down?: string; - /**default: "glyphicon glyphicon-chevron-left" */ + /** default: "glyphicon glyphicon-chevron-left" */ next?: string; - /**default: "glyphicon glyphicon-screenshot" */ + /** default: "glyphicon glyphicon-screenshot" */ previous?: string; - /**default: "glyphicon glyphicon-chevron-right" */ + /** default: "glyphicon glyphicon-chevron-right" */ time?: string; - /**default: "glyphicon glyphicon-chevron-down" */ + /** default: "glyphicon glyphicon-chevron-down" */ today?: string; - /**default: "glyphicon glyphicon-chevron-up" */ + /** default: "glyphicon glyphicon-chevron-up" */ up?: string; } @@ -551,14 +565,14 @@ export interface Event extends JQueryEventObject { } export interface ChangeEvent extends Event { - /**Previous date. False if the previous date is null. */ + /** Previous date. False if the previous date is null. */ oldDate: moment.Moment | boolean; } export interface UpdateEvent extends JQueryEventObject { - /**Change type as a momentjs format token. e.g. yyyy on year change */ + /** Change type as a momentjs format token. e.g. yyyy on year change */ change: string; - /**New viewDate. */ + /** New viewDate. */ viewDate: moment.Moment; } diff --git a/types/camelcase-keys/camelcase-keys-tests.ts b/types/camelcase-keys/camelcase-keys-tests.ts index ed2865e9ce..099b8c4a14 100644 --- a/types/camelcase-keys/camelcase-keys-tests.ts +++ b/types/camelcase-keys/camelcase-keys-tests.ts @@ -3,8 +3,8 @@ import camelcaseKeys = require('camelcase-keys'); camelcaseKeys({'foo-bar': true}); // => {fooBar: true} -camelcaseKeys({'foo-bar': true, 'nested': {unicorn_rainbow: true}}, {deep: true}); +camelcaseKeys({'foo-bar': true, nested: {unicorn_rainbow: true}}, {deep: true}); // => {fooBar: true, nested: {unicornRainbow: true}} -camelcaseKeys({'_': [], 'foo-bar': true}); -// => {_: [], fooBar: true} \ No newline at end of file +camelcaseKeys({_: [], 'foo-bar': true}); +// => {_: [], fooBar: true} diff --git a/types/chunked-dc/index.d.ts b/types/chunked-dc/index.d.ts index ab3acd6901..d200c07899 100644 --- a/types/chunked-dc/index.d.ts +++ b/types/chunked-dc/index.d.ts @@ -5,14 +5,13 @@ // Interfaces declare namespace chunkedDc { - - /** common.ts **/ + /** common.ts */ interface CommonStatic { HEADER_LENGTH: number; } - /** chunker.ts **/ + /** chunker.ts */ interface Chunker extends IterableIterator { hasNext: boolean; @@ -24,7 +23,7 @@ declare namespace chunkedDc { new(id: number, message: Uint8Array, chunkSize: number): Chunker; } - /** unchunker.ts **/ + /** unchunker.ts */ type MessageListener = (message: Uint8Array, context?: any) => void; @@ -38,13 +37,12 @@ declare namespace chunkedDc { new(): Unchunker; } - /** main.ts **/ + /** main.ts */ interface Standalone { Chunker: ChunkerStatic; Unchunker: UnchunkerStatic; } - } // Entry point for the packed ES5 version: diff --git a/types/clipboard/index.d.ts b/types/clipboard/index.d.ts index 5f12a41d5f..861d8c326b 100644 --- a/types/clipboard/index.d.ts +++ b/types/clipboard/index.d.ts @@ -27,21 +27,21 @@ declare namespace Clipboard { * @param {Element} elem Current element * @returns {String} Only 'cut' or 'copy'. */ - action?: (elem: Element) => string; + action?(elem: Element): string; /** * Overwrites default target input element. * @param {Element} elem Current element * @returns {Element} element to use. */ - target?: (elem: Element) => Element; + target?(elem: Element): Element; /** * Returns the explicit text to copy. * @param {Element} elem Current element * @returns {String} Text to be copied. */ - text?: (elem: Element) => string; + text?(elem: Element): string; } interface Event { diff --git a/types/code/code-tests.ts b/types/code/code-tests.ts index c3455577d9..1c2fa78fe5 100644 --- a/types/code/code-tests.ts +++ b/types/code/code-tests.ts @@ -16,7 +16,7 @@ expect([1, 2, 3]).to.part.include([1, 4]); expect(10, "Age").to.be.above(5); -const func = function() { return arguments; }; +const func = function() { return arguments; }; // tslint:disable-line only-arrow-functions expect(func()).to.be.arguments(); expect([1, 2]).to.be.an.array(); diff --git a/types/code/index.d.ts b/types/code/index.d.ts index dacd122915..a17f844d3a 100644 --- a/types/code/index.d.ts +++ b/types/code/index.d.ts @@ -174,7 +174,7 @@ interface Settings { /** * Truncate long assertion error messages for readability? * Defaults to true. - */ + */ truncateMessages?: boolean; /** * Ignore object prototypes when doing a deep comparison? diff --git a/types/codependency/codependency-tests.ts b/types/codependency/codependency-tests.ts index e0f8a793a6..2d39f4be52 100644 --- a/types/codependency/codependency-tests.ts +++ b/types/codependency/codependency-tests.ts @@ -1,8 +1,9 @@ -let requirePeer = codependency.register(module), package: any; - requirePeer = codependency.register(module, {index: ["dependencies", "devDependencies"]}); - requirePeer = codependency.get("some-middleware"); - package = requirePeer("some-peer-dependency-package"); - package = requirePeer("some-peer-dependency-package", {optional: true}); - package = requirePeer("some-peer-dependency-package", {dontThrow: true}); - package = requirePeer("some-peer-dependency-package", {optional: true, dontThrow: true}); - package = requirePeer.resolve("peer-package-name"); \ No newline at end of file +let requirePeer = codependency.register(module); +let package: any; +requirePeer = codependency.register(module, {index: ["dependencies", "devDependencies"]}); +requirePeer = codependency.get("some-middleware"); +package = requirePeer("some-peer-dependency-package"); +package = requirePeer("some-peer-dependency-package", {optional: true}); +package = requirePeer("some-peer-dependency-package", {dontThrow: true}); +package = requirePeer("some-peer-dependency-package", {optional: true, dontThrow: true}); +package = requirePeer.resolve("peer-package-name"); diff --git a/types/codependency/index.d.ts b/types/codependency/index.d.ts index 2ec424588d..c533a52e8e 100644 --- a/types/codependency/index.d.ts +++ b/types/codependency/index.d.ts @@ -22,8 +22,8 @@ interface RequirePeerFunctionOptions { interface RequirePeerFunction { (name: string, options?: RequirePeerFunctionOptions): any; - resolve: (name: string) => DependencyInfo; + resolve(name: string): DependencyInfo; } export function register(baseModule: NodeModule, options?: {index: string[]}): RequirePeerFunction; -export function get(middlewareName: string): RequirePeerFunction; \ No newline at end of file +export function get(middlewareName: string): RequirePeerFunction; diff --git a/types/coinstring/coinstring-tests.ts b/types/coinstring/coinstring-tests.ts index 1cc3fb9a42..556fe1bfc6 100644 --- a/types/coinstring/coinstring-tests.ts +++ b/types/coinstring/coinstring-tests.ts @@ -1,66 +1,62 @@ import cs = require('coinstring'); -var privateKeyHex = "1184cd2cdd640ca42cfc3a091c51d549b2f016d454b2774019c2b2d2e08529fd"; -var privateKeyHexBuf = new Buffer(privateKeyHex, 'hex'); -var version = 0x80; // Bitcoin private key +let privateKeyHex = "1184cd2cdd640ca42cfc3a091c51d549b2f016d454b2774019c2b2d2e08529fd"; +let privateKeyHexBuf = new Buffer(privateKeyHex, 'hex'); +let version = 0x80; // Bitcoin private key console.log(cs.encode(privateKeyHexBuf, version)); // => 5Hx15HFGyep2CfPxsJKe2fXJsCVn5DEiyoeGGF6JZjGbTRnqfiD -var hash160 = "3c176e659bea0f29a3e9bf7880c112b1b31b4dc8"; // hash representing uncompressed -var hash160Buf = new Buffer(hash160, 'hex'); -var version = 0x00; // Bitcoin public address +let hash160 = "3c176e659bea0f29a3e9bf7880c112b1b31b4dc8"; // hash representing uncompressed +let hash160Buf = new Buffer(hash160, 'hex'); +version = 0x00; // Bitcoin public address console.log(cs.encode(hash160Buf, version)); // => 16UjcYNBG9GTK4uq2f7yYEbuifqCzoLMGS -var privateKeyHex = "1184cd2cdd640ca42cfc3a091c51d549b2f016d454b2774019c2b2d2e08529fd"; +privateKeyHex = "1184cd2cdd640ca42cfc3a091c51d549b2f016d454b2774019c2b2d2e08529fd"; // for compressed, append "01" privateKeyHex += '01'; -var privateKeyHexBuf = new Buffer(privateKeyHex, 'hex'); -var version = 0x80; // Bitcoin private key +privateKeyHexBuf = new Buffer(privateKeyHex, 'hex'); +version = 0x80; // Bitcoin private key console.log(cs.encode(privateKeyHexBuf, version)); // => KwomKti1X3tYJUUMb1TGSM2mrZk1wb1aHisUNHCQXTZq5auC2qc3 -var hash160 = "3c176e659bea0f29a3e9bf7880c112b1b31b4dc8"; // hash representing uncompressed -var hash160Buf = new Buffer(hash160, 'hex'); -var version = 0x1E; // Dogecoin public address +hash160 = "3c176e659bea0f29a3e9bf7880c112b1b31b4dc8"; // hash representing uncompressed +hash160Buf = new Buffer(hash160, 'hex'); +version = 0x1E; // Dogecoin public address console.log(cs.encode(hash160Buf, version)); // => DAcq9oJpZZAjr56RmF7Y5zmWboZWQ4HAsW - -var data = "000000000000000000873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d50800e8f32e723decf4051aefac8e2c93c9c5b214313817cdb01a1494b917c8436b35"; -var buffer = new Buffer(data, 'hex'); -var versionBuffer = new Buffer('0488ade4', 'hex'); // 0488ade4 is a consant listed in the aforementioned bip32 wiki. +const data = "000000000000000000873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d50800e8f32e723decf4051aefac8e2c93c9c5b214313817cdb01a1494b917c8436b35"; +const buffer = new Buffer(data, 'hex'); +const versionBuffer = new Buffer('0488ade4', 'hex'); // 0488ade4 is a consant listed in the aforementioned bip32 wiki. console.log(cs.encode(buffer, versionBuffer)); // => xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi +privateKeyHex = "1184cd2cdd640ca42cfc3a091c51d549b2f016d454b2774019c2b2d2e08529fd"; +privateKeyHexBuf = new Buffer(privateKeyHex, 'hex'); +version = 0x80; // Bitcoin private key -var privateKeyHex = "1184cd2cdd640ca42cfc3a091c51d549b2f016d454b2774019c2b2d2e08529fd"; -var privateKeyHexBuf = new Buffer(privateKeyHex, 'hex'); -var version = 0x80; // Bitcoin private key - -var toBtcWif = cs.createEncoder(version); +const toBtcWif = cs.createEncoder(version); // later in your program console.log(toBtcWif(privateKeyHexBuf)); // => 5Hx15HFGyep2CfPxsJKe2fXJsCVn5DEiyoeGGF6JZjGbTRnqfiD +const wif = "5Hx15HFGyep2CfPxsJKe2fXJsCVn5DEiyoeGGF6JZjGbTRnqfiD"; +version = 0x80; // Bitcoin private key -var wif = "5Hx15HFGyep2CfPxsJKe2fXJsCVn5DEiyoeGGF6JZjGbTRnqfiD"; -var version = 0x80; // Bitcoin private key +const fromBtcWif = cs.createDecoder(version); -var fromBtcWif = cs.createDecoder(version); +hash160 = "3c176e659bea0f29a3e9bf7880c112b1b31b4dc8"; // hash representing uncompressed +hash160Buf = new Buffer(hash160, 'hex'); +version = 0x6F; // Bitcoin Testnet Address - -var hash160 = "3c176e659bea0f29a3e9bf7880c112b1b31b4dc8"; // hash representing uncompressed -var hash160Buf = new Buffer(hash160, 'hex'); -var version = 0x6F; // Bitcoin Testnet Address - -var testnetAddressValidator = cs.createValidator(version); -console.log(testnetAddressValidator("mkzgubTA5Ahi6BPSkE6MN9pEafRutznkMe")); // => true \ No newline at end of file +const testnetAddressValidator = cs.createValidator(version); +console.log(testnetAddressValidator("mkzgubTA5Ahi6BPSkE6MN9pEafRutznkMe")); // => true diff --git a/types/colors/index.d.ts b/types/colors/index.d.ts index e087bd0714..68d6fe593e 100644 --- a/types/colors/index.d.ts +++ b/types/colors/index.d.ts @@ -48,46 +48,46 @@ interface Color { export function setTheme(theme: any): void; -export var enabled: boolean; +export let enabled: boolean; -export var strip: Color; -export var stripColors: Color; +export const strip: Color; +export const stripColors: Color; -export var black: Color; -export var red: Color; -export var green: Color; -export var yellow: Color; -export var blue: Color; -export var magenta: Color; -export var cyan: Color; -export var white: Color; -export var gray: Color; -export var grey: Color; +export const black: Color; +export const red: Color; +export const green: Color; +export const yellow: Color; +export const blue: Color; +export const magenta: Color; +export const cyan: Color; +export const white: Color; +export const gray: Color; +export const grey: Color; -export var bgBlack: Color; -export var bgRed: Color; -export var bgGreen: Color; -export var bgYellow: Color; -export var bgBlue: Color; -export var bgMagenta: Color; -export var bgCyan: Color; -export var bgWhite: Color; +export const bgBlack: Color; +export const bgRed: Color; +export const bgGreen: Color; +export const bgYellow: Color; +export const bgBlue: Color; +export const bgMagenta: Color; +export const bgCyan: Color; +export const bgWhite: Color; -export var reset: Color; -export var bold: Color; -export var dim: Color; -export var italic: Color; -export var underline: Color; -export var inverse: Color; -export var hidden: Color; -export var strikethrough: Color; +export const reset: Color; +export const bold: Color; +export const dim: Color; +export const italic: Color; +export const underline: Color; +export const inverse: Color; +export const hidden: Color; +export const strikethrough: Color; -export var rainbow: Color; -export var zebra: Color; -export var america: Color; -export var trap: Color; -export var random: Color; -export var zalgo: Color; +export const rainbow: Color; +export const zebra: Color; +export const america: Color; +export const trap: Color; +export const random: Color; +export const zalgo: Color; declare global { interface String { @@ -130,4 +130,4 @@ declare global { random: string; zalgo: string; } -} \ No newline at end of file +} diff --git a/types/colors/safe.d.ts b/types/colors/safe.d.ts index c2145b7bc1..306b656b2b 100644 --- a/types/colors/safe.d.ts +++ b/types/colors/safe.d.ts @@ -1,4 +1,4 @@ -export var enabled: boolean; +export const enabled: boolean; export function strip(str: string): string; export function stripColors(str: string): string; diff --git a/types/connect-ensure-login/index.d.ts b/types/connect-ensure-login/index.d.ts index fb1716abf9..bbf827922c 100644 --- a/types/connect-ensure-login/index.d.ts +++ b/types/connect-ensure-login/index.d.ts @@ -23,51 +23,51 @@ interface LoggedOutOptions { } /** -* Ensure that a user is logged in before proceeding to next route middleware. -* -* This middleware ensures that a user is logged in. If a request is received -* that is unauthenticated, the request will be redirected to a login page (by -* default to `/login`). -* -* Additionally, `returnTo` will be be set in the session to the URL of the -* current request. After authentication, this value can be used to redirect -* the user to the page that was originally requested. -* -* Examples: -* -* app.get('/profile', -* ensureLoggedIn(), -* function(req, res) { ... }); -* -* app.get('/profile', -* ensureLoggedIn('/signin'), -* function(req, res) { ... }); -* -* app.get('/profile', -* ensureLoggedIn({ redirectTo: '/session/new', setReturnTo: false }), -* function(req, res) { ... }); -*/ + * Ensure that a user is logged in before proceeding to next route middleware. + * + * This middleware ensures that a user is logged in. If a request is received + * that is unauthenticated, the request will be redirected to a login page (by + * default to `/login`). + * + * Additionally, `returnTo` will be be set in the session to the URL of the + * current request. After authentication, this value can be used to redirect + * the user to the page that was originally requested. + * + * Examples: + * + * app.get('/profile', + * ensureLoggedIn(), + * function(req, res) { ... }); + * + * app.get('/profile', + * ensureLoggedIn('/signin'), + * function(req, res) { ... }); + * + * app.get('/profile', + * ensureLoggedIn({ redirectTo: '/session/new', setReturnTo: false }), + * function(req, res) { ... }); + */ export function ensureLoggedIn(options?: LoggedInOptions | string): RequestHandler; /** -* Ensure that no user is logged in before proceeding to next route middleware. -* -* This middleware ensures that no user is logged in. If a request is received -* that is authenticated, the request will be redirected to another page (by -* default to `/`). -* -* Examples: -* -* app.get('/login', -* ensureLoggedOut(), -* function(req, res) { ... }); -* -* app.get('/login', -* ensureLoggedOut('/home'), -* function(req, res) { ... }); -* -* app.get('/login', -* ensureLoggedOut({ redirectTo: '/home' }), -* function(req, res) { ... }); -*/ + * Ensure that no user is logged in before proceeding to next route middleware. + * + * This middleware ensures that no user is logged in. If a request is received + * that is authenticated, the request will be redirected to another page (by + * default to `/`). + * + * Examples: + * + * app.get('/login', + * ensureLoggedOut(), + * function(req, res) { ... }); + * + * app.get('/login', + * ensureLoggedOut('/home'), + * function(req, res) { ... }); + * + * app.get('/login', + * ensureLoggedOut({ redirectTo: '/home' }), + * function(req, res) { ... }); + */ export function ensureLoggedOut(options?: LoggedOutOptions | string): RequestHandler; diff --git a/types/convert-source-map/convert-source-map-tests.ts b/types/convert-source-map/convert-source-map-tests.ts index 96a638ca93..c591f124c6 100644 --- a/types/convert-source-map/convert-source-map-tests.ts +++ b/types/convert-source-map/convert-source-map-tests.ts @@ -2,11 +2,11 @@ import convert = require("convert-source-map"); // tslint:disable:max-line-length -var json = convert +const json = convert .fromComment('//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') .toJSON(); -var modified = convert +const modified = convert .fromComment('//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9vLmpzIiwic291cmNlcyI6WyJjb25zb2xlLmxvZyhcImhpXCIpOyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=') .setProperty('sources', ['CONSOLE.LOG("HI");']) .toJSON(); diff --git a/types/convert-source-map/index.d.ts b/types/convert-source-map/index.d.ts index e1577c4070..9576e5a08f 100644 --- a/types/convert-source-map/index.d.ts +++ b/types/convert-source-map/index.d.ts @@ -35,7 +35,6 @@ export interface SourceMapConverter { getProperty(key: string): any; } - /** Returns source map converter from given object */ export function fromObject(obj: any): SourceMapConverter; @@ -72,13 +71,13 @@ export function removeComments(src: string): string; export function removeMapFileComments(src: string): string; /** Returns the regex used to find source map comments */ -export var commentRegex: RegExp; +export const commentRegex: RegExp; /** Returns the regex used to find source map comments pointing to map files */ -export var mapFileCommentRegex: RegExp; +export const mapFileCommentRegex: RegExp; /** Returns a comment that links to an external source map via file. * By default, the comment is formatted like: //# sourceMappingURL=..., which you would normally see in a JS source file. * When options.multiline == true, the comment is formatted like: /*# sourceMappingURL=... *\/, which you would find in a CSS source file. */ -export function generateMapFileComment(file: string, options?: { multiline?: boolean }): string; \ No newline at end of file +export function generateMapFileComment(file: string, options?: { multiline?: boolean }): string; diff --git a/types/csv-stringify/csv-stringify-tests.ts b/types/csv-stringify/csv-stringify-tests.ts index a05f35d368..d7a6f0196b 100644 --- a/types/csv-stringify/csv-stringify-tests.ts +++ b/types/csv-stringify/csv-stringify-tests.ts @@ -12,7 +12,6 @@ stringify([["1", "2", "3"], ["4", "5", "6"]], { // nothing }); - stream = stringify({ delimiter: "," }); stream.write(["1", "2", "3"]); diff --git a/types/csv-stringify/index.d.ts b/types/csv-stringify/index.d.ts index e65695c059..a636547187 100644 --- a/types/csv-stringify/index.d.ts +++ b/types/csv-stringify/index.d.ts @@ -55,7 +55,6 @@ declare namespace stringify { * special values are 'auto', 'unix', 'mac', 'windows', 'unicode'; defaults to 'auto' (discovered in source or 'unix' if no source is specified). */ rowDelimiter?: string; - } interface Stringifier extends NodeJS.ReadWriteStream { diff --git a/types/currency-formatter/currencies.d.ts b/types/currency-formatter/currencies.d.ts index 163bd578de..4d65a9ab53 100644 --- a/types/currency-formatter/currencies.d.ts +++ b/types/currency-formatter/currencies.d.ts @@ -1,2 +1,2 @@ import { currencies } from "./index"; -export = currencies; \ No newline at end of file +export = currencies; diff --git a/types/currency-formatter/currency-formatter-tests.ts b/types/currency-formatter/currency-formatter-tests.ts index a64b9bc48f..f06f53ce05 100644 --- a/types/currency-formatter/currency-formatter-tests.ts +++ b/types/currency-formatter/currency-formatter-tests.ts @@ -42,6 +42,5 @@ currencyFormatter.format(-10, { // => ($10) - import currencies = require('currency-formatter/currencies'); currencies === currencyFormatter.currencies; diff --git a/types/decay/decay-tests.ts b/types/decay/decay-tests.ts index 41b67b6068..20f33210ac 100644 --- a/types/decay/decay-tests.ts +++ b/types/decay/decay-tests.ts @@ -19,4 +19,4 @@ score = hackerCalculator(upvotes, posted); let wilsonCalculator = wilsonScore(); score = wilsonCalculator(upvotes, downvotes); wilsonCalculator = wilsonScore(1.0); -score = wilsonCalculator(upvotes, downvotes); \ No newline at end of file +score = wilsonCalculator(upvotes, downvotes); diff --git a/types/deepmerge/deepmerge-tests.ts b/types/deepmerge/deepmerge-tests.ts index 4106de1275..8c7988ba78 100644 --- a/types/deepmerge/deepmerge-tests.ts +++ b/types/deepmerge/deepmerge-tests.ts @@ -10,4 +10,4 @@ const expected = { foo: { bar: 3, baz: 4 }, array: [ { does: 'work', too: [ 1, 2, 3, 4, 5, 6 ] }, { really: 'yes' } ], quux: 5 }; -const result = deepmerge(x, y); \ No newline at end of file +const result = deepmerge(x, y); diff --git a/types/deepmerge/index.d.ts b/types/deepmerge/index.d.ts index bf70f62e46..96d0412aa6 100644 --- a/types/deepmerge/index.d.ts +++ b/types/deepmerge/index.d.ts @@ -10,8 +10,8 @@ declare function deepmerge(x: T, y: T, options?: deepmerge.Options): T; declare namespace deepmerge { interface Options { clone?: boolean; - arrayMerge?: (destination: T, source: T, options?: Options) => T; + arrayMerge?(destination: T, source: T, options?: Options): T; } function all(objects: T[], options?: Options): T; -} \ No newline at end of file +} diff --git a/types/detect-port/detect-port-tests.ts b/types/detect-port/detect-port-tests.ts index 5ffd01ca7c..759313665b 100644 --- a/types/detect-port/detect-port-tests.ts +++ b/types/detect-port/detect-port-tests.ts @@ -8,10 +8,9 @@ const port: number = 8000; detect(port, (err: Error, _port: number) => { }); - function* yieldSyntax() { const _port: number = yield detect(port); -}; +} /** * use as a promise diff --git a/types/discontinuous-range/discontinuous-range-tests.ts b/types/discontinuous-range/discontinuous-range-tests.ts index 8b31d11b11..cfc69ed371 100644 --- a/types/discontinuous-range/discontinuous-range-tests.ts +++ b/types/discontinuous-range/discontinuous-range-tests.ts @@ -21,4 +21,4 @@ const entry: number | null = rangeOne.index(1); const stringified: string = rangeOne.toString(); // clone -const rangeThree: DiscontinuousRange = rangeOne.clone(); \ No newline at end of file +const rangeThree: DiscontinuousRange = rangeOne.clone(); diff --git a/types/discontinuous-range/index.d.ts b/types/discontinuous-range/index.d.ts index 670379a57e..edb6a1efd6 100644 --- a/types/discontinuous-range/index.d.ts +++ b/types/discontinuous-range/index.d.ts @@ -7,7 +7,6 @@ * Represents a discontinuous range of numbers. */ declare class DiscontinuousRange { - /** * Creates a discontinuous range at rangeStart, and ending at * rangeEnd. If rangeEnd is not specified, a range containing @@ -70,4 +69,4 @@ declare class DiscontinuousRange { clone(): DiscontinuousRange; } -export = DiscontinuousRange; \ No newline at end of file +export = DiscontinuousRange; diff --git a/types/dropkickjs/dropkickjs-tests.ts b/types/dropkickjs/dropkickjs-tests.ts index 206554da09..72006e1b6d 100644 --- a/types/dropkickjs/dropkickjs-tests.ts +++ b/types/dropkickjs/dropkickjs-tests.ts @@ -1,11 +1,11 @@ // constructor -var constructorNoOptions = new Dropkick('#my-select'); -var constructorNoOptions2 = new Dropkick(new HTMLSelectElement()); -var constructorOptions = new Dropkick('#my-select', {}); -var constructorOptions2 = new Dropkick(new HTMLSelectElement(), {}); +const constructorNoOptions = new Dropkick('#my-select'); +const constructorNoOptions2 = new Dropkick(new HTMLSelectElement()); +const constructorOptions = new Dropkick('#my-select', {}); +const constructorOptions2 = new Dropkick(new HTMLSelectElement(), {}); // options -var options: DropkickOptions = { +const options: DropkickOptions = { disabled: true, form: new HTMLFormElement(), length: 1, @@ -20,20 +20,20 @@ var options: DropkickOptions = { open() { }, initialize: () => { } }; -var withFullOptions = new Dropkick('#test', options); +const withFullOptions = new Dropkick('#test', options); -var dk = new Dropkick('#test'); +const dk = new Dropkick('#test'); // fields (same as options) -var o1 = dk.disabled; -var o2 = dk.form; -var o3 = dk.length; -var o4 = dk.mobile; -var o5 = dk.multiple; -var o6 = dk.options; -var o7 = dk.selectedIndex; -var o8 = dk.selectedOptions; -var o9 = dk.value; +const o1 = dk.disabled; +const o2 = dk.form; +const o3 = dk.length; +const o4 = dk.mobile; +const o5 = dk.multiple; +const o6 = dk.options; +const o7 = dk.selectedIndex; +const o8 = dk.selectedOptions; +const o9 = dk.value; // methods dk.add('new'); @@ -53,7 +53,7 @@ dk.focus(); dk.hide(4); dk.hide(4, false); -var node = dk.item(4); +const node = dk.item(4); dk.open(); @@ -64,18 +64,18 @@ dk.remove(4); dk.reset(); dk.reset(true); -var words = dk.search("qwer", "fuzzy"); +const words = dk.search("qwer", "fuzzy"); -var node2 = dk.select(4); -var node3 = dk.select("AL"); -var node4 = dk.select(4, true); +const node2 = dk.select(4); +const node3 = dk.select("AL"); +const node4 = dk.select(4, true); -var node5 = dk.selectOne(4); -var node6 = dk.selectOne(4, true); +const node5 = dk.selectOne(4); +const node6 = dk.selectOne(4, true); // real life example -var fieldValue = ''; -var selectOptions: DropkickOptions = { +let fieldValue = ''; +const selectOptions: DropkickOptions = { open(this: Dropkick) { const optionsList = ( this).data.elem.lastChild; // undocumented but useful data field if (optionsList.scrollWidth > optionsList.offsetWidth) { @@ -86,4 +86,4 @@ var selectOptions: DropkickOptions = { fieldValue = select.value; } }; -var select = new Dropkick('#select', options); \ No newline at end of file +const select = new Dropkick('#select', options); diff --git a/types/dropkickjs/index.d.ts b/types/dropkickjs/index.d.ts index 1e0a4f4acf..a7211070d4 100644 --- a/types/dropkickjs/index.d.ts +++ b/types/dropkickjs/index.d.ts @@ -14,10 +14,10 @@ interface DropkickOptions { selectedOptions?: string[]; value?: string; - change?: () => void; - close?: () => void; - initialize?: () => void; - open?: () => void; + change?(): void; + close?(): void; + initialize?(): void; + open?(): void; } declare class Dropkick { @@ -48,4 +48,4 @@ declare class Dropkick { selectedIndex: number; selectedOptions: string[]; value: string; -} \ No newline at end of file +} diff --git a/types/duplexer2/duplexer2-tests.ts b/types/duplexer2/duplexer2-tests.ts index cfc945adb7..d410a3eb52 100644 --- a/types/duplexer2/duplexer2-tests.ts +++ b/types/duplexer2/duplexer2-tests.ts @@ -1,8 +1,8 @@ import stream = require("stream"); import duplexer2 = require("duplexer2"); -const writable = new stream.Writable({ objectMode: true }), - readable = new stream.Readable({ objectMode: true }); +const writable = new stream.Writable({ objectMode: true }); +const readable = new stream.Readable({ objectMode: true }); writable.once("finish", () => { setTimeout(() => { @@ -30,4 +30,4 @@ duplex.write("oh, hi there", () => { duplex.end("", () => { console.log("finished ending"); -}); \ No newline at end of file +}); diff --git a/types/freeport/freeport-tests.ts b/types/freeport/freeport-tests.ts index 2746aeb4ed..35fdb19f2b 100644 --- a/types/freeport/freeport-tests.ts +++ b/types/freeport/freeport-tests.ts @@ -1,7 +1,7 @@ import freeport = require('freeport'); -let num: number, - error: Error; +let num: number; +let error: Error; freeport((err, made) => { error = err; diff --git a/types/geojson/geojson-tests.ts b/types/geojson/geojson-tests.ts index 42ae99ce47..1e4fe3b392 100644 --- a/types/geojson/geojson-tests.ts +++ b/types/geojson/geojson-tests.ts @@ -64,17 +64,14 @@ let featureWithPolygon: GeoJSON.Feature = { properties: null }; - let point: GeoJSON.Point = { type: "Point", coordinates: [100.0, 0.0] }; - // This type is commonly used in the turf package let pointCoordinates: number[] = point.coordinates; - let lineString: GeoJSON.LineString = { type: "LineString", coordinates: [ [100.0, 0.0], [101.0, 1.0] ] diff --git a/types/geojson/index.d.ts b/types/geojson/index.d.ts index 7c825d2541..902b367d52 100644 --- a/types/geojson/index.d.ts +++ b/types/geojson/index.d.ts @@ -3,124 +3,119 @@ // Definitions by: Jacob Bruun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace GeoJSON { +export as namespace GeoJSON; - /*** - * http://geojson.org/geojson-spec.html#geojson-objects - */ - export interface GeoJsonObject { - type: string; - bbox?: number[]; - crs?: CoordinateReferenceSystem; - } - - /*** - * http://geojson.org/geojson-spec.html#positions - */ - export type Position = number[]; - - /*** - * http://geojson.org/geojson-spec.html#geometry-objects - */ - interface DirectGeometryObject extends GeoJsonObject { - coordinates: Position[][][] | Position[][] | Position[] | Position; - } - /** - * GeometryObject supports geometry collection as well - */ - export type GeometryObject = DirectGeometryObject | GeometryCollection; - - /*** - * http://geojson.org/geojson-spec.html#point - */ - export interface Point extends DirectGeometryObject { - type: 'Point'; - coordinates: Position; - } - - /*** - * http://geojson.org/geojson-spec.html#multipoint - */ - export interface MultiPoint extends DirectGeometryObject { - type: 'MultiPoint'; - coordinates: Position[]; - } - - /*** - * http://geojson.org/geojson-spec.html#linestring - */ - export interface LineString extends DirectGeometryObject { - type: 'LineString'; - coordinates: Position[]; - } - - /*** - * http://geojson.org/geojson-spec.html#multilinestring - */ - export interface MultiLineString extends DirectGeometryObject { - type: 'MultiLineString'; - coordinates: Position[][]; - } - - /*** - * http://geojson.org/geojson-spec.html#polygon - */ - export interface Polygon extends DirectGeometryObject { - type: 'Polygon'; - coordinates: Position[][]; - } - - /*** - * http://geojson.org/geojson-spec.html#multipolygon - */ - export interface MultiPolygon extends DirectGeometryObject { - type: 'MultiPolygon'; - coordinates: Position[][][]; - } - - /*** - * http://geojson.org/geojson-spec.html#geometry-collection - */ - export interface GeometryCollection extends GeoJsonObject { - type: 'GeometryCollection'; - geometries: GeometryObject[]; - } - - /*** - * http://geojson.org/geojson-spec.html#feature-objects - */ - export interface Feature extends GeoJsonObject { - type: 'Feature'; - geometry: T; - properties: {} | null; - id?: string; - } - - /*** - * http://geojson.org/geojson-spec.html#feature-collection-objects - */ - export interface FeatureCollection extends GeoJsonObject { - type: 'FeatureCollection'; - features: Array>; - } - - /*** - * http://geojson.org/geojson-spec.html#coordinate-reference-system-objects - */ - export interface CoordinateReferenceSystem { - type: string; - properties: any; - } - - export interface NamedCoordinateReferenceSystem extends CoordinateReferenceSystem { - properties: { name: string }; - } - - export interface LinkedCoordinateReferenceSystem extends CoordinateReferenceSystem { - properties: { href: string; type: string }; - } +/*** +* http://geojson.org/geojson-spec.html#geojson-objects +*/ +export interface GeoJsonObject { + type: string; + bbox?: number[]; + crs?: CoordinateReferenceSystem; } -declare module 'geojson' { - export = GeoJSON; +/*** +* http://geojson.org/geojson-spec.html#positions +*/ +export type Position = number[]; + +/*** +* http://geojson.org/geojson-spec.html#geometry-objects +*/ +interface DirectGeometryObject extends GeoJsonObject { + coordinates: Position[][][] | Position[][] | Position[] | Position; +} +/** + * GeometryObject supports geometry collection as well + */ +export type GeometryObject = DirectGeometryObject | GeometryCollection; + +/*** +* http://geojson.org/geojson-spec.html#point +*/ +export interface Point extends DirectGeometryObject { + type: 'Point'; + coordinates: Position; +} + +/*** +* http://geojson.org/geojson-spec.html#multipoint +*/ +export interface MultiPoint extends DirectGeometryObject { + type: 'MultiPoint'; + coordinates: Position[]; +} + +/*** +* http://geojson.org/geojson-spec.html#linestring +*/ +export interface LineString extends DirectGeometryObject { + type: 'LineString'; + coordinates: Position[]; +} + +/*** +* http://geojson.org/geojson-spec.html#multilinestring +*/ +export interface MultiLineString extends DirectGeometryObject { + type: 'MultiLineString'; + coordinates: Position[][]; +} + +/*** +* http://geojson.org/geojson-spec.html#polygon +*/ +export interface Polygon extends DirectGeometryObject { + type: 'Polygon'; + coordinates: Position[][]; +} + +/*** +* http://geojson.org/geojson-spec.html#multipolygon +*/ +export interface MultiPolygon extends DirectGeometryObject { + type: 'MultiPolygon'; + coordinates: Position[][][]; +} + +/*** +* http://geojson.org/geojson-spec.html#geometry-collection +*/ +export interface GeometryCollection extends GeoJsonObject { + type: 'GeometryCollection'; + geometries: GeometryObject[]; +} + +/*** +* http://geojson.org/geojson-spec.html#feature-objects +*/ +export interface Feature extends GeoJsonObject { + type: 'Feature'; + geometry: T; + properties: {} | null; + id?: string; +} + +/*** +* http://geojson.org/geojson-spec.html#feature-collection-objects +*/ +export interface FeatureCollection extends GeoJsonObject { + type: 'FeatureCollection'; + features: Array>; +} + +/*** +* http://geojson.org/geojson-spec.html#coordinate-reference-system-objects +*/ +export interface CoordinateReferenceSystem { + type: string; + properties: any; +} + +export interface NamedCoordinateReferenceSystem extends CoordinateReferenceSystem { + properties: { name: string }; +} + +export interface LinkedCoordinateReferenceSystem extends CoordinateReferenceSystem { + properties: { href: string; type: string }; } diff --git a/types/geolib/index.d.ts b/types/geolib/index.d.ts index 95779ab2c9..8842c3eb20 100644 --- a/types/geolib/index.d.ts +++ b/types/geolib/index.d.ts @@ -122,7 +122,8 @@ declare namespace geolib { /** Calculates the length of a collection of coordinates. * - * Returns the length of the path in meters */ + * Returns the length of the path in meters + */ function getPathLength(coords: PositionAsDecimal[]): number; /** Calculates the speed between two points within a given time span. diff --git a/types/geopattern/geopattern-tests.ts b/types/geopattern/geopattern-tests.ts index 957da81c20..7d5df87fc8 100644 --- a/types/geopattern/geopattern-tests.ts +++ b/types/geopattern/geopattern-tests.ts @@ -1,6 +1,6 @@ /// -var pattern = GeoPattern.generate('GitHub'); +const pattern = GeoPattern.generate('GitHub'); pattern.toDataUrl(); $('#geopattern').geopattern('GitHub'); diff --git a/types/gettext.js/gettext.js-tests.ts b/types/gettext.js/gettext.js-tests.ts index 6e5b4448ae..1603aec42a 100644 --- a/types/gettext.js/gettext.js-tests.ts +++ b/types/gettext.js/gettext.js-tests.ts @@ -2,10 +2,10 @@ import * as Gettext from 'gettext.js'; const json: Gettext.JsonData = { "": { - "locale": "fr", + locale: "fr", "plural-forms": "nplurals=2; plural=n>1;" }, - "Welcome": "Bienvenue", + Welcome: "Bienvenue", "There is %1 apple": [ "Il y a %1 pomme", "Il y a %1 pommes" diff --git a/types/gettext.js/index.d.ts b/types/gettext.js/index.d.ts index 5096490721..02a328ed84 100644 --- a/types/gettext.js/index.d.ts +++ b/types/gettext.js/index.d.ts @@ -28,18 +28,18 @@ export interface JsonData extends JsonDataMessages { } export interface Gettext { - setMessages: (domain: string, locale: string, messages: JsonDataMessages, plural_forms?: PluralForm) => Gettext; - loadJSON: (jsonData: JsonData, domain?: string) => Gettext; - setLocale: (locale: string) => Gettext; - getLocale: () => string; - textdomain: (domain?: string) => Gettext | string; - gettext: (msgid: string, ...args: any[]) => string; - ngettext: (msgid: string, msgid_plural: string, n: number, ...args: any[]) => string; - pgettext: (msgctxt: string, msgid: string, ...args: any[]) => string; - dcnpgettext: (domain: string, msgctxt: string, msgid: string, msgid_plural: string, n: number, ...args: any[]) => string; - __: (msgid: string, ...args: any[]) => string; - _n: (msgid: string, msgid_plural: string, n: number, ...args: any[]) => string; - _p: (msgctxt: string, msgid: string, ...args: any[]) => string; + setMessages(domain: string, locale: string, messages: JsonDataMessages, plural_forms?: PluralForm): Gettext; + loadJSON(jsonData: JsonData, domain?: string): Gettext; + setLocale(locale: string): Gettext; + getLocale(): string; + textdomain(domain?: string): Gettext | string; + gettext(msgid: string, ...args: any[]): string; + ngettext(msgid: string, msgid_plural: string, n: number, ...args: any[]): string; + pgettext(msgctxt: string, msgid: string, ...args: any[]): string; + dcnpgettext(domain: string, msgctxt: string, msgid: string, msgid_plural: string, n: number, ...args: any[]): string; + __(msgid: string, ...args: any[]): string; + _n(msgid: string, msgid_plural: string, n: number, ...args: any[]): string; + _p(msgctxt: string, msgid: string, ...args: any[]): string; } export const i18n: GettextStatic; diff --git a/types/gsap/gsap-tests.ts b/types/gsap/gsap-tests.ts index f811ac1089..048a9d522e 100644 --- a/types/gsap/gsap-tests.ts +++ b/types/gsap/gsap-tests.ts @@ -1,6 +1,6 @@ import { TweenLite } from 'gsap'; -var tween = TweenLite +const tween = TweenLite .to(document.getElementById('some-div'), 1, { width: '200px', height: '200px' diff --git a/types/handsontable/index.d.ts b/types/handsontable/index.d.ts index ea57730f93..e4d1a7a8f1 100644 --- a/types/handsontable/index.d.ts +++ b/types/handsontable/index.d.ts @@ -4,292 +4,292 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped\ declare namespace ht { - interface Options { - allowEmpty?: boolean; - allowInsertColumn?: boolean; - allowInsertRow?: boolean; - allowInvalid?: boolean; - allowRemoveColumn?: boolean; - allowRemoveRow?: boolean; - autoColumnSize?: Object|boolean; - autoComplete?: any[]; - autoRowSize?: Object|boolean; - autoWrapCol?: boolean; - autoWrapRow?: boolean; - bindRowsWithHeaders?: boolean|string; - cell?: any[]; - cells?: Function; - checkedTemplate?: boolean|string; - className?: string|any[]; - colHeaders?: boolean|any[]|Function; - collapsibleColumns?: boolean|any[]; - columnHeaderHeight?: number|any[]; - columns?: any[]; - columnSorting?: boolean|Object; - columnSummary?: Object; - colWidths?: any[]|Function|number|string; - commentedCellClassName?: string; - comments?: boolean|any[]; - contextMenu?: boolean|any[]|Object; - contextMenuCopyPaste?: Object; - copyable?: boolean; - copyColsLimit?: number; - copyPaste?: boolean; - copyRowsLimit?: number; - correctFormat?: boolean; - currentColClassName?: string; - currentRowClassName?: string; - customBorders?: boolean|any[]; - data?: any[]|Function; - dataSchema?: Object; - dateFormat?: string; - debug?: boolean; - defaultDate?: string; - disableVisualSelection?: boolean|string|any[]; - dropdownMenu?: boolean|Object|any[]; - editor?: string|Function|boolean; - enterBeginsEditing?: boolean; - enterMoves?: Object|Function; - fillHandle?: boolean|string|Object; - filter?: boolean; - filteringCaseSensitive?: boolean; - filters?: boolean; - fixedColumnsLeft?: number; - fixedRowsBottom?: number; - fixedRowsTop?: number; - format?: string; - fragmentSelection?: boolean|string; - ganttChart?: Object; - headerTooltips?: boolean|Object; - height?: number|Function; - hiddenColumns?: boolean|Object; - hiddenRows?: boolean|Object; - invalidCellClassName?: string; - label?: Object; - language?: string; - manualColumnFreeze?: boolean; - manualColumnMove?: boolean|any[]; - manualColumnResize?: boolean|any[]; - manualRowMove?: boolean|any[]; - manualRowResize?: boolean|any[]; - maxCols?: number; - maxRows?: number; - mergeCells?: boolean|any[]; - minCols?: number; - minRows?: number; - minSpareCols?: number; - minSpareRows?: number; - multiSelect?: boolean; - nestedHeaders?: any[]; - noWordWrapClassName?: string; - observeChanges?: boolean; - observeDOMVisibility?: boolean; - outsideClickDeselects?: boolean; - pasteMode?: string; - persistentState?: boolean; - placeholder?: any; - placeholderCellClassName?: string; - preventOverflow?: string|boolean; - readOnly?: boolean; - readOnlyCellClassName?: string; - renderAllRows?: boolean; - renderer?: string|Function; - rowHeaders?: boolean|any[]|Function; - rowHeaderWidth?: number|any[]; - rowHeights?: any[]|Function|number|string; - search?: boolean; - selectOptions?: any[]; - skipColumnOnPaste?: boolean; - sortByRelevance?: boolean; - sortFunction?: Function; - sortIndicator?: boolean; - source?: any[]|Function; - startCols?: number; - startRows?: number; - stretchH?: string; - strict?: boolean; - tableClassName?: string|any[]; - tabMoves?: Object; - title?: string; - trimDropdown?: boolean; - trimWhitespace?: boolean; - type?: string; - uncheckedTemplate?: boolean|string; - undo?: boolean; - validator?: Function|RegExp; - viewportColumnRenderingOffset?: number|string; - viewportRowRenderingOffset?: number|string; - visibleRows?: number; - width?: number|Function; - wordWrap?: boolean; - isEmptyCol?(col: number): boolean; - isEmptyRow?(row: number): boolean; + interface Options { + allowEmpty?: boolean; + allowInsertColumn?: boolean; + allowInsertRow?: boolean; + allowInvalid?: boolean; + allowRemoveColumn?: boolean; + allowRemoveRow?: boolean; + autoColumnSize?: Object|boolean; + autoComplete?: any[]; + autoRowSize?: Object|boolean; + autoWrapCol?: boolean; + autoWrapRow?: boolean; + bindRowsWithHeaders?: boolean|string; + cell?: any[]; + cells?: Function; + checkedTemplate?: boolean|string; + className?: string|any[]; + colHeaders?: boolean|any[]|Function; + collapsibleColumns?: boolean|any[]; + columnHeaderHeight?: number|any[]; + columns?: any[]; + columnSorting?: boolean|Object; + columnSummary?: Object; + colWidths?: any[]|Function|number|string; + commentedCellClassName?: string; + comments?: boolean|any[]; + contextMenu?: boolean|any[]|Object; + contextMenuCopyPaste?: Object; + copyable?: boolean; + copyColsLimit?: number; + copyPaste?: boolean; + copyRowsLimit?: number; + correctFormat?: boolean; + currentColClassName?: string; + currentRowClassName?: string; + customBorders?: boolean|any[]; + data?: any[]|Function; + dataSchema?: Object; + dateFormat?: string; + debug?: boolean; + defaultDate?: string; + disableVisualSelection?: boolean|string|any[]; + dropdownMenu?: boolean|Object|any[]; + editor?: string|Function|boolean; + enterBeginsEditing?: boolean; + enterMoves?: Object|Function; + fillHandle?: boolean|string|Object; + filter?: boolean; + filteringCaseSensitive?: boolean; + filters?: boolean; + fixedColumnsLeft?: number; + fixedRowsBottom?: number; + fixedRowsTop?: number; + format?: string; + fragmentSelection?: boolean|string; + ganttChart?: Object; + headerTooltips?: boolean|Object; + height?: number|Function; + hiddenColumns?: boolean|Object; + hiddenRows?: boolean|Object; + invalidCellClassName?: string; + label?: Object; + language?: string; + manualColumnFreeze?: boolean; + manualColumnMove?: boolean|any[]; + manualColumnResize?: boolean|any[]; + manualRowMove?: boolean|any[]; + manualRowResize?: boolean|any[]; + maxCols?: number; + maxRows?: number; + mergeCells?: boolean|any[]; + minCols?: number; + minRows?: number; + minSpareCols?: number; + minSpareRows?: number; + multiSelect?: boolean; + nestedHeaders?: any[]; + noWordWrapClassName?: string; + observeChanges?: boolean; + observeDOMVisibility?: boolean; + outsideClickDeselects?: boolean; + pasteMode?: string; + persistentState?: boolean; + placeholder?: any; + placeholderCellClassName?: string; + preventOverflow?: string|boolean; + readOnly?: boolean; + readOnlyCellClassName?: string; + renderAllRows?: boolean; + renderer?: string|Function; + rowHeaders?: boolean|any[]|Function; + rowHeaderWidth?: number|any[]; + rowHeights?: any[]|Function|number|string; + search?: boolean; + selectOptions?: any[]; + skipColumnOnPaste?: boolean; + sortByRelevance?: boolean; + sortFunction?: Function; + sortIndicator?: boolean; + source?: any[]|Function; + startCols?: number; + startRows?: number; + stretchH?: string; + strict?: boolean; + tableClassName?: string|any[]; + tabMoves?: Object; + title?: string; + trimDropdown?: boolean; + trimWhitespace?: boolean; + type?: string; + uncheckedTemplate?: boolean|string; + undo?: boolean; + validator?: Function|RegExp; + viewportColumnRenderingOffset?: number|string; + viewportRowRenderingOffset?: number|string; + visibleRows?: number; + width?: number|Function; + wordWrap?: boolean; + isEmptyCol?(col: number): boolean; + isEmptyRow?(row: number): boolean; - // hooks - afterAutofillApplyValues?(startArea: any[], entireArea: any[]): void; - afterCellMetaReset?(): void; - afterChange?(changes: any[], source: string): void; - afterChangesObserved?(): void; - afterColumnMove?(startColumn: number, endColumn: number): void; - afterColumnResize?(currentColumn: number, newSize: number, isDoubleClick: boolean): void; - afterColumnSort?(column: number, order: boolean): void; - afterContextMenuDefaultOptions?(predefinedItems: any[]): void; - afterContextMenuHide?(context: Object): void; - afterContextMenuShow?(context: Object): void; - afterCopyLimit?(selectedRows: number, selectedColumnds: number, copyRowsLimit: number, copyColumnsLimit: number): void; - afterCreateCol?(index: number, amount: number): void; - afterCreateRow?(index: number, amount: number): void; - afterDeselect?(): void; - afterDestroy?(): void; - afterDocumentKeyDown?(event: Event): void; - afterFilter?(formulasStack: any[]): void; - afterGetCellMeta?(row: number, col: number, cellProperties: Object): void; - afterGetColHeader?(col: number, TH: Element): void; - afterGetColumnHeaderRenderers?(array: any[]): void; - afterGetRowHeader?(row: number, TH: Element): void; - afterGetRowHeaderRenderers?(array: any[]): void; - afterInit?(): void; - afterLoadData?(firstTime: boolean): void; - afterMomentumScroll?(): void; - afterOnCellCornerMouseDown?(event: Object): void; - afterOnCellMouseDown?(event: Object, coords: Object, TD: Element): void; - afterOnCellMouseOver?(event: Object, coords: Object, TD: Element): void; - afterRemoveCol?(index: number, amount: number): void; - afterRemoveRow?(index: number, amount: number): void; - afterRender?(isForced: boolean): void; - afterRenderer?(TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object): void; - afterRowMove?(startRow: number, endRow: number): void; - afterRowResize?(currentRow: number, newSize: number, isDoubleClick: boolean): void; - afterScrollHorizontally?(): void; - afterScrollVertically?(): void; - afterSelection?(r: number, c: number, r2: number, c2: number): void; - afterSelectionByProp?(r: number, p: string, r2: number, p2: string): void; - afterSelectionEnd?(r: number, c: number, r2: number, c2: number): void; - afterSelectionEndByProp?(r: number, p: string, r2: number, p2: string): void; - afterSetCellMeta?(row: number, col: number, key: string, value: any): void; - afterUpdateSettings?(): void; - afterValidate?(isValid: boolean, value: any, row: number, prop: string|number, source: string): void|boolean; - beforeAutofill?(start: Object, end: Object, data: any[]): void; - beforeCellAlignment?(stateBefore: any, range: any, type: string, alignmentClass: string): void; - beforeChange?(changes: any[], source: string): void; - beforeChangeRender?(changes: any[], source: string): void; - beforeColumnMove?(startColumn: number, endColumn: number): void; - beforeColumnResize?(currentColumn: number, newSize: number, isDoubleClick: boolean): void; - beforeColumnSort?(column: number, order: boolean): void; - beforeDrawBorders?(corners: any[], borderClassName: string): void; - beforeFilter?(formulasStack: any[]): void; - beforeGetCellMeta?(row: number, col: number, cellProperties: Object): void; - beforeInit?(): void; - beforeInitWalkontable?(walkontableConfig: Object): void; - beforeKeyDown?(event: Event): void; - beforeOnCellMouseDown?(event: Event, coords: Object, TD: Element): void; - beforeRemoveCol?(index: number, amount: number, logicalCols?: any[]): void; - beforeRemoveRow?(index: number, amount: number, logicalRows?: any[]): void; - beforeRender?(isForced: boolean): void; - beforeRenderer?(TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object): void; - beforeRowMove?(startRow: number, endRow: number): void; - beforeRowResize?(currentRow: number, newSize: number, isDoubleClick: boolean): any; - beforeSetRangeEnd?(coords: any[]): void; - beforeStretchingColumnWidth?(stretchedWidth: number, column: number): void; - beforeTouchScroll?(): void; - beforeValidate?(value: any, row: number, prop: string|number, source: string): void; - construct?(): void; - init?(): void; - modifyCol?(col: number): void; - modifyColHeader?(column: number): void; - modifyColWidth?(width: number, col: number): void; - modifyCopyableRange?(copyableRanges: any[]): void; - modifyRow?(row: number): void; - modifyRowHeader?(row: number): void; - modifyRowHeight?(height: number, row: number): void; - persistentStateLoad?(key: string, valuePlaceholder: Object): void; - persistentStateReset?(key: string): void; - persistentStateSave?(key: string, value: any): void; - unmodifyCol?(col: number): void; - } - interface Methods { - addHook(key: string, callback: Function|any[]): void; - addHookOnce(key: string, callback: Function|any[]): void; - alter(action: string, index: number, amount?: number, source?: string, keepEmptyRows?: boolean): void; - clear(): void; - colOffset(): number; - colToProp(col: number): string|number; - countCols(): number; - countEmptyCols(ending?: boolean): number; - countEmptyRows(ending?: boolean): number; - countRenderedCols(): number; - countRenderedRows(): number; - countRows(): number; - countSourceRows(): number; - countVisibleCols(): number; - countVisibleRows(): number; - deselectCell(): void; - destroy(): void; - destroyEditor(revertOriginal?: boolean): void; - getActiveEditor(): Object; - getCell(row: number, col: number, topmost?: boolean): Element; - getCellEditor(row: number, col: number): Object; - getCellMeta(row: number, col: number): Object; - getCellRenderer(row: number, col: number): Function; - getCellValidator(row: number, col: number): any; - getColHeader(col?: number): any[]|string; - getColWidth(col: number): number; - getCoords(elem: Element): Object; - getCopyableData(row: number, column: number): string; - getCopyableText(startRow: number, startCol: number, endRow: number, endCol: number): string; - getData(r?: number, c?: number, r2?: number, c2?: number): any[]; - getDataAtCell(row: number, col: number): any; - getDataAtCol(col: number): any[]; - getDataAtProp(prop: string|number): any[]; - getDataAtRow(row: number): any[]; - getDataAtRowProp(row: number, prop: string): any; - getDataType(rowFrom: number, columnFrom: number, rowTo: number, columnTo: number): string; - getInstance(): any; - getPlugin(pluginName: string): any; - getRowHeader(row?: number): any[]|string; - getRowHeight(row: number): number; - getSchema(): Object; - getSelected(): any[]; - getSelectedRange(): Range; - getSettings(): Options; - getSourceData(r?: number, c?: number, r2?: number, c2?: number): any[]; - getSourceDataAtCell(row: number, column: number): any; - getSourceDataAtCol(column: number): any[]; - getSourceDataAtRow(row: number): any[]|Object; - getValue(): any; - hasColHeaders(): boolean; - hasHook(key: string): boolean; - hasRowHeaders(): boolean; - isEmptyCol(col: number): boolean; - isEmptyRow(row: number): boolean; - isListening(): boolean; - listen(): void; - loadData(data: any[]): void; - populateFromArray(row: number, col: number, input: any[], endRow?: number, endCol?: number, source?: string, method?: string, direction?: string, deltas?: any[]): any; - propToCol(prop: string | number): number; - removeCellMeta(row: number, col: number, key: string): void; - removeHook(key: string, callback: Function): void; - render(): void; - rowOffset(): number; - runHooks(key: string, p1?: any, p2?: any, p3?: any, p4?: any, p5?: any, p6?: any): any; - selectCell(row: number, col: number, endRow?: number, endCol?: number, scrollToCell?: boolean, changeListener?: boolean): boolean; - selectCellByProp(row: number, prop: string, endRow?: number, endProp?: string, scrollToCell?: boolean): boolean; - setCellMeta(row: number, col: number, key: string, val: string): void; - setCellMetaObject(row: number, col: number, prop: Object): void; - setDataAtCell(row: number|any[], col: number, value: string, source?: string): void; - setDataAtRowProp(row: number|any[], prop: string, value: string, source?: string): void; - spliceCol(col: number, index: number, amount: number, elements?: any): void; - spliceRow(row: number, index: number, amount: number, elements?: any): void; - toPhysicalRow(row: number): number; - toPhysicalColumn(column: number): number; - toVisualRow(row: number): number; - toVisualColumn(column: number): number; - unlisten(): void; - updateSettings(settings: Object, init?: boolean): void; - validateCells(callback: Function): void; - } + // hooks + afterAutofillApplyValues?(startArea: any[], entireArea: any[]): void; + afterCellMetaReset?(): void; + afterChange?(changes: any[], source: string): void; + afterChangesObserved?(): void; + afterColumnMove?(startColumn: number, endColumn: number): void; + afterColumnResize?(currentColumn: number, newSize: number, isDoubleClick: boolean): void; + afterColumnSort?(column: number, order: boolean): void; + afterContextMenuDefaultOptions?(predefinedItems: any[]): void; + afterContextMenuHide?(context: Object): void; + afterContextMenuShow?(context: Object): void; + afterCopyLimit?(selectedRows: number, selectedColumnds: number, copyRowsLimit: number, copyColumnsLimit: number): void; + afterCreateCol?(index: number, amount: number): void; + afterCreateRow?(index: number, amount: number): void; + afterDeselect?(): void; + afterDestroy?(): void; + afterDocumentKeyDown?(event: Event): void; + afterFilter?(formulasStack: any[]): void; + afterGetCellMeta?(row: number, col: number, cellProperties: Object): void; + afterGetColHeader?(col: number, TH: Element): void; + afterGetColumnHeaderRenderers?(array: any[]): void; + afterGetRowHeader?(row: number, TH: Element): void; + afterGetRowHeaderRenderers?(array: any[]): void; + afterInit?(): void; + afterLoadData?(firstTime: boolean): void; + afterMomentumScroll?(): void; + afterOnCellCornerMouseDown?(event: Object): void; + afterOnCellMouseDown?(event: Object, coords: Object, TD: Element): void; + afterOnCellMouseOver?(event: Object, coords: Object, TD: Element): void; + afterRemoveCol?(index: number, amount: number): void; + afterRemoveRow?(index: number, amount: number): void; + afterRender?(isForced: boolean): void; + afterRenderer?(TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object): void; + afterRowMove?(startRow: number, endRow: number): void; + afterRowResize?(currentRow: number, newSize: number, isDoubleClick: boolean): void; + afterScrollHorizontally?(): void; + afterScrollVertically?(): void; + afterSelection?(r: number, c: number, r2: number, c2: number): void; + afterSelectionByProp?(r: number, p: string, r2: number, p2: string): void; + afterSelectionEnd?(r: number, c: number, r2: number, c2: number): void; + afterSelectionEndByProp?(r: number, p: string, r2: number, p2: string): void; + afterSetCellMeta?(row: number, col: number, key: string, value: any): void; + afterUpdateSettings?(): void; + afterValidate?(isValid: boolean, value: any, row: number, prop: string|number, source: string): void|boolean; + beforeAutofill?(start: Object, end: Object, data: any[]): void; + beforeCellAlignment?(stateBefore: any, range: any, type: string, alignmentClass: string): void; + beforeChange?(changes: any[], source: string): void; + beforeChangeRender?(changes: any[], source: string): void; + beforeColumnMove?(startColumn: number, endColumn: number): void; + beforeColumnResize?(currentColumn: number, newSize: number, isDoubleClick: boolean): void; + beforeColumnSort?(column: number, order: boolean): void; + beforeDrawBorders?(corners: any[], borderClassName: string): void; + beforeFilter?(formulasStack: any[]): void; + beforeGetCellMeta?(row: number, col: number, cellProperties: Object): void; + beforeInit?(): void; + beforeInitWalkontable?(walkontableConfig: Object): void; + beforeKeyDown?(event: Event): void; + beforeOnCellMouseDown?(event: Event, coords: Object, TD: Element): void; + beforeRemoveCol?(index: number, amount: number, logicalCols?: any[]): void; + beforeRemoveRow?(index: number, amount: number, logicalRows?: any[]): void; + beforeRender?(isForced: boolean): void; + beforeRenderer?(TD: Element, row: number, col: number, prop: string|number, value: string, cellProperties: Object): void; + beforeRowMove?(startRow: number, endRow: number): void; + beforeRowResize?(currentRow: number, newSize: number, isDoubleClick: boolean): any; + beforeSetRangeEnd?(coords: any[]): void; + beforeStretchingColumnWidth?(stretchedWidth: number, column: number): void; + beforeTouchScroll?(): void; + beforeValidate?(value: any, row: number, prop: string|number, source: string): void; + construct?(): void; + init?(): void; + modifyCol?(col: number): void; + modifyColHeader?(column: number): void; + modifyColWidth?(width: number, col: number): void; + modifyCopyableRange?(copyableRanges: any[]): void; + modifyRow?(row: number): void; + modifyRowHeader?(row: number): void; + modifyRowHeight?(height: number, row: number): void; + persistentStateLoad?(key: string, valuePlaceholder: Object): void; + persistentStateReset?(key: string): void; + persistentStateSave?(key: string, value: any): void; + unmodifyCol?(col: number): void; + } + interface Methods { + addHook(key: string, callback: Function|any[]): void; + addHookOnce(key: string, callback: Function|any[]): void; + alter(action: string, index: number, amount?: number, source?: string, keepEmptyRows?: boolean): void; + clear(): void; + colOffset(): number; + colToProp(col: number): string|number; + countCols(): number; + countEmptyCols(ending?: boolean): number; + countEmptyRows(ending?: boolean): number; + countRenderedCols(): number; + countRenderedRows(): number; + countRows(): number; + countSourceRows(): number; + countVisibleCols(): number; + countVisibleRows(): number; + deselectCell(): void; + destroy(): void; + destroyEditor(revertOriginal?: boolean): void; + getActiveEditor(): Object; + getCell(row: number, col: number, topmost?: boolean): Element; + getCellEditor(row: number, col: number): Object; + getCellMeta(row: number, col: number): Object; + getCellRenderer(row: number, col: number): Function; + getCellValidator(row: number, col: number): any; + getColHeader(col?: number): any[]|string; + getColWidth(col: number): number; + getCoords(elem: Element): Object; + getCopyableData(row: number, column: number): string; + getCopyableText(startRow: number, startCol: number, endRow: number, endCol: number): string; + getData(r?: number, c?: number, r2?: number, c2?: number): any[]; + getDataAtCell(row: number, col: number): any; + getDataAtCol(col: number): any[]; + getDataAtProp(prop: string|number): any[]; + getDataAtRow(row: number): any[]; + getDataAtRowProp(row: number, prop: string): any; + getDataType(rowFrom: number, columnFrom: number, rowTo: number, columnTo: number): string; + getInstance(): any; + getPlugin(pluginName: string): any; + getRowHeader(row?: number): any[]|string; + getRowHeight(row: number): number; + getSchema(): Object; + getSelected(): any[]; + getSelectedRange(): Range; + getSettings(): Options; + getSourceData(r?: number, c?: number, r2?: number, c2?: number): any[]; + getSourceDataAtCell(row: number, column: number): any; + getSourceDataAtCol(column: number): any[]; + getSourceDataAtRow(row: number): any[]|Object; + getValue(): any; + hasColHeaders(): boolean; + hasHook(key: string): boolean; + hasRowHeaders(): boolean; + isEmptyCol(col: number): boolean; + isEmptyRow(row: number): boolean; + isListening(): boolean; + listen(): void; + loadData(data: any[]): void; + populateFromArray(row: number, col: number, input: any[], endRow?: number, endCol?: number, source?: string, method?: string, direction?: string, deltas?: any[]): any; + propToCol(prop: string | number): number; + removeCellMeta(row: number, col: number, key: string): void; + removeHook(key: string, callback: Function): void; + render(): void; + rowOffset(): number; + runHooks(key: string, p1?: any, p2?: any, p3?: any, p4?: any, p5?: any, p6?: any): any; + selectCell(row: number, col: number, endRow?: number, endCol?: number, scrollToCell?: boolean, changeListener?: boolean): boolean; + selectCellByProp(row: number, prop: string, endRow?: number, endProp?: string, scrollToCell?: boolean): boolean; + setCellMeta(row: number, col: number, key: string, val: string): void; + setCellMetaObject(row: number, col: number, prop: Object): void; + setDataAtCell(row: number|any[], col: number, value: string, source?: string): void; + setDataAtRowProp(row: number|any[], prop: string, value: string, source?: string): void; + spliceCol(col: number, index: number, amount: number, elements?: any): void; + spliceRow(row: number, index: number, amount: number, elements?: any): void; + toPhysicalRow(row: number): number; + toPhysicalColumn(column: number): number; + toVisualRow(row: number): number; + toVisualColumn(column: number): number; + unlisten(): void; + updateSettings(settings: Object, init?: boolean): void; + validateCells(callback: Function): void; + } - interface Selection { + interface Selection { start: CellPosition; end: CellPosition; } diff --git a/types/har-format/index.d.ts b/types/har-format/index.d.ts index 7aaf479891..09ea2791fd 100644 --- a/types/har-format/index.d.ts +++ b/types/har-format/index.d.ts @@ -3,7 +3,6 @@ // Definitions by: Michael Mrowetz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - /** * HTTP Archive 1.2 * diff --git a/types/hoek/hoek-tests.ts b/types/hoek/hoek-tests.ts index bb2ac87389..45487c2f45 100644 --- a/types/hoek/hoek-tests.ts +++ b/types/hoek/hoek-tests.ts @@ -172,7 +172,7 @@ const source1 = { let result = Hoek.transform(source1, { 'person.address.lineOne': 'address.one', 'person.address.lineTwo': 'address.two', - 'title': 'title', + title: 'title', 'person.address.region': 'state' }); // Results in @@ -231,7 +231,8 @@ a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,'); // returns 4\^f\ // assert(condition, message) -const x = 1, y = 2 as number; +const x = 1; +const y = 2 as number; Hoek.assert(x === y, 'x should equal y'); // Throws 'x should equal y' diff --git a/types/hoek/index.d.ts b/types/hoek/index.d.ts index e1ea52677b..dfc7aa58ae 100644 --- a/types/hoek/index.d.ts +++ b/types/hoek/index.d.ts @@ -34,16 +34,17 @@ export function clone(obj: T): T; /** * Clone an object or array. - * */ + */ export function cloneWithShallow(obj: any, keys: string[]): any; /** - * Merge all the properties of source into target. */ + * Merge all the properties of source into target. + */ export function merge(target: T1, source: T2, isNullOverride?: boolean, isMergeArrays?: boolean): T1 & T2; /** * Apply options to a copy of the defaults. - * */ + */ export function applyToDefaults(defaults: T1, options: T2, isNullOverride?: boolean): T1 & T2; /** diff --git a/types/in-range/in-range-tests.ts b/types/in-range/in-range-tests.ts index a10113bd0f..041aea264e 100644 --- a/types/in-range/in-range-tests.ts +++ b/types/in-range/in-range-tests.ts @@ -6,4 +6,4 @@ inRange(30, 10, 100); inRange(30, 100, 10); -inRange(30, 10); \ No newline at end of file +inRange(30, 10); diff --git a/types/is-archive/is-archive-tests.ts b/types/is-archive/is-archive-tests.ts index 332deae7ec..c5c947c0d8 100644 --- a/types/is-archive/is-archive-tests.ts +++ b/types/is-archive/is-archive-tests.ts @@ -4,4 +4,4 @@ isArchive('src/unicorn.zip'); // => true isArchive('src/unicorn.txt'); -// => false \ No newline at end of file +// => false diff --git a/types/is-array/is-array-tests.ts b/types/is-array/is-array-tests.ts index 327c2ea3d0..7881b87574 100644 --- a/types/is-array/is-array-tests.ts +++ b/types/is-array/is-array-tests.ts @@ -7,7 +7,7 @@ isArray(true); isArray([]); isArray({}); -var x = {}; +const x = {}; if (isArray(x)) { x.push(0); } diff --git a/types/is-binary-path/is-binary-path-tests.ts b/types/is-binary-path/is-binary-path-tests.ts index 43505a5b32..59d9fe3c04 100644 --- a/types/is-binary-path/is-binary-path-tests.ts +++ b/types/is-binary-path/is-binary-path-tests.ts @@ -2,4 +2,4 @@ import isBinaryPath = require("is-binary-path"); const a: boolean = isBinaryPath("src/unicorn.png"); -const b: boolean = isBinaryPath("src/unicorn.txt"); \ No newline at end of file +const b: boolean = isBinaryPath("src/unicorn.txt"); diff --git a/types/is-compressed/is-compressed-tests.ts b/types/is-compressed/is-compressed-tests.ts index 7720b334a4..3a97ccc350 100644 --- a/types/is-compressed/is-compressed-tests.ts +++ b/types/is-compressed/is-compressed-tests.ts @@ -4,4 +4,4 @@ isCompressed('src/unicorn.zip'); // => true isCompressed('src/unicorn.txt'); -// => false \ No newline at end of file +// => false diff --git a/types/is-path-cwd/index.d.ts b/types/is-path-cwd/index.d.ts index c00b20dae8..468f06dbc6 100644 --- a/types/is-path-cwd/index.d.ts +++ b/types/is-path-cwd/index.d.ts @@ -4,4 +4,4 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped declare function isPathCwd(path: string): boolean; -export = isPathCwd; \ No newline at end of file +export = isPathCwd; diff --git a/types/is-path-cwd/is-path-cwd-tests.ts b/types/is-path-cwd/is-path-cwd-tests.ts index 80398a23cd..51405530ef 100644 --- a/types/is-path-cwd/is-path-cwd-tests.ts +++ b/types/is-path-cwd/is-path-cwd-tests.ts @@ -1,3 +1,3 @@ import isPathCwd = require("is-path-cwd"); -isPathCwd("unicorn"); \ No newline at end of file +isPathCwd("unicorn"); diff --git a/types/is-relative-url/is-relative-url-tests.ts b/types/is-relative-url/is-relative-url-tests.ts index 8835694624..2e93e6f4ed 100644 --- a/types/is-relative-url/is-relative-url-tests.ts +++ b/types/is-relative-url/is-relative-url-tests.ts @@ -7,4 +7,4 @@ isRelativeUrl('http://sindresorhus.com/foo/bar'); // => false isRelativeUrl('//sindresorhus.com'); -// => true \ No newline at end of file +// => true diff --git a/types/is-root-path/is-root-path-tests.ts b/types/is-root-path/is-root-path-tests.ts index 3e050cd162..ec5256ebaf 100644 --- a/types/is-root-path/is-root-path-tests.ts +++ b/types/is-root-path/is-root-path-tests.ts @@ -4,4 +4,4 @@ isRootPath('/'); // => true isRootPath('/Users'); -// => false \ No newline at end of file +// => false diff --git a/types/is-text-path/is-text-path-tests.ts b/types/is-text-path/is-text-path-tests.ts index f7c417fe51..378614cfbe 100644 --- a/types/is-text-path/is-text-path-tests.ts +++ b/types/is-text-path/is-text-path-tests.ts @@ -4,4 +4,4 @@ isTextPath('src/unicorn.txt'); // => true isTextPath('src/unicorn.png'); -// => false \ No newline at end of file +// => false diff --git a/types/is-windows/is-windows-tests.ts b/types/is-windows/is-windows-tests.ts index 79ada21511..e62af8cad3 100644 --- a/types/is-windows/is-windows-tests.ts +++ b/types/is-windows/is-windows-tests.ts @@ -1,3 +1,3 @@ import * as isWindows from 'is-windows'; -var bool: boolean = isWindows(); +const bool: boolean = isWindows(); diff --git a/types/jump.js/index.d.ts b/types/jump.js/index.d.ts index 111c41d59a..5c811d8656 100644 --- a/types/jump.js/index.d.ts +++ b/types/jump.js/index.d.ts @@ -12,7 +12,7 @@ declare namespace jump { interface Options { duration?: number; offset?: number; - callback?: () => void; + callback?(): void; easing?: TransitionFunc; a11y?: boolean; } diff --git a/types/keycloak-js/index.d.ts b/types/keycloak-js/index.d.ts index 9f7e817df1..ee1ef73deb 100644 --- a/types/keycloak-js/index.d.ts +++ b/types/keycloak-js/index.d.ts @@ -308,33 +308,33 @@ declare namespace Keycloak { /** * Called when the adapter is initialized. */ - onReady?: (authenticated?: boolean) => void; + onReady?(authenticated?: boolean): void; /** * Called when a user is successfully authenticated. */ - onAuthSuccess?: () => void; + onAuthSuccess?(): void; /** * Called if there was an error during authentication. */ - onAuthError?: (errorData: KeycloakError) => void; + onAuthError?(errorData: KeycloakError): void; /** * Called when the token is refreshed. */ - onAuthRefreshSuccess?: () => void; + onAuthRefreshSuccess?(): void; /** * Called if there was an error while trying to refresh the token. */ - onAuthRefreshError?: () => void; + onAuthRefreshError?(): void; /** * Called if the user is logged out (will only be called if the session * status iframe is enabled, or in Cordova mode). */ - onAuthLogout?: () => void; + onAuthLogout?(): void; /** * Called when the access token is expired. If a refresh token is available @@ -342,7 +342,7 @@ declare namespace Keycloak { * it's not (ie. with implicit flow) you can redirect to login screen to * obtain a new access token. */ - onTokenExpired?: () => void; + onTokenExpired?(): void; /** * Called to initialize the adapter. diff --git a/types/leaflet-draw/leaflet-draw-tests.ts b/types/leaflet-draw/leaflet-draw-tests.ts index 9729747851..05f1a2db6a 100644 --- a/types/leaflet-draw/leaflet-draw-tests.ts +++ b/types/leaflet-draw/leaflet-draw-tests.ts @@ -1,7 +1,7 @@ -const osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', - osmAttrib = '© OpenStreetMap contributors', - osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}), - map = L.map('map', {layers: [osm], center: L.latLng(-37.7772, 175.2756), zoom: 15 }); +const osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; +const osmAttrib = '© OpenStreetMap contributors'; +const osm = L.tileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}); +const map = L.map('map', {layers: [osm], center: L.latLng(-37.7772, 175.2756), zoom: 15 }); const drawnItems = L.featureGroup(); map.addLayer(drawnItems); @@ -37,8 +37,8 @@ map.addControl(drawControl); map.on('draw:created', (e: any) => { const drawEvent = e as L.DrawEvents.Created; - const type = drawEvent.layerType, - layer = drawEvent.layer; + const type = drawEvent.layerType; + const layer = drawEvent.layer; drawnItems.addLayer(layer); }); diff --git a/types/leaflet-fullscreen/index.d.ts b/types/leaflet-fullscreen/index.d.ts index 5051af1f60..168fae8a28 100644 --- a/types/leaflet-fullscreen/index.d.ts +++ b/types/leaflet-fullscreen/index.d.ts @@ -7,6 +7,6 @@ declare namespace L { interface MapOptions { - fullscreenControl?: true | {pseudoFullscreen: boolean} + fullscreenControl?: true | {pseudoFullscreen: boolean}; } } diff --git a/types/leaflet-fullscreen/leaflet-fullscreen-tests.ts b/types/leaflet-fullscreen/leaflet-fullscreen-tests.ts index d016d2eea5..661f1bc208 100644 --- a/types/leaflet-fullscreen/leaflet-fullscreen-tests.ts +++ b/types/leaflet-fullscreen/leaflet-fullscreen-tests.ts @@ -1,5 +1,5 @@ -var map = L.map('map', { +const map = L.map('map', { center: [51.505, -0.09], zoom: 13, fullscreenControl: true, -}); \ No newline at end of file +}); diff --git a/types/leaflet/index.d.ts b/types/leaflet/index.d.ts index 0efffe8f9e..043a8eabe9 100644 --- a/types/leaflet/index.d.ts +++ b/types/leaflet/index.d.ts @@ -49,7 +49,7 @@ declare namespace L { function clipPolygon(points: Point[], bounds: BoundsExpression, round?: boolean): Point[]; } - module DomUtil { + namespace DomUtil { /** * Get Element by its ID or with the given HTML-Element */ @@ -796,7 +796,7 @@ declare namespace L { * } * ``` */ - pointToLayer?: (geoJsonPoint: GeoJSONFeature, latlng: LatLng) => Layer; // should import GeoJSON typings + pointToLayer?(geoJsonPoint: GeoJSONFeature, latlng: LatLng): Layer; // should import GeoJSON typings /** * A Function defining the Path options for styling GeoJSON lines and polygons, @@ -822,7 +822,7 @@ declare namespace L { * function (feature, layer) {} * ``` */ - onEachFeature?: (feature: GeoJSONFeature, layer: Layer) => void; + onEachFeature?(feature: GeoJSONFeature, layer: Layer): void; /** * A Function that will be used to decide whether to show a feature or not. @@ -835,13 +835,13 @@ declare namespace L { * } * ``` */ - filter?: (geoJsonFeature: GeoJSONFeature) => boolean; + filter?(geoJsonFeature: GeoJSONFeature): boolean; /** * A Function that will be used for converting GeoJSON coordinates to LatLngs. * The default is the coordsToLatLng static method. */ - coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng; // check if LatLng has an altitude property + coordsToLatLng?(coords: [number, number] | [number, number, number]): LatLng; // check if LatLng has an altitude property } /** diff --git a/types/loopback-boot/index.d.ts b/types/loopback-boot/index.d.ts index 93e912363e..89414d5a4c 100644 --- a/types/loopback-boot/index.d.ts +++ b/types/loopback-boot/index.d.ts @@ -185,7 +185,6 @@ interface OptionsLB { } declare namespace lb { - /** * compileToBrowserify * @@ -197,7 +196,6 @@ declare namespace lb { */ class compileToBrowserify { - /** * Application identifier used to load the correct boot configuration when * building multiple applications using browserify. @@ -207,4 +205,4 @@ declare namespace lb { } } -export = lb; \ No newline at end of file +export = lb; diff --git a/types/loopback-boot/loopback-boot-tests.ts b/types/loopback-boot/loopback-boot-tests.ts index 4885fca1d0..5b0e8d54a9 100644 --- a/types/loopback-boot/loopback-boot-tests.ts +++ b/types/loopback-boot/loopback-boot-tests.ts @@ -25,4 +25,4 @@ class Server { this.app.start(); }); } -} \ No newline at end of file +} diff --git a/types/lorem-ipsum/index.d.ts b/types/lorem-ipsum/index.d.ts index 0a2210c0d8..a4252de442 100644 --- a/types/lorem-ipsum/index.d.ts +++ b/types/lorem-ipsum/index.d.ts @@ -47,7 +47,7 @@ interface LoremIpsumOptions { /** * A PRNG function. Uses Math.random by default. */ - random?: () => number; + random?(): number; /** * The character to insert between paragraphs. Defaults to default EOL. diff --git a/types/ltx/index.d.ts b/types/ltx/index.d.ts index c5794f12bb..b466521876 100644 --- a/types/ltx/index.d.ts +++ b/types/ltx/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 -export {Element} from './lib/Element' +export {Element} from './lib/Element'; export {nameEqual, attrsEqual, childrenEqual, equal} from './lib/equal'; export {isNode, isElement, isText} from './lib/is'; export {clone} from './lib/clone'; diff --git a/types/lz-string/index.d.ts b/types/lz-string/index.d.ts index 3baaee4037..bd64854976 100644 --- a/types/lz-string/index.d.ts +++ b/types/lz-string/index.d.ts @@ -9,85 +9,85 @@ export as namespace LZString; declare namespace LZString { /** - * LZ-based compression algorithm for JavaScript. - */ + * LZ-based compression algorithm for JavaScript. + */ interface LZStringStatic { /** - * Compresses input string producing an instance of an "invalid" UTF-16 string. - * Such string could be stored in localStorage only on webkit - * browsers (tested on Android, Chrome, Safari). - * - * @param uncompressed A string which should be compressed. - */ + * Compresses input string producing an instance of an "invalid" UTF-16 string. + * Such string could be stored in localStorage only on webkit + * browsers (tested on Android, Chrome, Safari). + * + * @param uncompressed A string which should be compressed. + */ compress(uncompressed: string): string; /** - * Decompresses "invalid" input string created by the method compress(). - * - * @param compressed A string obtained from a call to compress(). - */ + * Decompresses "invalid" input string created by the method compress(). + * + * @param compressed A string obtained from a call to compress(). + */ decompress(compressed: string): string; /** - * Compresses input string producing an instance of a "valid" UTF-16 string, - * in the sense that all browsers can store them safely. - * - * @param uncompressed A string which should be compressed. - */ + * Compresses input string producing an instance of a "valid" UTF-16 string, + * in the sense that all browsers can store them safely. + * + * @param uncompressed A string which should be compressed. + */ compressToUTF16(uncompressed: string): string; /** - * Decompresses "valid" input string created by the method compressToUTF16(). - * - * @param compressed A string obtained from a call to compressToUTF16(). - */ + * Decompresses "valid" input string created by the method compressToUTF16(). + * + * @param compressed A string obtained from a call to compressToUTF16(). + */ decompressFromUTF16(compressed: string): string; /** - * Compresses input string producing an instance of a ASCII UTF-16 string, - * which represents the original string encoded in Base64. - * The result can be safely transported outside the browser with a - * guarantee that none of the characters produced need to be URL-encoded. - * - * @param uncompressed A string which should be compressed. - */ + * Compresses input string producing an instance of a ASCII UTF-16 string, + * which represents the original string encoded in Base64. + * The result can be safely transported outside the browser with a + * guarantee that none of the characters produced need to be URL-encoded. + * + * @param uncompressed A string which should be compressed. + */ compressToBase64(uncompressed: string): string; /** - * Decompresses ASCII UTF-16 input string created by the method compressToBase64(). - * - * @param compressed A string obtained from a call to compressToBase64(). - */ + * Decompresses ASCII UTF-16 input string created by the method compressToBase64(). + * + * @param compressed A string obtained from a call to compressToBase64(). + */ decompressFromBase64(compressed: string): string; /** - * produces ASCII strings representing the original string encoded in Base64 with a few - * tweaks to make these URI safe. Hence, you can send them to the server without thinking - * about URL encoding them. This saves bandwidth and CPU - * - * @param uncompressed A string which should be compressed. - */ + * produces ASCII strings representing the original string encoded in Base64 with a few + * tweaks to make these URI safe. Hence, you can send them to the server without thinking + * about URL encoding them. This saves bandwidth and CPU + * + * @param uncompressed A string which should be compressed. + */ compressToEncodedURIComponent(uncompressed: string): string; /** - * Decompresses "valid" input string created by the method compressToEncodedURIComponent(). - * - * @param compressed A string obtained from a call to compressToEncodedURIComponent(). - */ + * Decompresses "valid" input string created by the method compressToEncodedURIComponent(). + * + * @param compressed A string obtained from a call to compressToEncodedURIComponent(). + */ decompressFromEncodedURIComponent(compressed: string): string; /** - * produces an uint8Array - * - * @param uncompressed A string which should be compressed. - */ + * produces an uint8Array + * + * @param uncompressed A string which should be compressed. + */ compressToUint8Array(uncompressed: string): Uint8Array; /** - * Decompresses "valid" array created by the method compressToUint8Array(). - * - * @param compressed A string obtained from a call to compressToUint8Array(). - */ + * Decompresses "valid" array created by the method compressToUint8Array(). + * + * @param compressed A string obtained from a call to compressToUint8Array(). + */ decompressFromUint8Array(compressed: Uint8Array): string; } } diff --git a/types/math3d/index.d.ts b/types/math3d/index.d.ts index 5a46c249c9..626aed9df6 100644 --- a/types/math3d/index.d.ts +++ b/types/math3d/index.d.ts @@ -125,7 +125,7 @@ export class Matrix4x4 { size: { rows: number, columns: number }; values: number[]; - determinant(): number + determinant(): number; inverse(): Matrix4x4; negate(): Matrix4x4; transpose(): Matrix4x4; diff --git a/types/mem/index.d.ts b/types/mem/index.d.ts index 0f79a9f525..94ea5137ec 100644 --- a/types/mem/index.d.ts +++ b/types/mem/index.d.ts @@ -5,7 +5,7 @@ interface Options { maxAge?: number; - cacheKey?: (...args: any[]) => string; + cacheKey?(...args: any[]): string; cache?: any; } diff --git a/types/memoizee/index.d.ts b/types/memoizee/index.d.ts index 456641dc59..c83e0ea307 100644 --- a/types/memoizee/index.d.ts +++ b/types/memoizee/index.d.ts @@ -10,10 +10,10 @@ declare namespace memoizee { max?: number; preFetch?: number | true; promise?: boolean; - dispose?: (value: any) => void; + dispose?(value: any): void; async?: boolean; primitive?: boolean; - normalizer?: (value: any) => void; + normalizer?(value: any): void; resolvers?: Array<(arg: any) => any>; } @@ -23,7 +23,7 @@ declare namespace memoizee { } } -// tslint:disable:forbidden-types +// tslint:disable-next-line ban-types declare function memoizee(f: F, options?: memoizee.Options): F & memoizee.Memoized; export = memoizee; diff --git a/types/meteor-collection-hooks/index.d.ts b/types/meteor-collection-hooks/index.d.ts index 8aaf03f91d..73784822ea 100644 --- a/types/meteor-collection-hooks/index.d.ts +++ b/types/meteor-collection-hooks/index.d.ts @@ -72,7 +72,8 @@ declare namespace Mongo { doc: T ) => void ): void; - update(hook: ( + update( + hook: ( userId: string, doc: T, fieldNames: string[], @@ -81,7 +82,8 @@ declare namespace Mongo { ) => void, options?: CollectionHooks.HookOptionValue ): void; - upsert(hook: ( + upsert( + hook: ( userId: string, doc: T, selector: Mongo.Selector, @@ -97,14 +99,14 @@ declare namespace Mongo { limit?: number; fields?: Mongo.FieldSpecifier; reactive?: boolean; - transform?: (doc: any) => void; + transform?(doc: any): void; }): Mongo.Cursor; findOne(selector?: Mongo.Selector | Mongo.ObjectID | string, options?: { sort?: Mongo.SortSpecifier; skip?: number; fields?: Mongo.FieldSpecifier; reactive?: boolean; - transform?: (doc: any) => void; + transform?(doc: any): void; }): T; insert( doc: T, @@ -156,4 +158,4 @@ declare namespace CollectionHooks { after?: LocalHookOptions; all?: LocalHookOptions; } -} \ No newline at end of file +} diff --git a/types/meteor-collection-hooks/meteor-collection-hooks-tests.ts b/types/meteor-collection-hooks/meteor-collection-hooks-tests.ts index b8c0c63247..c3a3c0a7bd 100644 --- a/types/meteor-collection-hooks/meteor-collection-hooks-tests.ts +++ b/types/meteor-collection-hooks/meteor-collection-hooks-tests.ts @@ -76,4 +76,4 @@ Collection.hookOptions = { update: { fetchPrevious: true }, upsert: { fetchPrevious: true } } -}; \ No newline at end of file +}; diff --git a/types/msgpack-lite/index.d.ts b/types/msgpack-lite/index.d.ts index e451267dbc..dfdc3cd821 100644 --- a/types/msgpack-lite/index.d.ts +++ b/types/msgpack-lite/index.d.ts @@ -37,7 +37,7 @@ export function createCodec(options?: CodecOptions): Codec; /** * The default built-in codec */ -export var codec: { +export const codec: { /** * The default built-in codec */ @@ -72,30 +72,30 @@ export interface Encoder { minBufferSize: number; offset: number; start: number; - write: (chunk: any) => void; - fetch: () => void; - flush: () => void; - push: (chunk: any) => void; - pull: () => number; - read: () => number; - reserve: (length: number) => number; - send: (buffer: Buffer) => void; - encode: (chunk: any) => void; - end: (chunk: any) => void; + write(chunk: any): void; + fetch(): void; + flush(): void; + push(chunk: any): void; + pull(): number; + read(): number; + reserve(length: number): number; + send(buffer: Buffer): void; + encode(chunk: any): void; + end(chunk: any): void; } export interface Decoder { bufferish: any; offset: number; - fetch: () => void; - flush: () => void; - pull: () => number; - read: () => number; - write: (chunk: any) => void; - reserve: (length: number) => number; - decode: (chunk: any) => void; - push: (chunk: any) => void; - end: (chunk: any) => void; + fetch(): void; + flush(): void; + pull(): number; + read(): number; + write(chunk: any): void; + reserve(length: number): number; + decode(chunk: any): void; + push(chunk: any): void; + end(chunk: any): void; } export interface EncodeStream extends stream.Transform { @@ -150,4 +150,4 @@ export interface EncoderOptions { export interface DecoderOptions { codec?: Codec; -} \ No newline at end of file +} diff --git a/types/msgpack-lite/msgpack-lite-tests.ts b/types/msgpack-lite/msgpack-lite-tests.ts index a03d86b679..7e357c4b6a 100644 --- a/types/msgpack-lite/msgpack-lite-tests.ts +++ b/types/msgpack-lite/msgpack-lite-tests.ts @@ -3,18 +3,18 @@ import * as msgpack from 'msgpack-lite'; // https://github.com/kawanet/msgpack-lite#encoding-and-decoding-messagepack function encodingAndDecoding() { // encode from JS Object to MessagePack (Buffer) - var buffer = msgpack.encode({foo: "bar"}); + const buffer = msgpack.encode({foo: "bar"}); // decode from MessagePack (Buffer) to JS Object - var data = msgpack.decode(buffer); // => {"foo": "bar"} + const data = msgpack.decode(buffer); // => {"foo": "bar"} } // https://github.com/kawanet/msgpack-lite#writing-to-messagepack-stream function writingToStream() { - var fs = require("fs"); + const fs = require("fs"); - var writeStream = fs.createWriteStream("test.msp"); - var encodeStream = msgpack.createEncodeStream(); + const writeStream = fs.createWriteStream("test.msp"); + const encodeStream = msgpack.createEncodeStream(); encodeStream.pipe(writeStream); // send multiple objects to stream @@ -27,10 +27,10 @@ function writingToStream() { // https://github.com/kawanet/msgpack-lite#reading-from-messagepack-stream function readingFromStream() { - var fs = require("fs"); + const fs = require("fs"); - var readStream = fs.createReadStream("test.msp"); - var decodeStream = msgpack.createDecodeStream(); + const readStream = fs.createReadStream("test.msp"); + const decodeStream = msgpack.createDecodeStream(); // show multiple objects decoded from stream readStream.pipe(decodeStream).on("data", console.warn); @@ -50,25 +50,25 @@ function decodingBytesArray() { // https://github.com/kawanet/msgpack-lite#custom-extension-types-codecs function customExtensionTypes() { - var codec = msgpack.createCodec(); - codec.addExtPacker(0x3F, MyVector, myVectorPacker); - codec.addExtUnpacker(0x3F, myVectorUnpacker); - - var data = new MyVector(1, 2); - var encoded = msgpack.encode(data, {codec}); - var decoded = msgpack.decode(encoded, {codec}); - class MyVector { constructor(public x: number, public y: number) {} } + const codec = msgpack.createCodec(); + codec.addExtPacker(0x3F, MyVector, myVectorPacker); + codec.addExtUnpacker(0x3F, myVectorUnpacker); + + const data = new MyVector(1, 2); + const encoded = msgpack.encode(data, {codec}); + const decoded = msgpack.decode(encoded, {codec}); + function myVectorPacker(vector: MyVector) { - var array = [vector.x, vector.y]; + const array = [vector.x, vector.y]; return msgpack.encode(array); // return Buffer serialized } function myVectorUnpacker(buffer: Buffer | Uint8Array): MyVector { - var array = msgpack.decode(buffer); + const array = msgpack.decode(buffer); return new MyVector(array[0], array[1]); // return Object deserialized } } diff --git a/types/nanoscroller/index.d.ts b/types/nanoscroller/index.d.ts index ede65fc283..ffa648b1ab 100644 --- a/types/nanoscroller/index.d.ts +++ b/types/nanoscroller/index.d.ts @@ -8,115 +8,115 @@ declare namespace JQueryNanoScroller { interface NanoScrollerOptions { /** - * To scroll at the top or bottom. - */ + * To scroll at the top or bottom. + */ scroll?: 'top' | 'bottom'; /** - * To scroll at the top with an offset value. - */ + * To scroll at the top with an offset value. + */ scrollTop?: number; /** - * To scroll at the bottom with an offset value. - */ + * To scroll at the bottom with an offset value. + */ scrollBottom?: number; /** - * To scroll to an element. - */ + * To scroll to an element. + */ scrollTo?: JQuery; /** - * To stop the operation. - * This option will tell the plugin to disable all event bindings and hide the gadget scrollbar from the UI. - */ + * To stop the operation. + * This option will tell the plugin to disable all event bindings and hide the gadget scrollbar from the UI. + */ stop?: boolean; /** - * Destroys nanoScroller and restores browser's native scrollbar. - */ + * Destroys nanoScroller and restores browser's native scrollbar. + */ destroy?: boolean; /** - * To flash the scrollbar gadget for an amount of time defined in plugin settings (defaults to 1,5s). - * Useful if you want to show the user that there is more content waiting for him. - */ + * To flash the scrollbar gadget for an amount of time defined in plugin settings (defaults to 1,5s). + * Useful if you want to show the user that there is more content waiting for him. + */ flash?: boolean; /** - * Set to true if you want to use native scrolling in iOS 5+. - * This will disable your custom nanoScroller scrollbar in iOS 5+ and use the native one instead. - * While the native iOS scrollbar usually works much better, there could possibly be bugs in certain situations. - * @default false - */ + * Set to true if you want to use native scrolling in iOS 5+. + * This will disable your custom nanoScroller scrollbar in iOS 5+ and use the native one instead. + * While the native iOS scrollbar usually works much better, there could possibly be bugs in certain situations. + * @default false + */ iOSNativeScrolling?: boolean; /** - * Sets the minimum height of the slider element. - * @default 20 - */ + * Sets the minimum height of the slider element. + * @default 20 + */ sliderMinHeight?: number; /** - * Sets the maximum height of the slider element. - * @default null - */ + * Sets the maximum height of the slider element. + * @default null + */ sliderMaxHeight?: number | null; /** - * Set to true to prevent page scrolling when top or bottom inside the content div is reached. - * @default false - */ + * Set to true to prevent page scrolling when top or bottom inside the content div is reached. + * @default false + */ preventPageScrolling?: boolean; /** - * Set to true to disable the resize from nanoscroller. - * Useful if you want total control of the resize event. - * If you set this option to true remember to call the reset method so that the scroll don't have strange behavior. - * @default false - */ + * Set to true to disable the resize from nanoscroller. + * Useful if you want total control of the resize event. + * If you set this option to true remember to call the reset method so that the scroll don't have strange behavior. + * @default false + */ disableResize?: boolean; /** - * Set to true to stop the scrollbar from auto-hiding itself. - * @default false - */ + * Set to true to stop the scrollbar from auto-hiding itself. + * @default false + */ alwaysVisible?: boolean; /** - * Use this setting to specify the scrollbar hide delay in milliseconds if you have enabled the flash option. - * @default 1500 - */ + * Use this setting to specify the scrollbar hide delay in milliseconds if you have enabled the flash option. + * @default 1500 + */ flashDelay?: number; /** - * A classname for scrollbar track element. - * If you change this setting, you also have to change it in the plugin's CSS file. - * @default 'nano-pane' - */ + * A classname for scrollbar track element. + * If you change this setting, you also have to change it in the plugin's CSS file. + * @default 'nano-pane' + */ paneClass?: string; /** - * A classname for scrollbar thumb element. - * If you change this setting, you also have to change it in the plugin's CSS file. - * @default 'nano-slider' - */ + * A classname for scrollbar thumb element. + * If you change this setting, you also have to change it in the plugin's CSS file. + * @default 'nano-slider' + */ sliderClass?: string; /** - * A classname for your content div. - * If you change this setting, you also have to change it in the plugin's CSS file. - * @default 'nano-content' - */ + * A classname for your content div. + * If you change this setting, you also have to change it in the plugin's CSS file. + * @default 'nano-content' + */ contentClass?: string; /** - * A classname for scrollbar enabled mode. - * If you change this setting, you also have to change it in the plugin's CSS file. - * @default 'has-scrollbar' - */ + * A classname for scrollbar enabled mode. + * If you change this setting, you also have to change it in the plugin's CSS file. + * @default 'has-scrollbar' + */ enabledClass?: string; /** - * A classname for scrollbar flashed mode. - * If you change this setting, you also have to change it in the plugin's CSS file. - * @default 'flashed' - */ + * A classname for scrollbar flashed mode. + * If you change this setting, you also have to change it in the plugin's CSS file. + * @default 'flashed' + */ flashedClass?: string; /** - * - * If you change this setting, you also have to change it in the plugin's CSS file. - * @default 'active' - */ + * + * If you change this setting, you also have to change it in the plugin's CSS file. + * @default 'active' + */ activeClass?: string; /** - * Set the tab order of the scrollable content. - * Set to -1 to skip over the scrollable content when tabbing. - * @default 0 - */ + * Set the tab order of the scrollable content. + * Set to -1 to skip over the scrollable content when tabbing. + * @default 0 + */ tabIndex?: number; } } diff --git a/types/openfin/index.d.ts b/types/openfin/index.d.ts index e6c11d0180..ac90c223f7 100644 --- a/types/openfin/index.d.ts +++ b/types/openfin/index.d.ts @@ -19,7 +19,7 @@ * Overview * When running within the OpenFin Runtime your web applications have access to the "fin" namespace and all the modules within the API * without the need to include additional source files. You can treat the "fin" namespace as you would the "window", "navigator" or "document" objects. - **/ + */ declare namespace fin { const desktop: OpenFinDesktop; @@ -38,7 +38,9 @@ declare namespace fin { * Creates a new Application. * An object representing an application. Allows the developer to create, execute, show/close an application as well as listen to application events. */ - new (options: ApplicationOptions, callback?: (successObj: { httpResponseCode: number }) => void, + new ( + options: ApplicationOptions, + callback?: (successObj: { httpResponseCode: number }) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinApplication; /** * Returns an Application object that represents an existing application. @@ -62,7 +64,8 @@ declare namespace fin { /** * Registers an event listener on the specified event. */ - addEventListener(type: OpenFinApplicationEventType, + addEventListener( + type: OpenFinApplicationEventType, listener: (event: ApplicationBaseEvent | TrayIconClickedEvent | WindowEvent @@ -70,7 +73,8 @@ declare namespace fin { | WindowAuthRequested | WindowNavigationRejectedEvent | WindowEndLoadEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; + callback?: () => void, + errorCallback?: (reason: string) => void): void; /** * Closes the application and any child windows created by the application. */ @@ -110,7 +114,8 @@ declare namespace fin { /** * Removes a previously registered event listener from the specified event. */ - removeEventListener(type: OpenFinApplicationEventType, + removeEventListener( + type: OpenFinApplicationEventType, previouslyRegisteredListener: (event: ApplicationBaseEvent | TrayIconClickedEvent | WindowEvent @@ -118,7 +123,8 @@ declare namespace fin { | WindowAuthRequested | WindowNavigationRejectedEvent | WindowEndLoadEvent) => any, - callback?: () => void, errorCallback?: (reason: string) => void): void; + callback?: () => void, + errorCallback?: (reason: string) => void): void; /** * Removes the application's icon from the tray. */ @@ -423,12 +429,18 @@ declare namespace fin { /** * Registers an event listener on the specified event. */ - addEventListener(type: OpenFinExternalApplicationEventType, listener: () => void, callback?: () => void, + addEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; /** * Removes a previously registered event listener from the specified event. */ - removeEventListener(type: OpenFinExternalApplicationEventType, listener: () => void, callback?: () => void, + removeEventListener( + type: OpenFinExternalApplicationEventType, + listener: () => void, + callback?: () => void, errorCallback?: (reason: string, error: ErrorInfo) => void): void; } @@ -466,17 +478,35 @@ declare namespace fin { * Subscribes to messages from the specified application on the specified topic. If the subscription is for a uuid, [name], * topic combination that has already been published to upon subscription you will receive the last 20 missed messages in the order they were published. */ - subscribe(senderUuid: string, name: string, topic: string, listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - subscribe(senderUuid: string, topic: string, listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + subscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; /** * Unsubscribes to messages from the specified application on the specified topic. */ - unsubscribe(senderUuid: string, name: string, topic: string, listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; - unsubscribe(senderUuid: string, topic: string, listener: (message: any, uuid: string, name: string) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + name: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; + unsubscribe( + senderUuid: string, + topic: string, + listener: (message: any, uuid: string, name: string) => void, + callback?: () => void, + errorCallback?: (reason: string) => void): void; } interface OpenFinNotificationStatic { @@ -570,9 +600,11 @@ declare namespace fin { /** * Registers an event listener on the specified event. */ - addEventListener(type: OpenFinSystemEventType, + addEventListener( + type: OpenFinSystemEventType, listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; + callback?: () => void, + errorCallback?: (reason: string) => void): void; /** * Clears cached data containing window state/positions, * application resource files (images, HTML, JavaScript files), cookies, and items stored in the Local Storage. @@ -585,8 +617,11 @@ declare namespace fin { /** * Downloads the given application asset */ - downloadAsset(assetObj: AppAssetInfo, progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, - callback?: (successObj: { path: string }) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; + downloadAsset( + assetObj: AppAssetInfo, + progressListener?: (progress: { downloadedBytes: number, totalBytes: number }) => void, + callback?: (successObj: { path: string }) => void, + errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): void; /** * Exits the Runtime. */ @@ -671,16 +706,19 @@ declare namespace fin { /** * This function call will register a unique id and produce a token. The token can be used to broker an external connection. */ - registerExternalConnection(uuid: string, callback?: (detail: { - /** - * this will be unique each time - */ - token: string; - /** - * "remote-connection-uuid" - */ - uuid: string; - }) => void, errorCallback?: (reason: string) => void): void; + registerExternalConnection( + uuid: string, + callback?: (detail: { + /** + * this will be unique each time + */ + token: string; + /** + * "remote-connection-uuid" + */ + uuid: string; + }) => void, + errorCallback?: (reason: string) => void): void; /** * Removes the process entry for the passed UUID obtained from a prior call of fin.desktop.System.launchExternalProcess(). */ @@ -688,7 +726,8 @@ declare namespace fin { /** * Removes a previously registered event listener from the specified event. */ - removeEventListener(type: OpenFinSystemEventType, + removeEventListener( + type: OpenFinSystemEventType, listener: (event: SystemBaseEvent | DesktopIconClickedEvent | IdleStateChangedEvent | MonitorInfoChangedEvent | SessionChangedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; /** @@ -698,9 +737,16 @@ declare namespace fin { /** * Attempt to close an external process. The process will be terminated if it has not closed after the elapsed timeout in milliseconds. */ - terminateExternalProcess(processUuid: string, timeout: number, killTree: boolean, callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + terminateExternalProcess( + processUuid: string, + timeout: number, + killTree: boolean, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, errorCallback?: (reason: string) => void): void; - terminateExternalProcess(processUuid: string, timeout: number, callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, + terminateExternalProcess( + processUuid: string, + timeout: number, + callback?: (info: { result: "clean" | "terminated" | "failed" }) => void, errorCallback?: (reason: string) => void): void; /** * Update the OpenFin Runtime Proxy settings. @@ -932,7 +978,7 @@ declare namespace fin { * over any 'args' set in the 'app.json'. */ arguments?: string; - listener?: (result: { + listener?(result: { /** * "Exited" Or "released" on a call to releaseExternalProcess */ @@ -945,7 +991,7 @@ declare namespace fin { * Process exit code */ exitCode?: number; - }) => void; + }): void; certificate?: CertificationInfo; } @@ -974,7 +1020,7 @@ declare namespace fin { interface ExternalProcessInfo { pid?: number; - listener?: (result: { + listener?(result: { /** * "Exited" Or "released" on a call to releaseExternalProcess */ @@ -984,10 +1030,10 @@ declare namespace fin { */ uuid?: string; /* - * Process exit code - */ + * Process exit code + */ exitCode?: number; - }) => void; + }): void; } interface OpenFinWindowStatic { @@ -1005,7 +1051,9 @@ declare namespace fin { * @param {Function} [callback] - Called if the window creation was successful * @param {number} [callback.successObj] - httpResponseCode */ - new (options: WindowOptions, callback?: (successObj: { httpResponseCode: number }) => void, + new ( + options: WindowOptions, + callback?: (successObj: { httpResponseCode: number }) => void, errorCallback?: (reason: string, errorObj: NetworkErrorInfo) => void): OpenFinWindow; /** * Returns an instance of the current window. @@ -1049,14 +1097,16 @@ declare namespace fin { /** * Registers an event listener on the specified event. */ - addEventListener(type: OpenFinWindowEventType, listener: (event: WindowBaseEvent - | WindowAuthRequestedEvent - | WindowBoundsEvent - | WindowExternalProcessStartedEvent - | WindowExternalProcessExited - | WindowGroupChangedEvent - | WindowHiddenEvent - | Window_NavigationRejectedEvent) => void, + addEventListener( + type: OpenFinWindowEventType, + listener: (event: WindowBaseEvent + | WindowAuthRequestedEvent + | WindowBoundsEvent + | WindowExternalProcessStartedEvent + | WindowExternalProcessExited + | WindowGroupChangedEvent + | WindowHiddenEvent + | Window_NavigationRejectedEvent) => void, callback?: () => void, errorCallback?: (reason: string) => void): void; /** * Performs the specified window transitions @@ -1167,7 +1217,8 @@ declare namespace fin { /** * Removes a previously registered event listener from the specified event. */ - removeEventListener(type: OpenFinWindowEventType, + removeEventListener( + type: OpenFinWindowEventType, listener: (event: WindowBaseEvent | WindowAuthRequestedEvent | WindowBoundsEvent @@ -1176,7 +1227,8 @@ declare namespace fin { | WindowGroupChangedEvent | WindowHiddenEvent | Window_NavigationRejectedEvent) => void, - callback?: () => void, errorCallback?: (reason: string) => void): void; + callback?: () => void, + errorCallback?: (reason: string) => void): void; /** * Resizes the window by a specified amount. */ diff --git a/types/openfin/v15/tslint.json b/types/openfin/v15/tslint.json index e4f5db4fa0..9a8c3325b5 100644 --- a/types/openfin/v15/tslint.json +++ b/types/openfin/v15/tslint.json @@ -1,6 +1,13 @@ { "extends": "../tslint.json", "rules": { - "max-line-length": false + "align": false, + "eofline": false, + "jsdoc-format": false, + "max-line-length": false, + "no-consecutive-blank-lines": false, + "no-padding": false, + "no-var": false, + "prefer-method-signature": false } } diff --git a/types/openfin/v16/tslint.json b/types/openfin/v16/tslint.json index c5090ea20a..719a831603 100644 --- a/types/openfin/v16/tslint.json +++ b/types/openfin/v16/tslint.json @@ -1,7 +1,17 @@ -{ - "extends": "../../tslint.json", +{ + "extends": "../../tslint.json", "rules": { + "align": false, + "comment-format": false, + "eofline": false, + "jsdoc-format": false, "max-line-length": false, - "only-arrow-functions-2": false + "no-padding": false, + "no-var": false, + "object-literal-key-quotes": false, + "object-literal-shorthand": false, + "only-arrow-functions": false, + "prefer-method-signature": false, + "space-before-function-paren": false } } \ No newline at end of file diff --git a/types/path-is-absolute/path-is-absolute-tests.ts b/types/path-is-absolute/path-is-absolute-tests.ts index 6948e290fa..4fb87cf5f0 100644 --- a/types/path-is-absolute/path-is-absolute-tests.ts +++ b/types/path-is-absolute/path-is-absolute-tests.ts @@ -20,4 +20,4 @@ pathIsAbsolute.posix('C:/Users/foo'); pathIsAbsolute.win32('C:/Users/foo'); // => true pathIsAbsolute.win32('/home/foo'); -// => false \ No newline at end of file +// => false diff --git a/types/payment/payment-tests.ts b/types/payment/payment-tests.ts index 5601067419..b639b73127 100644 --- a/types/payment/payment-tests.ts +++ b/types/payment/payment-tests.ts @@ -1,16 +1,16 @@ import * as Payment from "payment"; -var input = document.getElementById('input') as HTMLInputElement; +const input = document.getElementById('input') as HTMLInputElement; Payment.restrictNumeric(input); Payment.formatCardNumber(input); Payment.formatCardExpiry(input); Payment.formatCardCVC(input); -var card = "1234 5678 9012 3456"; +const card = "1234 5678 9012 3456"; -var cardType = Payment.fns.cardType(card); +const cardType = Payment.fns.cardType(card); Payment.fns.validateCardNumber(card); Payment.fns.validateCardExpiry("1 / 20"); Payment.fns.validateCardExpiry("1", "20"); -Payment.fns.validateCardCVC("123", cardType); \ No newline at end of file +Payment.fns.validateCardCVC("123", cardType); diff --git a/types/pbf/pbf-tests.ts b/types/pbf/pbf-tests.ts index 39c67602d8..c0a8556c42 100644 --- a/types/pbf/pbf-tests.ts +++ b/types/pbf/pbf-tests.ts @@ -1,6 +1,6 @@ import Pbf = require('pbf'); -var pbf = new Pbf(new Uint8Array(1)); +const pbf = new Pbf(new Uint8Array(1)); new Pbf(); pbf.buf; pbf.pos; @@ -85,4 +85,4 @@ pbf.writeSVarintField(1, 2); pbf.writeStringField(1, ''); pbf.writeFloatField(1, 2); pbf.writeDoubleField(1, 2); -pbf.writeBooleanField(1, true); \ No newline at end of file +pbf.writeBooleanField(1, true); diff --git a/types/pikaday-time/index.d.ts b/types/pikaday-time/index.d.ts index 1fcb92a7ed..d1cd056b79 100644 --- a/types/pikaday-time/index.d.ts +++ b/types/pikaday-time/index.d.ts @@ -226,7 +226,7 @@ declare namespace Pikaday { * Callback function that gets passed a Date object for each day * in view. Should return true to disable selection of that day. */ - disableDayFn?: (date: Date) => boolean; + disableDayFn?(date: Date): boolean; /** * Number of years either side (e.g. 10) or array of upper/lower range @@ -285,22 +285,22 @@ declare namespace Pikaday { /** * Callback function for when a date is selected. */ - onSelect?: (date: Date) => void; + onSelect?(date: Date): void; /** * Callback function for when the picker becomes visible. */ - onOpen?: () => void; + onOpen?(): void; /** * Callback function for when the picker is hidden. */ - onClose?: () => void; + onClose?(): void; /** * Callback function for when the picker draws a new month. */ - onDraw?: () => void; + onDraw?(): void; /*--pikaday-time specific addition--*/ /** diff --git a/types/pikaday-time/pikaday-time-tests.ts b/types/pikaday-time/pikaday-time-tests.ts index 3dcaf17dcd..fec72dc553 100644 --- a/types/pikaday-time/pikaday-time-tests.ts +++ b/types/pikaday-time/pikaday-time-tests.ts @@ -7,8 +7,8 @@ new Pikaday({field: document.getElementById('datepicker')}); new Pikaday({field: $('#datepicker')[0]}); (() => { - var field: HTMLInputElement = document.getElementById('datepicker'); - var picker = new Pikaday({ + const field: HTMLInputElement = document.getElementById('datepicker'); + const picker = new Pikaday({ onSelect(date: Date) { field.value = picker.toString(); console.log(date.toISOString()); @@ -18,7 +18,7 @@ new Pikaday({field: $('#datepicker')[0]}); })(); (() => { - var picker = new Pikaday({ + const picker = new Pikaday({ field: document.getElementById('datepicker'), format: 'D MMM YYYY', onSelect() { @@ -50,7 +50,7 @@ new Pikaday({field: $('#datepicker')[0]}); })(); (() => { - var i18n: Pikaday.PikadayI18nConfig = { + const i18n: Pikaday.PikadayI18nConfig = { previousMonth: 'Previous Month', nextMonth: 'Next Month', months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], diff --git a/types/pixi.js/index.d.ts b/types/pixi.js/index.d.ts index d7a71abcef..81e0cf5637 100644 --- a/types/pixi.js/index.d.ts +++ b/types/pixi.js/index.d.ts @@ -800,7 +800,7 @@ declare namespace PIXI { context: CanvasRenderingContext2D | null; - render(displayObject: PIXI.DisplayObject, renderTexture?: PIXI.RenderTexture, clear?: boolean, transform?: PIXI.Transform, skipUpdateTransform?: boolean): void + render(displayObject: PIXI.DisplayObject, renderTexture?: PIXI.RenderTexture, clear?: boolean, transform?: PIXI.Transform, skipUpdateTransform?: boolean): void; setBlendMode(blendMode: number): void; destroy(removeView?: boolean): void; clear(clearColor?: string): void; @@ -887,7 +887,7 @@ declare namespace PIXI { _activeRenderTarget: RenderTarget; protected _initContext(): void; - render(displayObject: PIXI.DisplayObject, renderTexture?: PIXI.RenderTexture, clear?: boolean, transform?: PIXI.Transform, skipUpdateTransform?: boolean): void + render(displayObject: PIXI.DisplayObject, renderTexture?: PIXI.RenderTexture, clear?: boolean, transform?: PIXI.Transform, skipUpdateTransform?: boolean): void; setObjectRenderer(objectRenderer: ObjectRenderer): void; flush(): void; setBlendMode(blendMode: number): void; diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 1fbdf3942c..c35811aa4d 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -6,277 +6,276 @@ declare namespace Plots { interface StaticPlots { - resize: (root: Plotly.Root) => void + resize(root: Plotly.Root): void; } } declare namespace Plotly { - type Root = string | HTMLElement + type Root = string | HTMLElement; interface PlotlyStatic { - Plots: Plots.StaticPlots - newPlot: (root: Root, data: Partial[], layout?: Partial, config?: Partial) => void - relayout: (root: Root, layout: Partial) => void - redraw: (root: Root) => void - purge: (root: Root) => void - d3: any + Plots: Plots.StaticPlots; + newPlot(root: Root, data: Array>, layout?: Partial, config?: Partial): void; + relayout(root: Root, layout: Partial): void; + redraw(root: Root): void; + purge(root: Root): void; + d3: any; } // Layout interface Layout { - autosize: boolean - showlegend: boolean - xaxis: Partial - yaxis: Partial - margin: Partial - height: number - width: number - hovermode: "closest" | "x" | "y" | false - 'xaxis.range': [Datum, Datum] - 'yaxis.range': [Datum, Datum] - 'yaxis.type': AxisType - 'xaxis.type': AxisType - 'xaxis.autorange': boolean - 'yaxis.autorange': boolean - shapes: Partial[] + autosize: boolean; + showlegend: boolean; + xaxis: Partial; + yaxis: Partial; + margin: Partial; + height: number; + width: number; + hovermode: "closest" | "x" | "y" | false; + 'xaxis.range': [Datum, Datum]; + 'yaxis.range': [Datum, Datum]; + 'yaxis.type': AxisType; + 'xaxis.type': AxisType; + 'xaxis.autorange': boolean; + 'yaxis.autorange': boolean; + shapes: Array>; } - type AxisType = "date" | "log" | "linear" + type AxisType = "date" | "log" | "linear"; interface Axis { - showgrid: boolean - fixedrange: boolean - rangemode: "tozero" | 'normal' | 'nonnegative' - type: AxisType - tickformat: string - hoverformat: string - rangeslider: Partial - rangeselector: Partial, - range: [Datum, Datum] - showticklabels: boolean - autotick: boolean - zeroline: boolean - autorange: boolean | 'reversed' + showgrid: boolean; + fixedrange: boolean; + rangemode: "tozero" | 'normal' | 'nonnegative'; + type: AxisType; + tickformat: string; + hoverformat: string; + rangeslider: Partial; + rangeselector: Partial; + range: [Datum, Datum]; + showticklabels: boolean; + autotick: boolean; + zeroline: boolean; + autorange: boolean | 'reversed'; } interface ShapeLine { - color: string - width: number - dash: Dash + color: string; + width: number; + dash: Dash; } interface Shape { - visible: boolean - layer: 'below' | 'above' - type: 'rect' | 'circle' | 'line' | 'path' - path: string + visible: boolean; + layer: 'below' | 'above'; + type: 'rect' | 'circle' | 'line' | 'path'; + path: string; // x-reference is assigned to the x-values - xref: 'x' | 'paper' + xref: 'x' | 'paper'; // y-reference is assigned to the plot paper [0,1] - yref: 'paper' | 'y' - x0: Datum - y0: Datum - x1: Datum - y1: Datum - fillcolor: string - opacity: number - line: Partial + yref: 'paper' | 'y'; + x0: Datum; + y0: Datum; + x1: Datum; + y1: Datum; + fillcolor: string; + opacity: number; + line: Partial; } interface Margin { - t: number - b: number - l: number - r: number + t: number; + b: number; + l: number; + r: number; } type ModeBarButtons = 'lasso2d' | 'select2d' | 'sendDataToCloud' | 'autoScale2d' | 'zoom2d' | 'pan2d' | 'zoomIn2d' | 'zoomOut2d' | 'autoScale2d' | 'resetScale2d' | - 'hoverClosestCartesian' | 'hoverCompareCartesian' | 'zoom3d' | 'pan3d' | 'orbitRotation' | - 'tableRotation' | 'resetCameraDefault3d' | 'resetCameraLastSave3d' | 'hoverClosest3d' | - 'zoomInGeo' | 'zoomOutGeo' | 'resetGeo' | 'hoverClosestGeo' | 'hoverClosestGl2d' | - 'hoverClosestPie' | 'toggleHover' | 'resetViews' + 'hoverClosestCartesian' | 'hoverCompareCartesian' | 'zoom3d' | 'pan3d' | 'orbitRotation' | + 'tableRotation' | 'resetCameraDefault3d' | 'resetCameraLastSave3d' | 'hoverClosest3d' | + 'zoomInGeo' | 'zoomOutGeo' | 'resetGeo' | 'hoverClosestGeo' | 'hoverClosestGl2d' | + 'hoverClosestPie' | 'toggleHover' | 'resetViews'; // Data - type Datum = string | number | Date + type Datum = string | number | Date; - type Dash = 'solid' | 'dot' | 'dash' | 'longdash' | 'dashdot' | 'longdashdot' + type Dash = 'solid' | 'dot' | 'dash' | 'longdash' | 'dashdot' | 'longdashdot'; - type Data = ScatterData | BarData + type Data = ScatterData | BarData; // Bar interface BarData { - type: 'bar' - x: Datum[] - y: Datum[] + type: 'bar'; + x: Datum[]; + y: Datum[]; } // Scatter interface ScatterData { - type: 'scatter' | 'scattergl' - x: Datum[] - y: Datum[] - text: string | string[] - line: Partial - marker: Partial - mode: "lines" | "markers" | "text" | "lines+markers" | "text+markers" | "text+lines" | "text+lines+markers" | "none" - hoveron: "points" | "fills" - hoverinfo: "text" - fill: 'none' | 'tozeroy' | 'tozerox' | 'tonexty' | 'tonextx' | 'toself' | 'tonext' - fillcolor: string - legendgroup: string - name: string - connectgaps: boolean + type: 'scatter' | 'scattergl'; + x: Datum[]; + y: Datum[]; + text: string | string[]; + line: Partial; + marker: Partial; + mode: "lines" | "markers" | "text" | "lines+markers" | "text+markers" | "text+lines" | "text+lines+markers" | "none"; + hoveron: "points" | "fills"; + hoverinfo: "text"; + fill: 'none' | 'tozeroy' | 'tozerox' | 'tonexty' | 'tonextx' | 'toself' | 'tonext'; + fillcolor: string; + legendgroup: string; + name: string; + connectgaps: boolean; } interface ScatterMarker { - symbol: "" //Drawing.symbolList - opacity: number - size: number - maxdisplayed: number - sizeref: number - sizemin: number - sizemode: "diameter" | "area" - showscale: boolean - line: {} //TODO - colorbar: {} //TODO + symbol: ""; // Drawing.symbolList + opacity: number; + size: number; + maxdisplayed: number; + sizeref: number; + sizemin: number; + sizemode: "diameter" | "area"; + showscale: boolean; + line: {}; // TODO + colorbar: {}; // TODO } interface ScatterLine { - color: string - width: number - dash: Dash - shape: 'linear' | 'spline' | 'hv' | 'vh' | 'hvh' | 'vhv' - smoothing: number - simplify: boolean + color: string; + width: number; + dash: Dash; + shape: 'linear' | 'spline' | 'hv' | 'vh' | 'hvh' | 'vhv'; + smoothing: number; + simplify: boolean; } interface Font { - family: string - size: number - color: string + family: string; + size: number; + color: string; } interface Config { // no interactivity, for export or image generation - staticPlot: boolean + staticPlot: boolean; // we can edit titles, move annotations, etc - editable: boolean + editable: boolean; // DO autosize once regardless of layout.autosize // (use default width or height values otherwise) - autosizable: boolean + autosizable: boolean; // set the length of the undo/redo queue - queueLength: number + queueLength: number; // if we DO autosize, do we fill the container or the screen? - fillFrame: boolean + fillFrame: boolean; // if we DO autosize, set the frame margins in percents of plot size - frameMargins: number + frameMargins: number; // mousewheel or two-finger scroll zooms the plot - scrollZoom: boolean + scrollZoom: boolean; // double click interaction (false, 'reset', 'autosize' or 'reset+autosize') - doubleClick: 'reset+autosize' | 'reset' | 'autosize' | false + doubleClick: 'reset+autosize' | 'reset' | 'autosize' | false; // new users see some hints about interactivity - showTips: boolean + showTips: boolean; // link to open this plot in plotly - showLink: boolean + showLink: boolean; // if we show a link, does it contain data or just link to a plotly file? - sendData: boolean + sendData: boolean; // text appearing in the sendData link - linkText: string + linkText: string; // false or function adding source(s) to linkText - showSources: boolean + showSources: boolean; // display the mode bar (true, false, or 'hover') - displayModeBar: 'hover' | boolean + displayModeBar: 'hover' | boolean; // remove mode bar button by name // (see ./components/modebar/buttons.js for the list of names) - modeBarButtonsToRemove: ModeBarButtons[], + modeBarButtonsToRemove: ModeBarButtons[]; // add mode bar button using config objects // (see ./components/modebar/buttons.js for list of arguments) - modeBarButtonsToAdd: ModeBarButtons[], + modeBarButtonsToAdd: ModeBarButtons[]; // fully custom mode bar buttons as nested array, // where the outer arrays represents button groups, and // the inner arrays have buttons config objects or names of default buttons // (see ./components/modebar/buttons.js for more info) - modeBarButtons: boolean + modeBarButtons: boolean; // add the plotly logo on the end of the mode bar - displaylogo: boolean + displaylogo: boolean; // increase the pixel ratio for Gl plot images - plotGlPixelRatio: number + plotGlPixelRatio: number; // function to add the background color to a different container // or 'opaque' to ensure there's white behind it - setBackground: string | 'opaque' + setBackground: string | 'opaque'; // URL to topojson files used in geo charts - topojsonURL: string + topojsonURL: string; // Mapbox access token (required to plot mapbox trace types) // If using an Mapbox Atlas server, set this option to '', // so that plotly.js won't attempt to authenticate to the public Mapbox server. - mapboxAccessToken: string + mapboxAccessToken: string; // Turn all console logging on or off (errors will be thrown) // This should ONLY be set via Plotly.setPlotConfig - logging: boolean + logging: boolean; // Set global transform to be applied to all traces with no // specification needed - globalTransforms: any[] - + globalTransforms: any[]; } // Components interface RangeSlider { - visible: boolean - thickness: number - range: [Datum, Datum] - borderwidth: number - bordercolor: string - bgcolor: string + visible: boolean; + thickness: number; + range: [Datum, Datum]; + borderwidth: number; + bordercolor: string; + bgcolor: string; } interface RangeSelectorButton { - step: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'all' - stepmode: 'backward' | 'todate' - count: number - label: string + step: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | 'all'; + stepmode: 'backward' | 'todate'; + count: number; + label: string; } interface RangeSelector { - buttons: Partial[] - visible: boolean - x: number - xanchor: 'auto' | 'left' | 'center' | 'right' - y: number - yanchor: 'auto' | 'top' | 'middle' | 'bottom' - bgcolor: string - activecolor: string - bordercolor: string - borderwidth: number - font: Partial + buttons: Array>; + visible: boolean; + x: number; + xanchor: 'auto' | 'left' | 'center' | 'right'; + y: number; + yanchor: 'auto' | 'top' | 'middle' | 'bottom'; + bgcolor: string; + activecolor: string; + bordercolor: string; + borderwidth: number; + font: Partial; } } -declare var Plotly: Plotly.PlotlyStatic -export = Plotly \ No newline at end of file +declare var Plotly: Plotly.PlotlyStatic; +export = Plotly; diff --git a/types/plotly.js/plotly.js-tests.ts b/types/plotly.js/plotly.js-tests.ts index 293c5ade6a..ab71c73e7d 100644 --- a/types/plotly.js/plotly.js-tests.ts +++ b/types/plotly.js/plotly.js-tests.ts @@ -1,6 +1,6 @@ import * as Plotly from 'plotly.js'; -var data: Plotly.BarData[] = [ +const data: Plotly.BarData[] = [ { x: ['giraffes', 'orangutans', 'monkeys'], y: [20, 14, 23], diff --git a/types/proj4/index.d.ts b/types/proj4/index.d.ts index ff2b8334de..afba494556 100644 --- a/types/proj4/index.d.ts +++ b/types/proj4/index.d.ts @@ -38,28 +38,28 @@ declare namespace proj4 { inverse(coordinates: TemplateCoordinates): number[]; } - export const defaultDatum: string; + const defaultDatum: string; - export function Proj(srsCode: any, callback?: any): InterfaceProjection; + function Proj(srsCode: any, callback?: any): InterfaceProjection; - export const WGS84: any; + const WGS84: any; /** * Depecrated v3 */ - export function Point(x: number, y: number, z?: number): InterfaceCoordinates; - export function Point(coordinates: TemplateCoordinates | string): InterfaceCoordinates; + function Point(x: number, y: number, z?: number): InterfaceCoordinates; + function Point(coordinates: TemplateCoordinates | string): InterfaceCoordinates; - export function toPoint(array: number[]): InterfaceCoordinates; + function toPoint(array: number[]): InterfaceCoordinates; - export function defs(name: string, projection?: string): any; - export function defs(name: string[][]): any; + function defs(name: string, projection?: string): any; + function defs(name: string[][]): any; - export function transform(source: InterfaceProjection, dest: InterfaceProjection, point: TemplateCoordinates): any; + function transform(source: InterfaceProjection, dest: InterfaceProjection, point: TemplateCoordinates): any; - export function mgrs(coordinates: number[], accuracy: number): string; + function mgrs(coordinates: number[], accuracy: number): string; - export const version: string; + const version: string; } declare function proj4(fromProjection: string, toProjection?: string, coordinates?: proj4.TemplateCoordinates): proj4.Static; diff --git a/types/proj4/proj4-tests.ts b/types/proj4/proj4-tests.ts index 2c658b8f24..c5d549efe7 100644 --- a/types/proj4/proj4-tests.ts +++ b/types/proj4/proj4-tests.ts @@ -46,4 +46,4 @@ proj4.toPoint([1, 2, 3, 4]); // Point // WARNING: Deprecated in v3 -proj4.Point([1, 2, 3, 4]); \ No newline at end of file +proj4.Point([1, 2, 3, 4]); diff --git a/types/pulltorefreshjs/index.d.ts b/types/pulltorefreshjs/index.d.ts index e26af8e54c..2eab5b6741 100644 --- a/types/pulltorefreshjs/index.d.ts +++ b/types/pulltorefreshjs/index.d.ts @@ -7,111 +7,110 @@ export function init(options?: Options): void; export interface Options { /** - * Minimum distance required to trigger the refresh. - * (default: `60`) - */ + * Minimum distance required to trigger the refresh. + * (default: `60`) + */ distThreshold?: number; /** - * Maximum distance possible for the element. - * (default: `80`) - */ + * Maximum distance possible for the element. + * (default: `80`) + */ distMax?: number; /** - * After the `distThreshold` is reached and released, the element will have this height. - * (default: `50`) - */ + * After the `distThreshold` is reached and released, the element will have this height. + * (default: `50`) + */ distReload?: number; /** - * Before which element the pull to refresh elements will be? - * (default: `body`) - */ + * Before which element the pull to refresh elements will be? + * (default: `body`) + */ mainElement?: string; /** - * Which element should trigger the pull to refresh? - * (default: `body`) - */ + * Which element should trigger the pull to refresh? + * (default: `body`) + */ triggerElement?: string; /** - * What class will the main element have? - * (default: `.ptr`) - */ + * What class will the main element have? + * (default: `.ptr`) + */ ptrElement?: string; /** - * What class prefix for the elements? - * (default: `ptr--`) - */ + * What class prefix for the elements? + * (default: `ptr--`) + */ classPrefix?: string; /** - * What property will be used to calculate the element's proportions? - * (default: `min-height`) - */ + * What property will be used to calculate the element's proportions? + * (default: `min-height`) + */ cssProp?: string; /** - * The icon for both `instructionsPullToRefresh` and `instructionsReleaseToRefresh` - * (default: `⇣`) - */ + * The icon for both `instructionsPullToRefresh` and `instructionsReleaseToRefresh` + * (default: `⇣`) + */ iconArrow?: string; /** - * The icon when the refresh is in progress. - * (default: `…`) - */ + * The icon when the refresh is in progress. + * (default: `…`) + */ iconRefreshing?: string; /** - * The initial instructions string. - * (default: `Pull down to refresh`) - */ + * The initial instructions string. + * (default: `Pull down to refresh`) + */ instructionsPullToRefresh?: string; /** - * The instructions string when the `distThreshold` has been reached. - * (default: `Release to refresh`) - */ + * The instructions string when the `distThreshold` has been reached. + * (default: `Release to refresh`) + */ instructionsReleaseToRefresh?: string; /** - * The refreshing text. - * (default: `Refreshing`) - */ + * The refreshing text. + * (default: `Refreshing`) + */ instructionsRefreshing?: string; /** - * The delay, in milliseconds before the `onRefresh` is triggered. - * (default: `500`) - */ + * The delay, in milliseconds before the `onRefresh` is triggered. + * (default: `500`) + */ refreshTimeout?: number; /** - * The initialize function. - */ - onInit?: () => void; + * The initialize function. + */ + onInit?(): void; /** - * What will the pull to refresh trigger? You can return a promise. - * - * Defaults to `window.location.reload()` - */ + * What will the pull to refresh trigger? You can return a promise. + * + * Defaults to `window.location.reload()` + */ onRefresh?: (() => PromiseLike) | (() => void); - /** - * The resistance function, accepts one parameter, must return a number, capping at 1. - * - * Defaults to `t => Math.min(1, t / 2.5)` - */ - resistanceFunction?: (input: number) => number; + * The resistance function, accepts one parameter, must return a number, capping at 1. + * + * Defaults to `t => Math.min(1, t / 2.5)` + */ + resistanceFunction?(input: number): number; } /** * If no loader is present, this module is available as a global. */ -export as namespace PullToRefresh; \ No newline at end of file +export as namespace PullToRefresh; diff --git a/types/pulltorefreshjs/pulltorefreshjs-tests.ts b/types/pulltorefreshjs/pulltorefreshjs-tests.ts index b971e7a92d..47ca43a2e9 100644 --- a/types/pulltorefreshjs/pulltorefreshjs-tests.ts +++ b/types/pulltorefreshjs/pulltorefreshjs-tests.ts @@ -16,4 +16,4 @@ PullToRefresh.init({ PullToRefresh.init({ mainElement: "body", onRefresh: () => Promise.resolve(), -}); \ No newline at end of file +}); diff --git a/types/query-string/index.d.ts b/types/query-string/index.d.ts index 4021bb524b..a7ad2763df 100644 --- a/types/query-string/index.d.ts +++ b/types/query-string/index.d.ts @@ -4,36 +4,33 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -declare module "query-string" { - - interface ParseOptions { - arrayFormat?: 'bracket' | 'index' | 'none'; - } - - /** - * Parse a query string into an object. - * Leading ? or # are ignored, so you can pass location.search or location.hash directly. - * @param str - */ - export function parse(str: string, options?: ParseOptions): any; - - interface StringifyOptions { - strict?: boolean; - encode?: boolean; - arrayFormat?: 'bracket' | 'index' | 'none'; - } - - /** - * Stringify an object into a query string, sorting the keys. - * - * @param obj - */ - export function stringify(obj: object, options?: StringifyOptions): string; - - /** - * Extract a query string from a URL that can be passed into .parse(). - * - * @param str - */ - export function extract(str: string): string; +export interface ParseOptions { + arrayFormat?: 'bracket' | 'index' | 'none'; } + +/** + * Parse a query string into an object. + * Leading ? or # are ignored, so you can pass location.search or location.hash directly. + * @param str + */ +export function parse(str: string, options?: ParseOptions): any; + +export interface StringifyOptions { + strict?: boolean; + encode?: boolean; + arrayFormat?: 'bracket' | 'index' | 'none'; +} + +/** + * Stringify an object into a query string, sorting the keys. + * + * @param obj + */ +export function stringify(obj: object, options?: StringifyOptions): string; + +/** + * Extract a query string from a URL that can be passed into .parse(). + * + * @param str + */ +export function extract(str: string): string; diff --git a/types/range-parser/index.d.ts b/types/range-parser/index.d.ts index e90f448e11..5912777ec0 100644 --- a/types/range-parser/index.d.ts +++ b/types/range-parser/index.d.ts @@ -6,17 +6,17 @@ declare function RangeParser(size: number, str: string, options?: RangeParser.Options): RangeParser.Result | RangeParser.Ranges; declare namespace RangeParser { - export interface Ranges extends Array { + interface Ranges extends Array { type: string; } - export interface Range { + interface Range { start: number; end: number; } - export interface Options { + interface Options { combine?: boolean; } - export const enum Result { + const enum Result { invaild = -2, unsatisifiable = -1, } diff --git a/types/raw-body/index.d.ts b/types/raw-body/index.d.ts index bb074bac8e..7a10fa84b3 100644 --- a/types/raw-body/index.d.ts +++ b/types/raw-body/index.d.ts @@ -8,9 +8,9 @@ import { Readable } from "stream"; declare namespace getRawBody { - export type Encoding = string | true; + type Encoding = string | true; - export interface Options { + interface Options { /** * The length of the stream. If the contents of the stream do not add up to this length, an 400 error code is returned. */ @@ -30,7 +30,7 @@ declare namespace getRawBody { encoding?: Encoding | null; } - export interface RawBodyError extends Error { + interface RawBodyError extends Error { /** * The limit in bytes. */ diff --git a/types/readline-sync/index.d.ts b/types/readline-sync/index.d.ts index 78d7e313f9..677dbaf75c 100644 --- a/types/readline-sync/index.d.ts +++ b/types/readline-sync/index.d.ts @@ -18,7 +18,7 @@ interface BasicOptions { keepWhitespace?: boolean; encoding?: string; bufferSize?: number; - print?: (display: string, encoding: string) => void; + print?(display: string, encoding: string): void; history?: boolean; cd?: boolean; charlist?: string; @@ -29,7 +29,7 @@ interface BasicOptions { exists?: any; isFile?: boolean; isDirectory?: boolean; - validate?: (path: string) => boolean | string; + validate?(path: string): boolean | string; create?: boolean; guide?: boolean; } @@ -84,4 +84,4 @@ export function setPrint(value: (display: string, encoding: string) => void): vo /** * @deprecated Use the prompt option instead: readlineSync.setDefaultOptions({prompt: value}); */ -export function setPrompt(value: any): void; \ No newline at end of file +export function setPrompt(value: any): void; diff --git a/types/redux-action/redux-action-tests.ts b/types/redux-action/redux-action-tests.ts index cad92bba34..252239e23e 100644 --- a/types/redux-action/redux-action-tests.ts +++ b/types/redux-action/redux-action-tests.ts @@ -1,4 +1,3 @@ - import * as ReduxAction from 'redux-action'; import * as ReduxThunk from 'redux-thunk'; import * as Redux from 'redux'; diff --git a/types/redux-actions/redux-actions-tests.ts b/types/redux-actions/redux-actions-tests.ts index 11fa7adf13..f2d7cef7d1 100644 --- a/types/redux-actions/redux-actions-tests.ts +++ b/types/redux-actions/redux-actions-tests.ts @@ -131,9 +131,7 @@ ReduxActions.handleAction(act3, (state, action) => { return { hello: action.payload.s }; }, {hello: 'greetings'}); -ReduxActions.handleAction(ReduxActions.combineActions(act, act3, act2), (state, action) => { - -}, 0); +ReduxActions.handleAction(ReduxActions.combineActions(act, act3, act2), (state, action) => {}, 0); /* can't do this until it lands in 2.2, HKTs ReduxActions.handleAction(act, (state, action) => { diff --git a/types/redux-persist-transform-encrypt/redux-persist-transform-encrypt-tests.ts b/types/redux-persist-transform-encrypt/redux-persist-transform-encrypt-tests.ts index 76dc7985bd..fdbe7f60d8 100644 --- a/types/redux-persist-transform-encrypt/redux-persist-transform-encrypt-tests.ts +++ b/types/redux-persist-transform-encrypt/redux-persist-transform-encrypt-tests.ts @@ -1,15 +1,15 @@ -import { createStore, Reducer, Store } from "redux" -import { createPersistor, Transform } from "redux-persist" -import { EncryptorConfig } from "redux-persist-transform-encrypt" -import createEncryptor from "redux-persist-transform-encrypt" -import createAsyncEncryptor from "redux-persist-transform-encrypt/async" +import { createStore, Reducer, Store } from "redux"; +import { createPersistor, Transform } from "redux-persist"; +import { EncryptorConfig } from "redux-persist-transform-encrypt"; +import createEncryptor from "redux-persist-transform-encrypt"; +import createAsyncEncryptor from "redux-persist-transform-encrypt/async"; -const reducer: Reducer = (state: any, action: any) => ({ state, action }) +const reducer: Reducer = (state: any, action: any) => ({ state, action }); -const config: EncryptorConfig = { secretKey : "foo" } -const encryptor: Transform = createEncryptor(config) -const asyncEncryptor: Transform = createAsyncEncryptor(config) +const config: EncryptorConfig = { secretKey : "foo" }; +const encryptor: Transform = createEncryptor(config); +const asyncEncryptor: Transform = createAsyncEncryptor(config); -const store: Store = createStore(reducer) +const store: Store = createStore(reducer); -createPersistor(store, { transforms : [encryptor, asyncEncryptor] }) +createPersistor(store, { transforms : [encryptor, asyncEncryptor] }); diff --git a/types/redux-persist-transform-filter/redux-persist-transform-filter-tests.ts b/types/redux-persist-transform-filter/redux-persist-transform-filter-tests.ts index 737e4a70a7..67226438e5 100644 --- a/types/redux-persist-transform-filter/redux-persist-transform-filter-tests.ts +++ b/types/redux-persist-transform-filter/redux-persist-transform-filter-tests.ts @@ -1,15 +1,15 @@ -import { createStore, Reducer, Store } from "redux" -import { createPersistor, Transform } from "redux-persist" -import createFilter from "redux-persist-transform-filter" +import { createStore, Reducer, Store } from "redux"; +import { createPersistor, Transform } from "redux-persist"; +import createFilter from "redux-persist-transform-filter"; -const reducer: Reducer = (state: any, action: any) => ({ state, action }) +const reducer: Reducer = (state: any, action: any) => ({ state, action }); const filter: Transform = createFilter( "foo", ["foo.bar"], ["fizz.buzz"] -) +); -const store: Store = createStore(reducer) +const store: Store = createStore(reducer); -createPersistor(store, { transforms : [filter] }) +createPersistor(store, { transforms : [filter] }); diff --git a/types/restify-plugins/index.d.ts b/types/restify-plugins/index.d.ts index 68c9131c3b..d5009bce78 100644 --- a/types/restify-plugins/index.d.ts +++ b/types/restify-plugins/index.d.ts @@ -137,7 +137,7 @@ interface BodyParserOptions { * A callback to handle any multipart part which is not a file. * If this is omitted, the default handler is invoked which may or may not map the parts into req.params, depending on the mapParams-option. */ - multipartHandler?: () => void; + multipartHandler?(): void; /** * A callback to handle any multipart file. @@ -145,7 +145,7 @@ interface BodyParserOptions { * This typically happens when a browser sends a form and there is a parameter similar to . * If this is not provided, the default behaviour is to map the contents into req.params. */ - multipartFileHandler?: () => void; + multipartFileHandler?(): void; /** * If you want the uploaded files to include the extensions of the original files (multipart uploads only). Does nothing if multipartFileHandler is defined. @@ -367,9 +367,9 @@ type TMetricsCallback = 'close' | 'aborted' | undefined; interface MetricsCallbackOptions { /** - * Status code of the response. Can be undefined in the case of an `uncaughtException`. - * Otherwise, in most normal scenarios, even calling `res.send()` or `res.end()` should result in a 200 by default. - */ + * Status code of the response. Can be undefined in the case of an `uncaughtException`. + * Otherwise, in most normal scenarios, even calling `res.send()` or `res.end()` should result in a 200 by default. + */ statusCode: number; /** diff --git a/types/rx-core-binding/index.d.ts b/types/rx-core-binding/index.d.ts index 1f51c54e1c..e8ba93bd3a 100644 --- a/types/rx-core-binding/index.d.ts +++ b/types/rx-core-binding/index.d.ts @@ -65,31 +65,31 @@ declare namespace Rx { publish(): ConnectableObservable; publish(selector: (source: ConnectableObservable) => Observable): Observable; /** - * Returns an observable sequence that shares a single subscription to the underlying sequence. - * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, - * then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. - * - * @example - * var res = source.share(); - * - * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. - */ + * Returns an observable sequence that shares a single subscription to the underlying sequence. + * This operator is a specialization of publish which creates a subscription when the number of observers goes from zero to one, + * then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. + * + * @example + * var res = source.share(); + * + * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. + */ share(): Observable; publishLast(): ConnectableObservable; publishLast(selector: (source: ConnectableObservable) => Observable): Observable; publishValue(initialValue: T): ConnectableObservable; publishValue(selector: (source: ConnectableObservable) => Observable, initialValue: T): Observable; /** - * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue. - * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, - * then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. - * - * @example - * var res = source.shareValue(42); - * - * @param initialValue Initial value received by observers upon subscription. - * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. - */ + * Returns an observable sequence that shares a single subscription to the underlying sequence and starts with an initialValue. + * This operator is a specialization of publishValue which creates a subscription when the number of observers goes from zero to one, + * then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. + * + * @example + * var res = source.shareValue(42); + * + * @param initialValue Initial value received by observers upon subscription. + * @returns An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. + */ shareValue(initialValue: T): Observable; replay(selector?: boolean, bufferSize?: number, window?: number, scheduler?: IScheduler): ConnectableObservable; // hack to catch first omitted parameter replay(selector: (source: ConnectableObservable) => Observable, bufferSize?: number, window?: number, scheduler?: IScheduler): Observable; diff --git a/types/rx-core/index.d.ts b/types/rx-core/index.d.ts index f922b1f083..dab3d10fa5 100644 --- a/types/rx-core/index.d.ts +++ b/types/rx-core/index.d.ts @@ -5,8 +5,8 @@ declare namespace Rx { /** - * Promise A+ - */ + * Promise A+ + */ interface IPromise { then(onFulfilled: (value: T) => IPromise, onRejected: (reason: any) => IPromise): IPromise; then(onFulfilled: (value: T) => IPromise, onRejected?: (reason: any) => R): IPromise; @@ -30,10 +30,10 @@ declare namespace Rx { interface ObserverStatic { /** - * Schedules the invocation of observer methods on the given scheduler. - * @param scheduler Scheduler to schedule observer messages on. - * @returns Observer whose messages are scheduled on the given scheduler. - */ + * Schedules the invocation of observer methods on the given scheduler. + * @param scheduler Scheduler to schedule observer messages on. + * @returns Observer whose messages are scheduled on the given scheduler. + */ notifyOn(scheduler: IScheduler): Observer; } diff --git a/types/rx-lite-async/index.d.ts b/types/rx-lite-async/index.d.ts index d912f56d39..94117a1562 100644 --- a/types/rx-lite-async/index.d.ts +++ b/types/rx-lite-async/index.d.ts @@ -8,10 +8,10 @@ declare namespace Rx { interface ObservableStatic { /** - * Invokes the asynchronous function, surfacing the result through an observable sequence. - * @param functionAsync Asynchronous function which returns a Promise to run. - * @returns An observable sequence exposing the function's result value, or an exception. - */ + * Invokes the asynchronous function, surfacing the result through an observable sequence. + * @param functionAsync Asynchronous function which returns a Promise to run. + * @returns An observable sequence exposing the function's result value, or an exception. + */ startAsync(functionAsync: () => IPromise): Observable; start(func: () => T, context?: any, scheduler?: IScheduler): Observable; diff --git a/types/rx-lite-backpressure/index.d.ts b/types/rx-lite-backpressure/index.d.ts index d5039c2667..fa997f03c6 100644 --- a/types/rx-lite-backpressure/index.d.ts +++ b/types/rx-lite-backpressure/index.d.ts @@ -8,32 +8,32 @@ declare namespace Rx { interface Observable { /** - * Pauses the underlying observable sequence based upon the observable sequence which yields true/false. - * @example - * var pauser = new Rx.Subject(); - * var source = Rx.Observable.interval(100).pausable(pauser); - * @param pauser The observable sequence used to pause the underlying sequence. - * @returns The observable sequence which is paused based upon the pauser. - */ + * Pauses the underlying observable sequence based upon the observable sequence which yields true/false. + * @example + * var pauser = new Rx.Subject(); + * var source = Rx.Observable.interval(100).pausable(pauser); + * @param pauser The observable sequence used to pause the underlying sequence. + * @returns The observable sequence which is paused based upon the pauser. + */ pausable(pauser?: Observable): PausableObservable; /** - * Pauses the underlying observable sequence based upon the observable sequence which yields true/false, - * and yields the values that were buffered while paused. - * @example - * var pauser = new Rx.Subject(); - * var source = Rx.Observable.interval(100).pausableBuffered(pauser); - * @param pauser The observable sequence used to pause the underlying sequence. - * @returns The observable sequence which is paused based upon the pauser. - */ + * Pauses the underlying observable sequence based upon the observable sequence which yields true/false, + * and yields the values that were buffered while paused. + * @example + * var pauser = new Rx.Subject(); + * var source = Rx.Observable.interval(100).pausableBuffered(pauser); + * @param pauser The observable sequence used to pause the underlying sequence. + * @returns The observable sequence which is paused based upon the pauser. + */ pausableBuffered(pauser?: Observable): PausableObservable; /** - * Attaches a controller to the observable sequence with the ability to queue. - * @example - * var source = Rx.Observable.interval(100).controlled(); - * source.request(3); // Reads 3 values - */ + * Attaches a controller to the observable sequence with the ability to queue. + * @example + * var source = Rx.Observable.interval(100).controlled(); + * source.request(3); // Reads 3 values + */ controlled(enableQueue?: boolean): ControlledObservable; } diff --git a/types/rx-lite-coincidence/index.d.ts b/types/rx-lite-coincidence/index.d.ts index 3dc9f4c1be..3682126071 100644 --- a/types/rx-lite-coincidence/index.d.ts +++ b/types/rx-lite-coincidence/index.d.ts @@ -28,26 +28,26 @@ declare namespace Rx { buffer(bufferOpenings: Observable, bufferClosingSelector: () => Observable): Observable; /** - * Returns a new observable that triggers on the second and subsequent triggerings of the input observable. - * The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair. - * The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs. - * @returns An observable that triggers on successive pairs of observations from the input observable as an array. - */ + * Returns a new observable that triggers on the second and subsequent triggerings of the input observable. + * The Nth triggering of the input observable passes the arguments from the N-1th and Nth triggering as a pair. + * The argument passed to the N-1th triggering is held in hidden internal state until the Nth triggering occurs. + * @returns An observable that triggers on successive pairs of observations from the input observable as an array. + */ pairwise(): Observable; /** - * Returns two observables which partition the observations of the source by the given function. - * The first will trigger observations for those values for which the predicate returns true. - * The second will trigger observations for those values where the predicate returns false. - * The predicate is executed once for each subscribed observer. - * Both also propagate all error observations arising from the source and each completes - * when the source completes. - * @param predicate - * The function to determine which output Observable will trigger a particular observation. - * @returns - * An array of observables. The first triggers when the predicate returns true, - * and the second triggers when the predicate returns false. - */ + * Returns two observables which partition the observations of the source by the given function. + * The first will trigger observations for those values for which the predicate returns true. + * The second will trigger observations for those values where the predicate returns false. + * The predicate is executed once for each subscribed observer. + * Both also propagate all error observations arising from the source and each completes + * when the source completes. + * @param predicate + * The function to determine which output Observable will trigger a particular observation. + * @returns + * An array of observables. The first triggers when the predicate returns true, + * and the second triggers when the predicate returns false. + */ partition(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Array>; } } diff --git a/types/rx-lite-time/index.d.ts b/types/rx-lite-time/index.d.ts index 01fadea822..e5abaf3832 100644 --- a/types/rx-lite-time/index.d.ts +++ b/types/rx-lite-time/index.d.ts @@ -15,8 +15,8 @@ declare namespace Rx { debounceWithSelector(debounceDurationSelector: (item: T) => Observable): Observable; /** - * @deprecated use #debounceWithSelector instead. - */ + * @deprecated use #debounceWithSelector instead. + */ throttleWithSelector(debounceDurationSelector: (item: T) => Observable): Observable; skipLastWithTime(duration: number, scheduler?: IScheduler): Observable; diff --git a/types/rx-lite/index.d.ts b/types/rx-lite/index.d.ts index d56e4e473c..331145e0dd 100644 --- a/types/rx-lite/index.d.ts +++ b/types/rx-lite/index.d.ts @@ -352,32 +352,32 @@ declare namespace Rx { selectConcat(sequence: Observable): Observable; /** - * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then - * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. - * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - * @param [thisArg] Object to use as this when executing callback. - * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences - * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ + * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then + * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. + * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. + * @param [thisArg] Object to use as this when executing callback. + * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences + * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. + */ selectSwitch(selector: (value: T, index: number, source: Observable) => Observable, thisArg?: any): Observable; /** - * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then - * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. - * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - * @param [thisArg] Object to use as this when executing callback. - * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences - * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ + * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then + * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. + * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. + * @param [thisArg] Object to use as this when executing callback. + * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences + * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. + */ flatMapLatest(selector: (value: T, index: number, source: Observable) => Observable, thisArg?: any): Observable; // alias for selectSwitch /** - * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then - * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. - * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - * @param [thisArg] Object to use as this when executing callback. - * @since 2.2.28 - * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences - * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. - */ + * Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then + * transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. + * @param selector A transform function to apply to each source element; the second parameter of the function represents the index of the source element. + * @param [thisArg] Object to use as this when executing callback. + * @since 2.2.28 + * @returns An observable sequence whose elements are the result of invoking the transform function on each element of source producing an Observable of Observable sequences + * and that at any point in time produces the elements of the most recent inner observable sequence that has been received. + */ switchMap(selector: (value: T, index: number, source: Observable) => TResult, thisArg?: any): Observable; // alias for selectSwitch skip(count: number): Observable; @@ -388,46 +388,46 @@ declare namespace Rx { filter(predicate: (value: T, index: number, source: Observable) => boolean, thisArg?: any): Observable; // alias for where /** - * Converts an existing observable sequence to an ES6 Compatible Promise - * @example - * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); - * @param promiseCtor The constructor of the promise. - * @returns An ES6 compatible promise with the last value from the observable sequence. - */ + * Converts an existing observable sequence to an ES6 Compatible Promise + * @example + * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); + * @param promiseCtor The constructor of the promise. + * @returns An ES6 compatible promise with the last value from the observable sequence. + */ toPromise>(promiseCtor: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): TPromise; }): TPromise; /** - * Converts an existing observable sequence to an ES6 Compatible Promise - * @example - * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); - * - * // With config - * Rx.config.Promise = RSVP.Promise; - * var promise = Rx.Observable.return(42).toPromise(); - * @param [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. - * @returns An ES6 compatible promise with the last value from the observable sequence. - */ + * Converts an existing observable sequence to an ES6 Compatible Promise + * @example + * var promise = Rx.Observable.return(42).toPromise(RSVP.Promise); + * + * // With config + * Rx.config.Promise = RSVP.Promise; + * var promise = Rx.Observable.return(42).toPromise(); + * @param [promiseCtor] The constructor of the promise. If not provided, it looks for it in Rx.config.Promise. + * @returns An ES6 compatible promise with the last value from the observable sequence. + */ toPromise(promiseCtor?: { new (resolver: (resolvePromise: (value: T) => void, rejectPromise: (reason: any) => void) => void): IPromise; }): IPromise; // Experimental Flattening /** - * Performs a exclusive waiting for the first to finish before subscribing to another observable. - * Observables that come in between subscriptions will be dropped on the floor. - * Can be applied on `Observable>` or `Observable>`. - * @since 2.2.28 - * @returns A exclusive observable with only the results that happen when subscribed. - */ + * Performs a exclusive waiting for the first to finish before subscribing to another observable. + * Observables that come in between subscriptions will be dropped on the floor. + * Can be applied on `Observable>` or `Observable>`. + * @since 2.2.28 + * @returns A exclusive observable with only the results that happen when subscribed. + */ exclusive(): Observable; /** - * Performs a exclusive map waiting for the first to finish before subscribing to another observable. - * Observables that come in between subscriptions will be dropped on the floor. - * Can be applied on `Observable>` or `Observable>`. - * @since 2.2.28 - * @param selector Selector to invoke for every item in the current subscription. - * @param [thisArg] An optional context to invoke with the selector parameter. - * @returns {An exclusive observable with only the results that happen when subscribed. - */ + * Performs a exclusive map waiting for the first to finish before subscribing to another observable. + * Observables that come in between subscriptions will be dropped on the floor. + * Can be applied on `Observable>` or `Observable>`. + * @since 2.2.28 + * @param selector Selector to invoke for every item in the current subscription. + * @param [thisArg] An optional context to invoke with the selector parameter. + * @returns {An exclusive observable with only the results that happen when subscribed. + */ exclusiveMap(selector: (value: I, index: number, source: Observable) => R, thisArg?: any): Observable; publish(): ConnectableObservable; @@ -447,46 +447,46 @@ declare namespace Rx { empty(scheduler?: IScheduler): Observable; /** - * This method creates a new Observable sequence from an array object. - * @param array An array-like or iterable object to convert to an Observable sequence. - * @param mapFn Map function to call on every element of the array. - * @param [thisArg] The context to use calling the mapFn if provided. - * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. - */ + * This method creates a new Observable sequence from an array object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param mapFn Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ from(array: T[], mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler): Observable; /** - * This method creates a new Observable sequence from an array object. - * @param array An array-like or iterable object to convert to an Observable sequence. - * @param [mapFn] Map function to call on every element of the array. - * @param [thisArg] The context to use calling the mapFn if provided. - * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. - */ + * This method creates a new Observable sequence from an array object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param [mapFn] Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ from(array: T[], mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; /** - * This method creates a new Observable sequence from an array-like object. - * @param array An array-like or iterable object to convert to an Observable sequence. - * @param mapFn Map function to call on every element of the array. - * @param [thisArg] The context to use calling the mapFn if provided. - * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. - */ + * This method creates a new Observable sequence from an array-like object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param mapFn Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ from(array: { length: number; [index: number]: T; }, mapFn: (value: T, index: number) => TResult, thisArg?: any, scheduler?: IScheduler): Observable; /** - * This method creates a new Observable sequence from an array-like object. - * @param array An array-like or iterable object to convert to an Observable sequence. - * @param [mapFn] Map function to call on every element of the array. - * @param [thisArg] The context to use calling the mapFn if provided. - * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. - */ + * This method creates a new Observable sequence from an array-like object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param [mapFn] Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ from(array: { length: number; [index: number]: T; }, mapFn?: (value: T, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; /** - * This method creates a new Observable sequence from an array-like or iterable object. - * @param array An array-like or iterable object to convert to an Observable sequence. - * @param [mapFn] Map function to call on every element of the array. - * @param [thisArg] The context to use calling the mapFn if provided. - * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. - */ + * This method creates a new Observable sequence from an array-like or iterable object. + * @param array An array-like or iterable object to convert to an Observable sequence. + * @param [mapFn] Map function to call on every element of the array. + * @param [thisArg] The context to use calling the mapFn if provided. + * @param [scheduler] Optional scheduler to use for scheduling. If not provided, defaults to Scheduler.currentThread. + */ from(iterable: any, mapFn?: (value: any, index: number) => T, thisArg?: any, scheduler?: IScheduler): Observable; fromArray(array: T[], scheduler?: IScheduler): Observable; @@ -496,23 +496,23 @@ declare namespace Rx { never(): Observable; /** - * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. - * - * @example - * var res = Rx.Observable.of(1, 2, 3); - * @since 2.2.28 - * @returns The observable sequence whose elements are pulled from the given arguments. - */ + * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. + * + * @example + * var res = Rx.Observable.of(1, 2, 3); + * @since 2.2.28 + * @returns The observable sequence whose elements are pulled from the given arguments. + */ of(...values: T[]): Observable; /** - * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. - * @example - * var res = Rx.Observable.ofWithScheduler(Rx.Scheduler.timeout, 1, 2, 3); - * @since 2.2.28 - * @param [scheduler] A scheduler to use for scheduling the arguments. - * @returns The observable sequence whose elements are pulled from the given arguments. - */ + * This method creates a new Observable instance with a variable number of arguments, regardless of number or type of the arguments. + * @example + * var res = Rx.Observable.ofWithScheduler(Rx.Scheduler.timeout, 1, 2, 3); + * @since 2.2.28 + * @param [scheduler] A scheduler to use for scheduling the arguments. + * @returns The observable sequence whose elements are pulled from the given arguments. + */ ofWithScheduler(scheduler?: IScheduler, ...values: T[]): Observable; range(start: number, count: number, scheduler?: IScheduler): Observable; repeat(value: T, repeatCount?: number, scheduler?: IScheduler): Observable; @@ -582,10 +582,10 @@ declare namespace Rx { zipArray(sources: (Observable | IPromise)[]): Observable; /** - * Converts a Promise to an Observable sequence - * @param promise An ES6 Compliant promise. - * @returns An Observable sequence which wraps the existing promise success and failure. - */ + * Converts a Promise to an Observable sequence + * @param promise An ES6 Compliant promise. + * @returns An Observable sequence which wraps the existing promise success and failure. + */ fromPromise(promise: IPromise): Observable; prototype: any; @@ -599,8 +599,8 @@ declare namespace Rx { declare namespace Rx { namespace config { /** - * Configuration option to determine whether to use native events only - */ + * Configuration option to determine whether to use native events only + */ const useNativeEvents: boolean; } diff --git a/types/safe-regex/safe-regex-tests.ts b/types/safe-regex/safe-regex-tests.ts index a3c0b3a420..f67f04653b 100644 --- a/types/safe-regex/safe-regex-tests.ts +++ b/types/safe-regex/safe-regex-tests.ts @@ -1,2 +1,2 @@ import safe = require('safe-regex'); -console.log(safe("regex")); \ No newline at end of file +console.log(safe("regex")); diff --git a/types/semantic-ui/index.d.ts b/types/semantic-ui/index.d.ts index bdfa5c2249..54c1abdb8f 100644 --- a/types/semantic-ui/index.d.ts +++ b/types/semantic-ui/index.d.ts @@ -1394,23 +1394,23 @@ declare namespace SemanticUI { /** * Callback before element opens */ - onOpening?: (this: JQuery) => void; + onOpening?(this: JQuery): void; /** * Callback after element is open */ - onOpen?: (this: JQuery) => void; + onOpen?(this: JQuery): void; /** * Callback before element closes */ - onClosing?: (this: JQuery) => void; + onClosing?(this: JQuery): void; /** * Callback after element is closed */ - onClose?: (this: JQuery) => void; + onClose?(this: JQuery): void; /** * Callback on element open or close */ - onChange?: (this: JQuery) => void; + onChange?(this: JQuery): void; // endregion @@ -1495,59 +1495,59 @@ declare namespace SemanticUI { /** * Callback after a checkbox is either checked or unchecked. */ - onChange?: (this: HTMLElement) => void; + onChange?(this: HTMLElement): void; /** * Callback after a checkbox is checked. */ - onChecked?: (this: HTMLElement) => void; + onChecked?(this: HTMLElement): void; /** * Callback after a checkbox is set to undeterminate. */ - onIndeterminate?: (this: HTMLElement) => void; + onIndeterminate?(this: HTMLElement): void; /** * Callback after a checkbox is set to determinate. */ - onDeterminate?: (this: HTMLElement) => void; + onDeterminate?(this: HTMLElement): void; /** * Callback after a checkbox is unchecked. */ - onUnchecked?: (this: HTMLElement) => void; + onUnchecked?(this: HTMLElement): void; /** * Callback before a checkbox is checked. Can cancel change by returning false */ - beforeChecked?: (this: HTMLElement) => boolean; + beforeChecked?(this: HTMLElement): boolean; /** * Callback before a checkbox is set to undeterminate. Can cancel change by returning false */ - beforeIndeterminate?: (this: HTMLElement) => boolean; + beforeIndeterminate?(this: HTMLElement): boolean; /** * Callback before a checkbox is set to determinate. Can cancel change by returning false */ - beforeDeterminate?: (this: HTMLElement) => boolean; + beforeDeterminate?(this: HTMLElement): boolean; /** * Callback before a checkbox is unchecked. Can cancel change by returning false */ - beforeUnchecked?: (this: HTMLElement) => boolean; + beforeUnchecked?(this: HTMLElement): boolean; /** * Callback after a checkbox is enabled. */ - onEnable?: (this: HTMLElement) => void; + onEnable?(this: HTMLElement): void; /** * Callback after a checkbox is disabled. */ - onDisable?: (this: HTMLElement) => void; + onDisable?(this: HTMLElement): void; /** * Callback after a checkbox is enabled. * * @deprecated */ - onEnabled?: (this: HTMLElement) => void; + onEnabled?(this: HTMLElement): void; /** * Callback after a checkbox is disabled. * * @deprecated */ - onDisabled?: (this: HTMLElement) => void; + onDisabled?(this: HTMLElement): void; // endregion @@ -1676,15 +1676,15 @@ declare namespace SemanticUI { /** * Callback on element show */ - onShow?: (this: JQuery) => void; + onShow?(this: JQuery): void; /** * Callback on element hide */ - onHide?: (this: JQuery) => void; + onHide?(this: JQuery): void; /** * Callback on element show or hide */ - onchange?: (this: JQuery) => void; + onchange?(this: JQuery): void; // endregion @@ -1711,7 +1711,7 @@ declare namespace SemanticUI { * Templates used to generate dimmer content */ template?: { - dimmer?: () => JQuery; + dimmer?(): JQuery; }; /** * Class names used to attach style to state @@ -2078,39 +2078,39 @@ declare namespace SemanticUI { /** * Is called after a dropdown value changes. Receives the name and value of selection and the active menu element */ - onChange?: (this: JQuery, value: any, text: string, $choice: JQuery) => void; + onChange?(this: JQuery, value: any, text: string, $choice: JQuery): void; /** * Is called after a dropdown selection is added using a multiple select dropdown, only receives the added value */ - onAdd?: (this: JQuery, addedValue: any, addedText: string, $addedChoice: JQuery) => void; + onAdd?(this: JQuery, addedValue: any, addedText: string, $addedChoice: JQuery): void; /** * Is called after a dropdown selection is removed using a multiple select dropdown, only receives the removed value */ - onRemove?: (this: JQuery, removedValue: any, removedText: string, $removedChoice: JQuery) => void; + onRemove?(this: JQuery, removedValue: any, removedText: string, $removedChoice: JQuery): void; /** * Allows you to modify a label before it is added. Expects the jQ DOM element for a label to be returned. */ - onLabelCreate?: (this: JQuery, value: any, text: string) => JQuery; + onLabelCreate?(this: JQuery, value: any, text: string): JQuery; /** * Called when a label is remove, return false; will prevent the label from being removed. */ - onLabelRemove?: (this: JQuery, value: any) => false | void; + onLabelRemove?(this: JQuery, value: any): false | void; /** * Is called after a label is selected by a user */ - onLabelSelect?: (this: JQuery, $selectedLabels: JQuery) => void; + onLabelSelect?(this: JQuery, $selectedLabels: JQuery): void; /** * Is called after a dropdown is searched with no matching values */ - onNoResults?: (this: JQuery, searchValue: any) => void; + onNoResults?(this: JQuery, searchValue: any): void; /** * Is called before a dropdown is shown. If false is returned, dropdown will not be shown. */ - onShow?: (this: JQuery) => false | void; + onShow?(this: JQuery): false | void; /** * Is called before a dropdown is hidden. If false is returned, dropdown will not be hidden. */ - onHide?: (this: JQuery) => false | void; + onHide?(this: JQuery): false | void; // endregion @@ -2406,19 +2406,19 @@ declare namespace SemanticUI { /** * Callback when iframe is generated */ - onCreate?: (this: JQuery, url: string) => void; + onCreate?(this: JQuery, url: string): void; /** * Whenever an iframe contents is shown */ - onDisplay?: (this: JQuery) => void; + onDisplay?(this: JQuery): void; /** * Callback immediately before Embed is removed from DOM */ - onPlaceholderDisplay?: (this: JQuery) => void; + onPlaceholderDisplay?(this: JQuery): void; /** * Callback when module parameters are determined. Allows you to adjust parameters at run time by returning a new parameters object. */ - onEmbed?: (this: JQuery, parameters: any) => any; + onEmbed?(this: JQuery, parameters: any): any; // endregion @@ -2483,11 +2483,11 @@ declare namespace SemanticUI { /** * returns html for iframe */ - iframe?: (url: string, parameters: string) => string; + iframe?(url: string, parameters: string): string; /** * returns html for placeholder element */ - placeholder?: (image: string, icon: string) => string; + placeholder?(image: string, icon: string): string; }; // endregion @@ -2599,27 +2599,27 @@ declare namespace SemanticUI { /** * Is called when a modal starts to show. */ - onShow?: (this: JQuery) => void; + onShow?(this: JQuery): void; /** * Is called after a modal has finished showing animating. */ - onVisible?: (this: JQuery) => void; + onVisible?(this: JQuery): void; /** * Is called after a modal starts to hide. If the function returns false, the modal will not hide. */ - onHide?: (this: JQuery, $element: JQuery) => false | void; + onHide?(this: JQuery, $element: JQuery): false | void; /** * Is called after a modal has finished hiding animation. */ - onHidden?: (this: JQuery) => void; + onHidden?(this: JQuery): void; /** * Is called after a positive, approve or ok button is pressed. If the function returns false, the modal will not hide. */ - onApprove?: (this: JQuery, $element: JQuery) => false | void; + onApprove?(this: JQuery, $element: JQuery): false | void; /** * Is called after a negative, deny or cancel button is pressed. If the function returns false the modal will not hide. */ - onDeny?: (this: JQuery, $element: JQuery) => false | void; + onDeny?(this: JQuery, $element: JQuery): false | void; // endregion @@ -2747,7 +2747,7 @@ declare namespace SemanticUI { // region Callbacks - onHide?: (this: JQuery) => void; + onHide?(this: JQuery): void; // endregion @@ -2969,31 +2969,31 @@ declare namespace SemanticUI { /** * Callback on popup element creation, with created popup */ - onCreate?: (this: JQuery, $module: JQuery) => void; + onCreate?(this: JQuery, $module: JQuery): void; /** * Callback immediately before Popup is removed from DOM */ - onRemove?: (this: JQuery, $module: JQuery) => void; + onRemove?(this: JQuery, $module: JQuery): void; /** * Callback before popup is shown. Returning false from this callback will cancel the popup from showing. */ - onShow?: (this: JQuery, $module: JQuery) => false | void; + onShow?(this: JQuery, $module: JQuery): false | void; /** * Callback after popup is shown */ - onVisible?: (this: JQuery, $module: JQuery) => void; + onVisible?(this: JQuery, $module: JQuery): void; /** * Callback before popup is hidden. Returning false from this callback will cancel the popup from hiding. */ - onHide?: (this: JQuery, $module: JQuery) => false | void; + onHide?(this: JQuery, $module: JQuery): false | void; /** * Callback after popup is hidden */ - onHidden?: (this: JQuery, $module: JQuery) => void; + onHidden?(this: JQuery, $module: JQuery): void; /** * Callback after popup cannot be placed on screen */ - onUnplaceable?: (this: JQuery, $module: JQuery) => void; + onUnplaceable?(this: JQuery, $module: JQuery): void; // endregion @@ -3184,23 +3184,23 @@ declare namespace SemanticUI { /** * Callback on percentage change */ - onChange?: (this: JQuery, percent: number, value: number, total: number) => void; + onChange?(this: JQuery, percent: number, value: number, total: number): void; /** * Callback on success state */ - onSuccess?: (this: JQuery, total: number) => void; + onSuccess?(this: JQuery, total: number): void; /** * Callback on active state */ - onActive?: (this: JQuery, value: number, total: number) => void; + onActive?(this: JQuery, value: number, total: number): void; /** * Callback on error state */ - onError?: (this: JQuery, value: number, total: number) => void; + onError?(this: JQuery, value: number, total: number): void; /** * Callback on warning state */ - onWarning?: (this: JQuery, value: number, total: number) => void; + onWarning?(this: JQuery, value: number, total: number): void; // endregion @@ -3360,7 +3360,7 @@ declare namespace SemanticUI { /** * Is called after user selects a new rating */ - onRate?: (this: JQuery, value: number) => void; + onRate?(this: JQuery, value: number): void; // endregion @@ -3575,37 +3575,37 @@ declare namespace SemanticUI { * The first parameter includes the filtered response results for that element. * The function should return false to prevent default action (closing search results and selecting value). */ - onSelect?: (this: JQuery, result: any, response: any) => false | void; + onSelect?(this: JQuery, result: any, response: any): false | void; /** * Callback after processing element template to add HTML to results. Function should return false to prevent default actions. */ - onResultsAdd?: (this: JQuery, html: string) => false | void; + onResultsAdd?(this: JQuery, html: string): false | void; /** * Callback on search query */ - onSearchQuery?: (this: JQuery, query: string) => void; + onSearchQuery?(this: JQuery, query: string): void; /** * Callback on server response */ - onResults?: (this: JQuery, response: any) => void; + onResults?(this: JQuery, response: any): void; /** * Callback when results are opened */ - onResultsOpen?: (this: JQuery) => void; + onResultsOpen?(this: JQuery): void; /** * Callback when results are closed */ - onResultsClose?: (this: JQuery) => void; + onResultsClose?(this: JQuery): void; // endregion // region Templates templates?: { - escape?: (string: string) => string; - message?: (message: string, type: string) => string; - category?: (response: any) => string; - standard?: (response: any) => string; + escape?(string: string): string; + message?(message: string, type: string): string; + category?(response: any): string; + standard?(response: any): string; }; // endregion @@ -3769,11 +3769,11 @@ declare namespace SemanticUI { /** * Is called before side change */ - beforeChange?: (this: JQuery) => void; + beforeChange?(this: JQuery): void; /** * Is called after visible side change */ - onChange?: (this: JQuery) => void; + onChange?(this: JQuery): void; // endregion @@ -3966,23 +3966,23 @@ declare namespace SemanticUI { /** * Is called when a sidebar begins animating in. */ - onVisible?: (this: JQuery) => void; + onVisible?(this: JQuery): void; /** * Is called when a sidebar has finished animating in. */ - onShow?: (this: JQuery) => void; + onShow?(this: JQuery): void; /** * Is called when a sidebar begins to hide or show */ - onChange?: (this: JQuery) => void; + onChange?(this: JQuery): void; /** * Is called before a sidebar begins to animate out. */ - onHide?: (this: JQuery) => void; + onHide?(this: JQuery): void; /** * Is called after a sidebar has finished animating out. */ - onHidden?: (this: JQuery) => void; + onHidden?(this: JQuery): void; // endregion @@ -4153,27 +4153,27 @@ declare namespace SemanticUI { /** * Callback when element is repositioned from layout change */ - onReposition?: (this: JQuery) => void; + onReposition?(this: JQuery): void; /** * Callback when requestAnimationFrame fires from scroll handler. */ - onScroll?: (this: JQuery) => void; + onScroll?(this: JQuery): void; /** * Callback when element is fixed to page */ - onStick?: (this: JQuery) => void; + onStick?(this: JQuery): void; /** * Callback when element is unfixed from page */ - onUnstick?: (this: JQuery) => void; + onUnstick?(this: JQuery): void; /** * Callback when element is bound to top of parent container */ - onTop?: (this: JQuery) => void; + onTop?(this: JQuery): void; /** * Callback when element is bound to bottom of parent container */ - onBottom?: (this: JQuery) => void; + onBottom?(this: JQuery): void; // endregion @@ -4346,19 +4346,19 @@ declare namespace SemanticUI { /** * Callback only the first time a tab is loaded */ - onFirstLoad?: (this: JQuery, tabPath: string, parameterArray: any[], historyEvent: any) => void; + onFirstLoad?(this: JQuery, tabPath: string, parameterArray: any[], historyEvent: any): void; /** * Callback every time a tab is loaded */ - onLoad?: (this: JQuery, tabPath: string, parameterArray: any[], historyEvent: any) => void; + onLoad?(this: JQuery, tabPath: string, parameterArray: any[], historyEvent: any): void; /** * Called when a tab begins loading remote content */ - onRequest?: (this: JQuery, tabPath: string) => void; + onRequest?(this: JQuery, tabPath: string): void; /** * Called after a tab becomes visible */ - onVisible?: (this: JQuery, tabPath: string) => void; + onVisible?(this: JQuery, tabPath: string): void; // endregion @@ -4371,7 +4371,7 @@ declare namespace SemanticUI { /** * returns page title */ - determineTitle?: (tabArray: any[]) => string; + determineTitle?(tabArray: any[]): string; }; /** * Selectors used by module @@ -4515,19 +4515,19 @@ declare namespace SemanticUI { /** * Callback on each transition that changes visibility to shown */ - onShow?: (this: JQuery) => void; + onShow?(this: JQuery): void; /** * Callback on each transition that changes visibility to hidden */ - onHide?: (this: JQuery) => void; + onHide?(this: JQuery): void; /** * Callback on animation start, useful for queued animations */ - onStart?: (this: JQuery) => void; + onStart?(this: JQuery): void; /** * Callback on each transition complete */ - onComplete?: (this: JQuery) => void; + onComplete?(this: JQuery): void; // endregion @@ -4736,45 +4736,45 @@ declare namespace SemanticUI { /** * Allows modifying settings before request, or cancelling request */ - beforeSend?: (settings: ApiSettings) => any; + beforeSend?(settings: ApiSettings): any; /** * Allows modifying XHR object for request */ - beforeXHR?: (xhrObject: JQueryXHR) => any; + beforeXHR?(xhrObject: JQueryXHR): any; /** * Callback that occurs when request is made. Receives both the API success promise and the XHR request promise. */ - onRequest?: (promise: JQueryDeferred, xhr: JQueryXHR) => void; + onRequest?(promise: JQueryDeferred, xhr: JQueryXHR): void; /** * Allows modifying the server's response before parsed by other callbacks to determine API event success */ - onResponse?: (response: any) => void; + onResponse?(response: any): void; /** * Determines whether completed JSON response should be treated as successful * * @see {@link http://semantic-ui.com/behaviors/api.html#determining-json-success} */ - successTest?: (response: any) => boolean; + successTest?(response: any): boolean; /** * Callback after successful response, JSON response must pass successTest */ - onSuccess?: (response: any, element: JQuery, xhr: JQueryXHR) => void; + onSuccess?(response: any, element: JQuery, xhr: JQueryXHR): void; /** * Callback on request complete regardless of conditions */ - onComplete?: (response: any, element: JQuery, xhr: JQueryXHR) => void; + onComplete?(response: any, element: JQuery, xhr: JQueryXHR): void; /** * Callback on failed response, or JSON response that fails successTest */ - onFailure?: (response: any, element: JQuery) => void; + onFailure?(response: any, element: JQuery): void; /** * Callback on server error from returned status code, or XHR failure. */ - onError?: (errorMessage: string, element: JQuery, xhr: JQueryXHR) => void; + onError?(errorMessage: string, element: JQuery, xhr: JQueryXHR): void; /** * Callback on abort caused by user clicking a link or manually cancelling request. */ - onAbort?: (errorMessage: string, element: JQuery, xhr: JQueryXHR) => void; + onAbort?(errorMessage: string, element: JQuery, xhr: JQueryXHR): void; // endregion @@ -5077,19 +5077,19 @@ declare namespace SemanticUI { /** * Callback on each valid field */ - onValid?: (this: JQuery) => void; + onValid?(this: JQuery): void; /** * Callback on each invalid field */ - onInvalid?: (this: JQuery) => void; + onInvalid?(this: JQuery): void; /** * Callback if a form is all valid */ - onSuccess?: (this: JQuery, event: JQueryEventObject, fields: any) => void; + onSuccess?(this: JQuery, event: JQueryEventObject, fields: any): void; /** * Callback if any form field is invalid */ - onFailure?: (this: JQuery, formErrors: string[], fields: any) => void; + onFailure?(this: JQuery, formErrors: string[], fields: any): void; // endregion @@ -5279,43 +5279,43 @@ declare namespace SemanticUI { /** * Element's top edge has passed bottom of screen */ - onTopVisible?: (this: JQuery) => void; + onTopVisible?(this: JQuery): void; /** * Element's top edge has passed top of the screen */ - onTopPassed?: (this: JQuery) => void; + onTopPassed?(this: JQuery): void; /** * Element's bottom edge has passed bottom of screen */ - onBottomVisible?: (this: JQuery) => void; + onBottomVisible?(this: JQuery): void; /** * Any part of an element is visible on screen */ - onPassing?: (this: JQuery) => void; + onPassing?(this: JQuery): void; /** * Element's bottom edge has passed top of screen */ - onBottomPassed?: (this: JQuery) => void; + onBottomPassed?(this: JQuery): void; /** * Element's top edge has not passed bottom of screen */ - onTopVisibleReverse?: (this: JQuery) => void; + onTopVisibleReverse?(this: JQuery): void; /** * Element's top edge has not passed top of the screen */ - onTopPassedReverse?: (this: JQuery) => void; + onTopPassedReverse?(this: JQuery): void; /** * Element's bottom edge has not passed bottom of screen */ - onBottomVisibleReverse?: (this: JQuery) => void; + onBottomVisibleReverse?(this: JQuery): void; /** * Element's top has not passed top of screen but bottom has */ - onPassingReverse?: (this: JQuery) => void; + onPassingReverse?(this: JQuery): void; /** * Element's bottom edge has not passed top of screen */ - onBottomPassedReverse?: (this: JQuery) => void; + onBottomPassedReverse?(this: JQuery): void; // endregion @@ -5326,13 +5326,13 @@ declare namespace SemanticUI { * * @since 2.2 */ - onLoad?: (this: JQuery) => void; + onLoad?(this: JQuery): void; /** * Occurs after all img initialized at the same time have loaded. * * @since 2.2 */ - onAllLoaded?: (this: JQuery) => void; + onAllLoaded?(this: JQuery): void; // endregion @@ -5343,13 +5343,13 @@ declare namespace SemanticUI { * * @since 2.2 */ - onFixed?: (this: JQuery) => void; + onFixed?(this: JQuery): void; /** * Occurs after element has been removed from fixed position * * @since 2.2 */ - onUnfixed?: (this: JQuery) => void; + onUnfixed?(this: JQuery): void; // endregion @@ -5358,11 +5358,11 @@ declare namespace SemanticUI { /** * Occurs each time an elements calculations are updated */ - onUpdate?: (this: JQuery, calculations: ElementCalculations) => void; + onUpdate?(this: JQuery, calculations: ElementCalculations): void; /** * Occurs whenever element's visibility is refreshed */ - onRefresh?: (this: JQuery) => void; + onRefresh?(this: JQuery): void; // endregion diff --git a/types/semver-diff/index.d.ts b/types/semver-diff/index.d.ts index 550784e697..e5a1369439 100644 --- a/types/semver-diff/index.d.ts +++ b/types/semver-diff/index.d.ts @@ -9,4 +9,4 @@ declare namespace SemverDiff { declare function SemverDiff(versionA: string, versionB: string): SemverDiff.SemverDiffReturn; -export = SemverDiff; \ No newline at end of file +export = SemverDiff; diff --git a/types/semver/semver-tests.ts b/types/semver/semver-tests.ts index f1be6ca533..b7a1299ad3 100644 --- a/types/semver/semver-tests.ts +++ b/types/semver/semver-tests.ts @@ -1,20 +1,21 @@ import * as semver from "semver"; -var obj: {}; -var bool: boolean; -var num: number; -var str: string; -var diff: string; -var x: any = null; -var arr: any[]; -var exp: RegExp; -var strArr: string[]; -var numArr: string[]; +let obj: {}; +let bool: boolean; +let num: number; +let str: string; +let diff: string; +let x: any = null; +let arr: any[]; +let exp: RegExp; +let strArr: string[]; +let numArr: string[]; -var v1: string, v2: string; -var version: string; -var versions: string[]; -var loose: boolean; +let v1: string; +let v2: string; +let version: string; +let versions: string[]; +let loose: boolean; str = semver.valid(str); str = semver.clean(str); @@ -48,7 +49,7 @@ bool = semver.gtr(version, str, loose); bool = semver.ltr(version, str, loose); bool = semver.outside(version, str, str, loose); -var ver = new semver.SemVer(str, bool); +let ver = new semver.SemVer(str, bool); str = ver.raw; bool = ver.loose; str = ver.format(); @@ -67,8 +68,7 @@ num = ver.compareMain(ver); num = ver.comparePre(ver); ver = ver.inc(str); - -var comp = new semver.Comparator(str, bool); +const comp = new semver.Comparator(str, bool); str = comp.toString(); ver = comp.semver; @@ -77,8 +77,7 @@ bool = comp.value; comp.parse(str); bool = comp.test(ver); - -var range = new semver.Range(str, bool); +const range = new semver.Range(str, bool); str = range.raw; bool = range.loose; str = range.format(); @@ -87,8 +86,8 @@ str = range.toString(); bool = range.test(ver); -var sets: semver.Comparator[][]; +let sets: semver.Comparator[][]; sets = range.set; -var lims: semver.Comparator[]; +let lims: semver.Comparator[]; lims = range.parseRange(str); diff --git a/types/serialize-javascript/index.d.ts b/types/serialize-javascript/index.d.ts index 9cfa69b977..deb4331961 100644 --- a/types/serialize-javascript/index.d.ts +++ b/types/serialize-javascript/index.d.ts @@ -10,9 +10,9 @@ declare namespace serializeJavascript { * It can be used to add whitespace and indentation to the serialized output to make it more readable. */ space?: string | number | undefined; - /** - * This option is a signal to serialize() that the object being serialized does not contain any function or regexps values. - * This enables a hot-path that allows serialization to be over 3x faster. + /** + * This option is a signal to serialize() that the object being serialized does not contain any function or regexps values. + * This enables a hot-path that allows serialization to be over 3x faster. * If you're serializing a lot of data, and know its pure JSON, then you can enable this option for a speed-up. */ isJSON?: boolean; diff --git a/types/sheetify/sheetify-tests.ts b/types/sheetify/sheetify-tests.ts index 31b35c220d..eba3a63336 100644 --- a/types/sheetify/sheetify-tests.ts +++ b/types/sheetify/sheetify-tests.ts @@ -1,8 +1,8 @@ import * as sheetify from 'sheetify'; -function done1(err: Error, css: string, prefix: string) {}; -function done2(err: Error, css: string) {}; -function done3(err: Error) {}; +function done1(err: Error, css: string, prefix: string) {} +function done2(err: Error, css: string) {} +function done3(err: Error) {} const test1 = sheetify('foobar'); const test2 = sheetify('foobar', {global: true}); diff --git a/types/shipit-utils/shipit-utils-tests.ts b/types/shipit-utils/shipit-utils-tests.ts index 81cb741054..36da5f0073 100644 --- a/types/shipit-utils/shipit-utils-tests.ts +++ b/types/shipit-utils/shipit-utils-tests.ts @@ -1,11 +1,9 @@ import shipit = require("shipit"); import utils = require("shipit-utils"); -var originalShipit = utils.getShipit(shipit); +const originalShipit = utils.getShipit(shipit); -var task = () => { - return shipit.local("sleep 10s"); -}; +const task = () => shipit.local("sleep 10s"); utils.registerTask(originalShipit, "myTask", task); utils.registerTask(originalShipit, "myTask", ["some", "other", "tasks"]); diff --git a/types/shipit/index.d.ts b/types/shipit/index.d.ts index 187b8c1f7d..3146b82fb0 100644 --- a/types/shipit/index.d.ts +++ b/types/shipit/index.d.ts @@ -32,7 +32,7 @@ interface Tasks { interface Task { blocking: boolean; dep: string[]; - fn: () => void; + fn(): void; name: string; } @@ -49,12 +49,12 @@ export function start(tasks: string | string[]): typeof shipit; export function start(...tasks: string[]): typeof shipit; export function task(name: string, depsOrFn: string[] | EmptyCallback, fn?: () => void): typeof shipit; -export var config: {}; -export var domain: any; -export var doneCallback: any; -export var environment: string; -export var seq: any[]; -export var tasks: Tasks; -export var isRunning: boolean; +export const config: {}; +export const domain: any; +export const doneCallback: any; +export const environment: string; +export const seq: any[]; +export const tasks: Tasks; +export const isRunning: boolean; export as namespace shipit; diff --git a/types/simple-oauth2/simple-oauth2-tests.ts b/types/simple-oauth2/simple-oauth2-tests.ts index 7a47078a71..83197a06eb 100644 --- a/types/simple-oauth2/simple-oauth2-tests.ts +++ b/types/simple-oauth2/simple-oauth2-tests.ts @@ -17,10 +17,8 @@ const credentials = { import oauth2lib = require("simple-oauth2"); const oauth2 = oauth2lib.create(credentials); - // #Authorization Code flow (() => { - // Authorization oauth2 URI const authorizationUri = oauth2.authorizationCode.authorizeURL({ redirect_uri: 'http://localhost:3000/callback', @@ -58,7 +56,6 @@ const oauth2 = oauth2lib.create(credentials); }); })(); - // #Client Credentials Flow (() => { const tokenConfig = {}; @@ -73,7 +70,6 @@ const oauth2 = oauth2lib.create(credentials); const token = oauth2.accessToken.create(result); }); - // Promises // Get the access token object for the client oauth2.clientCredentials @@ -86,7 +82,6 @@ const oauth2 = oauth2lib.create(credentials); }); })(); - // #Access Token object (() => { // Sample of a JSON access token (you got it through previous steps) @@ -97,7 +92,7 @@ const oauth2 = oauth2lib.create(credentials); }; // Create the access token wrapper - var token = oauth2.accessToken.create(tokenObject); + let token = oauth2.accessToken.create(tokenObject); // Check if the token is expired. If expired it is refreshed. if (token.expired()) { @@ -139,7 +134,6 @@ const oauth2 = oauth2lib.create(credentials); }); })(); - // #Errors // not applicable, as those errors about missing authentication codes are already found by the typescript compiler diff --git a/types/slug/slug-tests.ts b/types/slug/slug-tests.ts index 5ba9aa7f29..cc6b4d1a10 100644 --- a/types/slug/slug-tests.ts +++ b/types/slug/slug-tests.ts @@ -1,5 +1,5 @@ import slug = require('slug'); -var print = console.log.bind(console, '>'); +const print = console.log.bind(console, '>'); print(slug('i ♥ unicode')); // > i-love-unicode @@ -38,4 +38,4 @@ slug.defaults.modes['pretty'] = { lower: false, charmap: slug.charmap, multicharmap: slug.multicharmap -}; \ No newline at end of file +};