Dark GT Theme
A collection of themes with github default dark theme
A collection of themes with github default dark theme
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 |
|---|---|---|
| emphasis | — | italic |
| strong | — | bold |
| header | #BD93F9 | — |
| meta.diff, meta.diff.header | #6272A4 | — |
| markup.inserted | #50FA7B | — |
| markup.deleted | #FF5555 | — |
| markup.changed | #FFB86C | — |
| invalid | #FF5555 | underline italic |
| invalid.deprecated | #F8F8F2 | underline italic |
| entity.name.filename | #F1FA8C | — |
| markup.error | #FF5555 | — |
| markup.underline | — | underline |
| markup.bold | #FFB86C | bold |
| markup.heading | #BD93F9 | bold |
| markup.italic | #F1FA8C | italic |
| beginning.punctuation.definition.list.markdown, beginning.punctuation.definition.quote.markdown, punctuation.definition.link.restructuredtext | #8BE9FD | — |
| markup.inline.raw, markup.raw.restructuredtext | #50FA7B | — |
| markup.underline.link, markup.underline.link.image | #8BE9FD | — |
| meta.link.reference.def.restructuredtext, punctuation.definition.directive.restructuredtext, string.other.link.description, string.other.link.title | #FF79C6 | — |
| entity.name.directive.restructuredtext, markup.quote | #F1FA8C | italic |
| meta.separator.markdown | #6272A4 | — |
| fenced_code.block.language, markup.raw.inner.restructuredtext, markup.fenced_code.block.markdown punctuation.definition.markdown | #50FA7B | — |
| punctuation.definition.constant.restructuredtext | #BD93F9 | — |
| markup.heading.markdown punctuation.definition.string.begin, markup.heading.markdown punctuation.definition.string.end | #BD93F9 | — |
| meta.paragraph.markdown punctuation.definition.string.begin, meta.paragraph.markdown punctuation.definition.string.end | #F8F8F2 | — |
| markup.quote.markdown meta.paragraph.markdown punctuation.definition.string.begin, markup.quote.markdown meta.paragraph.markdown punctuation.definition.string.end | #F1FA8C | — |
| entity.name.type.class, entity.name.class | #8BE9FD | |
| keyword.expressions-and-types.swift, keyword.other.this, variable.language, variable.language punctuation.definition.variable.php, variable.other.readwrite.instance.ruby, variable.parameter.function.language.special | #BD93F9 | italic |
| entity.other.inherited-class | #8BE9FD | italic |
| comment, punctuation.definition.comment, unused.comment, wildcard.comment | #6272A4 | — |
| comment keyword.codetag.notation, comment.block.documentation keyword, comment.block.documentation storage.type.class | #FF79C6 | — |
| comment.block.documentation entity.name.type | #8BE9FD | italic |
| comment.block.documentation entity.name.type punctuation.definition.bracket | #8BE9FD | — |
| comment.block.documentation variable | #FFB86C | italic |
| constant, variable.other.constant | #BD93F9 | — |
| constant.character.escape, constant.character.string.escape, constant.regexp | #FF79C6 | — |
| entity.name.tag | #FF79C6 | — |
| entity.other.attribute-name.parent-selector | #FF79C6 | — |
| entity.other.attribute-name | #50FA7B | italic |
| entity.name.function, meta.function-call.object, meta.function-call.php, meta.function-call.static, meta.method-call.java meta.method, meta.method.groovy, support.function.any-method.lua, keyword.operator.function.infix | #50FA7B | — |
| entity.name.variable.parameter, meta.at-rule.function variable, meta.at-rule.mixin variable, meta.function.arguments variable.other.php, meta.selectionset.graphql meta.arguments.graphql variable.arguments.graphql, variable.parameter | #FFB86C | italic |
| meta.decorator variable.other.readwrite, meta.decorator variable.other.property | #50FA7B | italic |
| meta.decorator variable.other.object | #50FA7B | — |
| keyword, punctuation.definition.keyword | #FF79C6 | — |
| keyword.control.new, keyword.operator.new | — | bold |
| meta.selector | #FF79C6 | — |
| support | #8BE9FD | italic |
| support.function.magic, support.variable, variable.other.predefined | #BD93F9 | |
| support.function, support.type.property-name | — | |
| constant.other.symbol.hashkey punctuation.definition.constant.ruby, entity.other.attribute-name.placeholder punctuation, entity.other.attribute-name.pseudo-class punctuation, entity.other.attribute-name.pseudo-element punctuation, meta.group.double.toml, meta.group.toml, meta.object-binding-pattern-variable punctuation.destructuring, punctuation.colon.graphql, punctuation.definition.block.scalar.folded.yaml, punctuation.definition.block.scalar.literal.yaml, punctuation.definition.block.sequence.item.yaml, punctuation.definition.entity.other.inherited-class, punctuation.function.swift, punctuation.separator.dictionary.key-value, punctuation.separator.hash, punctuation.separator.inheritance, punctuation.separator.key-value, punctuation.separator.key-value.mapping.yaml, punctuation.separator.namespace, punctuation.separator.pointer-access, punctuation.separator.slice, string.unquoted.heredoc punctuation.definition.string, support.other.chomping-indicator.yaml, punctuation.separator.annotation | #FF79C6 | — |
| keyword.operator.other.powershell, keyword.other.statement-separator.powershell, meta.brace.round, meta.function-call punctuation, punctuation.definition.arguments.begin, punctuation.definition.arguments.end, punctuation.definition.entity.begin, punctuation.definition.entity.end, punctuation.definition.tag.cs, punctuation.definition.type.begin, punctuation.definition.type.end, punctuation.section.scope.begin, punctuation.section.scope.end, storage.type.generic.java, string.template meta.brace, string.template punctuation.accessor | #F8F8F2 | — |
| meta.string-contents.quoted.double punctuation.definition.variable, punctuation.definition.interpolation.begin, punctuation.definition.interpolation.end, punctuation.definition.template-expression.begin, punctuation.definition.template-expression.end, punctuation.section.embedded.begin, punctuation.section.embedded.coffee, punctuation.section.embedded.end, punctuation.section.embedded.end source.php, punctuation.section.embedded.end source.ruby, punctuation.definition.variable.makefile | #FF79C6 | — |
| entity.name.function.target.makefile, entity.name.section.toml, entity.name.tag.yaml, variable.other.key.toml | #8BE9FD | — |
| constant.other.date, constant.other.timestamp | #FFB86C | — |
| variable.other.alias.yaml | #50FA7B | italic underline |
| storage, meta.implementation storage.type.objc, meta.interface-or-protocol storage.type.objc, source.groovy storage.type.def | #FF79C6 | |
| entity.name.type, keyword.primitive-datatypes.swift, keyword.type.cs, meta.protocol-list.objc, meta.return-type.objc, source.go storage.type, source.groovy storage.type, source.java storage.type, source.powershell entity.other.attribute-name, storage.class.std.rust, storage.type.attribute.swift, storage.type.c, storage.type.core.rust, storage.type.cs, storage.type.groovy, storage.type.objc, storage.type.php, storage.type.haskell, storage.type.ocaml | #8BE9FD | italic |
| entity.name.type.type-parameter, meta.indexer.mappedtype.declaration entity.name.type, meta.type.parameters entity.name.type | #FFB86C | — |
| storage.modifier | #FF79C6 | — |
| string.regexp, constant.other.character-class.set.regexp, constant.character.escape.backslash.regexp | #F1FA8C | — |
| punctuation.definition.group.capture.regexp | #FF79C6 | — |
| string.regexp punctuation.definition.string.begin, string.regexp punctuation.definition.string.end | #FF5555 | — |
| punctuation.definition.character-class.regexp | #8BE9FD | — |
| punctuation.definition.group.regexp | #FFB86C | — |
| punctuation.definition.group.assertion.regexp, keyword.operator.negation.regexp | #FF5555 | — |
| meta.assertion.look-ahead.regexp | #50FA7B | — |
| string | #F1FA8C | — |
| punctuation.definition.string.begin, punctuation.definition.string.end | #E9F284 | — |
| punctuation.support.type.property-name.begin, punctuation.support.type.property-name.end | #8BE9FE | — |
| string.quoted.docstring.multi, string.quoted.docstring.multi.python punctuation.definition.string.begin, string.quoted.docstring.multi.python punctuation.definition.string.end, string.quoted.docstring.multi.python constant.character.escape | #6272A4 | — |
| variable, constant.other.key.perl, support.variable.property, variable.other.constant.js, variable.other.constant.ts, variable.other.constant.tsx | #F8F8F2 | — |
| meta.import variable.other.readwrite, meta.object-binding-pattern-variable variable.object.property, meta.variable.assignment.destructured.object.coffee variable | #FFB86C | italic |
| meta.import variable.other.readwrite.alias, meta.export variable.other.readwrite.alias, meta.variable.assignment.destructured.object.coffee variable variable | #F8F8F2 | |
| meta.selectionset.graphql variable | #F1FA8C | — |
| meta.selectionset.graphql meta.arguments variable | #F8F8F2 | — |
| entity.name.fragment.graphql, variable.fragment.graphql | #8BE9FD | — |
| constant.other.symbol.hashkey.ruby, keyword.operator.dereference.java, keyword.operator.navigation.groovy, meta.scope.for-loop.shell punctuation.definition.string.begin, meta.scope.for-loop.shell punctuation.definition.string.end, meta.scope.for-loop.shell string, storage.modifier.import, punctuation.section.embedded.begin.tsx, punctuation.section.embedded.end.tsx, punctuation.section.embedded.begin.jsx, punctuation.section.embedded.end.jsx, punctuation.separator.list.comma.css, constant.language.empty-list.haskell | #F8F8F2 | — |
| source.shell variable.other | #BD93F9 | — |
| support.constant | #BD93F9 | |
| meta.scope.prerequisites.makefile | #F1FA8C | — |
| meta.attribute-selector.scss | #F1FA8C | — |
| punctuation.definition.attribute-selector.end.bracket.square.scss, punctuation.definition.attribute-selector.begin.bracket.square.scss | #F8F8F2 | — |
| meta.preprocessor.haskell | #6272A4 | — |
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 | #b8cfe680 | italic |
| string, constant.other.symbol | #d5ff80 | — |
| string.regexp, constant.character, constant.other | #95e6cb | — |
| constant.numeric | #dfbfff | — |
| constant.language | #dfbfff | — |
| variable, variable.parameter.function-call | #cccac2 | — |
| variable.member | #f28779 | — |
| variable.language | #5ccfe6 | italic |
| storage | #ffad66 | — |
| keyword | #ffad66 | — |
| keyword.operator | #f29e74 | — |
| punctuation.separator, punctuation.terminator | #cccac2b3 | — |
| punctuation.section | #cccac2 | — |
| punctuation.accessor | #f29e74 | — |
| punctuation.definition.template-expression | #ffad66 | — |
| punctuation.section.embedded | #ffad66 | — |
| meta.embedded | #cccac2 | — |
| source.java storage.type, source.haskell storage.type, source.c storage.type | #73d0ff | — |
| entity.other.inherited-class | #5ccfe6 | — |
| storage.type.function | #ffad66 | — |
| source.java storage.type.primitive | #5ccfe6 | — |
| entity.name.function | #ffd173 | — |
| variable.parameter, meta.parameter | #dfbfff | — |
| variable.function, variable.annotation, meta.function-call.generic, support.function.go | #ffd173 | — |
| support.function, support.macro | #f28779 | — |
| entity.name.import, entity.name.package | #d5ff80 | — |
| entity.name | #73d0ff | — |
| entity.name.tag, meta.tag.sgml | #5ccfe6 | — |
| support.class.component | #73d0ff | — |
| punctuation.definition.tag.end, punctuation.definition.tag.begin, punctuation.definition.tag | #5ccfe680 | — |
| entity.other.attribute-name | #ffd173 | — |
| support.constant | #f29e74 | italic |
| support.type, support.class, source.go storage.type | #5ccfe6 | — |
| meta.decorator variable.other, meta.decorator punctuation.decorator, storage.type.annotation | #ffdfb3 | — |
| invalid | #ff6666 | — |
| meta.diff, meta.diff.header | #c594c5 | — |
| source.ruby variable.other.readwrite | #ffd173 | — |
| source.css entity.name.tag, source.sass entity.name.tag, source.scss entity.name.tag, source.less entity.name.tag, source.stylus entity.name.tag | #73d0ff | — |
| source.css support.type, source.sass support.type, source.scss support.type, source.less support.type, source.stylus support.type | #b8cfe680 | — |
| support.type.property-name | #5ccfe6 | |
| constant.numeric.line-number.find-in-files - match | #b8cfe680 | — |
| constant.numeric.line-number.match | #ffad66 | — |
| entity.name.filename.find-in-files | #d5ff80 | — |
| message.error | #ff6666 | — |
| markup.heading, markup.heading entity.name | #d5ff80 | bold |
| markup.underline.link, string.other.link | #5ccfe6 | — |
| markup.italic | #f28779 | italic |
| markup.bold | #f28779 | bold |
| markup.italic markup.bold, markup.bold markup.italic | — | bold italic |
| markup.raw | — | — |
| markup.raw.inline | — | — |
| meta.separator | #b8cfe680 | bold |
| markup.quote | #95e6cb | italic |
| markup.list punctuation.definition.list.begin | #ffd173 | — |
| markup.inserted | #87d96c | — |
| markup.changed | #80bfff | — |
| markup.deleted | #f27983 | — |
| markup.strike | #ffdfb3 | — |
| markup.table | #5ccfe6 | — |
| text.html.markdown markup.inline.raw | #f29e74 | — |
| text.html.markdown meta.dummy.line-break | #b8cfe680 | — |
| punctuation.definition.markdown | #b8cfe680 | — |
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 |
|---|---|---|
| nothing.specific | #F8F8F2 | — |
| meta.embedded, source.groovy.embedded | #F8F8F2 | — |
| comment | #88846f | — |
| string | #E6DB74 | — |
| punctuation.definition.template-expression, punctuation.section.embedded | #F92672 | — |
| meta.template.expression | #F8F8F2 | — |
| constant.numeric | #AE81FF | — |
| constant.numeric.other.suffix, keyword.other.unit | #66D9EF | italic |
| constant.language | #AE81FF | — |
| constant.character, constant.other | #AE81FF | — |
| variable | #F8F8F2 | |
| entity.name.variable.enum-member | #AE81FF | — |
| keyword | #F92672 | — |
| keyword.other.var.cs, keyword.other.namespace, keyword.operator.arrow, keyword.other.class, keyword.other.enum, keyword.type, keyword.other.get, keyword.other.set | #66D9EF | italic |
| keyword.operator.null-conditional.cs | #F8F8F2 | — |
| storage | #F92672 | |
| storage.type | #66D9EF | italic |
| entity.name.type.namespace | #F8F8F2 | — |
| entity.name.type.namespace.declaration | #A6E22E | — |
| entity.name.type.type-parameter | #66D9EF | italic |
| entity.name.type, entity.name.class, entity.name.scope-resolution | #A6E22E | — |
| entity.other.inherited-class | #A6E22E | italic |
| entity.name.function | #A6E22E | |
| entity.name.function.invocation.cs | #66D9EF | — |
| variable.parameter, entity.name.variable.parameter | #FD971F | italic |
| entity.name.tag | #F92672 | |
| entity.other.attribute-name | #A6E22E | |
| punctuation.squarebracket.attribute | #F92672 | — |
| support.function | #66D9EF | |
| support.constant | #66D9EF | |
| support.type, support.class | #66D9EF | italic |
| support.other.variable | — | |
| meta.structure.dictionary.json string.quoted.double.json | #CFCFC2 | — |
| meta.diff, meta.diff.header | #75715E | — |
| markup.deleted | #F92672 | — |
| markup.inserted | #A6E22E | — |
| markup.changed | #E6DB74 | — |
| constant.numeric.line-number.find-in-files - match | #AE81FFA0 | — |
| entity.name.filename.find-in-files | #E6DB74 | — |
| markup.quote | #F92672 | — |
| markup.list | #E6DB74 | — |
| markup.bold, markup.italic | #66D9EF | — |
| markup.inline.raw | #FD971F | |
| markup.heading | #A6E22E | — |
| markup.heading.setext | #A6E22E | bold |
| markup.heading.markdown | — | bold |
| markup.quote.markdown | #75715E | italic |
| markup.bold.markdown | — | bold |
| string.other.link.title.markdown,string.other.link.description.markdown | #AE81FF | — |
| markup.underline.link.markdown,markup.underline.link.image.markdown | #E6DB74 | — |
| markup.italic.markdown | — | italic |
| markup.list.unnumbered.markdown, markup.list.numbered.markdown | #f8f8f2 | — |
| punctuation.definition.list.begin.markdown | #A6E22E | — |
| token.info-token | #6796e6 | — |
| token.warn-token | #cd9731 | — |
| token.error-token | #f44747 | — |
| token.debug-token | #b267e6 | — |
| variable.language, keyword.other.this, keyword.other.base, keyword.other.value | #FD971F | italic |
| entity.name.scope-resolution.function.call.cpp, entity.name.scope-resolution.cpp, keyword.operator.decrement.cpp, keyword.operator.increment.cpp, keyword.operator.assignment.cpp, keyword.operator.assignment.compound.cpp, keyword.operator.assignment.compound.bitwise.cpp, keyword.operator.bitwise.cpp, keyword.operator.bitwise.shift.cpp, keyword.operator.logical.cpp, keyword.operator.ternary.cpp, keyword.operator.cpp, storage.modifier.pointer.cpp, storage.modifier.reference.cpp, keyword.operator.comparison.cpp, entity.name.type.cpp, entity.name.type.parameter.cpp, variable.parameter.cpp | #F8F8F2 | |
| keyword.other.unit.suffix.integer.cpp, keyword.other.unit.suffix.floating-point.cpp | #AE81FF | |
| entity.name.function.call.cpp, entity.name.function.member.cpp | #66D9EF | |
| variable.parameter.preprocessor.c, entity.name.function.preprocessor.c, variable.parameter.probably.c, keyword.operator.decrement.c, keyword.operator.increment.c, keyword.operator.assignment.c, keyword.operator.assignment.compound.c, keyword.operator.assignment.compound.bitwise.c, keyword.operator.bitwise.c, keyword.operator.bitwise.shift.c, keyword.operator.logical.c, keyword.operator.ternary.c, keyword.operator.c, keyword.operator.comparison.c, variable.parameter.c | #F8F8F2 | |
| keyword.other.unit.suffix.integer.c, keyword.other.unit.suffix.floating-point.c | #AE81FF | |
| entity.name.function.c, entity.name.function.member.c | #66D9EF | |
| meta.function-call.generic.python | #66D9EF | |
| punctuation.definition.variable.powershell | #F92672 | — |
| variable.other.member.powershell | #A6E22E | — |
| support.variable.automatic.powershell | #66D9EF | — |
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 |
|---|---|---|
| meta.embedded, source.groovy.embedded | #D4D4D4 | — |
| emphasis | — | italic |
| strong | — | bold |
| header | #000080 | — |
| comment | #6A9955 | — |
| constant.language | #569cd6 | — |
| constant.numeric, variable.other.enummember, keyword.operator.plus.exponent, keyword.operator.minus.exponent | #b5cea8 | — |
| constant.regexp | #646695 | — |
| entity.name.tag | #569cd6 | — |
| entity.name.tag.css | #d7ba7d | — |
| entity.other.attribute-name | #9cdcfe | — |
| entity.other.attribute-name.class.css, entity.other.attribute-name.class.mixin.css, entity.other.attribute-name.id.css, entity.other.attribute-name.parent-selector.css, entity.other.attribute-name.pseudo-class.css, entity.other.attribute-name.pseudo-element.css, source.css.less entity.other.attribute-name.id, entity.other.attribute-name.scss | #d7ba7d | — |
| invalid | #f44747 | — |
| markup.underline | — | underline |
| markup.bold | #569cd6 | bold |
| markup.heading | #569cd6 | bold |
| markup.italic | — | italic |
| markup.inserted | #b5cea8 | — |
| markup.deleted | #d6f48c | — |
| markup.changed | #569cd6 | — |
| punctuation.definition.quote.begin.markdown | #6A9955 | — |
| punctuation.definition.list.begin.markdown | #6796e6 | — |
| markup.inline.raw | #d6f48c | — |
| punctuation.definition.tag | #808080 | — |
| meta.preprocessor, entity.name.function.preprocessor | #569cd6 | — |
| meta.preprocessor.string | #d6f48c | — |
| meta.preprocessor.numeric | #b5cea8 | — |
| meta.structure.dictionary.key.python | #9cdcfe | — |
| meta.diff.header | #569cd6 | — |
| storage | #569cd6 | — |
| storage.type | #569cd6 | — |
| storage.modifier, keyword.operator.noexcept | #569cd6 | — |
| string, meta.embedded.assembly | #d6f48c | — |
| string.tag | #d6f48c | — |
| string.value | #d6f48c | — |
| string.regexp | #d16969 | — |
| punctuation.definition.template-expression.begin, punctuation.definition.template-expression.end, punctuation.section.embedded | #569cd6 | — |
| meta.template.expression | #d4d4d4 | — |
| support.type.vendored.property-name, support.type.property-name, variable.css, variable.scss, variable.other.less, source.coffee.embedded | #9cdcfe | — |
| keyword | #569cd6 | — |
| keyword.control | #569cd6 | — |
| keyword.operator | #d4d4d4 | — |
| keyword.operator.new, keyword.operator.expression, keyword.operator.cast, keyword.operator.sizeof, keyword.operator.alignof, keyword.operator.typeid, keyword.operator.alignas, keyword.operator.instanceof, keyword.operator.logical.python, keyword.operator.wordlike | #569cd6 | — |
| keyword.other.unit | #b5cea8 | — |
| punctuation.section.embedded.begin.php, punctuation.section.embedded.end.php | #569cd6 | — |
| support.function.git-rebase | #9cdcfe | — |
| constant.sha.git-rebase | #b5cea8 | — |
| storage.modifier.import.java, variable.language.wildcard.java, storage.modifier.package.java | #d4d4d4 | — |
| variable.language | #569cd6 | — |
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}!`;
}
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}!`;
}
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}!`;
}
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}!`;
}