Sparkl
Publisher: sparklThemes 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 meta.tag, source source.css, source meta.embedded.block | #2F74D0 | — |
| source meta.tag meta.embedded.expression | #333 | — |
| comment, punctuation.definition.comment | #ababab | |
| comment.line.documentation, comment.block.documentation, comment.block.documentation punctuation.definition.comment | #62A9FF | |
| keyword.control.export | #fcb4ec | |
| invalid.illegal | #FF4848 | — |
| constant.language, support.constant, constant.numeric, constant.character, string | #7451FF | — |
| source.js source.css constant.numeric, source.js source.css constant.character, source.js source.css constant, source.js source.css string, source.js source.css constant.language, source.js source.css support.constant | #7451FF | — |
| entity.name.function, entity.name.type, support.function, entity.other.inherited-class, support.class | — | |
| meta.function-call entity.name.function, meta.function-call support.function, support.class.component | — | bold |
| constant.character.escape | #8668FF | — |
| meta.template.expression | #333 | — |
| source.css entity.other.attribute-name | — | 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}!`;
}