displaying bar graph, fetching distributions message

This commit is contained in:
Sriram Hariharan
2023-03-08 00:26:56 -06:00
parent f3bf746c6e
commit fe8c2378d2
11 changed files with 193 additions and 6 deletions

View File

@@ -0,0 +1,9 @@
import { Course } from '../types/Course';
export default interface CourseDataMessages {
/**
* Gets the distribution of grades for the given course
* @returns an array of the number of students in each grade range from A+ to F, with the index of the array corresponding to the grade range
*/
getDistribution: (data: { course: Course }) => number[] | undefined;
}

View File

@@ -1,6 +1,4 @@
/**
* This is a type with all the message definitions that can be sent TO specific tabs
*/
export default interface TAB_MESSAGES {
reAnalyzePage: (data: { url: string }) => void;
}
export default interface TAB_MESSAGES {}

View File

@@ -3,18 +3,21 @@ import TAB_MESSAGES from './TabMessages';
import BrowserActionMessages from './BrowserActionMessages';
import HotReloadingMessages from './HotReloadingMessages';
import TabManagementMessages from './TabManagementMessages';
import CourseDataMessages from './CourseDataMessages';
/**
* This is a type with all the message definitions that can be sent TO the background script
*/
export type BACKGROUND_MESSAGES = BrowserActionMessages & TabManagementMessages & HotReloadingMessages;
export type BACKGROUND_MESSAGES = BrowserActionMessages &
TabManagementMessages &
HotReloadingMessages &
CourseDataMessages;
/**
* A utility object that can be used to send type-safe messages to the background script
*/
export const bMessenger = createMessenger<BACKGROUND_MESSAGES>('background');
/**
* A utility object that can be used to send type-safe messages to specific tabs
*/

View File

@@ -33,7 +33,6 @@ export type Semester = {
/**
* The internal representation of a course for the extension
*/
export class Course {
/** Every course has a uniqueId within UT's registrar system corresponding to each course section */
uniqueId: number;