Skip to content

Commit

Permalink
🆕 add types
Browse files Browse the repository at this point in the history
  • Loading branch information
codermarcos committed Apr 14, 2019
1 parent 528574a commit 36bf1c2
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions types/simple-mask-money.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
interface ISimpleMaskMoneyArgs {
afterFormat: (e: string) => {};
allowNegative: boolean = false;
beforeFormat: (e: string) => {};
negativeSignAfter: boolean = false;
decimalSeparator: string = ',';
fixed: boolean = true;
fractionDigits: number = 2;
prefix: string;
suffix: string;
thousandsSeparator: string = '.';
cursor: 'start' | 'move' | 'end';
}

interface ISimpleMaskMoney {
public static args: ISimpleMaskMoneyArgs;
public static formatToCurrency(value: number, args?: ISimpleMaskMoneyArgs): string;
public static formatToMask(value: number, args?: ISimpleMaskMoneyArgs): string;
public static formatToNumber(value: string, args?: ISimpleMaskMoneyArgs): number;
public static setMask(element: string | HTMLInputElement, args?: ISimpleMaskMoneyArgs): HTMLInputElement;
}

declare module 'simple-mask-money' {
export = ISimpleMaskMoney;
}

0 comments on commit 36bf1c2

Please sign in to comment.