From c9d41ebd8ac52245b214eb0f7809bb8e014958fd Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 17 Sep 2018 16:05:37 +0200 Subject: [PATCH] refactor: follow array-type lint rule --- .../decorators/cordova-function-override.ts | 2 +- .../core/decorators/cordova-instance.ts | 2 +- src/@ionic-native/core/decorators/cordova.ts | 2 +- src/@ionic-native/plugins/abbyy-rtr/index.ts | 12 ++++---- .../plugins/android-permissions/index.ts | 2 +- .../plugins/call-directory/index.ts | 16 +++++----- src/@ionic-native/plugins/call-log/index.ts | 2 +- src/@ionic-native/plugins/dialogs/index.ts | 4 +-- .../plugins/document-viewer/index.ts | 2 +- .../plugins/email-composer/index.ts | 6 ++-- src/@ionic-native/plugins/geofence/index.ts | 6 ++-- .../plugins/globalization/index.ts | 4 +-- src/@ionic-native/plugins/health/index.ts | 18 ++++++----- src/@ionic-native/plugins/hotspot/index.ts | 16 +++++----- .../plugins/in-app-purchase-2/index.ts | 2 +- .../plugins/index-app-content/index.ts | 20 ++++++------- .../plugins/intel-security/index.ts | 4 +-- .../plugins/local-notifications/index.ts | 30 +++++++++---------- src/@ionic-native/plugins/mixpanel/index.ts | 2 +- src/@ionic-native/plugins/onesignal/index.ts | 2 +- src/@ionic-native/plugins/paypal/index.ts | 4 +-- src/@ionic-native/plugins/pinterest/index.ts | 30 +++++++++---------- src/@ionic-native/plugins/sms/index.ts | 2 +- .../plugins/speech-recognition/index.ts | 12 ++++---- src/@ionic-native/plugins/sqlite/index.ts | 4 +-- src/@ionic-native/plugins/star-prnt/index.ts | 6 ++-- .../plugins/three-dee-touch/index.ts | 4 +-- src/@ionic-native/plugins/vibration/index.ts | 4 +-- .../plugins/wheel-selector/index.ts | 4 +-- src/@ionic-native/plugins/zeroconf/index.ts | 4 +-- tslint.json | 1 - 31 files changed, 115 insertions(+), 114 deletions(-) diff --git a/src/@ionic-native/core/decorators/cordova-function-override.ts b/src/@ionic-native/core/decorators/cordova-function-override.ts index a1c4d2dc..f432745e 100644 --- a/src/@ionic-native/core/decorators/cordova-function-override.ts +++ b/src/@ionic-native/core/decorators/cordova-function-override.ts @@ -19,7 +19,7 @@ function overrideFunction(pluginObj: any, methodName: string): Observable { export function cordovaFunctionOverride( pluginObj: any, methodName: string, - args: IArguments | Array = [] + args: IArguments | any[] = [] ) { return overrideFunction(pluginObj, methodName); } diff --git a/src/@ionic-native/core/decorators/cordova-instance.ts b/src/@ionic-native/core/decorators/cordova-instance.ts index 7dc27228..fc798ad9 100644 --- a/src/@ionic-native/core/decorators/cordova-instance.ts +++ b/src/@ionic-native/core/decorators/cordova-instance.ts @@ -1,7 +1,7 @@ import { wrapInstance } from './common'; import { CordovaOptions } from './interfaces'; -export function cordovaInstance(pluginObj: any, methodName: string, config: CordovaOptions, args: IArguments | Array) { +export function cordovaInstance(pluginObj: any, methodName: string, config: CordovaOptions, args: IArguments | any[]) { args = Array.from(args); return wrapInstance(pluginObj, methodName, config).apply(this, args); } diff --git a/src/@ionic-native/core/decorators/cordova.ts b/src/@ionic-native/core/decorators/cordova.ts index c6318694..44f0ab09 100644 --- a/src/@ionic-native/core/decorators/cordova.ts +++ b/src/@ionic-native/core/decorators/cordova.ts @@ -1,6 +1,6 @@ import { wrap } from './common'; import { CordovaOptions } from './interfaces'; -export function cordova(pluginObj: any, methodName: string, config: CordovaOptions, args: IArguments | Array) { +export function cordova(pluginObj: any, methodName: string, config: CordovaOptions, args: IArguments | any[]) { return wrap(pluginObj, methodName, config).apply(this, args); } diff --git a/src/@ionic-native/plugins/abbyy-rtr/index.ts b/src/@ionic-native/plugins/abbyy-rtr/index.ts index 7881d954..bd175130 100644 --- a/src/@ionic-native/plugins/abbyy-rtr/index.ts +++ b/src/@ionic-native/plugins/abbyy-rtr/index.ts @@ -21,12 +21,12 @@ export interface TextCaptureOptions { * for example: ["English", "French", "German"]. Empty array * disables language selection. */ - selectableRecognitionLanguages?: Array; + selectableRecognitionLanguages?: string[]; /** * Recognition language selected by default. */ - recognitionLanguages?: Array; + recognitionLanguages?: string[]; /** * Width and height of the recognition area, separated by a @@ -75,7 +75,7 @@ export interface TextCaptureResult { * ยท rect (string): position and size of the bounding rectangle, * a string of 4 integers separated with whitespaces ("x y width height"). */ - textLines: Array<{ text: string, quadrangle: string, rect?: string }>; + textLines: { text: string, quadrangle: string, rect?: string }[]; /** * Additional information. This object has the following keys: @@ -94,7 +94,7 @@ export interface TextCaptureResult { stabilityStatus: string, userAction: string, frameSize: string, - recognitionLanguages: Array + recognitionLanguages: string[] }; /** @@ -136,8 +136,8 @@ export interface DataCaptureOptions { customDataCaptureScenario?: { name: string, description: string, - recognitionLanguages: Array, - fields: Array<{ regEx: string }> + recognitionLanguages: string[], + fields: { regEx: string }[] }; /** diff --git a/src/@ionic-native/plugins/android-permissions/index.ts b/src/@ionic-native/plugins/android-permissions/index.ts index 46060dc1..25dc2a5a 100644 --- a/src/@ionic-native/plugins/android-permissions/index.ts +++ b/src/@ionic-native/plugins/android-permissions/index.ts @@ -223,7 +223,7 @@ export class AndroidPermissions extends IonicNativePlugin { /** * Request permissions - * @param {Array} permissions An array with permissions + * @param {string[]} permissions An array with permissions * @return {Promise} Returns a promise */ @Cordova() diff --git a/src/@ionic-native/plugins/call-directory/index.ts b/src/@ionic-native/plugins/call-directory/index.ts index 689b135d..dffc9185 100644 --- a/src/@ionic-native/plugins/call-directory/index.ts +++ b/src/@ionic-native/plugins/call-directory/index.ts @@ -7,8 +7,8 @@ export interface CallDirectoryItem { } export interface CallDirectoryLog { - plugin: Array; - extension: Array; + plugin: string[]; + extension: string[]; } /** @@ -62,21 +62,21 @@ export class CallDirectory extends IonicNativePlugin { /** * Add identification numbers - * @param {Array} items Set of numbers with labels + * @param {CallDirectoryItem[]} items Set of numbers with labels * @return {Promise} Returns a promise that resolves when numbers are added */ @Cordova() - addIdentification(items: Array): Promise { + addIdentification(items: CallDirectoryItem[]): Promise { return; } /** * Remove identification numbers - * @param {Array} items Set of numbers with arbitrary label + * @param {CallDirectoryItem[]} items Set of numbers with arbitrary label * @return {Promise} Returns a promise that resolves when numbers are removed */ @Cordova() - removeIdentification(items: Array): Promise { + removeIdentification(items: CallDirectoryItem[]): Promise { return; } @@ -91,10 +91,10 @@ export class CallDirectory extends IonicNativePlugin { /** * Get all numbers and labels in call directory - * @return {Array} Returns a promise that resolves with an array of all items + * @return {CallDirectoryItem[]} Returns a promise that resolves with an array of all items */ @Cordova() - getAllItems(): Promise> { + getAllItems(): Promise { return; } diff --git a/src/@ionic-native/plugins/call-log/index.ts b/src/@ionic-native/plugins/call-log/index.ts index 67832e9d..b625a36d 100644 --- a/src/@ionic-native/plugins/call-log/index.ts +++ b/src/@ionic-native/plugins/call-log/index.ts @@ -3,7 +3,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; export interface CallLogObject { name: string; - value: string | Array; + value: string | string[]; operator: '==' | '!=' | '>' | '>=' | '<' | '<=' | 'like'; } diff --git a/src/@ionic-native/plugins/dialogs/index.ts b/src/@ionic-native/plugins/dialogs/index.ts index a452061e..505f040f 100644 --- a/src/@ionic-native/plugins/dialogs/index.ts +++ b/src/@ionic-native/plugins/dialogs/index.ts @@ -65,7 +65,7 @@ export class Dialogs extends IonicNativePlugin { * Displays a customizable confirmation dialog box. * @param {string} message Dialog message. * @param {string} [title] Dialog title. (Optional, defaults to Confirm) - * @param {Array} [buttonLabels] Array of strings specifying button labels. (Optional, defaults to [OK,Cancel]) + * @param {string[]} [buttonLabels] Array of strings specifying button labels. (Optional, defaults to [OK,Cancel]) * @returns {Promise} Returns a promise that resolves the button index that was clicked, or 0 if the user has dismissed the dialog by clicking outside the dialog box. Note that the index use one-based indexing. */ @Cordova({ @@ -84,7 +84,7 @@ export class Dialogs extends IonicNativePlugin { * Displays a native dialog box that is more customizable than the browser's prompt function. * @param {string} [message] Dialog message. * @param {string} [title] Dialog title. (Optional, defaults to Prompt) - * @param {Array} [buttonLabels] Array of strings specifying button labels. (Optional, defaults to ["OK","Cancel"]) + * @param {string[]} [buttonLabels] Array of strings specifying button labels. (Optional, defaults to ["OK","Cancel"]) * @param {string} [defaultText] Default text box input value. (Optional, Default: empty string) * @returns {Promise} Returns a promise that resolves an object with the button index clicked and the text entered */ diff --git a/src/@ionic-native/plugins/document-viewer/index.ts b/src/@ionic-native/plugins/document-viewer/index.ts index c3686bef..f9ab1c1c 100644 --- a/src/@ionic-native/plugins/document-viewer/index.ts +++ b/src/@ionic-native/plugins/document-viewer/index.ts @@ -78,7 +78,7 @@ export class DocumentViewer extends IonicNativePlugin { * * @param url {string} Url to the file * @param contentType {string} Content type of the file - * @param options {Array} options + * @param options {DocumentViewerOptions} options * @param [onPossible] {Function} * @param [onMissingApp] {Function} * @param [onImpossible] {Function} diff --git a/src/@ionic-native/plugins/email-composer/index.ts b/src/@ionic-native/plugins/email-composer/index.ts index 7fd29ca2..c821d32d 100644 --- a/src/@ionic-native/plugins/email-composer/index.ts +++ b/src/@ionic-native/plugins/email-composer/index.ts @@ -16,17 +16,17 @@ export interface EmailComposerOptions { /** * Email address(es) for To field */ - to?: string | Array; + to?: string | string[]; /** * Email address(es) for CC field */ - cc?: string | Array; + cc?: string | string[]; /** * Email address(es) for BCC field */ - bcc?: string | Array; + bcc?: string | string[]; /** * File paths or base64 data streams diff --git a/src/@ionic-native/plugins/geofence/index.ts b/src/@ionic-native/plugins/geofence/index.ts index ed377164..0c10fa87 100644 --- a/src/@ionic-native/plugins/geofence/index.ts +++ b/src/@ionic-native/plugins/geofence/index.ts @@ -120,7 +120,7 @@ export class Geofence extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - addOrUpdate(geofences: Object | Array): Promise { + addOrUpdate(geofences: Object | Object[]): Promise { return; } @@ -131,7 +131,7 @@ export class Geofence extends IonicNativePlugin { * @returns {Promise} */ @Cordova() - remove(geofenceId: string | Array): Promise { + remove(geofenceId: string | string[]): Promise { return; } @@ -148,7 +148,7 @@ export class Geofence extends IonicNativePlugin { /** * Returns an array of geofences currently being monitored. * - * @returns {Promise>} + * @returns {Promise} */ @Cordova() getWatched(): Promise { diff --git a/src/@ionic-native/plugins/globalization/index.ts b/src/@ionic-native/plugins/globalization/index.ts index d2e88d10..7d5740c5 100644 --- a/src/@ionic-native/plugins/globalization/index.ts +++ b/src/@ionic-native/plugins/globalization/index.ts @@ -126,7 +126,7 @@ export class Globalization extends IonicNativePlugin { /** * Returns an array of the names of the months or days of the week, depending on the client's user preferences and calendar. * @param options Object with type (narrow or wide) and item (month or days). - * @returns {Promise<{value: Array}>} Returns a promise. + * @returns {Promise<{value: string[]}>} Returns a promise. */ @Cordova({ callbackOrder: 'reverse' @@ -134,7 +134,7 @@ export class Globalization extends IonicNativePlugin { getDateNames(options: { type: string; item: string; - }): Promise<{ value: Array }> { + }): Promise<{ value: string[] }> { return; } diff --git a/src/@ionic-native/plugins/health/index.ts b/src/@ionic-native/plugins/health/index.ts index 943c4818..3e21e409 100644 --- a/src/@ionic-native/plugins/health/index.ts +++ b/src/@ionic-native/plugins/health/index.ts @@ -207,7 +207,6 @@ export interface HealthData { }) @Injectable() export class Health extends IonicNativePlugin { - /** * Tells if either Google Fit or HealthKit are available. * @@ -254,11 +253,11 @@ export class Health extends IonicNativePlugin { * In Android 6 and over, this function will also ask for some dynamic permissions if needed * (e.g. in the case of "distance", it will need access to ACCESS_FINE_LOCATION). * - * @param {Array} datatypes a list of data types you want to be granted access to. + * @param {string[] | HealthDataType[]} datatypes a list of data types you want to be granted access to. * @return {Promise} */ @Cordova() - requestAuthorization(datatypes: Array): Promise { + requestAuthorization(datatypes: string[] | HealthDataType[]): Promise { return; } @@ -270,11 +269,11 @@ export class Health extends IonicNativePlugin { * In iOS, this function will only check authorization status for writeable data. * Read-only data will always be considered as not authorized. This is an intended behaviour of HealthKit. * - * @param {Array} datatypes a list of data types you want to check access of, same as in requestAuthorization + * @param {string[] | HealthDataType[]} datatypes a list of data types you want to check access of, same as in requestAuthorization * @return {Promise} Returns a promise that resolves with a boolean that indicates the authorization status */ @Cordova() - isAuthorized(datatypes: Array): Promise { + isAuthorized(datatypes: string[] | HealthDataType[]): Promise { return; } @@ -310,7 +309,9 @@ export class Health extends IonicNativePlugin { * @return {Promise} */ @Cordova() - query(queryOptions: HealthQueryOptions): Promise { return; } + query(queryOptions: HealthQueryOptions): Promise { + return; + } /** * Gets aggregated data in a certain time window. Usually the sum is returned for the given quantity. @@ -334,7 +335,9 @@ export class Health extends IonicNativePlugin { * @return {Promise} */ @Cordova() - queryAggregated(queryOptionsAggregated: HealthQueryOptionsAggregated): Promise { + queryAggregated( + queryOptionsAggregated: HealthQueryOptionsAggregated + ): Promise { return; } @@ -356,5 +359,4 @@ export class Health extends IonicNativePlugin { store(storeOptions: HealthStoreOptions): Promise { return; } - } diff --git a/src/@ionic-native/plugins/hotspot/index.ts b/src/@ionic-native/plugins/hotspot/index.ts index da6ba10a..715204db 100644 --- a/src/@ionic-native/plugins/hotspot/index.ts +++ b/src/@ionic-native/plugins/hotspot/index.ts @@ -119,7 +119,7 @@ export interface HotspotDevice { * ... * * - * this.hotspot.scanWifi().then((networks: Array) => { + * this.hotspot.scanWifi().then((networks: HotspotNetwork[]) => { * console.log(networks); * }); * @@ -215,10 +215,10 @@ export class Hotspot extends IonicNativePlugin { } /** - * @returns {Promise>} + * @returns {Promise} */ @Cordova() - getAllHotspotDevices(): Promise> { + getAllHotspotDevices(): Promise { return; } @@ -254,7 +254,7 @@ export class Hotspot extends IonicNativePlugin { * Promise that connection to the WiFi network was successfull, rejected if unsuccessful */ @Cordova() - connectToWifiAuthEncrypt(ssid: string, password: string, authentication: string, encryption: Array): Promise { + connectToWifiAuthEncrypt(ssid: string, password: string, authentication: string, encryption: string[]): Promise { return; } @@ -331,18 +331,18 @@ export class Hotspot extends IonicNativePlugin { } /** - * @returns {Promise>} + * @returns {Promise} */ @Cordova() - scanWifi(): Promise> { + scanWifi(): Promise { return; } /** - * @returns {Promise>} + * @returns {Promise} */ @Cordova() - scanWifiByLevel(): Promise> { + scanWifiByLevel(): Promise { return; } diff --git a/src/@ionic-native/plugins/in-app-purchase-2/index.ts b/src/@ionic-native/plugins/in-app-purchase-2/index.ts index 9b05271f..9696c046 100644 --- a/src/@ionic-native/plugins/in-app-purchase-2/index.ts +++ b/src/@ionic-native/plugins/in-app-purchase-2/index.ts @@ -77,7 +77,7 @@ export interface IAPProductOptions { type: string; } -export type IAPProducts = Array & { +export type IAPProducts = IAPProduct[] & { /** * Get product by ID */ diff --git a/src/@ionic-native/plugins/index-app-content/index.ts b/src/@ionic-native/plugins/index-app-content/index.ts index 1e65cc3c..3627adf8 100644 --- a/src/@ionic-native/plugins/index-app-content/index.ts +++ b/src/@ionic-native/plugins/index-app-content/index.ts @@ -21,7 +21,7 @@ export interface IndexItem { /** * Item keywords */ - keywords?: Array; + keywords?: string[]; /** * Lifetime in minutes @@ -89,31 +89,31 @@ export class IndexAppContent extends IonicNativePlugin { /** * Add or change items to spotlight index - * @param {Array} items Array of items to index - * @return {Promise} Returns if index set was successfull + * @param {IndexItem[]} items Array of items to index + * @return {Promise} Returns if index set was successfully */ @Cordova() - setItems(items: Array): Promise { + setItems(items: IndexItem[]): Promise { return; } /** * Clear all items stored for a given array of domains - * @param {Array} domains Array of domains to clear - * @return {Promise} Resolve if successfull + * @param {string[]} domains Array of domains to clear + * @return {Promise} Resolve if successfully */ @Cordova() - clearItemsForDomains(domains: Array): Promise { + clearItemsForDomains(domains: string[]): Promise { return; } /** * Clear all items stored for a given array of identifiers - * @param {Array} identifiers Array of identifiers to clear - * @return {Promise} Resolve if successfull + * @param {string[]} identifiers Array of identifiers to clear + * @return {Promise} Resolve if successfully */ @Cordova() - clearItemsForIdentifiers(identifiers: Array): Promise { + clearItemsForIdentifiers(identifiers: string[]): Promise { return; } diff --git a/src/@ionic-native/plugins/intel-security/index.ts b/src/@ionic-native/plugins/intel-security/index.ts index 21b8858f..154bf530 100644 --- a/src/@ionic-native/plugins/intel-security/index.ts +++ b/src/@ionic-native/plugins/intel-security/index.ts @@ -105,7 +105,7 @@ export class IntelSecurityData { * @returns {Promise} Returns a promise that resolves to an array of owners' unique IDs, or rejects with an error. */ @Cordova({ otherPromise: true }) - getOwners(instanceID: any): Promise> { + getOwners(instanceID: any): Promise { return; } @@ -125,7 +125,7 @@ export class IntelSecurityData { * @returns {Promise} Returns a promise that resolves to a list of web owners, or rejects with an error. */ @Cordova({ otherPromise: true }) - getWebOwners(instanceID: any): Promise> { + getWebOwners(instanceID: any): Promise { return; } diff --git a/src/@ionic-native/plugins/local-notifications/index.ts b/src/@ionic-native/plugins/local-notifications/index.ts index ae4579e4..7d237833 100755 --- a/src/@ionic-native/plugins/local-notifications/index.ts +++ b/src/@ionic-native/plugins/local-notifications/index.ts @@ -485,12 +485,12 @@ export interface ILocalNotification { export class LocalNotifications extends IonicNativePlugin { /** * Schedules a single or multiple notifications - * @param options {Notification | Array} optional + * @param options {Notification | ILocalNotification[]} optional */ @Cordova({ sync: true }) - schedule(options?: ILocalNotification | Array): void {} + schedule(options?: ILocalNotification | ILocalNotification[]): void {} /** * Updates a previously scheduled notification. Must include the id in the options parameter. @@ -571,28 +571,28 @@ export class LocalNotifications extends IonicNativePlugin { /** * Get all the notification ids - * @returns {Promise>} + * @returns {Promise} */ @Cordova() - getIds(): Promise> { + getIds(): Promise { return; } /** * Get the ids of triggered notifications - * @returns {Promise>} + * @returns {Promise} */ @Cordova() - getTriggeredIds(): Promise> { + getTriggeredIds(): Promise { return; } /** * Get the ids of scheduled notifications - * @returns {Promise>} Returns a promise + * @returns {Promise} Returns a promise */ @Cordova() - getScheduledIds(): Promise> { + getScheduledIds(): Promise { return; } @@ -628,28 +628,28 @@ export class LocalNotifications extends IonicNativePlugin { /** * Get all notification objects - * @returns {Promise>} + * @returns {Promise} */ @Cordova() - getAll(): Promise> { + getAll(): Promise { return; } /** * Get all scheduled notification objects - * @returns {Promise>} + * @returns {Promise} */ @Cordova() - getAllScheduled(): Promise> { + getAllScheduled(): Promise { return; } /** * Get all triggered notification objects - * @returns {Promise>} + * @returns {Promise} */ @Cordova() - getAllTriggered(): Promise> { + getAllTriggered(): Promise { return; } @@ -680,7 +680,7 @@ export class LocalNotifications extends IonicNativePlugin { @Cordova() addActions( groupId: any, - actions: Array + actions: ILocalNotificationAction[] ): Promise { return; } diff --git a/src/@ionic-native/plugins/mixpanel/index.ts b/src/@ionic-native/plugins/mixpanel/index.ts index c2968d0f..b529c5c3 100644 --- a/src/@ionic-native/plugins/mixpanel/index.ts +++ b/src/@ionic-native/plugins/mixpanel/index.ts @@ -251,7 +251,7 @@ export class MixpanelPeople extends IonicNativePlugin { * @return {Promise} */ @Cordova() - unset(propertiesArray: Array): Promise { + unset(propertiesArray: string[]): Promise { return; } diff --git a/src/@ionic-native/plugins/onesignal/index.ts b/src/@ionic-native/plugins/onesignal/index.ts index 08eabd5e..c7d5593e 100644 --- a/src/@ionic-native/plugins/onesignal/index.ts +++ b/src/@ionic-native/plugins/onesignal/index.ts @@ -563,7 +563,7 @@ export class OneSignal extends IonicNativePlugin { /** * Deletes tags that were previously set on a user with `sendTag` or `sendTags`. * - * @param {Array} Keys to remove. + * @param {string[]} Keys to remove. */ @Cordova({ sync: true }) deleteTags(keys: string[]): void {} diff --git a/src/@ionic-native/plugins/paypal/index.ts b/src/@ionic-native/plugins/paypal/index.ts index c3d017cd..333360fd 100644 --- a/src/@ionic-native/plugins/paypal/index.ts +++ b/src/@ionic-native/plugins/paypal/index.ts @@ -150,7 +150,7 @@ export class PayPal extends IonicNativePlugin { /** * Please Read Docs on Profile Sharing at https://github.com/paypal/PayPal-iOS-SDK#profile-sharing * - * @param {Array} scopes scopes Set of requested scope-values. Accepted scopes are: openid, profile, address, email, phone, futurepayments and paypalattributes + * @param {string[]} scopes scopes Set of requested scope-values. Accepted scopes are: openid, profile, address, email, phone, futurepayments and paypalattributes * See https://developer.paypal.com/docs/integration/direct/identity/attributes/ for more details * @returns {Promise} */ @@ -205,7 +205,7 @@ export class PayPalPayment { /** * Optional array of PayPalItem objects. */ - items: Array; + items: PayPalItem[]; /** * Optional payee email, if your app is paying a third-party merchant. * The payee's email. It must be a valid PayPal email address. diff --git a/src/@ionic-native/plugins/pinterest/index.ts b/src/@ionic-native/plugins/pinterest/index.ts index 22d65669..8ad61f77 100644 --- a/src/@ionic-native/plugins/pinterest/index.ts +++ b/src/@ionic-native/plugins/pinterest/index.ts @@ -152,14 +152,14 @@ export interface PinterestPin { * .catch(err => console.error('Error loggin in', err)); * * this.pinterest.getMyPins() - * .then((pins: Array) => console.log(pins)) + * .then((pins: PinterestPin[]) => console.log(pins)) * .catch(err => console.error(err)); * * this.pinterest.getMe() * .then((user: PinterestUser) => console.log(user)); * * this.pinterest.getMyBoards() - * .then((boards: Array) => console.log(boards)); + * .then((boards: PinterestBoard[]) => console.log(boards)); * * ``` * @interfaces @@ -192,7 +192,7 @@ export class Pinterest extends IonicNativePlugin { /** * Logs the user in using their Pinterest account. - * @param scopes {Array} Array of scopes that you need access to. You can use Pinterest.SCOPES constant for convenience. + * @param scopes {string[]} Array of scopes that you need access to. You can use Pinterest.SCOPES constant for convenience. * @returns {Promise} The response object will contain the user's profile data, as well as the access token (if you need to use it elsewhere, example: send it to your server and perform actions on behalf of the user). */ @Cordova() @@ -216,12 +216,12 @@ export class Pinterest extends IonicNativePlugin { * * @param fields {string} Optional fields separated by comma * @param limit {number} Optional limit, defaults to 100, maximum is 100. - * @returns {Promise>} + * @returns {Promise} */ @Cordova({ callbackOrder: 'reverse' }) - getMyPins(fields?: string, limit?: number): Promise> { + getMyPins(fields?: string, limit?: number): Promise { return; } @@ -229,12 +229,12 @@ export class Pinterest extends IonicNativePlugin { * * @param fields {string} Optional fields separated by comma * @param limit {number} Optional limit, defaults to 100, maximum is 100. - * @returns {Promise>} + * @returns {Promise} */ @Cordova({ callbackOrder: 'reverse' }) - getMyBoards(fields?: string, limit?: number): Promise> { + getMyBoards(fields?: string, limit?: number): Promise { return; } @@ -242,12 +242,12 @@ export class Pinterest extends IonicNativePlugin { * Get the authenticated user's likes. * @param fields {string} Optional fields separated by comma * @param limit {number} Optional limit, defaults to 100, maximum is 100. - * @returns {Promise>} + * @returns {Promise} */ @Cordova({ callbackOrder: 'reverse' }) - getMyLikes(fields?: string, limit?: number): Promise> { + getMyLikes(fields?: string, limit?: number): Promise { return; } @@ -255,12 +255,12 @@ export class Pinterest extends IonicNativePlugin { * Get the authenticated user's followers. * @param fields {string} Optional fields separated by comma * @param limit {number} Optional limit, defaults to 100, maximum is 100. - * @returns {Promise>} + * @returns {Promise} */ @Cordova({ callbackOrder: 'reverse' }) - getMyFollowers(fields?: string, limit?: number): Promise> { + getMyFollowers(fields?: string, limit?: number): Promise { return; } @@ -268,12 +268,12 @@ export class Pinterest extends IonicNativePlugin { * Get the authenticated user's followed boards. * @param fields {string} Optional fields separated by comma * @param limit {number} Optional limit, defaults to 100, maximum is 100. - * @returns {Promise>} + * @returns {Promise} */ @Cordova({ callbackOrder: 'reverse' }) - getMyFollowedBoards(fields?: string, limit?: number): Promise> { + getMyFollowedBoards(fields?: string, limit?: number): Promise { return; } @@ -323,13 +323,13 @@ export class Pinterest extends IonicNativePlugin { * @param boardId {string} The ID of the board * @param fields {string} Optional fields separated by comma * @param limit {number} Optional limit, defaults to 100, maximum is 100. - * @returns {Promise>} + * @returns {Promise} */ @Cordova({ successIndex: 1, errorIndex: 2 }) - getBoardPins(boardId: string, fields?: string, limit?: number): Promise> { + getBoardPins(boardId: string, fields?: string, limit?: number): Promise { return; } diff --git a/src/@ionic-native/plugins/sms/index.ts b/src/@ionic-native/plugins/sms/index.ts index 0e7ef9a3..7db7e1f4 100644 --- a/src/@ionic-native/plugins/sms/index.ts +++ b/src/@ionic-native/plugins/sms/index.ts @@ -54,7 +54,7 @@ export interface SmsOptionsAndroid { export class SMS extends IonicNativePlugin { /** * Sends sms to a number - * @param phoneNumber {string|Array} Phone number + * @param phoneNumber {string|string[]} Phone number * @param message {string} Message * @param options {SmsOptions} Options * @returns {Promise} Resolves promise when the SMS has been sent diff --git a/src/@ionic-native/plugins/speech-recognition/index.ts b/src/@ionic-native/plugins/speech-recognition/index.ts index 2f0e7666..93ddd481 100644 --- a/src/@ionic-native/plugins/speech-recognition/index.ts +++ b/src/@ionic-native/plugins/speech-recognition/index.ts @@ -72,7 +72,7 @@ export interface SpeechRecognitionListeningOptionsAndroid { * // Start the recognition process * this.speechRecognition.startListening(options) * .subscribe( - * (matches: Array) => console.log(matches), + * (matches: string[]) => console.log(matches), * (onerror) => console.log('error:', onerror) * ) * @@ -82,7 +82,7 @@ export interface SpeechRecognitionListeningOptionsAndroid { * // Get the list of supported languages * this.speechRecognition.getSupportedLanguages() * .then( - * (languages: Array) => console.log(languages), + * (languages: string[]) => console.log(languages), * (error) => console.log(error) * ) * @@ -119,7 +119,7 @@ export class SpeechRecognition extends IonicNativePlugin { /** * Start the recognition process - * @return {Promise< Array >} list of recognized terms + * @return {Promise< string[] >} list of recognized terms */ @Cordova({ callbackOrder: 'reverse', @@ -127,7 +127,7 @@ export class SpeechRecognition extends IonicNativePlugin { }) startListening( options?: SpeechRecognitionListeningOptions - ): Observable> { + ): Observable { return; } @@ -141,10 +141,10 @@ export class SpeechRecognition extends IonicNativePlugin { /** * Get the list of supported languages - * @return {Promise< Array >} list of languages + * @return {Promise< string[] >} list of languages */ @Cordova() - getSupportedLanguages(): Promise> { + getSupportedLanguages(): Promise { return; } diff --git a/src/@ionic-native/plugins/sqlite/index.ts b/src/@ionic-native/plugins/sqlite/index.ts index 0436bcdf..d324815e 100644 --- a/src/@ionic-native/plugins/sqlite/index.ts +++ b/src/@ionic-native/plugins/sqlite/index.ts @@ -125,11 +125,11 @@ export class SQLiteObject { } /** - * @param sqlStatements {Array} + * @param sqlStatements {string[] | string[][] | any[]} * @returns {Promise} */ @CordovaInstance() - sqlBatch(sqlStatements: Array): Promise { + sqlBatch(sqlStatements: string[] | string[][] | any[]): Promise { return; } diff --git a/src/@ionic-native/plugins/star-prnt/index.ts b/src/@ionic-native/plugins/star-prnt/index.ts index e2e8f41e..2020cabe 100644 --- a/src/@ionic-native/plugins/star-prnt/index.ts +++ b/src/@ionic-native/plugins/star-prnt/index.ts @@ -136,13 +136,13 @@ export interface PrintCommand { * Data (Command) is added to the command buffer. Takes an array of bytes. * Example: {appendBytes:[0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e]} */ - appendBytes?: Array; + appendBytes?: number[]; /** * Data (Command) is added to the command buffer. Takes an array of bytes. * Example: {appendRawBytes:[0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e]} */ - appendRawBytes?: Array; + appendRawBytes?: number[]; /** * Set command of the character space is generated and added to the command buffer. Character Spacs (Unit: Dots) Example: 4 @@ -241,7 +241,7 @@ export interface PrintCommand { * Example: {appendHorizontalTabPosition:[15, 35]} * Delete positions Example: {appendHorizontalTabPosition:[]} */ - appendHorizontalTabPosition?: Array; + appendHorizontalTabPosition?: number[]; /** * Print command of the logo is generated and added to the command buffer. The logo has to be uploaded to the printer using the Star Print utility. diff --git a/src/@ionic-native/plugins/three-dee-touch/index.ts b/src/@ionic-native/plugins/three-dee-touch/index.ts index b25c2539..854f79e7 100644 --- a/src/@ionic-native/plugins/three-dee-touch/index.ts +++ b/src/@ionic-native/plugins/three-dee-touch/index.ts @@ -85,7 +85,7 @@ export interface ThreeDeeTouchForceTouch { * ); * * - * let actions: Array = [ + * let actions: ThreeDeeTouchQuickAction[] = [ * { * type: 'checkin', * title: 'Check in', @@ -164,7 +164,7 @@ export class ThreeDeeTouch extends IonicNativePlugin { @Cordova({ sync: true }) - configureQuickActions(quickActions: Array): void {} + configureQuickActions(quickActions: ThreeDeeTouchQuickAction[]): void {} /** * When a home icon is pressed, your app launches and this JS callback is invoked. diff --git a/src/@ionic-native/plugins/vibration/index.ts b/src/@ionic-native/plugins/vibration/index.ts index cd4a6cae..ef5e0a9c 100644 --- a/src/@ionic-native/plugins/vibration/index.ts +++ b/src/@ionic-native/plugins/vibration/index.ts @@ -40,12 +40,12 @@ export class Vibration extends IonicNativePlugin { /** * Vibrates the device for given amount of time. - * @param time {number|Array} Milliseconds to vibrate the device. If passed an array of numbers, it will define a vibration pattern. Pass 0 to stop any vibration immediately. + * @param time {number|number[]} Milliseconds to vibrate the device. If passed an array of numbers, it will define a vibration pattern. Pass 0 to stop any vibration immediately. */ @Cordova({ sync: true }) - vibrate(time: number | Array) { + vibrate(time: number | number[]) { } } diff --git a/src/@ionic-native/plugins/wheel-selector/index.ts b/src/@ionic-native/plugins/wheel-selector/index.ts index e25779ac..f1f1ae1a 100644 --- a/src/@ionic-native/plugins/wheel-selector/index.ts +++ b/src/@ionic-native/plugins/wheel-selector/index.ts @@ -19,12 +19,12 @@ export interface WheelSelectorOptions { /** * The items to display (array of items). */ - items: Array>; + items: WheelSelectorItem[][]; /** * Which items to display by default. */ - defaultItems?: Array; + defaultItems?: DefaultItem[]; /** * The 'ok' button text diff --git a/src/@ionic-native/plugins/zeroconf/index.ts b/src/@ionic-native/plugins/zeroconf/index.ts index 1bc7f4b1..eef3220a 100644 --- a/src/@ionic-native/plugins/zeroconf/index.ts +++ b/src/@ionic-native/plugins/zeroconf/index.ts @@ -8,8 +8,8 @@ export interface ZeroconfService { name: string; port: number; hostname: string; - ipv4Addresses: Array; - ipv6Addresses: Array; + ipv4Addresses: string[]; + ipv6Addresses: string[]; txtRecord: any; } diff --git a/tslint.json b/tslint.json index dd09b715..be3a586b 100644 --- a/tslint.json +++ b/tslint.json @@ -6,7 +6,6 @@ "no-import-side-effect": false, "no-redundant-jsdoc": false, // TODO: Activate rules step by step - "array-type": false, "ban-types": false, "no-shadowed-variable": false, "only-arrow-functions": false,