ratovia
Publisher: ratoviaThemes in package: 1
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 |
|---|---|---|
| — | #FCFFDB | — |
| comment | #FFFF8E | — |
| string | #EDBDFF | — |
| constant.numeric | #EDBDFF | — |
| constant.language | #EDBDFF | — |
| constant.character, constant.other | #EDBDFF | — |
| variable | #FCFFDB | — |
| keyword | #00FF90 | — |
| storage | #ff0064ff | — |
| storage.type | #0062ffff | italic |
| entity.name.class | #00FF00 | underline |
| entity.other.inherited-class | #66a8feff | italic underline |
| entity.name.function | #00FFFF | — |
| variable.parameter | #ff005aff | italic |
| entity.name.tag | #00FFA6 | — |
| entity.other.attribute-name | #00FFFF | — |
| support.function | #00FFFF | |
| support.constant | #FF8A00 | — |
| support.type, support.class | #ff8a00ff | italic |
| support.other.variable | — | |
| invalid | #ffffffff | |
| invalid.deprecated | #ffffffff | — |
| html.string.quoted | #FF75BF | — |
| text.html.mt | #FFFFFF | — |
| constant.other.symbol.ruby | #00FFA6 | — |
| string.quoted.double.ruby | #EDBDFF | underline |
| string.quoted.single.ruby | #EDBDFF | underline |
| entity.name.type.class.ruby | #00FF00 | underline |
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}!`;
}