@junkawasaki/kawadb-orm
Version:
TypeScript ORM for KawaDB with KSQL support - works in Web and Electron environments
42 lines (41 loc) • 985 B
TypeScript
/**
* Entity 基底クラス
*/
import { EntityId, BaseEntity } from '../types/EntityTypes';
/**
* 全てのエンティティの基底クラス
*/
export declare abstract class Entity implements BaseEntity {
id?: EntityId;
createdAt?: Date;
updatedAt?: Date;
constructor();
/**
* エンティティがもつIDかどうか
*/
hasId(): boolean;
/**
* エンティティを更新したときの処理
*/
markAsUpdated(): void;
/**
* エンティティをJSONに変換
*/
toJSON(): any;
/**
* JSONからエンティティを復元
*/
static fromJSON<T extends Entity>(this: new () => T, json: any): T;
/**
* エンティティを複製
*/
clone(): this;
/**
* エンティティが別のエンティティと等しいかどうか
*/
equals(other: Entity): boolean;
/**
* エンティティのハッシュ値を取得
*/
hashCode(): string;
}