syml
Publisher: JWdeveloperThemes in package: 1
scripting yaml file
scripting yaml file
Full workbench mockup using this variant's colors and tokenColors.
Loading...
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| function.syml | #228B22 | — |
| symbols.syml | #fbfbe3 | — |
| global.syml | #a9c2dc | — |
| comment.syml | #228B22 | — |
| code.syml | #f7f6c1 | — |
| yaml.section.syml | #358bca | — |
| constant.numeric.syml | #d3869b | — |
| keyword.control.syml | #e78a4e | — |
| keyword.special-dollar-brace.syml | #FFAA00 | — |
| string.quoted.double.syml, string.quoted.single.syml, punctuation.definition.string.begin.syml, punctuation.definition.string.end.syml, string.quoted.double.interpolated.syml, string.quoted.single.interpolated.syml, string.quoted.triple.syml | #a9b665 | — |
| spigot.black.syml | #000000 | — |
| spigot.dark_blue.syml | #1800ff | — |
| spigot.dark_green.syml | #00AA00 | — |
| spigot.dark_aqua.syml | #00AAAA | — |
| spigot.dark_red.syml | #AA0000 | — |
| spigot.dark_purple.syml | #AA00AA | — |
| spigot.gold.syml | #FFAA00 | — |
| spigot.gray.syml | #AAAAAA | — |
| spigot.dark_gray.syml | #555555 | — |
| spigot.blue.syml | #5555FF | — |
| spigot.green.syml | #55FF55 | — |
| spigot.aqua.syml | #55FFFF | — |
| spigot.red.syml | #FF5555 | — |
| spigot.light_purple.syml | #FF55FF | — |
| spigot.yellow.syml | #FFFF55 | — |
| spigot.white.syml | #FFFFFF | — |
| spigot.bold.syml | #FFFFFF | 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}!`;
}