import EntryFields from './fields';

interface EntryOptions {
  fields?: EntryFields;
  /**This is the first 8 digits of the routing and transit number of the receiving bank
   *  (where the recipient account is located). */
  receivingDFI?: string;
  /**This is the account number of the recipient. */
  DFIAccount?: string;
  /**This is the amount of the transaction. */
  amount?: string | number;
  /**This is an optional field to identify the transaction to the Receiver.
   * Max Length 15
   */
  idNumber?: string;
  /**This field is entered by the Originator to provide additional identification of
   * the Receiver and may be helpful in identifying returned Entries */
  individualName?: string;
  /**ODFI may include codes, of significance to them, to enable specialized handling of the entry. */
  discretionaryData?: string;
  /**Trancode for the transaction - see Common Data Elements for trancode definitions. */
  transactionCode?: string;
  /**This is the check digit (9th digit) of the routing and transit number of
   * the receiving bank (where the recipient account is located). */
  checkDigit?: string;
  /**For Health Care EFT Transactions (except Prenotification Entries),
   * the Addenda Record Indicator of the CCD Entry must always contain a value of "1." */
  addendaId?: string;
  /**Assigned by the ODFI in ascending sequence that uniquely identifies each entry within a batch and the file.
   * Beginning of the trace number should be the same as originatingDFI
   */
  traceNumber?: string;
}

declare class Entry {
  private _addendas: any[];
  public fields: EntryFields;

  constructor(options: EntryOptions, autoValidate?: boolean);

  addAddenda(entryAddenda: any): void;
  getAddendas(): any[];
  getRecordCount(): number;
  generateString(cb: (result: string) => void): void;
  private _validate(): void;
  get(category: string): any;
  set(category: string, value: any): void;
}

export = Entry;
