@jonstuebe/allot-utils
Version:
Util functions for Allot
30 lines (29 loc) • 1.4 kB
TypeScript
import { InitialBill, Bill, PayPeriod, YearIndexes } from "./types";
export declare function getFutureBillDates({ due, startOn }: Bill, numDates?: number): Date[];
export declare function addFutureBillDates(bill: Bill, numDates?: number): {
dueDates: Date[];
name: string;
amount: number;
autoPay?: boolean | undefined;
startOn: Date;
due: {
weekly?: 0 | 2 | 1 | 6 | 5 | 4 | 3 | undefined;
monthly?: 0 | 2 | 1 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | undefined;
yearly?: YearIndexes | undefined;
};
};
export declare function getBillAmountForPayPeriod(bill: Bill, payPeriod: PayPeriod): number;
export declare function isBillInPayPeriod(bill: Bill, payPeriod: PayPeriod): boolean;
export declare function getBillDatesForPayPeriod({ dueDates }: Bill, { start, end }: PayPeriod): Date[];
export declare function createBill(bill: InitialBill): {
name: string;
amount: number;
autoPay?: boolean | undefined;
startOn: Date;
due: {
weekly?: 0 | 2 | 1 | 6 | 5 | 4 | 3 | undefined;
monthly?: 0 | 2 | 1 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | undefined;
yearly?: YearIndexes | undefined;
};
dueDates: never[];
};