素缃 · Su Xiang
Publisher: MosaulseThemes in package: 2
一本手抄旧书的颜色,落在你的代码上。泛黄的纸张、褪色的墨迹、朱砂色的印章、青碧玉的翠色标题。
一本手抄旧书的颜色,落在你的代码上。泛黄的纸张、褪色的墨迹、朱砂色的印章、青碧玉的翠色标题。
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 | #D0C3AE | — |
| comment, punctuation.definition.comment | #938A7A | — |
| keyword, storage.type, storage.modifier | #D95B4A | — |
| string, punctuation.definition.string | #E3947C | — |
| constant.numeric, constant.language, support.constant | #D95B4A | — |
| entity.name.function, support.function | #7DA494 | — |
| entity.name.type, entity.name.class, entity.name.tag, support.type, support.class | #7DA494 | — |
| variable, variable.parameter, variable.other | #D0C3AE | — |
| punctuation, meta.brace, punctuation.definition | #938A7A | — |
| entity.name.tag | #7DA494 | — |
| entity.other.attribute-name | #D95B4A | — |
| variable.other.property, variable.other.object.property, variable.other.member, meta.object-literal.key, support.variable.property | #D9A85F | — |
| variable.parameter, meta.function.parameters | #C5B79F | — |
| entity.name.namespace, entity.name.module, support.module | #7DA494 | — |
| meta.decorator, entity.name.function.decorator, punctuation.decorator | #E3947C | — |
| string.regexp, constant.character.escape | #E3947C | — |
| support.type.property-name.json, meta.structure.dictionary.json string.quoted.double.json | #7DA494 | — |
| entity.other.attribute-name.class.css, entity.other.attribute-name.id.css, support.type.property-name.css | #9DBFAD | — |
| markup.heading, punctuation.definition.heading | #E3947C | — |
| markup.inline.raw, markup.underline.link, string.other.link | #7DA494 | — |
| invalid | #D95B4A | — |
| source | #D0C3AE | — |
| comment, punctuation.definition.comment | #938A7A | — |
| keyword, storage.type, storage.modifier | #D95B4A | — |
| string, punctuation.definition.string | #E3947C | — |
| constant.numeric, constant.language, support.constant | #D95B4A | — |
| entity.name.function, support.function | #7DA494 | — |
| entity.name.type, entity.name.class, entity.name.tag, support.type, support.class | #7DA494 | — |
| variable, variable.parameter, variable.other | #D0C3AE | — |
| punctuation, meta.brace, punctuation.definition | #938A7A | — |
| entity.name.tag | #7DA494 | — |
| entity.other.attribute-name | #D95B4A | — |
| variable.other.property, variable.other.object.property, variable.other.member, meta.object-literal.key, support.variable.property | #D9A85F | — |
| variable.parameter, meta.function.parameters | #C5B79F | — |
| entity.name.namespace, entity.name.module, support.module | #7DA494 | — |
| meta.decorator, entity.name.function.decorator, punctuation.decorator | #E3947C | — |
| string.regexp, constant.character.escape | #E3947C | — |
| support.type.property-name.json, meta.structure.dictionary.json string.quoted.double.json | #7DA494 | — |
| entity.other.attribute-name.class.css, entity.other.attribute-name.id.css, support.type.property-name.css | #9DBFAD | — |
| markup.heading, punctuation.definition.heading | #E3947C | — |
| markup.inline.raw, markup.underline.link, string.other.link | #7DA494 | — |
| invalid | #D95B4A | — |
| source | — | — |
| comment, punctuation.definition.comment | — | normal |
| keyword, storage.type, storage.modifier | — | bold |
| string, punctuation.definition.string | — | italic |
| constant.numeric, constant.language, support.constant | — | — |
| entity.name.function, support.function | — | — |
| entity.name.type, entity.name.class, entity.name.tag, support.type, support.class | — | bold |
| variable, variable.parameter, variable.other | — | — |
| punctuation, meta.brace, punctuation.definition | — | — |
| entity.name.tag | — | — |
| entity.other.attribute-name | — | — |
| variable.other.property, variable.other.object.property, variable.other.member, meta.object-literal.key, support.variable.property | — | — |
| variable.parameter, meta.function.parameters | — | — |
| entity.name.namespace, entity.name.module, support.module | — | — |
| meta.decorator, entity.name.function.decorator, punctuation.decorator | — | — |
| string.regexp, constant.character.escape | — | — |
| support.type.property-name.json, meta.structure.dictionary.json string.quoted.double.json | — | — |
| entity.other.attribute-name.class.css, entity.other.attribute-name.id.css, support.type.property-name.css | — | — |
| markup.heading, punctuation.definition.heading | — | bold |
| markup.inline.raw, markup.underline.link, string.other.link | — | — |
| markup.italic | — | italic |
| markup.bold | — | bold |
| invalid | — | 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}!`;
}