···11-import type { CardType } from "$lib/data/cards";
22-33-export interface Card {
44- id: CardId;
55- // eslint-disable-next-line @typescript-eslint/naming-convention -- this is a server owned field
66- card_type_id: CardType; // TODO: is this to be linked to database records? or to code...
77-}
88-99-declare const __brand: unique symbol;
1010-export type CardId = string & { [__brand]: "CardId" };
-15
src/lib/appserver/Field.ts
···11-/* eslint-disable @typescript-eslint/naming-convention */
22-export interface Field {
33- id: FieldId;
44- name: string;
55- account_id: string;
66-}
77-88-declare const __brand: unique symbol;
99-export type FieldId = number & { [__brand]: "FieldId" };
1010-1111-export type FieldIdString = `${number}` & { [__brand]: "FieldId" };
1212-1313-export function parseFieldId(string: FieldIdString): FieldId {
1414- return Number.parseInt(string) as FieldId;
1515-}
-16
src/lib/appserver/FieldTile.ts
···11-import type { AccountId } from "./Account";
22-import type { CardId } from "./Card";
33-import type { FieldId } from "./Field";
44-55-export interface FieldTile {
66- // eslint-disable-next-line @typescript-eslint/naming-convention -- this is a server owned field
77- account_id: AccountId;
88- // eslint-disable-next-line @typescript-eslint/naming-convention -- this is a server owned field
99- tile_id: CardId;
1010- // eslint-disable-next-line @typescript-eslint/naming-convention -- this is a server owned field
1111- field_id?: FieldId;
1212- // eslint-disable-next-line @typescript-eslint/naming-convention -- this is a server owned field
1313- grid_x?: number;
1414- // eslint-disable-next-line @typescript-eslint/naming-convention -- this is a server owned field
1515- grid_y?: number;
1616-}