Fresh Start
Publisher: Brihi Ilyes ImadThemes in package: 1
A clean dark theme for VS Code with refined syntax highlighting for Go, Python, TypeScript, JavaScript, JSON, and YAML
A clean dark theme for VS Code with refined syntax highlighting for Go, Python, TypeScript, JavaScript, JSON, and YAML
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 |
|---|---|---|
| keyword.package.go, keyword.control.import.go, keyword.type.go, keyword.var.go, keyword.const.go, keyword.interface.go, keyword.struct.go, keyword.function.go, keyword.control.go, keyword.channel.go, keyword.map.go | #d9a4ffff | normal |
| entity.name.type.go, entity.name.function.go, entity.name.type.any.go, entity.name.type.comparable.go | #fcc060ff | normal |
| entity.name.function.support.go, entity.name.function.support.builtin.go | #7fa1ffff | normal |
| entity.name.import.go, entity.name.type.package.go, variable.other.import.go | #ffcea8ff | normal |
| storage.type.numeric.go, storage.type.string.go, storage.type.boolean.go, storage.type.byte.go, storage.type.error.go, storage.type.rune.go, storage.type.uintptr.go | #60ffa5ff | normal |
| comment.line.double-slash.go, comment.block.go | #75787cff | italic |
| string.quoted.double.go, string.quoted.raw.go, string.quoted.rune.go, constant.character.escape.go, constant.other.placeholder.go | #d9ffb2e9 | — |
| constant.numeric.decimal.go, constant.numeric.hexadecimal.go, constant.numeric.octal.go, constant.numeric.binary.go, constant.language.boolean.go, constant.language.null.go, constant.language.iota.go, constant.numeric.decimal.point.go | #fcbc92ff | — |
| variable.other.constant.go, variable.other.assignment.go, variable.other.property.go, variable.other.go | #e9ecefff | — |
| variable.other.label.go | #ffd5fcff | — |
| keyword.operator.address.go, keyword.operator.channel.go, keyword.operator.decrement.go, keyword.operator.increment.go, keyword.operator.comparison.go, keyword.operator.logical.go, keyword.operator.assignment.go, keyword.operator.arithmetic.go, keyword.operator.arithmetic.bitwise.go, keyword.operator.ellipsis.go, punctuation.terminator.go, punctuation.other.period.go, punctuation.other.comma.go, punctuation.other.colon.go | #c5ffedff | — |
| support.type.property-name.json | #fcc060ff | |
| punctuation.definition.string.begin.json, punctuation.definition.string.end.json | #d9ffb2e9 | normal |
| string.quoted.double.json | #d9ffb2e9 | — |
| constant.numeric.json | #fcbc92ff | — |
| constant.language.boolean.json | #fcbc92ff | — |
| constant.language.null.json | #fcbc92ff | — |
| punctuation.separator.key-value.json, punctuation.separator.array.json, punctuation.separator.dictionary.pair.json | #c5ffedff | — |
| keyword.control.flow.python, keyword.control.import.python, storage.modifier.declaration.python, storage.type.class.python, storage.type.function.python, storage.type.function.async.python, storage.type.function.lambda.python, keyword.operator.logical.python | #d9a4ffff | normal |
| entity.name.type.class | #fcc060ff | normal |
| entity.name.function, meta.function.lambda.parameters.python, meta.lambda-function.python, support.function.magic.python | #7fa1ffff | normal |
| entity.name.namespace | #ffcea8ff | normal |
| comment.line.number-sign.python, punctuation.definition.comment | #75787cff | italic |
| string.quoted.single.python, punctuation.definition.string.begin.python, punctuation.definition.string.end.python, string.quoted.single.python, string.interpolated.python, storage.type.string.python | #d9ffb2e9 | — |
| string.quoted.docstring.multi.python, string.quoted.docstring.single.python | #c3d2b5e9 | italic |
| constant.numeric, constant.language.boolean, constant.language.null, constant.language, support.constant | #fcbc92ff | — |
| meta.function.parameters.python, meta.function.python, meta.fstring.python | #e9ecefff | — |
| support.variable.magic.python, variable.parameter.function.language.special.self.python | #ffd5fcff | — |
| punctuation.separator, meta.function.python, punctuation.section.class.begin.python, keyword.operator.arithmetic.python, meta.lambda-function.python, keyword.operator.assignment.python, keyword.operator.comparison.python, keyword.operator.bitwise.python, keyword.operator.unpacking.parameter.python | #c5ffedff | — |
| keyword.control, keyword.control.import.ts, keyword.control.from.ts, keyword.control.export.ts, keyword.control.as.ts, keyword.control.type.ts, keyword.control.default.ts, keyword.control.import.ts, keyword.control.export.ts, keyword.control.from.ts, keyword.operator, keyword.operator.new, storage.type, storage.type.ts, storage.type.class.ts, storage.type.interface.ts, storage.type.enum.ts, storage.type.type.ts, storage.type.function, storage.type.namespace.ts, storage.modifier, storage.modifier.ts, storage.modifier.async.ts, storage.modifier.public.ts, storage.modifier.private.ts, storage.modifier.protected.ts, storage.modifier.static.ts, storage.modifier.readonly.ts, storage.modifier.export.ts, storage.modifier.default.ts, storage.modifier.declare.ts, storage.modifier.abstract.ts, storage.modifier.override.ts, storage.modifier.optional.ts, storage.type.js, storage.type.ts, keyword.control.js, keyword.control.import.js, keyword.control.from.js, keyword.control.export.js, keyword.control.as.js, keyword.control.type.js, keyword.control.default.js, keyword.operator.js, storage.modifier.js, storage.modifier.async.js, storage.modifier.public.js, storage.modifier.private.js, storage.modifier.protected.js, storage.modifier.static.js, storage.modifier.readonly.js, storage.modifier.export.js, storage.modifier.default.js, storage.modifier.declare.js, storage.modifier.abstract.js, storage.modifier.override.js, storage.modifier.optional.js, storage.type.class.js | #d9a4ffff | normal |
| entity.name.type, entity.name.type.ts, entity.name.type.class, entity.name.type.enum, entity.name.type.interface, entity.name.type.module.ts, entity.name.type.alias.ts, entity.name.function.ts, entity.other.inherited-class.ts, entity.name.type.js, entity.name.type.class.js, entity.name.type.enum.js, entity.name.type.interface.js, entity.name.type.module.js, entity.name.type.alias.js, entity.name.function.js, entity.other.inherited-class.js | #fcc060ff | normal |
| entity.name.function.member, entity.name.function.member.ts, entity.name.function.member.js | #7fa1ffff | normal |
| variable.other.readwrite.alias.ts, meta.import.ts, meta.block.ts, meta.export.ts, variable.other.import.ts, variable.other.readwrite.alias.js, meta.import.js, meta.block.js, meta.export.js, variable.other.import.js | #ffcea8ff | normal |
| support.type.primitive.ts, support.type.builtin.ts, support.type.object.ts, support.type.array.ts, support.type.boolean.ts, support.type.string.ts, support.type.number.ts, entity.name.type.parameter, support.type.primitive.js, support.type.builtin.js, support.type.object.js, support.type.array.js, support.type.boolean.js, support.type.string.js, support.type.number.js, entity.name.type.parameter.js | #60ffa5ff | normal |
| comment.line.double-slash.ts, comment.block.ts, comment.block.documentation.ts, punctuation.definition.comment.ts, comment.line.double-slash.js, comment.block.js, comment.block.documentation.js, punctuation.definition.comment.js | #75787cff | italic |
| string.quoted.single.ts, string.quoted.double.ts, string.template.ts, string.quoted.single.js, string.quoted.double.js, string.template.js, entity.name.function.tagged-template.ts, entity.name.function.tagged-template.js, punctuation.definition.string.begin.ts, punctuation.definition.string.end.ts, punctuation.definition.string.begin.js, punctuation.definition.string.end.js, string.regexp.ts, string.regexp.js | #d9ffb2e9 | — |
| constant.numeric.ts, constant.language.boolean.ts, constant.language.null.ts, constant.language.undefined.ts, constant.numeric.js, constant.language.boolean.js, constant.language.null.js, constant.language.undefined.js, punctuation.definition.template-expression.begin.ts, punctuation.definition.template-expression.end.ts, punctuation.definition.template-expression.begin.js, punctuation.definition.template-expression.end.js, keyword.operator.quantifier.regexp, keyword.operator.anchor.regexp, keyword.control.anchor.regexp, keyword.control.assertion.regexp, constant.character.escape.ts, constant.character.escape.js | #fcbc92ff | — |
| variable.other.readwrite.ts, variable.other.readwrite.js, variable.other.object.ts, variable.other.object.js, variable.other.property.ts, variable.other.property.js, entity.name.type.module.js | #e9ecefff | — |
| variable.language.this.ts, variable.language.super.ts, variable.language.this.js, variable.language.super.js, support.class.ts, support.class.js, support.class.promise.ts, support.class.promise.js, support.constant.property.ts, support.constant.property.js, support.function.ts, support.function.js, variable.other.standard, constant.character.escape.backslash.regexp, constant.other.character-class.range.regexp, constant.other.character-class.set.regexp | #ffd5fcff | — |
| keyword.operator.arithmetic.ts, keyword.operator.assignment.ts, keyword.operator.comparison.ts, keyword.operator.logical.ts, keyword.operator.bitwise.ts, keyword.operator.ternary.ts, punctuation.separator.ts, punctuation.terminator.ts, punctuation.definition.array.ts, punctuation.definition.object.ts, keyword.operator.arithmetic.js, keyword.operator.assignment.js, keyword.operator.comparison.js, keyword.operator.logical.js, keyword.operator.bitwise.js, keyword.operator.ternary.js, punctuation.separator.js, punctuation.terminator.js, punctuation.definition.array.js, punctuation.definition.object.js, punctuation.terminator.statement.ts, punctuation.terminator.statement.js, keyword.operator.type.ts, keyword.operator.type.js, keyword.operator.type.annotation.ts, keyword.operator.type.annotation.js, punctuation.definition.typeparameters.begin.ts, punctuation.definition.typeparameters.end.ts, punctuation.definition.typeparameters.begin.js, punctuation.definition.typeparameters.end.js, keyword.operator.assignment.ts, keyword.operator.comparison.ts, keyword.operator.logical.ts, keyword.operator.bitwise.ts, keyword.operator.ternary.ts, punctuation.separator.ts, punctuation.terminator.ts, punctuation.definition.array.ts, punctuation.definition.object.ts, keyword.operator.assignment.js, keyword.operator.comparison.js, keyword.operator.logical.js, keyword.operator.bitwise.js, keyword.operator.ternary.js, punctuation.separator.js, punctuation.terminator.js, punctuation.definition.array.js, punctuation.definition.object.js, storage.type.function.arrow.ts, storage.type.function.arrow.js, keyword.operator.assignment.compound.ts, keyword.operator.assignment.compound.js, keyword.operator.relational.ts, keyword.operator.relational.js, keyword.operator.bitwise.shift.ts, keyword.operator.bitwise.shift.js, punctuation.accessor.optional.ts, punctuation.accessor.optional.js, keyword.operator.increment.ts, keyword.operator.increment.js, keyword.operator.decrement.ts, keyword.operator.decrement.js, punctuation.definition.block.tag.jsdoc, keyword.operator.rest.ts, keyword.operator.rest.js, keyword.operator.spread.ts, keyword.operator.spread.js | #c5ffedff | — |
| entity.name.tag.yaml | #fcc060ff | normal |
| constant.language.null.yaml, constant.other.timestamp.yaml, constant.language.boolean.yaml | #ffd5fcff | — |
| comment.line.number-sign.yaml, punctuation.definition.comment.yaml | #75787cff | italic |
| string.quoted.single.yaml, string.quoted.double.yaml, string.unquoted.plain.out.yaml, string.unquoted.plain.in.yaml, string.unquoted.block.yaml, constant.character.escape.yaml, punctuation.definition.string.begin.yaml, punctuation.definition.string.end.yaml | #d9ffb2e9 | — |
| constant.numeric.integer.yaml, constant.numeric.float.yaml | #fcbc92ff | — |
| entity.name.type, variable.other.alias.yaml, variable.other.anchor.yaml, keyword.other.directive.yaml.yaml | #60ffa5ff | — |
| punctuation.separator.key-value.mapping.yaml, punctuation.separator.sequence.yaml, punctuation.separator.entry.yaml, punctuation.definition.alias.yaml, punctuation.definition.anchor.yaml, punctuation.definition.block.sequence.item.yaml, punctuation.definition.directive.begin.yaml, keyword.operator.directive.yaml, keyword.operator.anchor.yaml, keyword.operator.alias.yaml, keyword.control.flow.block-scalar.folded.yaml, keyword.control.flow.block-scalar.literal.yaml, keyword.control.property.anchor.yaml, keyword.control.flow.alias.yaml, meta.block-mapping.yaml, constant.language.merge.yaml, entity.other.document.begin.yaml, entity.other.document.end.yaml | #c5ffedff | — |
| storage.type | #7fa1ffff | — |
| keyword.package.go, keyword.control.import.go, keyword.type.go, keyword.var.go, keyword.const.go, keyword.interface.go, keyword.struct.go, keyword.function.go, keyword.control.go, keyword.channel.go, keyword.map.go | #d9a4ffff | normal |
| entity.name.type.go, entity.name.function.go, entity.name.type.any.go, entity.name.type.comparable.go | #fcc060ff | normal |
| entity.name.function.support.go, entity.name.function.support.builtin.go | #7fa1ffff | normal |
| entity.name.import.go, entity.name.type.package.go, variable.other.import.go | #ffcea8ff | normal |
| storage.type.numeric.go, storage.type.string.go, storage.type.boolean.go, storage.type.byte.go, storage.type.error.go, storage.type.rune.go, storage.type.uintptr.go | #60ffa5ff | normal |
| comment.line.double-slash.go, comment.block.go | #75787cff | italic |
| string.quoted.double.go, string.quoted.raw.go, string.quoted.rune.go, constant.character.escape.go, constant.other.placeholder.go | #d9ffb2e9 | — |
| constant.numeric.decimal.go, constant.numeric.hexadecimal.go, constant.numeric.octal.go, constant.numeric.binary.go, constant.language.boolean.go, constant.language.null.go, constant.language.iota.go, constant.numeric.decimal.point.go | #fcbc92ff | — |
| variable.other.constant.go, variable.other.assignment.go, variable.other.property.go, variable.other.go | #e9ecefff | — |
| variable.other.label.go | #ffd5fcff | — |
| keyword.operator.address.go, keyword.operator.channel.go, keyword.operator.decrement.go, keyword.operator.increment.go, keyword.operator.comparison.go, keyword.operator.logical.go, keyword.operator.assignment.go, keyword.operator.arithmetic.go, keyword.operator.arithmetic.bitwise.go, keyword.operator.ellipsis.go, punctuation.terminator.go, punctuation.other.period.go, punctuation.other.comma.go, punctuation.other.colon.go | #c5ffedff | — |
| support.type.property-name.json | #fcc060ff | |
| punctuation.definition.string.begin.json, punctuation.definition.string.end.json | #d9ffb2e9 | normal |
| string.quoted.double.json | #d9ffb2e9 | — |
| constant.numeric.json | #fcbc92ff | — |
| constant.language.boolean.json | #fcbc92ff | — |
| constant.language.null.json | #fcbc92ff | — |
| punctuation.separator.key-value.json, punctuation.separator.array.json, punctuation.separator.dictionary.pair.json | #c5ffedff | — |
| keyword.control.flow.python, keyword.control.import.python, storage.modifier.declaration.python, storage.type.class.python, storage.type.function.python, storage.type.function.async.python, storage.type.function.lambda.python, keyword.operator.logical.python | #d9a4ffff | normal |
| entity.name.type.class | #fcc060ff | normal |
| entity.name.function, meta.function.lambda.parameters.python, meta.lambda-function.python, support.function.magic.python | #7fa1ffff | normal |
| entity.name.namespace | #ffcea8ff | normal |
| comment.line.number-sign.python, punctuation.definition.comment | #75787cff | italic |
| string.quoted.single.python, punctuation.definition.string.begin.python, punctuation.definition.string.end.python, string.quoted.single.python, string.interpolated.python, storage.type.string.python | #d9ffb2e9 | — |
| string.quoted.docstring.multi.python, string.quoted.docstring.single.python | #c3d2b5e9 | italic |
| constant.numeric, constant.language.boolean, constant.language.null, constant.language, support.constant | #fcbc92ff | — |
| meta.function.parameters.python, meta.function.python, meta.fstring.python | #e9ecefff | — |
| support.variable.magic.python, variable.parameter.function.language.special.self.python | #ffd5fcff | — |
| punctuation.separator, meta.function.python, punctuation.section.class.begin.python, keyword.operator.arithmetic.python, meta.lambda-function.python, keyword.operator.assignment.python, keyword.operator.comparison.python, keyword.operator.bitwise.python, keyword.operator.unpacking.parameter.python | #c5ffedff | — |
| keyword.control, keyword.control.import.ts, keyword.control.from.ts, keyword.control.export.ts, keyword.control.as.ts, keyword.control.type.ts, keyword.control.default.ts, keyword.control.import.ts, keyword.control.export.ts, keyword.control.from.ts, keyword.operator, keyword.operator.new, storage.type, storage.type.ts, storage.type.class.ts, storage.type.interface.ts, storage.type.enum.ts, storage.type.type.ts, storage.type.function, storage.type.namespace.ts, storage.modifier, storage.modifier.ts, storage.modifier.async.ts, storage.modifier.public.ts, storage.modifier.private.ts, storage.modifier.protected.ts, storage.modifier.static.ts, storage.modifier.readonly.ts, storage.modifier.export.ts, storage.modifier.default.ts, storage.modifier.declare.ts, storage.modifier.abstract.ts, storage.modifier.override.ts, storage.modifier.optional.ts, storage.type.js, storage.type.ts, keyword.control.js, keyword.control.import.js, keyword.control.from.js, keyword.control.export.js, keyword.control.as.js, keyword.control.type.js, keyword.control.default.js, keyword.operator.js, storage.modifier.js, storage.modifier.async.js, storage.modifier.public.js, storage.modifier.private.js, storage.modifier.protected.js, storage.modifier.static.js, storage.modifier.readonly.js, storage.modifier.export.js, storage.modifier.default.js, storage.modifier.declare.js, storage.modifier.abstract.js, storage.modifier.override.js, storage.modifier.optional.js, storage.type.class.js | #d9a4ffff | normal |
| entity.name.type, entity.name.type.ts, entity.name.type.class, entity.name.type.enum, entity.name.type.interface, entity.name.type.module.ts, entity.name.type.alias.ts, entity.name.function.ts, entity.other.inherited-class.ts, entity.name.type.js, entity.name.type.class.js, entity.name.type.enum.js, entity.name.type.interface.js, entity.name.type.module.js, entity.name.type.alias.js, entity.name.function.js, entity.other.inherited-class.js | #fcc060ff | normal |
| entity.name.function.member, entity.name.function.member.ts, entity.name.function.member.js | #7fa1ffff | normal |
| variable.other.readwrite.alias.ts, meta.import.ts, meta.block.ts, meta.export.ts, variable.other.import.ts, variable.other.readwrite.alias.js, meta.import.js, meta.block.js, meta.export.js, variable.other.import.js | #ffcea8ff | normal |
| support.type.primitive.ts, support.type.builtin.ts, support.type.object.ts, support.type.array.ts, support.type.boolean.ts, support.type.string.ts, support.type.number.ts, entity.name.type.parameter, support.type.primitive.js, support.type.builtin.js, support.type.object.js, support.type.array.js, support.type.boolean.js, support.type.string.js, support.type.number.js, entity.name.type.parameter.js | #60ffa5ff | normal |
| comment.line.double-slash.ts, comment.block.ts, comment.block.documentation.ts, punctuation.definition.comment.ts, comment.line.double-slash.js, comment.block.js, comment.block.documentation.js, punctuation.definition.comment.js | #75787cff | italic |
| string.quoted.single.ts, string.quoted.double.ts, string.template.ts, string.quoted.single.js, string.quoted.double.js, string.template.js, entity.name.function.tagged-template.ts, entity.name.function.tagged-template.js, punctuation.definition.string.begin.ts, punctuation.definition.string.end.ts, punctuation.definition.string.begin.js, punctuation.definition.string.end.js, string.regexp.ts, string.regexp.js | #d9ffb2e9 | — |
| constant.numeric.ts, constant.language.boolean.ts, constant.language.null.ts, constant.language.undefined.ts, constant.numeric.js, constant.language.boolean.js, constant.language.null.js, constant.language.undefined.js, punctuation.definition.template-expression.begin.ts, punctuation.definition.template-expression.end.ts, punctuation.definition.template-expression.begin.js, punctuation.definition.template-expression.end.js, keyword.operator.quantifier.regexp, keyword.operator.anchor.regexp, keyword.control.anchor.regexp, keyword.control.assertion.regexp, constant.character.escape.ts, constant.character.escape.js | #fcbc92ff | — |
| variable.other.readwrite.ts, variable.other.readwrite.js, variable.other.object.ts, variable.other.object.js, variable.other.property.ts, variable.other.property.js, entity.name.type.module.js | #e9ecefff | — |
| variable.language.this.ts, variable.language.super.ts, variable.language.this.js, variable.language.super.js, support.class.ts, support.class.js, support.class.promise.ts, support.class.promise.js, support.constant.property.ts, support.constant.property.js, support.function.ts, support.function.js, variable.other.standard, constant.character.escape.backslash.regexp, constant.other.character-class.range.regexp, constant.other.character-class.set.regexp | #ffd5fcff | — |
| keyword.operator.arithmetic.ts, keyword.operator.assignment.ts, keyword.operator.comparison.ts, keyword.operator.logical.ts, keyword.operator.bitwise.ts, keyword.operator.ternary.ts, punctuation.separator.ts, punctuation.terminator.ts, punctuation.definition.array.ts, punctuation.definition.object.ts, keyword.operator.arithmetic.js, keyword.operator.assignment.js, keyword.operator.comparison.js, keyword.operator.logical.js, keyword.operator.bitwise.js, keyword.operator.ternary.js, punctuation.separator.js, punctuation.terminator.js, punctuation.definition.array.js, punctuation.definition.object.js, punctuation.terminator.statement.ts, punctuation.terminator.statement.js, keyword.operator.type.ts, keyword.operator.type.js, keyword.operator.type.annotation.ts, keyword.operator.type.annotation.js, punctuation.definition.typeparameters.begin.ts, punctuation.definition.typeparameters.end.ts, punctuation.definition.typeparameters.begin.js, punctuation.definition.typeparameters.end.js, keyword.operator.assignment.ts, keyword.operator.comparison.ts, keyword.operator.logical.ts, keyword.operator.bitwise.ts, keyword.operator.ternary.ts, punctuation.separator.ts, punctuation.terminator.ts, punctuation.definition.array.ts, punctuation.definition.object.ts, keyword.operator.assignment.js, keyword.operator.comparison.js, keyword.operator.logical.js, keyword.operator.bitwise.js, keyword.operator.ternary.js, punctuation.separator.js, punctuation.terminator.js, punctuation.definition.array.js, punctuation.definition.object.js, storage.type.function.arrow.ts, storage.type.function.arrow.js, keyword.operator.assignment.compound.ts, keyword.operator.assignment.compound.js, keyword.operator.relational.ts, keyword.operator.relational.js, keyword.operator.bitwise.shift.ts, keyword.operator.bitwise.shift.js, punctuation.accessor.optional.ts, punctuation.accessor.optional.js, keyword.operator.increment.ts, keyword.operator.increment.js, keyword.operator.decrement.ts, keyword.operator.decrement.js, punctuation.definition.block.tag.jsdoc, keyword.operator.rest.ts, keyword.operator.rest.js, keyword.operator.spread.ts, keyword.operator.spread.js | #c5ffedff | — |
| entity.name.tag.yaml | #fcc060ff | normal |
| constant.language.null.yaml, constant.other.timestamp.yaml, constant.language.boolean.yaml | #ffd5fcff | — |
| comment.line.number-sign.yaml, punctuation.definition.comment.yaml | #75787cff | italic |
| string.quoted.single.yaml, string.quoted.double.yaml, string.unquoted.plain.out.yaml, string.unquoted.plain.in.yaml, string.unquoted.block.yaml, constant.character.escape.yaml, punctuation.definition.string.begin.yaml, punctuation.definition.string.end.yaml | #d9ffb2e9 | — |
| constant.numeric.integer.yaml, constant.numeric.float.yaml | #fcbc92ff | — |
| entity.name.type, variable.other.alias.yaml, variable.other.anchor.yaml, keyword.other.directive.yaml.yaml | #60ffa5ff | — |
| punctuation.separator.key-value.mapping.yaml, punctuation.separator.sequence.yaml, punctuation.separator.entry.yaml, punctuation.definition.alias.yaml, punctuation.definition.anchor.yaml, punctuation.definition.block.sequence.item.yaml, punctuation.definition.directive.begin.yaml, keyword.operator.directive.yaml, keyword.operator.anchor.yaml, keyword.operator.alias.yaml, keyword.control.flow.block-scalar.folded.yaml, keyword.control.flow.block-scalar.literal.yaml, keyword.control.property.anchor.yaml, keyword.control.flow.alias.yaml, meta.block-mapping.yaml, constant.language.merge.yaml, entity.other.document.begin.yaml, entity.other.document.end.yaml | #c5ffedff | — |
| storage.type | #7fa1ffff | — |
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}!`;
}