Flat-Theme
Publisher: AatricksThemes in package: 3
Full workbench mockup using this variant's colors and tokenColors.
Loading...
Workbench UI color keys from the theme JSON colors map.
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| comment, punctuation.definition.comment, comment.block.documentation, comment.line | #9aa0b8 | italic |
| variable, variable.other, variable.object | #c6d0f5 | — |
| variable.language, variable.language.this, variable.language.self, variable.language.super | #81c8be | — |
| variable.other.readwrite.instance, variable.other.enummember | #ca9ee6 | — |
| variable.parameter, variable.parameter.function, meta.function.parameters variable | #f2b5a8 | — |
| variable.other.property, variable.other.member, variable.other.object.property, support.variable.property | #aab8ff | — |
| constant, constant.numeric, constant.language, constant.character, variable.other.constant | #ef9f76 | — |
| string, string.quoted, punctuation.definition.string | #a6d189 | — |
| string.regexp, constant.character.escape | #99d1db | — |
| punctuation.definition.template-expression | #ca9ee6 | — |
| entity.name.namespace, entity.name.module, entity.name.package, support.module | #85c1dc | — |
| entity.name.type, entity.name.class, support.type, support.class, entity.other.inherited-class | #e5c890 | — |
| support.type.builtin, storage.type.builtin, storage.type.primitive | #e5c890 | — |
| entity.name.function.macro, support.function.macro | #f4b8e4 | — |
| entity.name.function, support.function, variable.function, meta.function-call | #8bb4ff | — |
| entity.other.attribute-name, entity.other.attribute-name.html, meta.annotation, storage.type.annotation, punctuation.definition.annotation | #f28fad | — |
| keyword, keyword.control, keyword.operator.new, storage.modifier, storage.type.function | #ca9ee6 | — |
| keyword.operator, keyword.operator.expression, punctuation.accessor | #a5adce | — |
| punctuation, punctuation.definition.block, punctuation.definition.parameters, punctuation.section, meta.brace | #969bb2 | — |
| support.type.property-name.json, source.json meta.structure.dictionary.json support.type.property-name.json | #aab8ff | — |
| markup.heading, entity.name.section | #8bb4ff | bold |
| markup.bold | #f2b5a8 | bold |
| markup.italic | #f2b5a8 | italic |
| markup.underline.link | #8bb4ff | italic |
| markup.inline.raw, markup.raw.block, markup.fenced_code.block | #a6d189 | — |
| markup.inserted, markup.inserted.diff | #a6d189 | — |
| markup.deleted, markup.deleted.diff | #f28fad | — |
| invalid, invalid.illegal | #f28fad | bold |
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}!`;
}