Skip to main content
Nightingale Theme | Coding Theme
VS Code preview Full workbench mockup using this variant's colors and tokenColors.
colors Workbench UI color keys from the theme JSON colors map.
activityBar.background #2c2c2c activityBar.foreground #DCD7BA activityBarBadge.background #6297e2 activityBarBadge.foreground #DCD7BA badge.background #5b82b8 button.background #6297e2 tokenColors TextMate scopes and font styles (syntax highlighting rules).
scope foreground fontStyle entity.name.function, support.function, support.constant.handlebars, source.powershell variable.other.member, entity.name.operator.custom-literal #85a8da italic support.class, support.type, entity.name.type, entity.name.namespace, entity.other.attribute, entity.name.scope-resolution, entity.name.class, storage.type.numeric.go, storage.type.byte.go, storage.type.boolean.go, storage.type.string.go, storage.type.uintptr.go, storage.type.error.go, storage.type.rune.go, storage.type.cs, storage.type.generic.cs, storage.type.modifier.cs, storage.type.variable.cs, storage.type.annotation.java, storage.type.generic.java, storage.type.java, storage.type.object.array.java, storage.type.primitive.array.java, storage.type.primitive.java, storage.type.token.java, storage.type.groovy, storage.type.annotation.groovy, storage.type.parameters.groovy, storage.type.generic.groovy, storage.type.object.array.groovy, storage.type.primitive.array.groovy, storage.type.primitive.groovy #7cd0bf — meta.type.cast.expr, meta.type.new.expr, support.constant.math, support.constant.dom, support.constant.json, entity.other.inherited-class
Shiki preview TypeScript sample highlighted with this variant's colors and tokenColors.
Nightingale Theme — Nightingale
button.secondaryBackground
#424242
button.secondaryForeground #DCD7BA
checkbox.border #4a4a4a
debugToolBar.background #2d2d2d
descriptionForeground #DCD7BA
diffEditor.insertedTextBackground #2B3328
dropdown.background #282828
dropdown.border #151515
editor.background #202020
editor.findMatchBackground #3e3e3e
editor.findMatchBorder #FF9E3B
editor.findMatchHighlightBackground #444444
editor.foreground #ffffff
editor.lineHighlightBackground #363636
editor.selectionBackground #323232
editor.selectionHighlightBackground #373737
editor.selectionHighlightBorder #696969
editor.wordHighlightBackground #6363634d
editor.wordHighlightBorder #5a5a5a
editor.wordHighlightStrongBackground #3737374d
editor.wordHighlightStrongBorder #5a5a5a
editorBracketHighlight.foreground1 #E6C384
editorBracketHighlight.foreground2 #7AA89F
editorBracketHighlight.foreground3 #FFA066
editorBracketHighlight.foreground4 #D27E99
editorBracketHighlight.foreground5 #7E9CD8
editorBracketHighlight.foreground6 #957FB8
editorBracketHighlight.unexpectedBracket.foreground #FF5D62
editorBracketMatch.background #6363634d
editorBracketMatch.border #5a5a5a
editorBracketPairGuide.activeBackground1 #E6C384
editorBracketPairGuide.activeBackground2 #7AA89F
editorBracketPairGuide.activeBackground3 #FFA066
editorBracketPairGuide.activeBackground4 #D27E99
editorBracketPairGuide.activeBackground5 #7E9CD8
editorBracketPairGuide.activeBackground6 #957FB8
editorCursor.background #DCD7BA
editorCursor.foreground #DCD7BA
editorError.foreground #E82424
editorGroup.border #16161D
editorGroupHeader.tabsBackground #181818
editorGutter.addedBackground #76946A
editorGutter.deletedBackground #C34043
editorGutter.modifiedBackground #DCA561
editorHoverWidget.background #2e2e2e
editorHoverWidget.border #585858
editorHoverWidget.highlightForeground #658594
editorIndentGuide.activeBackground #525252
editorIndentGuide.background #303030
editorInlayHint.background #2d2d2d
editorInlayHint.foreground #727169
editorLineNumber.activeForeground #DCD7BA
editorLineNumber.foreground #585858
editorMarkerNavigation.background #353535
editorRuler.foreground #373737
editorSuggestWidget.background #2e2e2e
editorSuggestWidget.border #585858
editorSuggestWidget.selectedBackground #383838
editorWarning.foreground #FF9E3B
editorWhitespace.foreground #575757
editorWidget.background #1c1c1c
focusBorder #505050
gitDecoration.ignoredResourceForeground #727169
input.background #2a2a2a
list.activeSelectionBackground #333333
list.activeSelectionForeground #DCD7BA
list.focusBackground #333333
list.focusForeground #DCD7BA
list.highlightForeground #7E9CD8
list.hoverBackground #484848
list.hoverForeground #DCD7BA
list.inactiveSelectionBackground #333333
list.inactiveSelectionForeground #DCD7BA
list.warningForeground #FF9E3B
menu.foreground #DCD7BA
menu.separatorBackground #202020
minimapGutter.addedBackground #76946A
minimapGutter.deletedBackground #C34043
minimapGutter.modifiedBackground #DCA561
panel.border #1b1b1b
panelSectionHeader.background #212121
peekView.border #5e5e5e
peekViewEditor.background #2e2e2e
peekViewEditor.matchHighlightBackground #2D4F67
peekViewResult.background #414141
scrollbar.shadow #3d3d3d
scrollbarSlider.activeBackground #81818166
scrollbarSlider.background #54545466
scrollbarSlider.hoverBackground #67676766
sideBar.background #202020
sideBar.border #1b1b1b
sideBar.foreground #DCD7BA
sideBarSectionHeader.background #272727
sideBarSectionHeader.foreground #DCD7BA
sideBarTitle.foreground #bbbbbb
statusBar.background #282828
statusBar.debuggingBackground #ee4545
statusBar.debuggingBorder #272727
statusBar.debuggingForeground #DCD7BA
statusBar.foreground #C8C093
statusBar.noFolderBackground #282828
statusBarItem.hoverBackground #353535
statusBarItem.remoteBackground #353535
statusBarItem.remoteForeground #DCD7BA
tab.activeBackground #202020
tab.activeForeground #DCD7BA
tab.border #232323
tab.hoverBackground #373737
tab.inactiveBackground #2e2e2e
tab.unfocusedHoverBackground #414141
terminal.ansiBlack #1F1F28
terminal.ansiBlue #5690ac
terminal.ansiBrightBlack #2A2A37
terminal.ansiBrightBlue #81c0da
terminal.ansiBrightCyan #A3D4D5
terminal.ansiBrightGreen #aed97a
terminal.ansiBrightMagenta #D27E99
terminal.ansiBrightRed #FF5D62
terminal.ansiBrightWhite #DCD7BA
terminal.ansiBrightYellow #E6C384
terminal.ansiCyan #9CABCA
terminal.ansiGreen #89c471
terminal.ansiMagenta #957FB8
terminal.ansiRed #e14c4c
terminal.ansiWhite #DCD7BA
terminal.ansiYellow #ffd13b
terminal.background #1a1a1a
terminal.border #1b1b1b
terminal.foreground #DCD7BA
terminal.selectionBackground #283c57
textBlockQuote.background #282828
textBlockQuote.border #1a1a1a
textLink.foreground #7ebcfd
textPreformat.foreground #ffbd7b
titleBar.activeBackground #414141
titleBar.activeForeground #DCD7BA
titleBar.inactiveBackground #3a3a3a
titleBar.inactiveForeground #DCD7BA
walkThrough.embeddedEditorBackground #1f1f1f
#7cd0bf
keyword.control, source.cpp keyword.operator.new, keyword.operator.delete, keyword.other.using, keyword.other.operator, entity.name.operator #a584c0 italic bold
variable, meta.definition.variable.name, support.variable, entity.name.variable, constant.other.placeholder #e8e4ca —
variable.other.constant, variable.other.enummember #f5a284 —
meta.object-literal.key #ffaca3 —
punctuation.definition.group.regexp, punctuation.definition.group.assertion.regexp, punctuation.definition.character-class.regexp, punctuation.character.set.begin.regexp, punctuation.character.set.end.regexp, keyword.operator.negation.regexp, support.other.parenthesis.regexp #eeab91 —
constant.character.character-class.regexp, constant.other.character-class.set.regexp, constant.other.character-class.regexp, constant.character.set.regexp, string.regexp #ff8585 —
keyword.operator.or.regexp, keyword.control.anchor.regexp #e1e1a7 —
keyword.operator.quantifier.regexp #e0c88d —
constant.character #569cd6 —
constant.character.escape #d7ba7d —
entity.name.label #C8C8C8 —
constant.numeric, variable.other.enummember, keyword.operator.plus.exponent, keyword.operator.minus.exponent #ff9488 italic
markup.italic #E46876 italic
markup.bold, markup.bold string #85a8da bold
markup.bold markup.italic, markup.italic markup.bold, markup.quote markup.bold, markup.bold markup.italic string, markup.italic markup.bold string, markup.quote markup.bold string #E46876 bold italic
markup.underline #7FB4CA underline
markup.heading #98BB6C bold
markup.quote #957FB8 italic
markup.fenced_code.block.markdown, markup.raw.block.fenced.markdown #9a9a9a —
text.html.markdown, punctuation.definition.list_item.markdown #DCD7BA —
string.other.link.title.markdown #ffd666 —
constant.other.reference.link.markdown #ffd666 —
meta.separator #e4844d bold
markup.strikethrough #d58989 strikethrough
punctuation.definition.quote.begin.markdown #957FB8 —
punctuation.definition.list.begin.markdown #6796e6 bold
markup.inline.raw #ffbd7b —
meta.preprocessor, entity.name.function.preprocessor #85a8da —
meta.preprocessor.string #98BB6C —
meta.preprocessor.numeric #FF9488 —
storage.modifier, keyword.operator.noexcept #569cd6 —
string, meta.embedded.assembly #98BB6C —
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.operator, punctuation.separator.annotation.result #f1c57e —
source.json meta.structure.dictionary.json support.type.property-name.json #D27E99 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #E6C384 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #FFA066 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #FF5D62 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #FFA066 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #7E9CD8 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #D27E99 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #957FB8 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #98BB6C —
source.css meta.property-value.css, source.css meta.property-list.css, source.css meta.selector.css #DCD7BA —
punctuation.definition.tag #808080 —
entity.name.tag.html #769acc —
meta.tag.inline.b.start.html, meta.tag.inline.b.end.html — bold
meta.tag.inline.em.start.html, meta.tag.inline.em.end.html — italic
string.quoted.double.html #ffa994 —
entity.other.attribute-name #9CDCFE italic
entity.other.attribute-name.class #E6C384 —
entity.other.attribute-name.id #E6C384 italic
support.type.vendored.property-name, source.css support.type.property-name, source.sass support.type.property-name, source.scss support.type.property-name, source.less support.type.property-name, source.stylus support.type.property-name, source.postcss support.type.property-name, support.type.property-name, variable.css, variable.scss, variable.other.less, source.coffee.embedded #81b9f1 —
support.constant.property-value, support.constant.font-name, support.constant.media-type, support.constant.media, constant.other.color.rgb-value, constant.other.rgb-value, support.constant.color #FF9488 —
keyword.other.unit #FF9488 italic
keyword.control.tag-name.django, keyword.operator.django, constant.other.tag.name.django #d89ce2 —
string.unquoted.tag-string.django #f3cd87 —
storage.type.templatetag.django #f3cd87 —
entity.name.function, support.function, support.constant.handlebars, source.powershell variable.other.member, entity.name.operator.custom-literal #85a8da italic
support.class, support.type, entity.name.type, entity.name.namespace, entity.other.attribute, entity.name.scope-resolution, entity.name.class, storage.type.numeric.go, storage.type.byte.go, storage.type.boolean.go, storage.type.string.go, storage.type.uintptr.go, storage.type.error.go, storage.type.rune.go, storage.type.cs, storage.type.generic.cs, storage.type.modifier.cs, storage.type.variable.cs, storage.type.annotation.java, storage.type.generic.java, storage.type.java, storage.type.object.array.java, storage.type.primitive.array.java, storage.type.primitive.java, storage.type.token.java, storage.type.groovy, storage.type.annotation.groovy, storage.type.parameters.groovy, storage.type.generic.groovy, storage.type.object.array.groovy, storage.type.primitive.array.groovy, storage.type.primitive.groovy #7cd0bf —
meta.type.cast.expr, meta.type.new.expr, support.constant.math, support.constant.dom, support.constant.json, entity.other.inherited-class #7cd0bf —
keyword.control, source.cpp keyword.operator.new, keyword.operator.delete, keyword.other.using, keyword.other.operator, entity.name.operator #a584c0 italic bold
variable, meta.definition.variable.name, support.variable, entity.name.variable, constant.other.placeholder #e8e4ca —
variable.other.constant, variable.other.enummember #f5a284 —
meta.object-literal.key #ffaca3 —
punctuation.definition.group.regexp, punctuation.definition.group.assertion.regexp, punctuation.definition.character-class.regexp, punctuation.character.set.begin.regexp, punctuation.character.set.end.regexp, keyword.operator.negation.regexp, support.other.parenthesis.regexp #eeab91 —
constant.character.character-class.regexp, constant.other.character-class.set.regexp, constant.other.character-class.regexp, constant.character.set.regexp, string.regexp #ff8585 —
keyword.operator.or.regexp, keyword.control.anchor.regexp #e1e1a7 —
keyword.operator.quantifier.regexp #e0c88d —
constant.character #569cd6 —
constant.character.escape #d7ba7d —
entity.name.label #C8C8C8 —
constant.numeric, variable.other.enummember, keyword.operator.plus.exponent, keyword.operator.minus.exponent #ff9488 italic
markup.italic #E46876 italic
markup.bold, markup.bold string #85a8da bold
markup.bold markup.italic, markup.italic markup.bold, markup.quote markup.bold, markup.bold markup.italic string, markup.italic markup.bold string, markup.quote markup.bold string #E46876 bold italic
markup.underline #7FB4CA underline
markup.heading #98BB6C bold
markup.quote #957FB8 italic
markup.fenced_code.block.markdown, markup.raw.block.fenced.markdown #9a9a9a —
text.html.markdown, punctuation.definition.list_item.markdown #DCD7BA —
string.other.link.title.markdown #ffd666 —
constant.other.reference.link.markdown #ffd666 —
meta.separator #e4844d bold
markup.strikethrough #d58989 strikethrough
punctuation.definition.quote.begin.markdown #957FB8 —
punctuation.definition.list.begin.markdown #6796e6 bold
markup.inline.raw #ffbd7b —
meta.preprocessor, entity.name.function.preprocessor #85a8da —
meta.preprocessor.string #98BB6C —
meta.preprocessor.numeric #FF9488 —
storage.modifier, keyword.operator.noexcept #569cd6 —
string, meta.embedded.assembly #98BB6C —
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.operator, punctuation.separator.annotation.result #f1c57e —
source.json meta.structure.dictionary.json support.type.property-name.json #D27E99 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #E6C384 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #FFA066 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #FF5D62 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #FFA066 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #7E9CD8 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #D27E99 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #957FB8 —
source.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json meta.structure.dictionary.value.json meta.structure.dictionary.json support.type.property-name.json #98BB6C —
source.css meta.property-value.css, source.css meta.property-list.css, source.css meta.selector.css #DCD7BA —
punctuation.definition.tag #808080 —
entity.name.tag.html #769acc —
meta.tag.inline.b.start.html, meta.tag.inline.b.end.html — bold
meta.tag.inline.em.start.html, meta.tag.inline.em.end.html — italic
string.quoted.double.html #ffa994 —
entity.other.attribute-name #9CDCFE italic
entity.other.attribute-name.class #E6C384 —
entity.other.attribute-name.id #E6C384 italic
support.type.vendored.property-name, source.css support.type.property-name, source.sass support.type.property-name, source.scss support.type.property-name, source.less support.type.property-name, source.stylus support.type.property-name, source.postcss support.type.property-name, support.type.property-name, variable.css, variable.scss, variable.other.less, source.coffee.embedded #81b9f1 —
support.constant.property-value, support.constant.font-name, support.constant.media-type, support.constant.media, constant.other.color.rgb-value, constant.other.rgb-value, support.constant.color #FF9488 —
keyword.other.unit #FF9488 italic
keyword.control.tag-name.django, keyword.operator.django, constant.other.tag.name.django #d89ce2 —
string.unquoted.tag-string.django #f3cd87 —
storage.type.templatetag.django #f3cd87 —
meta.embedded, source.groovy.embedded, string meta.image.inline.markdown #D4D4D4 —
constant.language #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 —
meta.structure.dictionary.key.python #9cdcfe —
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 }!` ;
}
fetchUser.ts
index.ts
README.md
src
components
fetchUser.ts
src
components
fetchUser.ts
fetchUser 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Problems1
Output
Debug Console
Terminal
Ports
~/my-project $ pnpm dev
▲ Next.js ready on http://localhost:3000
✓ compiled client and server successfully in 412ms
wait - compiling /theme/vscode...
~/my-project
main*
Button.tsx
31
$
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 }!` ;
}