import { Attribute } from "./db"; import { Handler } from "./defaultHandler"; import { allModifierInput, primaryData, serializeReturn } from "./types"; export class Datatype{ type: string; args: primaryData[]; constructor(type:string, args: primaryData[]){ this.type = type; this.args = args; } serialize(handler : Handler): serializeReturn{ return handler.datatypes[this.type as keyof typeof handler.datatypes](this.args); } } export abstract class Modifier { t: string; a: Array; constructor(type: string, args: (allModifierInput)[]) { this.t = type; this.a = args; } serialize(handler : Handler): serializeReturn { return handler.modifiers[this.t as keyof typeof handler.modifiers](handler,this.a); } } export class BooleanModifier extends Modifier { } export class NumberModifier extends Modifier { } export class StringModifier extends Modifier { } export class Aggregation { t: string; a: Attribute; constructor(type: string, args: Attribute) { this.t = type; this.a = args; } serialize(handler : Handler): serializeReturn { return handler.aggregations[this.t as keyof typeof handler.aggregations](handler,this.a); } } export class Joins { serialize(handler : Handler): serializeReturn { return ["", []]; } }