ofx4js
Version:
A javascript OFX library, ported from OFX4J
81 lines (80 loc) • 2.74 kB
TypeScript
import { SortedSet } from '../collections/SortedSet';
import { ChildAggregate } from '../meta/ChildAggregate';
import { Element } from '../meta/Element';
import { Header } from '../meta/Header';
import { AggregateAttribute } from './AggregateAttribute';
export interface HeaderMap {
[key: string]: Header;
}
export interface HeaderValues {
[key: string]: Object;
}
/**
* Holder for meta information about an aggregate class.
*/
export declare class AggregateInfo {
private name;
private attributes;
private headers;
private owner;
constructor(name: string, owner: any, parentInfo?: AggregateInfo);
/**
* The name of the aggregate.
*
* @return The name of the aggregate.
*/
getName(): string;
setName(name: string): void;
getOwner(): any;
/**
* The attributes.
*
* @return The attributes.
*/
getAttributes(): SortedSet<AggregateAttribute>;
/**
* Get the attribute by the specified name.
*
* @param name The name of the attribute.
* @param orderHint The order at which the attribute should come after in case there are more than one candidates.
* @param assignableTo The class this attribute must be assignable to
* @return The attribute by the specified name,
* or if there are more than one by that name,
* the first one after the specified order,
* or if there are none then the first collection that
* comes after the order hint, or the latest if there
* are none that come after the order hint, or null.
*/
getAttribute(name: string, orderHint: number, assignableTo?: any): AggregateAttribute;
/**
* Whether this aggregate has headers.
*
* @return Whether this aggregate has headers.
*/
hasHeaders(): boolean;
/**
* Get the headers defined by the specific aggregate instance.
*
* @param instance The aggregate instance.
* @return The headers.
*/
getHeaders(instance: Object): HeaderValues;
/**
* The type of the specified header.
*
* @param name The header name.
* @return The header type, or null if no header by the specified name exists.
*/
getHeaderType(name: string): any;
/**
* Set the header value for the specified instance.
*
* @param instance The instance.
* @param name The name of the header.
* @param value the value of the header.
*/
setHeader(instance: Object, name: string, value: Object): void;
addChildAggregate(childAggregate: ChildAggregate): void;
addElement(element: Element): void;
addHeader(header: Header): void;
}