bankdata-germany
Version:
Data and BIC Validator for German Banks
88 lines (85 loc) • 3.12 kB
TypeScript
/**
* bankdata-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/>.
*/
import { BankData, ProbablyString } from "./types";
export interface Banks {
[blz: string]: string[];
}
export interface NextBanks {
remove: string[];
upsert: Banks;
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 nextUpsert
* @param nextRemove
*/
export declare const combineCurrentNext: (current: Banks, nextUpsert: Banks, nextRemove: string[]) => Banks;
/**
* Get data, either current or combined with next by comparing it to valid-to
* date from next data
* @param date
* @returns
*/
export declare const bankDataSet: (date?: string | Date) => Banks;
/**
* Get name (and BIC if available) for bank with given BLZ
*
* @param blz German BLZ with 8 digits
* @param date Bank data valid at this date (default: current date)
* @returns Bank data or null if invalid
*/
export declare const bankDataByBLZ: (blz: string, date?: string | Date) => BankData | null;
/**
* Get name (and BIC if available) for bank with given BBAN
*
* @param bban German BBAN with 18 digits
* @param date Bank data valid at this date (default: current date)
* @returns Bank data or null if invalid
*/
export declare const bankDataByBBAN: (bban: ProbablyString, date?: string | Date) => BankData | null;
/**
* Get name (and BIC if available) for bank with given IBAN
*
* @param bban German IBAN with 22 digits
* @param date Bank data valid at this date (default: current date)
* @returns Bank data or null if invalid
*/
export declare const bankDataByIBAN: (iban: ProbablyString, date?: string | Date) => BankData | null;
/**
* Get bank data for bank with given BIC
*
* @param bic BIC to search for
* @param date Bank data valid at this date (default: current date)
* @returns Bank data or null
*/
export declare const bankDataByBIC: (bic: ProbablyString, date?: string | Date) => BankData | null;
/**
* Search all bank data and check if any contains the BIC
*
* @param bic BIC to search for
* @param date Bank data valid at this date (default: current date)
* @returns Whether BIC exists in bank data
*/
export declare const isBICInData: (bic: string, date?: string | Date) => boolean;