29 lines
808 B
TypeScript
29 lines
808 B
TypeScript
import type {
|
|
CompetitionFormat,
|
|
CompetitionId,
|
|
CompletedSeriesProjection,
|
|
InProgressSeriesProjection,
|
|
SeriesOutcome,
|
|
TeamId,
|
|
} from "../src/index.js";
|
|
|
|
type Expect<T extends true> = T;
|
|
type IsAssignable<From, To> = [From] extends [To] ? true : false;
|
|
type Not<T extends boolean> = T extends true ? false : true;
|
|
|
|
export type TeamIdCannotBeUsedAsCompetitionId = Expect<
|
|
Not<IsAssignable<TeamId, CompetitionId>>
|
|
>;
|
|
|
|
export type CompletedSeriesRequiresOutcome = Expect<
|
|
IsAssignable<CompletedSeriesProjection, { outcome: SeriesOutcome }>
|
|
>;
|
|
|
|
export type InProgressSeriesCannotExposeOutcome = Expect<
|
|
IsAssignable<InProgressSeriesProjection, { outcome?: never }>
|
|
>;
|
|
|
|
export type LegacyBracketModeIsNotACompetitionFormat = Expect<
|
|
Not<IsAssignable<{ type: "bracket" }, CompetitionFormat>>
|
|
>;
|