From 7b51234919c155c484496e44e03699d2d454f968 Mon Sep 17 00:00:00 2001 From: Igor Polishchuk Date: Mon, 19 Mar 2018 14:17:10 +0200 Subject: [PATCH 1/3] Fixed CreditCardTypeChangeHandler typings --- types/cleave.js/options/creditCard.d.ts | 19 +++++++++++++++++++ .../{options.d.ts => options/index.d.ts} | 17 +---------------- types/cleave.js/tsconfig.json | 3 ++- 3 files changed, 22 insertions(+), 17 deletions(-) create mode 100644 types/cleave.js/options/creditCard.d.ts rename types/cleave.js/{options.d.ts => options/index.d.ts} (76%) diff --git a/types/cleave.js/options/creditCard.d.ts b/types/cleave.js/options/creditCard.d.ts new file mode 100644 index 0000000000..c052a2f2c2 --- /dev/null +++ b/types/cleave.js/options/creditCard.d.ts @@ -0,0 +1,19 @@ +import Cleave = require("../"); + +// Credit Card Options +export type CreditCardType = + | "amex" + | "dankort" + | "diners" + | "discover" + | "instapayment" + | "jcb" + | "maestro" + | "mastercard" + | "uatp" + | "unknown" + | "unionPay" + | "mir" + | "visa"; + +export type CreditCardTypeChangeHandler = (this: Cleave, type: CreditCardType) => void; \ No newline at end of file diff --git a/types/cleave.js/options.d.ts b/types/cleave.js/options/index.d.ts similarity index 76% rename from types/cleave.js/options.d.ts rename to types/cleave.js/options/index.d.ts index 81757fe097..60e2e99e40 100644 --- a/types/cleave.js/options.d.ts +++ b/types/cleave.js/options/index.d.ts @@ -1,19 +1,4 @@ -// Credit Card Options -export type CreditCardType = - | "amex" - | "dankort" - | "diners" - | "discover" - | "instapayment" - | "jcb" - | "maestro" - | "mastercard" - | "uatp" - | "unknown" - | "unionPay" - | "mir" - | "visa"; -export type CreditCardTypeChangeHandler = (owner: HTMLInputElement, type: CreditCardType) => void; +import { CreditCardTypeChangeHandler } from "./creditCard"; export interface CleaveOptions { creditCard?: boolean; diff --git a/types/cleave.js/tsconfig.json b/types/cleave.js/tsconfig.json index c2d5447360..9ad0f08e29 100644 --- a/types/cleave.js/tsconfig.json +++ b/types/cleave.js/tsconfig.json @@ -21,7 +21,8 @@ "files": [ "cleave.js-tests.tsx", "index.d.ts", - "options.d.ts", + "options/crediCard.d.ts", + "options/index.d.ts", "react/index.d.ts" ] } \ No newline at end of file From c1e6b7b10721ea8886c035def893f596e53bd750 Mon Sep 17 00:00:00 2001 From: Igor Polishchuk Date: Mon, 19 Mar 2018 14:26:35 +0200 Subject: [PATCH 2/3] fixed compilerOptions.files typo --- types/cleave.js/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/cleave.js/tsconfig.json b/types/cleave.js/tsconfig.json index 9ad0f08e29..ec4da5d047 100644 --- a/types/cleave.js/tsconfig.json +++ b/types/cleave.js/tsconfig.json @@ -21,7 +21,7 @@ "files": [ "cleave.js-tests.tsx", "index.d.ts", - "options/crediCard.d.ts", + "options/creditCard.d.ts", "options/index.d.ts", "react/index.d.ts" ] From a82f022dcf96d54ba4f484599158a3af617a8359 Mon Sep 17 00:00:00 2001 From: Igor Polishchuk Date: Mon, 19 Mar 2018 14:34:23 +0200 Subject: [PATCH 3/3] added newline --- types/cleave.js/options/creditCard.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/cleave.js/options/creditCard.d.ts b/types/cleave.js/options/creditCard.d.ts index c052a2f2c2..b7f55ff5b0 100644 --- a/types/cleave.js/options/creditCard.d.ts +++ b/types/cleave.js/options/creditCard.d.ts @@ -16,4 +16,4 @@ export type CreditCardType = | "mir" | "visa"; -export type CreditCardTypeChangeHandler = (this: Cleave, type: CreditCardType) => void; \ No newline at end of file +export type CreditCardTypeChangeHandler = (this: Cleave, type: CreditCardType) => void;