mirror of https://github.com/BTCPrivate/copay.git
lint: reenable tslint ban-types, fix all the types
This commit is contained in:
parent
49e8a58b46
commit
d29d69224c
|
@ -1,10 +1,10 @@
|
|||
export class Profile {
|
||||
|
||||
public version: string;
|
||||
public createdOn: Number;
|
||||
public createdOn: number;
|
||||
public credentials: any[];
|
||||
public disclaimerAccepted: boolean;
|
||||
public checked: Object;
|
||||
public checked: any;
|
||||
public checkedUA?: any;
|
||||
public dirty: boolean;
|
||||
|
||||
|
|
|
@ -24,9 +24,9 @@ export class BackupGamePage {
|
|||
|
||||
public currentIndex: number;
|
||||
public deleted: boolean;
|
||||
public mnemonicWords: String[];
|
||||
public mnemonicWords: string[];
|
||||
public shuffledMnemonicWords: any[];
|
||||
public password: String;
|
||||
public password: string;
|
||||
public customWords: any[];
|
||||
public selectComplete: boolean;
|
||||
public error: boolean;
|
||||
|
@ -84,7 +84,7 @@ export class BackupGamePage {
|
|||
if (this.slides) this.slides.lockSwipes(true);
|
||||
}
|
||||
|
||||
private shuffledWords(words: String[]) {
|
||||
private shuffledWords(words: string[]) {
|
||||
var sort = _.sortBy(words);
|
||||
|
||||
return _.map(sort, (w) => {
|
||||
|
|
|
@ -98,7 +98,7 @@ export class BitPayCardPage {
|
|||
};
|
||||
}
|
||||
|
||||
private setGetStarted(history: any, cb: Function) {
|
||||
private setGetStarted(history: any, cb: () => any) {
|
||||
|
||||
// Is the card new?
|
||||
if (!_.isEmpty(history.transactionList))
|
||||
|
|
|
@ -112,7 +112,7 @@ export class BuyGlideraPage {
|
|||
});
|
||||
}
|
||||
|
||||
private ask2FaCode(mode, cb): Function {
|
||||
private ask2FaCode(mode, cb): () => any {
|
||||
if (mode != 'NONE') {
|
||||
// SHOW PROMPT
|
||||
var title = 'Please, enter the code below';
|
||||
|
|
|
@ -116,7 +116,7 @@ export class SellGlideraPage {
|
|||
});
|
||||
}
|
||||
|
||||
private ask2FaCode(mode, cb): Function {
|
||||
private ask2FaCode(mode, cb): () => any {
|
||||
if (mode != 'NONE') {
|
||||
// SHOW PROMPT
|
||||
let title = 'Please, enter the code below';
|
||||
|
|
|
@ -81,12 +81,12 @@ export class PaperWalletPage {
|
|||
}
|
||||
}
|
||||
|
||||
private getPrivateKey(scannedKey: string, isPkEncrypted: boolean, passphrase: string, cb: Function): Function {
|
||||
private getPrivateKey(scannedKey: string, isPkEncrypted: boolean, passphrase: string, cb: (err, scannedKey) => any): () => any {
|
||||
if (!isPkEncrypted) return cb(null, scannedKey);
|
||||
this.wallet.decryptBIP38PrivateKey(scannedKey, passphrase, null, cb);
|
||||
}
|
||||
|
||||
private getBalance(privateKey: string, cb: Function): void {
|
||||
private getBalance(privateKey: string, cb: (err: any, balance: number) => any): void {
|
||||
this.wallet.getBalanceFromPrivateKey(privateKey, cb);
|
||||
}
|
||||
|
||||
|
|
|
@ -286,7 +286,7 @@ export class AmountPage {
|
|||
public showSendMaxMenu(): void {
|
||||
let buttons: any[] = [];
|
||||
|
||||
let sendMaxButton: Object = {
|
||||
let sendMaxButton = {
|
||||
text: this.itemSelectorLabel,
|
||||
icon: 'speedometer',
|
||||
handler: () => {
|
||||
|
|
|
@ -57,7 +57,7 @@ export class BitPayAccountProvider {
|
|||
) {
|
||||
}
|
||||
|
||||
public pair(pairData: any, pairingReason: string, cb: Function) {
|
||||
public pair(pairData: any, pairingReason: string, cb: (err: string, paired?: boolean, apiContext?: any) => any) {
|
||||
this.checkOtp(pairData, (otp) => {
|
||||
pairData.otp = otp;
|
||||
let deviceName = 'Unknown device';
|
||||
|
@ -127,7 +127,7 @@ export class BitPayAccountProvider {
|
|||
});
|
||||
}
|
||||
|
||||
private checkOtp(pairData: any, cb: Function) {
|
||||
private checkOtp(pairData: any, cb: (otp?) => any) {
|
||||
if (pairData.otp) {
|
||||
let msg = 'Enter Two Factor for your BitPay account'; // TODO gettextcatalog
|
||||
this.popupProvider.ionicPrompt(null, msg, null).then((res) => {
|
||||
|
@ -138,7 +138,7 @@ export class BitPayAccountProvider {
|
|||
}
|
||||
}
|
||||
|
||||
private fetchBasicInfo(apiContext: any, cb: Function) {
|
||||
private fetchBasicInfo(apiContext: any, cb: (err, basicInfo?) => any) {
|
||||
let json = {
|
||||
method: 'getBasicInfo'
|
||||
};
|
||||
|
@ -153,7 +153,7 @@ export class BitPayAccountProvider {
|
|||
};
|
||||
|
||||
// Returns account objects as stored.
|
||||
public getAccountsAsStored(cb: Function) {
|
||||
public getAccountsAsStored(cb: (err, accounts) => any) {
|
||||
this.persistenceProvider.getBitpayAccounts(this.bitPayProvider.getEnvironment().network).then((accounts) => {
|
||||
return cb(null, accounts);
|
||||
}).catch((err) => {
|
||||
|
@ -163,7 +163,7 @@ export class BitPayAccountProvider {
|
|||
|
||||
// Returns an array where each element represents an account including all information required for fetching data
|
||||
// from the server for each account (apiContext).
|
||||
public getAccounts(cb: Function) {
|
||||
public getAccounts(cb: (err, accounts?) => any) {
|
||||
this.getAccountsAsStored((err, accounts) => {
|
||||
if (err || _.isEmpty(accounts)) {
|
||||
return cb(err, []);
|
||||
|
@ -198,7 +198,7 @@ export class BitPayAccountProvider {
|
|||
this.persistenceProvider.setBitpayAccount(this.bitPayProvider.getEnvironment().network, account);
|
||||
};
|
||||
|
||||
public removeAccount(email: string, cb: Function) {
|
||||
public removeAccount(email: string, cb: () => any) {
|
||||
this.persistenceProvider.removeBitpayAccount(this.bitPayProvider.getEnvironment().network, email).then(() => {
|
||||
this.bitPayCardProvider.register();
|
||||
return cb();
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
"prefer-for-of": false,
|
||||
"forin": false,
|
||||
"prefer-const": false,
|
||||
"ban-types": false,
|
||||
"no-unused-expression": false,
|
||||
"no-eval": false,
|
||||
"no-object-literal-type-assertion": false,
|
||||
|
|
Loading…
Reference in New Issue