UNPKG

memory-orm

Version:
25 lines (24 loc) 680 B
import { ID, NameBase } from './type' export declare type STRUCT<T extends string> = Struct & { [label in T]: any } export declare class Struct extends Array { idx?: string get id(): string static $name: NameBase static bless(o: any[]): void static deploy(struct: any): void static update(item: any, old: any): void static create(item: any): void static delete(old: any): void static map_partition(item: any, emit: any): void static map_reduce(item: any, emit: any): void static order(item: any, emit: any): void } export declare function Structure<T extends string>( labels: readonly T[], get: (this: STRUCT<T>) => ID ): { new (): STRUCT<T> }