Options
All
  • Public
  • Public/Protected
  • All
Menu

Module src/config

Index

Type aliases

CourseStatus

CourseStatus: defaultConfig.CourseStatus

CourseType

CourseType: defaultConfig.CourseType

Variables

Const TYPES

TYPES: Readonly<{ -1: string; 0: string; 1: string; 2: string; 3: string; 4: string; 5: string; 6: string; 7: string; 8: string; 9: string }> = defaultConfig.TYPES

lecture type number => meaning

Const TYPES_PARSE

TYPES_PARSE: Readonly<{ : number; CLN: number; Clinical: number; DIS: number; DRL: number; Discussion: number; Drill: number; IND: number; Independent Study: number; LAB: number; LEC: number; Laboratory: number; Lecture: number; PRA: number; Practicum: number; SEM: number; STO: number; Seminar: number; Studio: number; WKS: number; Workshop: number }> = defaultConfig.TYPES_PARSE

parse lecture type string to id

Const backend

backend: BackendConfig = require('../package.json').backend

Configuration of the backend.

Const enableKeyConversion

enableKeyConversion: true = true

whether to enable conversion from Course.key to human readable string. It is only used to inform user about the removal of a course when its key does not exist in catalog. The regex variable keyRegex will be used to match Course.key

see

Course.key

Const keyRegex

keyRegex: typeof enableKeyConversion extends true ? RegExp : null = /([a-z]{1,5})([0-9]{1,5})([0-9])$/i

the regex used to match the components of Course.key. It must have three capture groups, one for the department string, one for the course number, and one for the course type, corresponding to the keys of TYPES

Const runningOnElectron

runningOnElectron: boolean = defaultConfig.runningOnElectron

whether running on electron

Const semesterDataExpirationTime

semesterDataExpirationTime: number = defaultConfig.semesterDataExpirationTime

Const semesterListExpirationTime

semesterListExpirationTime: number = defaultConfig.semesterListExpirationTime

expiration config, usually no need to change

Const ui

ui: { sideBarWidth: 19; sideMargin: 3; tabBarWidth: 3; tabBarWidthMobile: 10 } = defaultConfig.ui

some default UI configurations. Usually no need to change

Type declaration

  • sideBarWidth: 19
  • sideMargin: 3
  • tabBarWidth: 3
  • tabBarWidthMobile: 10

Const version

version: string = defaultConfig.version

the version string from package.json

Functions

formatLocationURL

  • formatLocationURL(addr: string): string
  • Given an address, convert it to an link to the map (e.g. Google map)

    Parameters

    • addr: string

    Returns string

    an url or an empty string

getApi

  • getApi(): string

parseSemesterData

  • parseSemesterData(rawData: string[][]): [{}, Course[], Section[]]

requestBuildingSearcher

  • requestBuildingSearcher(): Promise<string[]>
  • request the building list from remote and store in localStorage

    Returns Promise<string[]>

    a building searcher

requestCourses

requestSemesterList

requestTimeMatrix

  • requestTimeMatrix(): Promise<Int32Array>

viewCourseforum

viewEvals

viewGrades

viewHpEvals

Object literals

Const dataend

dataend: object

Functions for fetching data

buildings

buildings: requestBuildingSearcher = requestBuildingSearcher

courses

courses: requestCourses = requestCourses

distances

distances: requestTimeMatrix = requestTimeMatrix

semesters

semesters: requestSemesterList = requestSemesterList

Const modalLinks

modalLinks: object

Used to generate a list of action buttons in section/course modal. We used it to open external pages relevant to the given course/section.

course

course: { action: viewEvals; name: string }[] = [{name: 'Course Evaluations',action: viewEvals},{name: 'Grade Distribution',action: viewGrades},{name: 'Reviews (theCourseForum)',action: viewCourseforum},{name: 'Reviews (Hoosmyprofessor, Chinese)',action: viewHpEvals}]

section

section: { name: string; action: any }[] = [{name: 'Course Evaluations',action: viewEvals},{name: 'Grade Distribution',action: viewGrades},{name: "More Details (Lou's List)",action: function(semester: SemesterJSON, section: Section) {window.open(`https://louslist.org/sectiontip.php?Semester=${semester.id}&ClassNumber=${section.id}`,'_blank','width=650,height=700,scrollbars=yes');}},{name: 'Reviews (theCourseForum)',action: viewCourseforum},{name: 'Reviews (Hoosmyprofessor, Chinese)',action: viewHpEvals}]

Generated using TypeDoc