From bead197886f9e35acd6901d41081829f46c56ef2 Mon Sep 17 00:00:00 2001 From: David Paz Date: Fri, 15 Sep 2017 16:34:18 +0200 Subject: [PATCH] Update currency-formatter api Add unformat() function and add missing option to format function options --- types/currency-formatter/index.d.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/types/currency-formatter/index.d.ts b/types/currency-formatter/index.d.ts index 67591738ab..92d7259a56 100644 --- a/types/currency-formatter/index.d.ts +++ b/types/currency-formatter/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for currency-formatter 1.0 // Project: https://github.com/smirzaei/currency-formatter#readme // Definitions by: Mohamed Hegazy +// David Paz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export interface Currency { @@ -18,6 +19,7 @@ export const defaultCurrency: Currency; export function findCurrency(currencyCode: string): Currency; export function format(value: number, options: { code?: string, + locale?: string, symbol?: string, decimal?: string, thousand?: string, @@ -28,3 +30,17 @@ export function format(value: number, options: { zero: string } }): string; + +export function unformat(value: string, options: { + code?: string, + locale?: string, + symbol?: string, + decimal?: string, + thousand?: string, + precision?: number, + format?: string | { + pos: string, + neg: string, + zero: string + } +}): number;