UNPKG

@orbit/records

Version:

A flexible data access and synchronization layer.

55 lines (54 loc) 1.56 kB
import { Exception } from '@orbit/core'; import { ValidationIssue } from '@orbit/validators'; /** * An error occured related to the schema. */ export declare class SchemaError extends Exception { constructor(description: string); } /** * A validation failed. */ export declare class ValidationError extends Exception { issues?: ValidationIssue[]; constructor(description: string, issues?: ValidationIssue[]); } /** * A model is not defined in the schema. */ export declare class ModelNotDefined extends SchemaError { constructor(type: string); } /** * An attribute definition could not be found in the model definition. */ export declare class AttributeNotDefined extends SchemaError { constructor(type: string, attribute: string); } /** * A key definition could not be found in the model definition. */ export declare class KeyNotDefined extends SchemaError { constructor(type: string, key: string); } /** * A relationship definition could not be found in the model definition. */ export declare class RelationshipNotDefined extends SchemaError { constructor(type: string, relationship: string); } /** * An error occurred related to a particular record. */ export declare abstract class RecordException extends Exception { type: string; id: string; field?: string; constructor(description: string, type: string, id: string, field?: string); } /** * A record could not be found. */ export declare class RecordNotFoundException extends RecordException { constructor(type: string, id: string); }