qif-ts
Version:
Typescript library to map QIF formatted data
68 lines (67 loc) • 1.55 kB
TypeScript
/**
* Represents an entire QIF file's data.
*
* @public
*/
export declare type QifData = {
type: QifType;
transactions: QifTransaction[];
};
/**
* Enum of all possible QIF file types for a QIF file.
*
* @public
*/
export declare enum QifType {
Cash = "!Type:Cash",
Bank = "!Type:Bank",
Card = "!Type:CCard",
Investment = "!Type:Invst",
Asset = "!Type:Oth A",
Liability = "!Type:Oth L",
Invoice = "!Type:Invoice",
Account = "!Account",
Category = "!Type:Cat",
Class = "!Type:Class",
Memorized = "!Type:Memorized"
}
/**
* Represents a single item from a Qif file, with all associated item fields.
*
* @public
*/
export declare type QifTransaction = {
date?: string;
amount?: number;
clearedStatus?: string;
reference?: string;
payee?: string;
memo?: string;
address?: string[];
category?: string;
splits?: QifSplit[];
investmentAction?: string;
investmentSecurity?: string;
investmentPrice?: number;
investmentQuantity?: number;
investmentReminder?: string;
investmentComission?: number;
investmentAccount?: string;
investmentAmountTransferred?: number;
};
/**
* Represents a split of a transaction.
*
* @public
*/
export declare type QifSplit = {
category?: string;
memo?: string;
amount?: number;
percent?: number;
};
export declare const QIF_TYPE_STRINGS_MAP: Record<string, QifType>;
export declare class QifMapperError extends Error {
}
export declare class QifParserError extends Error {
}