ART Template
Publisher: eSquaredThemes in package: 1
ART Template syntax highlighting
ART Template syntax highlighting
Full workbench mockup using this variant's colors and tokenColors.
Loading...
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| comment, punctuation.definition.comment | #AAAAAA | italic |
| invalid.illegal | #660000 | |
| keyword.operator | #777777 | — |
| keyword, storage | #4B83CD | — |
| storage.type, support.type | #AA3731 | — |
| constant.language | #AB6526 | — |
| entity.name.function, support.function | #4331aa | bold |
| support.class | #7A3E9D | bold |
| entity.name.section | — | bold |
| constant.numeric | #448C27 | — |
| constant.character.escape | #777777 | — |
| string.regexp | #AB6526 | — |
| markup.heading | #7A3E9D | — |
| markup.bold | #448C27 | bold |
| markup.list | #4B83CD | — |
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}!`;
}