0.1.4•Updated 6 months ago
// deno-lint-ignore-file ban-types
import { Entity, run_on_worker } from "@infinity-beyond/classes/entity.ts";
import { SupplyPermissions } from "@supply/supply.permissions.ts";
import { SupplyRest } from "@supply/supply.rest.ts";
import { SupplyMeta } from "@supply/supply.meta.ts";
export class Supply<
EntityName extends string,
PEMC extends Entity.Meta.Config = {},
> extends Entity<
Supply.Events,
EntityName,
Supply.Permissions<EntityName>,
Supply.Meta.Type,
PEMC,
Supply.Options<PEMC>
> {
readonly REST = new SupplyRest(this);
protected static override Permissions: readonly string[] = SupplyPermissions;
constructor(name: EntityName, options: Supply.Options<PEMC> = {}) {
super(name, options, SupplyMeta as Supply.Meta.Type);
}
@run_on_worker
async AddItem(item: Supply.Item.Unentered) {
item; // TODO
}
}