Dusk Theme
Publisher: haroonahmadThemes in package: 4
A mid-tone theme between light and dark — easy on the eyes in any environment. Three background variants with warm amber/gold/peach syntax highlighting.
A mid-tone theme between light and dark — easy on the eyes in any environment. Three background variants with warm amber/gold/peach syntax highlighting.
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, punctuation.definition.comment | #9E9185 | italic |
| comment.block.documentation, comment.line.documentation | #AEA090 | italic |
| storage.type.class.jsdoc, punctuation.definition.block.tag.jsdoc, entity.name.type.instance.jsdoc | #BEB890 | italic |
| string, string.quoted, string.quoted.single, string.quoted.double, string.quoted.triple, string.other | #FFC870 | — |
| string.template, string.interpolated | #FFD880 | — |
| meta.template.expression, punctuation.definition.template-expression | #FFF8F0 | — |
| string.regexp, constant.regexp | #FFE870 | — |
| punctuation.definition.group.regexp, keyword.operator.quantifier.regexp, keyword.operator.or.regexp | #F0D050 | — |
| constant.character.escape | #FFD060 | — |
| punctuation.definition.string | #E8A850 | — |
| keyword, keyword.control, keyword.control.flow, keyword.control.conditional, keyword.control.loop, keyword.control.exception, keyword.control.import, keyword.control.export, keyword.control.from, keyword.control.as, keyword.control.async, keyword.control.await | #FFB828 | — |
| keyword.other, keyword.operator.new, keyword.operator.delete, keyword.operator.typeof, keyword.operator.void, keyword.operator.instanceof, keyword.operator.in, keyword.operator.of | #FFB828 | — |
| storage, storage.type, storage.type.function, storage.type.class, storage.type.interface, storage.type.enum, storage.type.type, storage.type.namespace, storage.type.module, storage.type.let, storage.type.const, storage.type.var, storage.type.async, storage.type.arrow, storage.type.primitive | #FFB828 | — |
| storage.modifier, storage.modifier.async, storage.modifier.static, storage.modifier.public, storage.modifier.private, storage.modifier.protected, storage.modifier.abstract, storage.modifier.readonly, storage.modifier.override, storage.modifier.final | #FFD040 | italic |
| keyword.operator, keyword.operator.arithmetic, keyword.operator.assignment, keyword.operator.comparison, keyword.operator.logical, keyword.operator.bitwise, keyword.operator.ternary, keyword.operator.spread, keyword.operator.rest, keyword.operator.optional, keyword.operator.nullish, keyword.operator.pipe | #EDE0CC | — |
| punctuation, punctuation.separator, punctuation.terminator, punctuation.accessor, meta.delimiter, punctuation.definition.parameters, punctuation.definition.block, punctuation.definition.array | #C8B89C | — |
| constant.numeric, constant.numeric.integer, constant.numeric.float, constant.numeric.hex, constant.numeric.binary, constant.numeric.octal, constant.numeric.scientific | #A8F890 | — |
| constant.language, constant.language.boolean, constant.language.null, constant.language.undefined, constant.language.nan, constant.language.infinity | #FFB828 | — |
| constant.other, constant.other.enum, constant.other.caps, variable.other.constant, variable.other.enummember | #F0E080 | — |
| support.constant, support.constant.math, support.constant.dom, support.constant.json | #F0E080 | — |
| entity.name.function, entity.name.method, entity.name.constructor, meta.definition.method, meta.definition.function | #FF8C5A | — |
| meta.function-call, meta.function-call.generic, variable.function, support.function | #FF8C5A | — |
| support.function.builtin, support.function.magic | #FFA070 | — |
| entity.name.function.member, support.function.method | #FF8C5A | — |
| entity.name.type, entity.name.class, entity.name.interface, entity.name.enum, entity.name.namespace, entity.name.struct, entity.name.trait, entity.name.impl, entity.name.module | #5EE8E8 | — |
| entity.name.type.alias, entity.name.type.instance, meta.type.annotation, support.type, support.class | #5EE8E8 | — |
| entity.other.inherited-class | #5EE8E8 | italic |
| entity.name.type.parameter, variable.type.parameter, meta.type.parameters | #D8B8FF | — |
| storage.type.primitive, support.type.primitive, keyword.type, entity.name.type.numeric, support.type.builtin | #5EE8E8 | — |
| variable, variable.other, variable.other.readwrite, variable.other.object, variable.other.local | #FFF8F0 | — |
| variable.other.constant, variable.other.constant.object | #EDE0CC | — |
| variable.language, variable.language.this, variable.language.self, variable.language.super, variable.language.arguments, variable.language.special | #FFB828 | italic |
| variable.parameter, variable.parameter.function | #D8B8FF | — |
| variable.other.property, variable.other.object.property, support.variable.property, meta.object-literal.key | #FFF8F0 | — |
| variable.other.member, variable.other.readwrite.member | #B8D8E8 | — |
| entity.name.tag, entity.name.tag.html, entity.name.tag.xml, entity.name.tag.js.jsx, entity.name.tag.tsx | #80C8FF | — |
| entity.other.attribute-name, entity.other.attribute-name.html, entity.other.attribute-name.id, entity.other.attribute-name.class, entity.other.attribute-name.event, meta.attribute | #F0D090 | — |
| punctuation.definition.tag, punctuation.definition.tag.begin, punctuation.definition.tag.end, punctuation.separator.key-value.html | #60A8D8 | — |
| punctuation.section.embedded, meta.jsx.children | #FFF8F0 | — |
| entity.other.attribute-name.class.css, entity.other.attribute-name.id.css, entity.other.attribute-name.pseudo-class.css, entity.other.attribute-name.pseudo-element.css | #FFB828 | — |
| support.type.property-name, support.type.property-name.css, support.type.property-name.media | #80C8FF | — |
| support.constant.property-value, support.constant.font-name, support.constant.color | #FFC870 | — |
| keyword.other.unit, keyword.other.unit.css | #A8F890 | — |
| keyword.control.at-rule, keyword.control.at-rule.media, keyword.control.at-rule.import, keyword.control.at-rule.keyframes | #FFB828 | — |
| variable.css | #D8B8FF | — |
| meta.decorator, entity.name.function.decorator, punctuation.definition.decorator, storage.type.annotation, entity.name.type.annotation | #D8B8FF | italic |
| punctuation.decorator, keyword.decorator | #D8B8FF | — |
| string.quoted.double.import, string.quoted.single.import, meta.import string, module.imports | #E8B060 | — |
| markup.heading, entity.name.section.markdown, punctuation.definition.heading | #FFC870 | bold |
| markup.bold | #FFF8F0 | bold |
| markup.italic | #FFF8F0 | italic |
| markup.inline.raw, markup.raw.inline | #5EE8E8 | — |
| markup.raw.block | #CDDBDB | — |
| markup.underline.link, string.other.link.title.markdown | #80C8FF | — |
| meta.link.inline.description.markdown | #FFF8F0 | — |
| markup.quote | #AEA090 | italic |
| punctuation.definition.list.begin.markdown | #FFB828 | — |
| meta.separator.markdown | #5A5048 | — |
| fenced_code.block.language | #90E878 | — |
| support.type.property-name.json, string.json meta.structure, source.json meta.mapping.key string | #80C8FF | — |
| constant.language.json | #FFB828 | — |
| entity.name.tag.yaml, support.type.property-name.yaml | #80C8FF | — |
| entity.name.type.anchor.yaml, variable.other.alias.yaml | #D8B8FF | — |
| support.function.magic.python, entity.name.function.magic.python | #FF8C5A | italic |
| variable.parameter.function.language.python | #FFB828 | italic |
| string.interpolated.python | #FFD880 | — |
| meta.function.parameters.annotation.python | #5EE8E8 | — |
| support.function.builtin.python | #FFA070 | — |
| storage.modifier.lifetime.rust, entity.name.type.lifetime.rust | #D8B8FF | — |
| entity.name.function.macro.rust, meta.macro.rust | #FFC870 | — |
| keyword.other.unsafe.rust | #FF7070 | bold |
| comment.line.number-sign.shell | #9E9185 | italic |
| support.function.builtin.shell | #FF8C5A | — |
| variable.other.normal.shell | #FFF8F0 | — |
| invalid.illegal | #FF7070 | — |
| invalid.deprecated | #7A6E62 | strikethrough |
| meta.preprocessor, keyword.control.directive, punctuation.definition.directive | #FFD040 | — |
| meta.diff.header, meta.diff.range | #80C8FF | — |
| markup.inserted | #90E878 | — |
| markup.deleted | #FF7070 | — |
| markup.changed | #FFB828 | — |
| comment, punctuation.definition.comment | #9E9185 | italic |
| comment.block.documentation, comment.line.documentation | #AEA090 | italic |
| storage.type.class.jsdoc, punctuation.definition.block.tag.jsdoc, entity.name.type.instance.jsdoc | #BEB890 | italic |
| string, string.quoted, string.quoted.single, string.quoted.double, string.quoted.triple, string.other | #FFC870 | — |
| string.template, string.interpolated | #FFD880 | — |
| meta.template.expression, punctuation.definition.template-expression | #FFF8F0 | — |
| string.regexp, constant.regexp | #FFE870 | — |
| punctuation.definition.group.regexp, keyword.operator.quantifier.regexp, keyword.operator.or.regexp | #F0D050 | — |
| constant.character.escape | #FFD060 | — |
| punctuation.definition.string | #E8A850 | — |
| keyword, keyword.control, keyword.control.flow, keyword.control.conditional, keyword.control.loop, keyword.control.exception, keyword.control.import, keyword.control.export, keyword.control.from, keyword.control.as, keyword.control.async, keyword.control.await | #FFB828 | — |
| keyword.other, keyword.operator.new, keyword.operator.delete, keyword.operator.typeof, keyword.operator.void, keyword.operator.instanceof, keyword.operator.in, keyword.operator.of | #FFB828 | — |
| storage, storage.type, storage.type.function, storage.type.class, storage.type.interface, storage.type.enum, storage.type.type, storage.type.namespace, storage.type.module, storage.type.let, storage.type.const, storage.type.var, storage.type.async, storage.type.arrow, storage.type.primitive | #FFB828 | — |
| storage.modifier, storage.modifier.async, storage.modifier.static, storage.modifier.public, storage.modifier.private, storage.modifier.protected, storage.modifier.abstract, storage.modifier.readonly, storage.modifier.override, storage.modifier.final | #FFD040 | italic |
| keyword.operator, keyword.operator.arithmetic, keyword.operator.assignment, keyword.operator.comparison, keyword.operator.logical, keyword.operator.bitwise, keyword.operator.ternary, keyword.operator.spread, keyword.operator.rest, keyword.operator.optional, keyword.operator.nullish, keyword.operator.pipe | #EDE0CC | — |
| punctuation, punctuation.separator, punctuation.terminator, punctuation.accessor, meta.delimiter, punctuation.definition.parameters, punctuation.definition.block, punctuation.definition.array | #C8B89C | — |
| constant.numeric, constant.numeric.integer, constant.numeric.float, constant.numeric.hex, constant.numeric.binary, constant.numeric.octal, constant.numeric.scientific | #A8F890 | — |
| constant.language, constant.language.boolean, constant.language.null, constant.language.undefined, constant.language.nan, constant.language.infinity | #FFB828 | — |
| constant.other, constant.other.enum, constant.other.caps, variable.other.constant, variable.other.enummember | #F0E080 | — |
| support.constant, support.constant.math, support.constant.dom, support.constant.json | #F0E080 | — |
| entity.name.function, entity.name.method, entity.name.constructor, meta.definition.method, meta.definition.function | #FF8C5A | — |
| meta.function-call, meta.function-call.generic, variable.function, support.function | #FF8C5A | — |
| support.function.builtin, support.function.magic | #FFA070 | — |
| entity.name.function.member, support.function.method | #FF8C5A | — |
| entity.name.type, entity.name.class, entity.name.interface, entity.name.enum, entity.name.namespace, entity.name.struct, entity.name.trait, entity.name.impl, entity.name.module | #5EE8E8 | — |
| entity.name.type.alias, entity.name.type.instance, meta.type.annotation, support.type, support.class | #5EE8E8 | — |
| entity.other.inherited-class | #5EE8E8 | italic |
| entity.name.type.parameter, variable.type.parameter, meta.type.parameters | #D8B8FF | — |
| storage.type.primitive, support.type.primitive, keyword.type, entity.name.type.numeric, support.type.builtin | #5EE8E8 | — |
| variable, variable.other, variable.other.readwrite, variable.other.object, variable.other.local | #FFF8F0 | — |
| variable.other.constant, variable.other.constant.object | #EDE0CC | — |
| variable.language, variable.language.this, variable.language.self, variable.language.super, variable.language.arguments, variable.language.special | #FFB828 | italic |
| variable.parameter, variable.parameter.function | #D8B8FF | — |
| variable.other.property, variable.other.object.property, support.variable.property, meta.object-literal.key | #FFF8F0 | — |
| variable.other.member, variable.other.readwrite.member | #B8D8E8 | — |
| entity.name.tag, entity.name.tag.html, entity.name.tag.xml, entity.name.tag.js.jsx, entity.name.tag.tsx | #80C8FF | — |
| entity.other.attribute-name, entity.other.attribute-name.html, entity.other.attribute-name.id, entity.other.attribute-name.class, entity.other.attribute-name.event, meta.attribute | #F0D090 | — |
| punctuation.definition.tag, punctuation.definition.tag.begin, punctuation.definition.tag.end, punctuation.separator.key-value.html | #60A8D8 | — |
| punctuation.section.embedded, meta.jsx.children | #FFF8F0 | — |
| entity.other.attribute-name.class.css, entity.other.attribute-name.id.css, entity.other.attribute-name.pseudo-class.css, entity.other.attribute-name.pseudo-element.css | #FFB828 | — |
| support.type.property-name, support.type.property-name.css, support.type.property-name.media | #80C8FF | — |
| support.constant.property-value, support.constant.font-name, support.constant.color | #FFC870 | — |
| keyword.other.unit, keyword.other.unit.css | #A8F890 | — |
| keyword.control.at-rule, keyword.control.at-rule.media, keyword.control.at-rule.import, keyword.control.at-rule.keyframes | #FFB828 | — |
| variable.css | #D8B8FF | — |
| meta.decorator, entity.name.function.decorator, punctuation.definition.decorator, storage.type.annotation, entity.name.type.annotation | #D8B8FF | italic |
| punctuation.decorator, keyword.decorator | #D8B8FF | — |
| string.quoted.double.import, string.quoted.single.import, meta.import string, module.imports | #E8B060 | — |
| markup.heading, entity.name.section.markdown, punctuation.definition.heading | #FFC870 | bold |
| markup.bold | #FFF8F0 | bold |
| markup.italic | #FFF8F0 | italic |
| markup.inline.raw, markup.raw.inline | #5EE8E8 | — |
| markup.raw.block | #CDDBDB | — |
| markup.underline.link, string.other.link.title.markdown | #80C8FF | — |
| meta.link.inline.description.markdown | #FFF8F0 | — |
| markup.quote | #AEA090 | italic |
| punctuation.definition.list.begin.markdown | #FFB828 | — |
| meta.separator.markdown | #5A5048 | — |
| fenced_code.block.language | #90E878 | — |
| support.type.property-name.json, string.json meta.structure, source.json meta.mapping.key string | #80C8FF | — |
| constant.language.json | #FFB828 | — |
| entity.name.tag.yaml, support.type.property-name.yaml | #80C8FF | — |
| entity.name.type.anchor.yaml, variable.other.alias.yaml | #D8B8FF | — |
| support.function.magic.python, entity.name.function.magic.python | #FF8C5A | italic |
| variable.parameter.function.language.python | #FFB828 | italic |
| string.interpolated.python | #FFD880 | — |
| meta.function.parameters.annotation.python | #5EE8E8 | — |
| support.function.builtin.python | #FFA070 | — |
| storage.modifier.lifetime.rust, entity.name.type.lifetime.rust | #D8B8FF | — |
| entity.name.function.macro.rust, meta.macro.rust | #FFC870 | — |
| keyword.other.unsafe.rust | #FF7070 | bold |
| comment.line.number-sign.shell | #9E9185 | italic |
| support.function.builtin.shell | #FF8C5A | — |
| variable.other.normal.shell | #FFF8F0 | — |
| invalid.illegal | #FF7070 | — |
| invalid.deprecated | #7A6E62 | strikethrough |
| meta.preprocessor, keyword.control.directive, punctuation.definition.directive | #FFD040 | — |
| meta.diff.header, meta.diff.range | #80C8FF | — |
| markup.inserted | #90E878 | — |
| markup.deleted | #FF7070 | — |
| markup.changed | #FFB828 | — |
| comment, punctuation.definition.comment | #9E9185 | italic |
| comment.block.documentation, comment.line.documentation | #AEA095 | italic |
| storage.type.class.jsdoc, punctuation.definition.block.tag.jsdoc, entity.name.type.instance.jsdoc | #BEB090 | italic |
| string, string.quoted, string.quoted.single, string.quoted.double, string.quoted.triple, string.other | #FFB87A | — |
| string.template, string.interpolated | #FFC88A | — |
| meta.template.expression, punctuation.definition.template-expression | #E8DDD0 | — |
| string.regexp, constant.regexp | #F0D870 | — |
| punctuation.definition.group.regexp, keyword.operator.quantifier.regexp, keyword.operator.or.regexp | #D8B860 | — |
| constant.character.escape | #E8C870 | — |
| punctuation.definition.string | #DDA070 | — |
| keyword, keyword.control, keyword.control.flow, keyword.control.conditional, keyword.control.loop, keyword.control.exception, keyword.control.import, keyword.control.export, keyword.control.from, keyword.control.as, keyword.control.async, keyword.control.await | #F0B828 | — |
| keyword.other, keyword.operator.new, keyword.operator.delete, keyword.operator.typeof, keyword.operator.void, keyword.operator.instanceof, keyword.operator.in, keyword.operator.of | #F0B828 | — |
| storage, storage.type, storage.type.function, storage.type.class, storage.type.interface, storage.type.enum, storage.type.type, storage.type.namespace, storage.type.module, storage.type.let, storage.type.const, storage.type.var, storage.type.async, storage.type.arrow, storage.type.primitive | #F0B828 | — |
| storage.modifier, storage.modifier.async, storage.modifier.static, storage.modifier.public, storage.modifier.private, storage.modifier.protected, storage.modifier.abstract, storage.modifier.readonly, storage.modifier.override, storage.modifier.final | #DDB840 | italic |
| keyword.operator, keyword.operator.arithmetic, keyword.operator.assignment, keyword.operator.comparison, keyword.operator.logical, keyword.operator.bitwise, keyword.operator.ternary, keyword.operator.spread, keyword.operator.rest, keyword.operator.optional, keyword.operator.nullish, keyword.operator.pipe | #DDD0B8 | — |
| punctuation, punctuation.separator, punctuation.terminator, punctuation.accessor, meta.delimiter, punctuation.definition.parameters, punctuation.definition.block, punctuation.definition.array | #C0B098 | — |
| constant.numeric, constant.numeric.integer, constant.numeric.float, constant.numeric.hex, constant.numeric.binary, constant.numeric.octal, constant.numeric.scientific | #A0CC8C | — |
| constant.language, constant.language.boolean, constant.language.null, constant.language.undefined, constant.language.nan, constant.language.infinity | #F0B828 | — |
| constant.other, constant.other.enum, constant.other.caps, variable.other.constant, variable.other.enummember | #E0D080 | — |
| support.constant, support.constant.math, support.constant.dom, support.constant.json | #E0D080 | — |
| entity.name.function, entity.name.method, entity.name.constructor, meta.definition.method, meta.definition.function | #FF8C5A | — |
| meta.function-call, meta.function-call.generic, variable.function, support.function | #FF8C5A | — |
| support.function.builtin, support.function.magic | #FFA06A | — |
| entity.name.function.member, support.function.method | #FF8C5A | — |
| entity.name.type, entity.name.class, entity.name.interface, entity.name.enum, entity.name.namespace, entity.name.struct, entity.name.trait, entity.name.impl, entity.name.module | #5ED4D4 | — |
| entity.name.type.alias, entity.name.type.instance, meta.type.annotation, support.type, support.class | #5ED4D4 | — |
| entity.other.inherited-class | #5ED4D4 | italic |
| entity.name.type.parameter, variable.type.parameter, meta.type.parameters | #D4BAEC | — |
| storage.type.primitive, support.type.primitive, keyword.type, entity.name.type.numeric, support.type.builtin | #5ED4D4 | — |
| variable, variable.other, variable.other.readwrite, variable.other.object, variable.other.local | #EDD9B8 | — |
| variable.other.constant, variable.other.constant.object | #DDD0A8 | — |
| variable.language, variable.language.this, variable.language.self, variable.language.super, variable.language.arguments, variable.language.special | #F0B828 | italic |
| variable.parameter, variable.parameter.function | #D4BAEC | — |
| variable.other.property, variable.other.object.property, support.variable.property, meta.object-literal.key | #EDD9B8 | — |
| variable.other.member, variable.other.readwrite.member | #B8C8D8 | — |
| entity.name.tag, entity.name.tag.html, entity.name.tag.xml, entity.name.tag.js.jsx, entity.name.tag.tsx | #7AB8E8 | — |
| entity.other.attribute-name, entity.other.attribute-name.html, entity.other.attribute-name.id, entity.other.attribute-name.class, entity.other.attribute-name.event, meta.attribute | #E0BC8A | — |
| punctuation.definition.tag, punctuation.definition.tag.begin, punctuation.definition.tag.end, punctuation.separator.key-value.html | #5A8AAA | — |
| punctuation.section.embedded, meta.jsx.children | #E8DDD0 | — |
| entity.other.attribute-name.class.css, entity.other.attribute-name.id.css, entity.other.attribute-name.pseudo-class.css, entity.other.attribute-name.pseudo-element.css | #D4A017 | — |
| support.type.property-name, support.type.property-name.css, support.type.property-name.media | #7AA2C8 | — |
| support.constant.property-value, support.constant.font-name, support.constant.color | #E8A87C | — |
| keyword.other.unit, keyword.other.unit.css | #8DB07B | — |
| keyword.control.at-rule, keyword.control.at-rule.media, keyword.control.at-rule.import, keyword.control.at-rule.keyframes | #D4A017 | — |
| variable.css | #C3A6D4 | — |
| meta.decorator, entity.name.function.decorator, punctuation.definition.decorator, storage.type.annotation, entity.name.type.annotation | #B8A0DC | italic |
| punctuation.decorator, keyword.decorator | #B8A0DC | — |
| string.quoted.double.import, string.quoted.single.import, meta.import string, module.imports | #C8987A | — |
| markup.heading, entity.name.section.markdown, punctuation.definition.heading | #FFB87A | bold |
| markup.bold | #E8DDD0 | bold |
| markup.italic | #E8DDD0 | italic |
| markup.inline.raw, markup.raw.inline | #5ED4D4 | — |
| markup.raw.block | #C8B89A | — |
| markup.underline.link, string.other.link.title.markdown | #7AB8E8 | — |
| meta.link.inline.description.markdown | #E8DDD0 | — |
| markup.quote | #9A8E85 | italic |
| punctuation.definition.list.begin.markdown | #D4A017 | — |
| meta.separator.markdown | #6A5E52 | — |
| fenced_code.block.language | #8DB07B | — |
| support.type.property-name.json, string.json meta.structure, source.json meta.mapping.key string | #7AB8E8 | — |
| constant.language.json | #F0B828 | — |
| entity.name.tag.yaml, support.type.property-name.yaml | #7AB8E8 | — |
| entity.name.type.anchor.yaml, variable.other.alias.yaml | #D4BAEC | — |
| support.function.magic.python, entity.name.function.magic.python | #FF8C5A | italic |
| variable.parameter.function.language.python | #F0B828 | italic |
| string.interpolated.python | #FFC88A | — |
| meta.function.parameters.annotation.python | #5ED4D4 | — |
| support.function.builtin.python | #FFA06A | — |
| storage.modifier.lifetime.rust, entity.name.type.lifetime.rust | #D4BAEC | — |
| entity.name.function.macro.rust, meta.macro.rust | #FFB87A | — |
| keyword.other.unsafe.rust | #C87070 | bold |
| comment.line.number-sign.shell | #8A7E75 | italic |
| support.function.builtin.shell | #E07B54 | — |
| variable.other.normal.shell | #D4C5A9 | — |
| invalid.illegal | #C87070 | — |
| invalid.deprecated | #8A7E75 | strikethrough |
| meta.preprocessor, keyword.control.directive, punctuation.definition.directive | #C8A040 | — |
| meta.diff.header, meta.diff.range | #7AA2C8 | — |
| markup.inserted | #8DB07B | — |
| markup.deleted | #C87070 | — |
| markup.changed | #D4A017 | — |
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}!`;
}