nosqlax
Version:
NoSQLax is a modern, lightweight JavaScript Object Document Mapper(ODM) library that makes working with CouchDB a breeze. Inspired by CouchDB’s “Relax” philosophy and the chill vibes of Snorlax, NoSQLax takes the hassle out of managing your data, offering
33 lines (32 loc) • 872 B
TypeScript
interface IBaseEntity {
id?: string;
rev?: string;
[key: string]: any;
toJSON(): Record<string, any>;
}
import { ValidateFunction } from 'ajv';
declare abstract class BaseEntity implements IBaseEntity {
private _id?;
private _rev?;
static type: string;
static schemaOrSchemaId: string | object;
static ajvOptions: any;
private __data;
static validators: Record<string, ValidateFunction>;
[key: string]: any;
static fieldMap: Record<string, string>;
constructor(data?: {
_id?: string;
_rev?: string;
[key: string]: any;
});
static initialize(): Promise<void>;
toJSON(): {
[x: string]: any;
};
private initializeData;
get id(): string | undefined;
get rev(): string | undefined;
static getFieldMap(): Record<string, string>;
}
export default BaseEntity;