wise-eyes-core
Version:
Web server to monitor the status of owlcms
85 lines (84 loc) • 2.46 kB
TypeScript
export interface AthleteState {
attemptNumber: number | null;
bestClean: number | null;
bestSnatch: number | null;
category: string;
clean1State: AttemptState;
clean1Weight: number | null;
clean1WeightPounds: number | null;
clean2State: AttemptState;
clean2Weight: number | null;
clean2WeightPounds: number | null;
clean3State: AttemptState;
clean3Weight: number | null;
clean3WeightPounds: number | null;
cleanRank: number | null;
membership: string | null;
meta: Record<string, unknown> | null;
name: string;
nextWeight: number | null;
nextWeightPounds: number | null;
snatch1State: AttemptState;
snatch1Weight: number | null;
snatch1WeightPounds: number | null;
snatch2State: AttemptState;
snatch2Weight: number | null;
snatch2WeightPounds: number | null;
snatch3State: AttemptState;
snatch3Weight: number | null;
snatch3WeightPounds: number | null;
snatchRank: number | null;
startNumber: number;
team: string;
total: number | null;
totalRank: number | null;
}
type AttemptState = 'bad' | 'empty' | 'good' | 'request';
export type Meta = Record<string, Record<string, unknown>>;
export interface OwlcmsAthlete {
bestCleanJerk: string;
bestSnatch: string;
category: string;
cattempts: OwlcmsAttempt[];
cleanJerkRank: string;
custom1: string;
custom2: string;
flagURL: string;
fullName: string;
group: string;
membership: string;
sattempts: OwlcmsAttempt[];
sinclair: string;
sinclairRank: string;
snatchRank: string;
startNumber: string;
subCategory: string;
teamName: string;
total: string;
totalRank: string;
yearOfBirth: string;
}
export type OwlcmsAthleteList = Array<OwlcmsAthlete | OwlcmsAthleteSpacer>;
export interface OwlcmsAthleteSpacer {
isSpacer: true;
}
export interface OwlcmsAttempt {
liftStatus: AttemptState;
stringValue: string;
}
export default class Athlete {
private static meta;
private static metaFields;
private state;
static getMeta(membership: string): Record<string, unknown>;
static loadMeta(meta: Meta): void;
constructor(data: OwlcmsAthlete);
private getAttemptNumber;
private getNextWeight;
private getNextWeightPounds;
getState(): AthleteState;
private parseWeight;
private parseWeightPounds;
update(data: OwlcmsAthlete): void;
}
export {};