persian-bank-react 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,87 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { HTMLAttributes } from 'react';
3
+
4
+ /**
5
+ * Identifiers for supported Iranian banks and financial institutions.
6
+ *
7
+ * The values are intentionally kept as stable, lowercase identifiers
8
+ * so they can safely be used as component props, lookup keys, and
9
+ * serialized values.
10
+ */
11
+ type BankNameType$1 = "ayandeh" | "markazi" | "blue" | "caspian" | "dey" | "eghtesaade-novin" | "future" | "gardeshgari" | "iran-europe" | "iran-venezuela" | "iran-zamin" | "karafarin" | "keshavarzi" | "khavar-mianeh" | "maskan" | "mehr-iran" | "melall" | "mellat" | "melli" | "noor" | "parsian" | "pasargad" | "post" | "refah" | "resalat" | "saderat" | "saman" | "sanat-madan" | "sarmayeh" | "sepah" | "shahr" | "sina" | "standard-chartered" | "taavon-eslami" | "tejarat" | "tosee" | "tosee-sedarat" | "tossee-taavon" | "kosar" | "mehr-eghtesaad" | "ghavamin" | "hekmat" | "ansar" | "unknown";
12
+ /**
13
+ * Props shared by the BankIcon component.
14
+ *
15
+ * Extending SVG HTML attributes allows consumers to use standard
16
+ * SVG properties such as className, aria-label, width, height,
17
+ * and other native React SVG attributes.
18
+ */
19
+ interface BankIconPropsType extends HTMLAttributes<SVGElement> {
20
+ /** Identifier of the bank whose icon should be rendered. */
21
+ name: BankNameType$1;
22
+ }
23
+ /**
24
+ * Metadata associated with a bank.
25
+ *
26
+ * `type` is the stable identifier used internally by the icon system,
27
+ * while `name` represents the human-readable bank name.
28
+ */
29
+ interface BankInfo$1 {
30
+ type: BankNameType$1;
31
+ name: string;
32
+ }
33
+
34
+ type bankType_BankIconPropsType = BankIconPropsType;
35
+ declare namespace bankType {
36
+ export type { bankType_BankIconPropsType as BankIconPropsType, BankInfo$1 as BankInfo, BankNameType$1 as BankNameType };
37
+ }
38
+
39
+ /**
40
+ * Renders the icon for a supported Iranian bank.
41
+ *
42
+ * Each bank icon is kept as an inline SVG so it:
43
+ * - Scales cleanly at any size.
44
+ * - Inherits standard SVG/React props from the caller.
45
+ * - Doesn't require an additional image request.
46
+ */
47
+ declare function BankIcon({ name, ...props }: BankIconPropsType): false | react_jsx_runtime.JSX.Element;
48
+
49
+ type BankNameType = "ayandeh" | "markazi" | "blue" | "caspian" | "dey" | "eghtesaade-novin" | "future" | "gardeshgari" | "iran-europe" | "iran-venezuela" | "iran-zamin" | "karafarin" | "keshavarzi" | "khavar-mianeh" | "maskan" | "mehr-iran" | "melall" | "mellat" | "melli" | "noor" | "parsian" | "pasargad" | "post" | "refah" | "resalat" | "saderat" | "saman" | "sanat-madan" | "sarmayeh" | "sepah" | "shahr" | "sina" | "standard-chartered" | "taavon-eslami" | "tejarat" | "tosee" | "tosee-sedarat" | "tossee-taavon" | "kosar" | "mehr-eghtesaad" | "ghavamin" | "hekmat" | "ansar" | "unknown";
50
+ interface BankInfo {
51
+ type: BankNameType;
52
+ name: string;
53
+ }
54
+
55
+ /**
56
+ * Resolves the issuing bank from an Iranian card number.
57
+ *
58
+ * The function accepts both string and numeric input and normalizes
59
+ * formatting characters such as spaces or hyphens before performing
60
+ * the BIN lookup.
61
+ *
62
+ * @returns Bank metadata when the BIN is recognized; otherwise `null`.
63
+ */
64
+ declare function getBankFromCard(cardNumber: string | number): BankInfo | null;
65
+ /**
66
+ * Resolves the issuing bank from an Iranian SHEBA/IBAN number.
67
+ *
68
+ * Both formats are supported:
69
+ * - `IR` prefixed: `IRxxxxxxxxxxxxxxxxxxxxxxxx`
70
+ * - 24-digit numeric value when `useIR` is enabled
71
+ *
72
+ * Whitespace is ignored, making formatted SHEBA values safe to pass
73
+ * directly to the function.
74
+ *
75
+ * @param sheba - Iranian SHEBA/IBAN value.
76
+ * @param useIR - Whether the supplied value omits the `IR` prefix.
77
+ * @returns Bank metadata when the bank code is recognized; otherwise `null`.
78
+ */
79
+ declare function getBankFromSheba(sheba: string, useIR?: boolean): BankInfo | null;
80
+
81
+ declare const bankUtil_getBankFromCard: typeof getBankFromCard;
82
+ declare const bankUtil_getBankFromSheba: typeof getBankFromSheba;
83
+ declare namespace bankUtil {
84
+ export { bankUtil_getBankFromCard as getBankFromCard, bankUtil_getBankFromSheba as getBankFromSheba };
85
+ }
86
+
87
+ export { BankIcon, bankType as Types, bankUtil as Utils };