chore: add js-doc (#275)
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Represents a tab with an additional `id` property
|
||||
*/
|
||||
export type TabWithId = Omit<chrome.tabs.Tab, 'id'> & { id: number };
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,6 +12,9 @@ const MIMEType = {
|
||||
ANY: '*/*',
|
||||
} as const satisfies Record<string, string>;
|
||||
|
||||
/**
|
||||
* Represents a key of the MIMEType object
|
||||
*/
|
||||
export type MIMETypeKey = keyof typeof MIMEType;
|
||||
|
||||
export default MIMEType;
|
||||
|
||||
@@ -52,11 +52,15 @@ type NestedKeys<T> = {
|
||||
export type ThemeColor = NestedKeys<typeof colors>;
|
||||
|
||||
/**
|
||||
* Represents a Tailwind colorway: a colorway is a key in the theme.colors object that has an object as its value.
|
||||
* Represents a Tailwind colorway: a colorway is a key in the theme.colors object that has an object as its value
|
||||
*/
|
||||
export type TWColorway = {
|
||||
[K in keyof typeof theme.colors]: (typeof theme.colors)[K] extends Record<string, unknown> ? K : never;
|
||||
}[keyof typeof theme.colors];
|
||||
|
||||
/**
|
||||
* Represents the index type for accessing the theme colors based on the specified TWColorway
|
||||
*/
|
||||
export type TWIndex = keyof (typeof theme.colors)[TWColorway];
|
||||
|
||||
/**
|
||||
|
||||
@@ -207,9 +207,9 @@ export function getUnusedColor(
|
||||
}
|
||||
|
||||
// OKLab helper functions (https://github.com/bottosson/bottosson.github.io/blob/master/misc/colorpicker/colorconversion.js)
|
||||
function srgbTransferFunction(a: number): number {
|
||||
return a <= 0.0031308 ? 12.92 * a : 1.055 * a ** 0.4166666666666667 - 0.055;
|
||||
}
|
||||
// function srgbTransferFunction(a: number): number {
|
||||
// return a <= 0.0031308 ? 12.92 * a : 1.055 * a ** 0.4166666666666667 - 0.055;
|
||||
// }
|
||||
|
||||
function srgbTransferFunctionInv(a: number): number {
|
||||
return a > 0.04045 ? ((a + 0.055) / 1.055) ** 2.4 : a / 12.92;
|
||||
|
||||
@@ -2,7 +2,7 @@ import Text from '@views/components/common/Text/Text';
|
||||
import React from 'react';
|
||||
|
||||
/**
|
||||
* A type that represents the flags that a course can have.
|
||||
* A type that represents the flags that a course can have
|
||||
*/
|
||||
export type Flag = 'WR' | 'QR' | 'GC' | 'CD' | 'E' | 'II';
|
||||
export const flagMap = {
|
||||
|
||||
@@ -13,6 +13,9 @@ import React, { Fragment } from 'react';
|
||||
|
||||
import ExtensionRoot from './ExtensionRoot/ExtensionRoot';
|
||||
|
||||
/**
|
||||
* Represents the props for the _Dialog component
|
||||
*/
|
||||
export interface _DialogProps {
|
||||
className?: string;
|
||||
title?: JSX.Element;
|
||||
|
||||
@@ -7,6 +7,10 @@ import Dialog from '../Dialog';
|
||||
import Text from '../Text/Text';
|
||||
|
||||
type DialogElement = (show: boolean) => ReactNode;
|
||||
|
||||
/**
|
||||
* Represents information for a prompt dialog
|
||||
*/
|
||||
export interface PromptInfo extends Omit<DialogInfo, 'buttons' | 'className' | 'title' | 'description'> {
|
||||
title: JSX.Element | string;
|
||||
description: JSX.Element | string;
|
||||
|
||||
Reference in New Issue
Block a user