export declare const defaultErrors: { allowedCharactersError: string; tooShortError: string; tooLongError: string; wrongLengthForState: string; parseError: string; missingZeroError: string; unknownStatePrefixError: string; unknownFinanzamtError: string; wrongStateError: string; bezirksnummerError: string; pruefzifferError: string; nwInternalConsistencyError: string; missingStateInformationError: string; }; type ErrorMessages = typeof defaultErrors; export type ISO3166_2Codes = 'DE-BW' | 'DE-BY' | 'DE-BE' | 'DE-BB' | 'DE-SN' | 'DE-ST' | 'DE-HB' | 'DE-HH' | 'DE-HE' | 'DE-MV' | 'DE-TH' | 'DE-NI' | 'DE-NW' | 'DE-RP' | 'DE-SL' | 'DE-SH'; type ISO3166_2Codes_11erVerfahren = 'DE-BY' | 'DE-BE-A' | 'DE-BE-B' | 'DE-BB' | 'DE-HB' | 'DE-HH' | 'DE-MV' | 'DE-NI' | 'DE-NW' | 'DE-SL' | 'DE-SN' | 'DE-ST' | 'DE-TH'; export type Options = { bundesland?: ISO3166_2Codes; errorMessages?: Partial; }; /** * Returns `undefined`, if the given `val` is a valid German Steuernummer. If * not, returns and error describing the first violated constraint met during * the validation process. * * Using the second options argument, a `bundesland` can be passed to explicitly * state the Bundesland the Steuernummer should belong to. * * This is what's being validated: * * - The given string contains only digits, ' ', or '/' * - The number of digits in the given string is between 10 and 13 * - The state (Bundesland) issuing the Steuernummer is known * - Either, because the Steuernummer contains a state prefix (i.e., is of * length >= 12) * - Or, because the `bundesland` option was used to deliberately name the * state (for example, when providing a Steuernummer using the common * Standardschema der Länder) * - The state information contained in the Steuernummer matches the * `bundesland` option, if both are given * - The Bundesfinanzamtsnummer part of the Steuernummer references a known * Bundesfinanzamt. The list to check against is based on the "GemFA 2.0" * (GEMeinden und FinanzAemter 2.0) data, which lists 610 Finanzämter as of * October 5th 2022. * - The Bezirksnummer part of the Steuernummer is valid (checking Bundesland- * specific constraints) * - The Unterscheidungsnummer and Prüfziffer fulfill requirements specific to * Nordrhein-Westfalen * - The Prüfziffer is valid. In the case of a Steuernummer from Berlin, * validation passes if the Prüfziffer matches that calculated either for the * Berlin-A _or_ the Berlin-B scheme. * * Cf. https://download.elster.de/download/schnittstellen/Pruefung_der_Steuer_und_Steueridentifikatsnummer.pdf * * Using the second options argument, all / individual error messages (default * to German) can be overwritten. */ export declare function validateSteuernummer(value: string, options?: Options): any; export type ParsedSteuernummer = { normalizedSteuernummer: string; states: ISO3166_2Codes | ISO3166_2Codes[]; statePrefix: string; bundesfinanzamtnummer: string; bezirksnummer: string; unterscheidungsnummer: string; pruefziffer: string; }; /** * Parses the steuernummer contained in the given `value`, or throws an error if * parsing is not possible. `value` could contain a steuernummer in the: * - "Standardschema der Länder" * - "Vereinheitlichtes Bundesschema" * - "Vereinheitlichtes Bundesschema zur elektronischen Übermittlung" */ export declare function parseSteuernummer(value: string, options: Options): ParsedSteuernummer; /** * Determines the Prüfziffer of the given `normalizedDigits` (string of digits * with length 12) using the 2er-Verfahren (used in DE-BW, DE-HE, and DE-SH). */ export declare function getPruefziffer2er(normalizedDigits: string): number; /** * Determines the Prüfziffer of the given `normalizedDigits` (string of digits * with length 12) using the modified 11er Verfahren (used in DE-RP). */ export declare function getPruefzifferModified11er(normalizedDigits: string): number; /** * Determines the Prüfziffer of the given `normalizedDigits` (string of digits * with length 12) using the 11er Verfahren (used in most Bundeslaender, where * not the 2er Verfahren or modified 11er Verfahren is used). */ export declare function getPruefziffer11er(normalizedDigits: string, land: ISO3166_2Codes_11erVerfahren): number; export {};