4d46's dark theme
Publisher: 4d46Themes 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 |
|---|---|---|
| markup.bold | — | bold |
| markup.italic | — | italic |
| markup.underline | — | underline |
| markup.heading | — | bold |
| variable | #ababab | — |
| comment | #505050 | italic |
| storage.type, storage.modifier, keyword, meta.function.definition, meta.function-call keyword.operator.expression, meta.import keyword.control, keyword.control.import, keyword.control.export, keyword.control.from, keyword.control.as, keyword.control.directive | #868686 | italic |
| constant.other.option, keyword.operator, keyword.other.unit, storage.type.function.arrow, punctuation, meta.brace, meta.separator.markdown | #6d6d6d | none |
| keyword.control | #d7d7d7 | bold |
| entity.name.function, support.function, meta.function-call.generic | #b9a994 | — |
| support.type, entity.name.type, storage.type.haskell | #478387 | italic |
| constant.numeric | #2baad2 | — |
| string, punctuation.definition.string | #39bdbc | — |
| constant.language | #5ca6cc | — |
| support.constant.property-value, constant.other.color | #5ca6cc | underline |
| variable.other.property, variable.other.object.property, support.type.property-name | #9e9e9e | italic |
| variable.other.object | #ababab | — |
| entity.name.tag | #955756 | bold |
| support.class.component, markup.heading | #9e6755 | bold |
| entity.other.attribute-name | #917271 | italic |
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}!`;
}