forked from webschik/mt940-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypings.ts
52 lines (48 loc) · 1.17 KB
/
typings.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
export interface Tag {
multiline?: boolean;
open?: (state: State) => any;
readContent?: (state: State, symbolCode: number) => any;
readToken: (state: State) => number;
close?: (state: State) => any;
[key: string]: any;
}
export interface State {
pos: number;
statementIndex: number;
transactionIndex: number;
tag?: Tag;
tagContentStart?: number;
tagContentEnd?: number;
data: Uint8Array|Buffer;
statements: Statement[];
[key: string]: any;
}
export interface BalanceInfo {
isCredit: boolean;
date: string;
currency: string;
value: number;
}
export interface Transaction {
id: string;
code: string;
fundsCode: string;
isCredit: boolean;
isExpense: boolean;
currency: string;
description: string;
amount: number;
valueDate: string;
entryDate: string;
}
export interface Statement {
referenceNumber: string;
relatedReferenceNumber?: string;
accountId: string;
number: string;
openingBalance: BalanceInfo;
closingBalance: BalanceInfo;
closingAvailableBalance?: BalanceInfo;
forwardAvailableBalance?: BalanceInfo;
transactions: Transaction[];
}