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 Comparator<T> = (a: T, b: T) => number; | |
| type GetIndex = <T>(input: T[], comparator: Comparator<T>) => number; | |
| export const getMaxIndex: GetIndex; | |
| export const getMinIndex: GetIndex; | |
| export const getMedianIndex: GetIndex; | |
| type GetElement = <T>(input: T[], comparator: Comparator<T>) => T | null; | |
| export const getMaxElement: GetElement; | |
| export const getMinElement: GetElement; |
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
| declare module 'str-utils' { | |
| type StrUtil = (input: string) => string; | |
| export const strReverse: StrUtil; | |
| export const strToLower: StrUtil; | |
| export const strToUpper: StrUtil; | |
| export const strRandomize: StrUtil; | |
| export const strInvertCase: StrUtil; | |
| } |
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 CallbackBasedAsyncFunction<T> = (callback: (response: ApiResponse<T>) => void) => void; | |
| type PromiseBasedAsyncFunction<T> = () => Promise<T>; | |
| export function promisify<T>(fn: CallbackBasedAsyncFunction<T>): PromiseBasedAsyncFunction<T> { | |
| return () => new Promise<T>((resolve, reject) => { | |
| fn((response) => { | |
| if (response.status === 'success') { | |
| resolve(response.data); | |
| } else { | |
| reject(new Error(response.error)); |
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
| const getObjectKeys = <T>(obj: T) => Object.keys(obj) as (keyof T)[]; | |
| export function filterPersons(persons: Person[], personType: User['type'], criteria: Partial<Omit<User, 'type'>>): User[]; | |
| export function filterPersons(persons: Person[], personType: Admin['type'], criteria: Partial<Omit<Admin, 'type'>>): Admin[]; | |
| export function filterPersons(persons: Person[], personType: Person['type'], criteria: Partial<Person>): Person[] { | |
| return persons | |
| .filter((person) => person.type === personType) | |
| .filter((person) => { | |
| let criteriaKeys = getObjectKeys(criteria); | |
| return criteriaKeys.every((fieldName) => { |
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 User { | |
| type: 'user'; | |
| name: string; | |
| age: number; | |
| occupation: string; | |
| } | |
| interface Admin { | |
| type: 'admin'; | |
| name: string; |
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
| const Skeleton = styled.div` | |
| border-radius: 4px; | |
| background: ${({ theme }) => theme.color["Neutral/Neutral 10"]}; | |
| animation: flashing 1s infinite alternate; | |
| @keyframes flashing { | |
| 0% { | |
| opacity: 1; | |
| } | |
| 90%, |
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
| @include media-extra-small-down() { | |
| } | |
| @include media-extra-small-only2() { | |
| } | |
| @include media-compact-only() { | |
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
| input { | |
| &:-webkit-autofill, | |
| &:-webkit-autofill:hover, | |
| &:-webkit-autofill:focus { | |
| background: $input-background; | |
| border: 1px solid $text-input-primary; | |
| -webkit-text-fill-color: $text-input-primary; | |
| transition: background-color 5000s ease-in-out 0s; | |
| -webkit-box-shadow: 0 0 0 1000px $input-background inset !important; | |
| } |
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
| @import "src/styles/colors.scss"; | |
| @import "src/styles/adaptive.scss"; | |
| @import "src/styles/variables.scss"; | |
| .$TM_FILENAME_BASE$ { | |
| } |
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
| import React from "react"; | |
| import styles from "./styles.module.scss"; | |
| import classNames from "classnames"; | |
| interface $TM_FILENAME_BASE$Props { | |
| className?: string; | |
| } | |
| let cx = classNames.bind(styles); | |
| const $TM_FILENAME_BASE$ = (props: $TM_FILENAME_BASE$Props) => { |