UNPKG

ibantools-germany

Version:

IBAN Validator and Generator for German Bank Accounts

55 lines (52 loc) 1.88 kB
/** * ibantools-germany * Copyright (C) 2022-2024 Markus Baumer <markus@baumer.dev> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */ export interface CheckDigits { [method: string]: number[]; } export interface NextCheckDigits { add: CheckDigits; remove: CheckDigits; valid: string; } /** * Returns date object * * @param date Date from string or current date if undefined * @returns */ export declare const dateObject: (date?: string | Date) => Date; /** * Combines current data by adding or removing from data provided in next * @param current * @param nextAdd * @param nextRemove */ export declare const combineCurrentNext: (current: CheckDigits, nextAdd: CheckDigits, nextRemove: CheckDigits) => CheckDigits; /** * Get data, either current or combined with next by comparing it to valid-to * date from next data * @param date * @returns */ export declare const checkDigitData: (date?: string | Date) => CheckDigits; /** * Get the check digit method assigned for a BLZ * * @param blz German BLZ with 8 digits * @param date Method valid at this date (default: current date) * @returns Check digit method or null if invalid */ export declare const methodForBLZ: (blz: string, date?: string | Date) => string | null;