Beans dim
Publisher: danielcjacksThemes 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 |
|---|---|---|
| source | #a0a0a0 | — |
| meta.export.default | #a0988a | — |
| storage.type | #464b58 | — |
| variable.other.constant entity.name.function, meta.definition.function entity.name.function | #c19267 | — |
| keyword.control | #725f8c | — |
| string.regexp | #724772 | — |
| variable.parameter | #c1b4a4 | — |
| meta.parameters | #4f4f4f | — |
| meta.function-call entity.name.function | #a17768 | — |
| comment | #474747 | — |
| constant, string | #6d7e6d | — |
| meta.definition.variable, meta.object-literal.key | #7b8b9d | — |
| punctuation, meta.brace.round | #545454 | — |
| storage.type.function, meta.brace.curly, meta.brace.square, keyword.operator, meta.objectliteral punctuation.definition.block | #777777 | — |
| punctuation.definition.string | #4c524c | — |
| constant.language | #6d7e6d | italic bold |
| storage.modifier.async | #725f8c | — |
| string variable.other.readwrite | #A0A0A0 | — |
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}!`;
}