Options
All
  • Public
  • Public/Protected
  • All
Menu

Module src/models

models and data structures used across the website

Index

Type aliases

CourseSearchResult

CourseSearchResult: SearchResult<"title" | "description">

Day

Day: keyof typeof dayToInt

EventJSON

EventJSON: [string, number, undefined | string, undefined | string, undefined | string]

ScheduleDays

SearchMatch

SearchMatch: [Match<"key" | "title" | "description">[], Map<number, SectionMatch[]>]

the match entry for a Course

0: the array of matches for the fields of this Course

1: the Map that maps Section.id to the array of matches for the fields of that section

SectionMatch

SectionMatch<T>: Match<T>

Type parameters

SectionMatchFields

SectionMatchFields: "topic" | "instructors" | "rooms"

SectionSearchResult

SectionSearchResult: SearchResult<"topic" | "instructors" | "rooms">

ValidFlag

ValidFlag: number

last several bits of this number correspond to different types of validity, as specified by Section.Validity

flag & 0b1 !== 0 => Section.Validity[1] flag & 0b10 !== 0 => Section.Validity[2] flag & 0b100 !== 0 => Section.Validity[3]

Variables

Const DAYS

DAYS: ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"] = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'] as const

Const dayToInt

dayToInt: Readonly<{ Fr: number; Mo: number; Sa: number; Su: number; Th: number; Tu: number; We: number }> = Object.freeze({Mo: 0,Tu: 1,We: 2,Th: 3,Fr: 4,Sa: 5,Su: 6})

Const generatedMsg

generatedMsg: "You are editing a generated schedule, please edit the proposed schedule instead. If you want to keep this particular generated schedule, click "copy" to do so." = "You are editing a generated schedule, please edit the proposed schedule instead. If you want to keep this particular generated schedule, click "copy" to do so."

Const scores

scores: Map<string, ScoreEntry> = new Map<string, ScoreEntry>()

Functions

filterSections

  • filterSections(group: SectionJSON[], allSections: Section[], warnings: string[], convKey: string): Set<number>

getCombinedMeeting

  • getCombinedMeeting(meetings: readonly Meeting[], key: "instructor" | "room"): string[]
  • extract the array of instructor names from the array of meetings

    Parameters

    • meetings: readonly Meeting[]
    • key: "instructor" | "room"

    Returns string[]

is_v5_v7

  • is_v5_v7(arr: any[]): arr is SectionJSON[]
  • check whether the array is the correct JSON format for plannable v5.x to v7.x

    Parameters

    • arr: any[]

    Returns arr is SectionJSON[]

is_v8

  • is_v8(arr: any[]): arr is SectionJSON[][]
  • check whether the array is the correct JSON format for plannable v8.x

    Parameters

    • arr: any[]

    Returns arr is SectionJSON[][]

toMatches

Generated using TypeDoc