/**
* The base type for all Gedcom related errors. All errors are currently also instances of {@link ErrorParse}.
*/
export declare abstract class ErrorGedcomBase extends Error {
protected constructor(message?: string);
}
/**
* The base class of all parsing errors.
*/
export declare class ErrorParse extends ErrorGedcomBase {
readonly message: string;
constructor(message: string);
}
/**
* Thrown if it is unlikely a Gedcom file, for instance if a completely unrelated file was passed.
*/
export declare class ErrorInvalidFileType extends ErrorParse {
}
/**
* Thrown on likely Gedcom files if there was an error during the decoding of the characters.
* Such an error can be muted by passing false to the strict parameter of a decoding method (for example, {@link decodeAnsel}).
*/
export declare class ErrorGedcomDecoding extends ErrorParse {
readonly illegalCode: number;
constructor(message: string, illegalCode: number);
}
/**
* Thrown on likely Gedcom file in rare occasions if the charset was detected but is not supported.
* An example would be UTF-32.
*/
export declare class ErrorUnsupportedCharset extends ErrorParse {
readonly charset: string;
constructor(message: string, charset: string);
}
/**
* Thrown on likely Gedcom files if a line could not be tokenized properly.
* This is perhaps the most common error in practice.
*/
export declare class ErrorTokenization extends ErrorParse {
readonly lineNumber: number;
readonly line: string;
constructor(message: string, lineNumber: number, line: string);
}
/**
* The base class of all tree structuring errors.
* Such errors can be thrown only after the tokenization phase has completed successfully.
*/
export declare class ErrorTreeSyntax extends ErrorParse {
readonly lineNumber: number;
constructor(message: string, lineNumber: number);
}
/**
* Thrown if a line is incorrectly nested.
*/
export declare class ErrorInvalidNesting extends ErrorTreeSyntax {
readonly lineNumber: number;
readonly currentLevel: number;
readonly level: number;
constructor(message: string, lineNumber: number, currentLevel: number, level: number);
}
/**
* Thrown if a concatenation or a continuation line is incorrectly used.
*/
export declare class ErrorInvalidConcatenation extends ErrorTreeSyntax {
readonly lineNumber: number;
readonly kind: string;
constructor(message: string, lineNumber: number, kind: string);
}
/**
* Thrown if a record appears at a position other than the top-most level.
*/
export declare class ErrorInvalidRecordDefinition extends ErrorTreeSyntax {
constructor(message: string, lineNumber: number);
}
/**
* Thrown if the file does not start with a header or does not end with a trailer.
*/
export declare class ErrorTreeStructure extends ErrorParse {
constructor(message: string);
}
/**
* @deprecated This error cannot occur, an empty tree would throw a {@link ErrorInvalidFileType} instead.
*/
export declare class ErrorEmptyTree extends ErrorTreeStructure {
constructor(message: string);
}
/**
* The base class of all indexing errors.
* Such errors can occur if an inconsistency is discovered while indexing the data.
*/
export declare class ErrorIndexing extends ErrorParse {
constructor(message: string);
}
/**
* Thrown if a duplicate pointer is discovered.
*/
export declare class ErrorDuplicatePointer extends ErrorIndexing {
readonly lineNumber: number;
readonly lineNumberOriginalDefinition: number;
readonly pointer: string;
constructor(message: string, lineNumber: number, lineNumberOriginalDefinition: number, pointer: string);
}