UNPKG

@lordfokas/magic-orm

Version:

A class-based ORM in TypeScript. Unorthodox and extremely opinionated, made to fit my specific use cases.

15 lines (14 loc) 670 B
import { type Class } from "./Structures.js"; import { Entity } from "./Entity.js"; export declare class Serializer { #private; static register<T extends Entity>(entity: Class<T>, name: string): void; /** 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; }