ofx4js
Version:
A javascript OFX library, ported from OFX4J
70 lines (69 loc) • 2.33 kB
TypeScript
import { OFXReader } from "./OFXReader";
import { OFXHandler } from "./OFXHandler";
import { StringReader } from "./StringReader";
/**
* Base class for an OFX reader. Parses the headers and determines whether we're parsing an
* OFX v2 or OFX v1 element. For OFX v2, uses a standard SAX library.
*/
export declare class BaseOFXReader implements OFXReader {
static OFX_2_PROCESSING_INSTRUCTION_PATTERN: RegExp;
private contentHandler;
constructor();
/**
* The content handler.
*
* @return The content handler.
*/
getContentHandler(): OFXHandler;
/**
* The content handler.
*
* @param handler The content handler.
*/
setContentHandler(handler: OFXHandler): void;
/**
* Parse the reader, including the headers.
*
* @param reader The reader.
*/
parse(reader: StringReader): void;
/**
* The first characters of the first OFX element, '<', 'O', 'F', 'X'
*
* @return The first characters of the OFX element.
*/
protected getFirstElementStart(): Array<string>;
/**
* Whether the specified buffer contains the specified character.
*
* @param buffer The buffer.
* @param c The character to search for.
* @return Whether the specified buffer contains the specified character.
*/
private contains;
private shiftAndAppend;
/**
* Parse an OFX version 1 stream from the first OFX element (defined by the {@link #getFirstElementStart() first element characters}).
*
* @param text The text.
*/
protected parseV1FromFirstElement(text: string): void;
/**
* Parse an OFX version 2 stream from the first OFX element (defined by the {@link #getFirstElementStart() first element characters}).
*
* @param text The text.
*/
protected parseV2FromFirstElement(text: string): void;
/**
* Process the given characters as OFX version 1 headers.
*
* @param chars The characters to process.
*/
protected processOFXv1Headers(chars: string): void;
/**
* Process the given characters as OFX version 2 headers.
*
* @param chars The characters to process.
*/
protected processOFXv2Headers(chars: string): void;
}