素缃 · Su Xiang
Publisher: MosaulseThemes in package: 6
一本手抄旧书的颜色,落在你的代码上。泛黄的纸张、褪色的墨迹、朱砂色的印章、青碧玉的翠色标题。
一本手抄旧书的颜色,落在你的代码上。泛黄的纸张、褪色的墨迹、朱砂色的印章、青碧玉的翠色标题。
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 |
|---|---|---|
| comment, comment.line, comment.block, comment.line.double-slash, comment.line.number-sign, comment.block.documentation | #9a8878 | italic |
| comment.block.documentation | #9a8878 | italic |
| keyword, keyword.control, keyword.operator.expression, keyword.other, storage.type, storage.modifier | #f05a46 | — |
| keyword.control.import, keyword.control.include, keyword.control.package, keyword.control.namespace | #f05a46 | — |
| keyword.operator, keyword.operator.assignment, keyword.operator.comparison, keyword.operator.arithmetic, keyword.operator.logical | #9a8878 | — |
| string, string.quoted, string.quoted.single, string.quoted.double, string.quoted.triple, string.quoted.other, string.unquoted | #f1908c | — |
| string.template, string.template variable, string.interpolation, string.interpolated | #f1908c | — |
| constant.character.escape, constant.character.code | #f1908c | — |
| constant.numeric, constant.numeric.integer, constant.numeric.float, constant.numeric.hex, constant.numeric.octal, constant.numeric.binary | #f05a46 | — |
| constant.language, constant.other, constant.other.color | #f05a46 | — |
| constant.language.boolean, constant.language.null, constant.language.undefined | #f05a46 | — |
| entity.name.type, entity.name.type.class, entity.name.type.enum, entity.name.type.interface, entity.name.type.struct, entity.name.type.type-alias, entity.other.inherited-class | #579572 | — |
| entity.name.function, entity.name.function.constructor, meta.function-call, support.function, support.function.builtin, support.function.console | #83a78d | — |
| entity.name.function.member, entity.name.method | #83a78d | — |
| variable, variable.other.readwrite, variable.other.property, variable.other.constant | #d4c4b7 | — |
| variable.parameter, variable.parameter.function | #c1b2a3 | — |
| variable.other.object.property, support.type.property-name, meta.object-literal.key, meta.structure.dictionary.key | #9a8878 | — |
| support.class, support.type, support.constant, support.variable | #579572 | — |
| punctuation, punctuation.definition, punctuation.section, punctuation.terminator, punctuation.separator, punctuation.accessor, meta.brace | #9a8878 | — |
| markup.heading, entity.name.section, markup.heading.setext | #f05a46 | bold |
| markup.bold, markup.italic | — | bold |
| markup.list, markup.list.unnumbered, markup.list.numbered | #f05a46 | — |
| markup.underline.link, string.other.link | #83a78d | underline |
| markup.inline.raw, markup.fenced_code.block | #f1908c | — |
| markup.quote | #9a8878 | italic |
| markup.inserted, markup.deleted | #f1908c | — |
| entity.other.attribute-name.class, entity.other.attribute-name.id | #9a8878 | — |
| support.type.property-name.css, support.type.property-name.media | #9a8878 | — |
| entity.name.tag | #579572 | — |
| entity.other.attribute-name | #f1908c | — |
| support.type.property-name.json | #9a8878 | — |
| meta.diff.header, meta.diff.range, meta.diff.index | #c08eaf | — |
| invalid.deprecated | #9a8878 | underline |
| invalid.illegal | #f05a46 | — |
| comment, comment.line, comment.block, comment.line.double-slash, comment.line.number-sign, comment.block.documentation | #9a8878 | italic |
| comment.block.documentation | #9a8878 | italic |
| keyword, keyword.control, keyword.operator.expression, keyword.other, storage.type, storage.modifier | #f05a46 | — |
| keyword.control.import, keyword.control.include, keyword.control.package, keyword.control.namespace | #f05a46 | — |
| keyword.operator, keyword.operator.assignment, keyword.operator.comparison, keyword.operator.arithmetic, keyword.operator.logical | #9a8878 | — |
| string, string.quoted, string.quoted.single, string.quoted.double, string.quoted.triple, string.quoted.other, string.unquoted | #f1908c | — |
| string.template, string.template variable, string.interpolation, string.interpolated | #f1908c | — |
| constant.character.escape, constant.character.code | #f1908c | — |
| constant.numeric, constant.numeric.integer, constant.numeric.float, constant.numeric.hex, constant.numeric.octal, constant.numeric.binary | #f05a46 | — |
| constant.language, constant.other, constant.other.color | #f05a46 | — |
| constant.language.boolean, constant.language.null, constant.language.undefined | #f05a46 | — |
| entity.name.type, entity.name.type.class, entity.name.type.enum, entity.name.type.interface, entity.name.type.struct, entity.name.type.type-alias, entity.other.inherited-class | #579572 | — |
| entity.name.function, entity.name.function.constructor, meta.function-call, support.function, support.function.builtin, support.function.console | #83a78d | — |
| entity.name.function.member, entity.name.method | #83a78d | — |
| variable, variable.other.readwrite, variable.other.property, variable.other.constant | #d4c4b7 | — |
| variable.parameter, variable.parameter.function | #c1b2a3 | — |
| variable.other.object.property, support.type.property-name, meta.object-literal.key, meta.structure.dictionary.key | #9a8878 | — |
| support.class, support.type, support.constant, support.variable | #579572 | — |
| punctuation, punctuation.definition, punctuation.section, punctuation.terminator, punctuation.separator, punctuation.accessor, meta.brace | #9a8878 | — |
| markup.heading, entity.name.section, markup.heading.setext | #f05a46 | bold |
| markup.bold, markup.italic | — | bold |
| markup.list, markup.list.unnumbered, markup.list.numbered | #f05a46 | — |
| markup.underline.link, string.other.link | #83a78d | underline |
| markup.inline.raw, markup.fenced_code.block | #f1908c | — |
| markup.quote | #9a8878 | italic |
| markup.inserted, markup.deleted | #f1908c | — |
| entity.other.attribute-name.class, entity.other.attribute-name.id | #9a8878 | — |
| support.type.property-name.css, support.type.property-name.media | #9a8878 | — |
| entity.name.tag | #579572 | — |
| entity.other.attribute-name | #f1908c | — |
| support.type.property-name.json | #9a8878 | — |
| meta.diff.header, meta.diff.range, meta.diff.index | #c08eaf | — |
| invalid.deprecated | #9a8878 | underline |
| invalid.illegal | #f05a46 | — |
| 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}!`;
}