@idealic/poker-engine
Version:
Professional poker game engine and hand evaluator with built-in iterator utilities
56 lines • 1.13 kB
TypeScript
import { Card } from './types';
/** Represents a bounding box for a region on screen */
export interface Box {
/** X coordinate of top-left corner */
x: number;
/** Y coordinate of top-left corner */
y: number;
/** Width of bounding box */
width: number;
/** Height of bounding box */
height: number;
}
export type Region = {
type: 'text';
value: string;
label?: string;
box: Box;
} | {
type: 'flag';
value: boolean;
box: Box;
} | {
type: 'card';
value: Card;
box: Box;
} | {
type: 'avatar';
value: string;
box: Box;
} | {
type: 'group';
label: string;
box: Box;
} | {
type: 'button';
label: string;
box: Box;
} | {
type: 'input';
label: string;
box: Box;
};
/** Generic type for JSON AST with OCR region information */
export type JSONAST<T> = (T extends (infer U)[] ? {
region: Region;
value: JSONAST<U>[];
} : T extends object ? {
region: Region;
value: {
[K in keyof T]: JSONAST<T[K]>;
};
} : {
region: Region;
value: T;
}) | null;
//# sourceMappingURL=types2.d.ts.map