This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use client"; | |
import { memo, useState } from "react"; | |
import classes from "./colorSlider.module.css"; | |
import { | |
GRADIENT, | |
MAX_RANGE, | |
RGB, | |
determineColorFromValue, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type PageId = number; | |
type PageOption = { | |
optionText: string; | |
dialIndex: number; | |
pageId: PageId; | |
}; | |
class Page { | |
id: PageId; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Convert string to number | |
type ToNumber<S> = S extends `${infer N extends number}` ? N : never; | |
// Creates an array with a particular length | |
type ArrayWithLength< | |
T extends number, | |
A extends number[] = number[], | |
> = A["length"] extends T ? A : ArrayWithLength<T, [...A, A["length"]]>; | |
// Generates a union type with all the numbers from zero -> n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface CommonData { | |
someRandomData: string; | |
} | |
type DataOne = { | |
someDataOneValue: string; | |
}; | |
type DataTwo = { | |
someDataTwoValue: string; |