@lordfokas/magic-orm
Version:
A class-based ORM in TypeScript. Unorthodox and extremely opinionated, made to fit my specific use cases.
16 lines (15 loc) • 718 B
TypeScript
import { type Class } from "./Structures.js";
import { Entity } from "./Entity.js";
export declare class Serializer {
static register<T extends Entity>(entity: Class<T>, name: string): void;
static lookup(name: string): Class<Entity>;
/** Transforms a JSON structure into concrete entities */
static fromJSON<T extends Entity>(data: string): T;
/** Transforms an object into concrete entities */
static fromObject<T extends Entity>(data: object): T;
/** Converts entities into JSON strings. */
static toJSON(data: Entity | Array<Entity>, pretty?: boolean): string;
/** Converts entities into raw objects */
static toObject(data: Entity | Array<Entity>): object;
}