Leetcode Light
Publisher: Goh Yong JingThemes in package: 1
Leetcode's light theme
Leetcode's light theme
Full workbench mockup using this variant's colors and tokenColors.
Loading...
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| namespace | #000000 | — |
| class | #000000 | — |
| enum | #000000 | — |
| interface | #000000 | — |
| struct | #000000 | — |
| typeParameter | #000000 | — |
| type | #000000 | — |
| parameter | #000000 | — |
| variable | #000000 | — |
| property | #000000 | — |
| enumMember | #000000 | — |
| decorator | #000000 | — |
| event | #000000 | — |
| function | #000000 | — |
| method | #000000 | — |
| macro | #000000 | — |
| label | #000000 | — |
| comment | #008000 | — |
| string | #000000 | — |
| keyword | #AF00DB | — |
| number | #098658 | — |
| regexp | #000000 | — |
| operator | #000000 | — |
| declaration | #000000 | — |
| definition | #000000 | — |
| readonly, constant | #098658 | — |
| static | #000000 | — |
| deprecated | #000000 | strikethrough |
| abstract | #000000 | italic |
| async | #000000 | — |
| modification | #000000 | — |
| documentation | #000000 | — |
| defaultLibrary | #000000 | — |
| storage.type.function.python, variable.language.special.self.python, storage.type.class.python, constant.character.format.placeholder.other.python | #0000FF | — |
| entity.name.function.python, entity.name.function.decorator.python, support.function.builtin.python, support.function.magic.python | #795E26 | — |
| variable.parameter.function.language.python, variable.parameter.function.language.special.self.python | #001080 | — |
| string.quoted.single.python | #A31515 | — |
| entity.name.type.class.python, entity.other.inherited-class.python, support.type.exception.python, support.type.python | #267F99 | — |
| constant.other.caps.python, keyword.operator.unpacking.parameter.python, keyword.operator.arithmetic.python | #000000 | — |
| variable.other.readwrite.alias.ts, variable.object.property.ts, variable.parameter.ts, variable.other.object.ts, variable.other.property.ts, variable.other.readwrite.ts | #001080 | — |
| entity.name.function.ts | #795E26 | — |
| string.quoted.single.ts, punctuation.definition.string.template.begin.ts, punctuation.definition.string.template.end.ts, string.template.ts, punctuation.definition.string.begin.ts, punctuation.definition.string.end.ts, string.quoted.double.ts | #A31515 | — |
| storage.type.ts, storage.type.enum.ts, storage.type.interface.ts, storage.type.function.ts, punctuation.definition.template-expression.begin.ts, punctuation.definition.template-expression.end.ts, meta.type.annotation.ts, storage.modifier.async.ts, keyword.operator.expression.is.ts, keyword.operator.expression.typeof.ts, keyword.operator.new.ts | #0000FF | — |
| entity.name.type.enum.ts, entity.name.type.interface.ts, support.type.primitive.ts, entity.name.type.ts | #267F99 | — |
| variable.other.enummember.ts, variable.other.constant.ts | #0070C1 | — |
| keyword.operator.type.annotation.ts, keyword.operator.assignment.ts, keyword.operator.rest.ts, keyword.operator.arithmetic.ts, keyword.operator.comparison.ts | #000000 | — |
export interface User {
id: string;
name: string;
role: "admin" | "member";
tags: string[];
}
/**
* Fetch user data by ID
* @param id
* @returns User object or null if ID is invalid
*/
export async function fetchUser(id: string): Promise<User | null> {
if (!id) {
return null;
}
const response = await fetch(`/api/users/${id}`, {
method: "GET",
headers: { Accept: "application/json" },
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
return (await response.json()) as User;
}
function greet(user: User): string {
// Simple greeting function that uses the user's name
return `Hello, ${user.name}!`;
}