Skip to main content
Azeny 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.activeBackground #b9b3ff10 activityBar.activeBorder #667eea80 activityBar.background #1F2335 activityBar.dropBackground #b1b8da1f activityBar.foreground #b1b8da activityBar.inactiveForeground #4D5980 tokenColors TextMate scopes and font styles (syntax highlighting rules).
scope foreground fontStyle emphasis — italic strong — bold header #ffcdb2 — source #caffea — meta.diff, meta.diff.header #4D5980 —
Shiki preview TypeScript sample highlighted with this variant's colors and tokenColors.
Azeny Theme — Azeny Cutimaru
activityBarBadge.background #667eea
activityBarBadge.foreground #b1b8da
badge.background #44475a
badge.foreground #b1b8da
breadcrumb.activeSelectionForeground #b1b8da
breadcrumb.background #1F2335
breadcrumb.focusForeground #b1b8da
breadcrumb.foreground #4D5980
breadcrumbPicker.background #1F2335
button.background #44475a
button.foreground #b1b8da
button.hoverBackground #52556c
checkbox.background #1F2335
checkbox.border #1F2335
checkbox.foreground #b1b8da
contrastBorder #1F2335
debugExceptionWidget.background #420b0d
debugExceptionWidget.border #a31515
debugIcon.breakpointCurrentStackframeForeground #ffcc00
debugIcon.breakpointDisabledForeground #848484
debugIcon.breakpointForeground #e51400
debugIcon.breakpointStackframeForeground #89d185
debugIcon.breakpointUnverifiedForeground #848484
debugIcon.continueForeground #75beff
debugIcon.disconnectForeground #f48771
debugIcon.pauseForeground #75beff
debugIcon.restartForeground #89d185
debugIcon.startForeground #89d185
debugIcon.stepBackForeground #75beff
debugIcon.stepIntoForeground #75beff
debugIcon.stepOutForeground #75beff
debugIcon.stepOverForeground #75beff
debugIcon.stopForeground #f48771
debugToolBar.background #1F2335
descriptionForeground #c5c5c5
diffEditor.insertedTextBackground #61F0FF20
diffEditor.removedTextBackground #ff555550
dropdown.background #1F2335
dropdown.border #1F2335
dropdown.foreground #b1b8da
editor.background #24283B
editor.findMatchBackground #ead26680
editor.findMatchHighlightBackground #b1b8da40
editor.findRangeHighlightBackground #44475a75
editor.focusedStackFrameHighlightBackground #7abd7a4d
editor.foreground #b1b8da
editor.hoverHighlightBackground #1F2335
editor.inactiveSelectionBackground #44475a80
editor.lineHighlightBorder #44475a
editor.rangeHighlightBackground #b9b3ff15
editor.selectionBackground #44475a
editor.selectionHighlightBackground #424450
editor.snippetFinalTabstopHighlightBackground #24283B
editor.snippetFinalTabstopHighlightBorder #61F0FF
editor.snippetTabstopHighlightBackground #24283B
editor.snippetTabstopHighlightBorder #4D5980
editor.stackFrameHighlightBackground #ffff0033
editor.symbolHighlightBackground #b1b8da40
editor.wordHighlightBackground #66ea9050
editor.wordHighlightStrongBackground #61F0FF50
editorActiveLineNumber.foreground #c5c5c5
editorBracketMatch.background #0064001a
editorBracketMatch.border #888888
editorCodeLens.foreground #4D5980
editorCursor.foreground #aeafad
editorError.foreground #ff5555
editorGroup.border #b9b3ff
editorGroup.dropBackground #44475a70
editorGroupHeader.noTabsBackground #24283B
editorGroupHeader.tabsBackground #1F2335
editorGutter.addedBackground #61F0FF80
editorGutter.background #24283B
editorGutter.commentRangeForeground #c5c5c5
editorGutter.deletedBackground #ff555580
editorGutter.modifiedBackground #66ea9080
editorHint.foreground #eeeeeeb3
editorHoverWidget.background #24283B
editorHoverWidget.border #4D5980
editorHoverWidget.foreground #b1b8da
editorHoverWidget.statusBarBackground #303241
editorIndentGuide.activeBackground #b1b8da45
editorIndentGuide.background #424450
editorInfo.foreground #75beff
editorLightBulb.foreground #ffcc00
editorLightBulbAutoFix.foreground #75beff
editorLineNumber.activeForeground #c5c5c5
editorLineNumber.foreground #4D5980
editorLink.activeForeground #66ea90
editorMarkerNavigation.background #1F2335
editorMarkerNavigationError.background #ff5555
editorMarkerNavigationInfo.background #75beff
editorMarkerNavigationWarning.background #66ea90
editorOverviewRuler.addedForeground #61F0FF80
editorOverviewRuler.border #1F2335
editorOverviewRuler.bracketMatchForeground #a0a0a0
editorOverviewRuler.commonContentForeground #60606066
editorOverviewRuler.currentContentForeground #61F0FF
editorOverviewRuler.deletedForeground #ff555580
editorOverviewRuler.errorForeground #ff555580
editorOverviewRuler.findMatchForeground #d186167e
editorOverviewRuler.incomingContentForeground #b9b3ff
editorOverviewRuler.infoForeground #66ea9080
editorOverviewRuler.modifiedForeground #66ea9080
editorOverviewRuler.rangeHighlightForeground #007acc99
editorOverviewRuler.selectionHighlightForeground #ead266
editorOverviewRuler.warningForeground #ead26680
editorOverviewRuler.wordHighlightForeground #66ea90
editorOverviewRuler.wordHighlightStrongForeground #61F0FF
editorPane.background #24283B
editorRuler.foreground #424450
editorSuggestWidget.background #1F2335
editorSuggestWidget.border #454545
editorSuggestWidget.foreground #b1b8da
editorSuggestWidget.highlightForeground #66ea90
editorSuggestWidget.selectedBackground #44475a
editorUnnecessaryCode.opacity #000000aa
editorWarning.foreground #66ea90
editorWhitespace.foreground #424450
editorWidget.background #1F2335
editorWidget.border #454545
editorWidget.foreground #b1b8da
errorForeground #5a607d
extensionBadge.remoteBackground #667eea
extensionBadge.remoteForeground #b1b8da
extensionButton.prominentBackground #61F0FF90
extensionButton.prominentForeground #b1b8da
extensionButton.prominentHoverBackground #61F0FF60
focusBorder #4D5980
foreground #b1b8da
gitDecoration.addedResourceForeground #81b88b
gitDecoration.conflictingResourceForeground #ead266
gitDecoration.deletedResourceForeground #ff5555
gitDecoration.ignoredResourceForeground #4D5980
gitDecoration.modifiedResourceForeground #66ea90
gitDecoration.submoduleResourceForeground #8db9e2
gitDecoration.untrackedResourceForeground #61F0FF
gitlens.gutterBackgroundColor #b1b8da13
gitlens.gutterForegroundColor #bebebe
gitlens.gutterUncommittedForegroundColor #00bcf299
gitlens.lineHighlightBackgroundColor #00bcf233
gitlens.lineHighlightOverviewRulerColor #00bcf299
gitlens.trailingLineBackgroundColor #00000000
gitlens.trailingLineForegroundColor #99999959
icon.foreground #c5c5c5
imagePreview.border #80808059
input.background #24283B
input.border #1F2335
input.foreground #b1b8da
input.placeholderForeground #4D5980
inputOption.activeBackground #4D598080
inputOption.activeBorder #b9b3ff
inputValidation.errorBackground #5a1d1d
inputValidation.errorBorder #ff5555
inputValidation.infoBackground #063b49
inputValidation.infoBorder #667eea
inputValidation.warningBackground #352a05
inputValidation.warningBorder #ead266
list.activeSelectionBackground #44475a
list.activeSelectionForeground #b1b8da
list.deemphasizedForeground #667eea40
list.dropBackground #44475a
list.errorForeground #5a607d
list.filterMatchBackground #b1b8da40
list.focusBackground #44475a75
list.highlightForeground #66ea90
list.hoverBackground #44475a75
list.inactiveSelectionBackground #44475a75
list.invalidItemForeground #b89500
list.warningForeground #ead266
listFilterWidget.background #1F2335
listFilterWidget.noMatchesOutline #ff5555
listFilterWidget.outline #424450
menu.background #1F2335
menu.foreground #b1b8da
menu.selectionBackground #44475a
menu.selectionForeground #b1b8da
menu.separatorBackground #bbbbbb
menubar.selectionBackground #b1b8da1a
menubar.selectionForeground #b1b8da
merge.commonContentBackground #60606029
merge.commonHeaderBackground #60606066
merge.currentContentBackground #61F0FF3a
merge.currentHeaderBackground #61F0FF90
merge.incomingContentBackground #b9b3ff3a
merge.incomingHeaderBackground #b9b3ff90
minimap.errorHighlight #ff1212b3
minimap.findMatchHighlight #d18616
minimap.selectionHighlight #264f78
minimap.warningHighlight #66ea90
minimapGutter.addedBackground #587c0c
minimapGutter.deletedBackground #94151b
minimapGutter.modifiedBackground #0c7d9d
notificationCenterHeader.background #2b2c39
notificationLink.foreground #3794ff
notifications.background #1F2335
notifications.border #2b2c39
notifications.foreground #b1b8da
notificationsErrorIcon.foreground #ff5555
notificationsInfoIcon.foreground #75beff
notificationsWarningIcon.foreground #66ea90
panel.background #24283B
panel.border #b9b3ff
panel.dropBackground #b1b8da1f
panelTitle.activeBorder #667eea
panelTitle.activeForeground #b1b8da
panelTitle.inactiveForeground #4D5980
peekView.border #44475a
peekViewEditor.background #24283B
peekViewEditor.matchHighlightBackground #FFFC5980
peekViewEditorGutter.background #24283B
peekViewResult.background #1F2335
peekViewResult.fileForeground #b1b8da
peekViewResult.lineForeground #b1b8da
peekViewResult.matchHighlightBackground #FFFC5980
peekViewResult.selectionBackground #44475a
peekViewResult.selectionForeground #b1b8da
peekViewTitle.background #1F2335
peekViewTitleDescription.foreground #4D5980
peekViewTitleLabel.foreground #b1b8da
pickerGroup.border #b9b3ff
pickerGroup.foreground #66ea90
problemsErrorIcon.foreground #ff5555
problemsInfoIcon.foreground #75beff
problemsWarningIcon.foreground #66ea90
progressBar.background #667eea
quickInput.background #1F2335
scrollbar.shadow #000000
scrollbarSlider.activeBackground #bfbfbf66
scrollbarSlider.background #79797966
scrollbarSlider.hoverBackground #646464b3
searchEditor.findMatchBackground #b1b8da2a
selection.background #b9b3ff
settings.checkboxBackground #1F2335
settings.checkboxBorder #1F2335
settings.checkboxForeground #b1b8da
settings.dropdownBackground #1F2335
settings.dropdownBorder #1F2335
settings.dropdownForeground #b1b8da
settings.dropdownListBorder #454545
settings.headerForeground #b1b8da
settings.modifiedItemIndicator #ead266
settings.numberInputBackground #1F2335
settings.numberInputBorder #1F2335
settings.numberInputForeground #b1b8da
settings.textInputBackground #1F2335
settings.textInputBorder #1F2335
settings.textInputForeground #b1b8da
sideBar.background #1F2335
sideBar.dropBackground #b1b8da1f
sideBarSectionHeader.background #1F2335
sideBarSectionHeader.border #1F2335
sideBarTitle.foreground #b1b8da
statusBar.background #1F2335
statusBar.debuggingBackground #ff5555
statusBar.debuggingForeground #1F2335
statusBar.foreground #b1b8da
statusBar.noFolderBackground #1F2335
statusBar.noFolderForeground #b1b8da
statusBarItem.activeBackground #b1b8da2e
statusBarItem.hoverBackground #b1b8da1f
statusBarItem.prominentBackground #ff5555
statusBarItem.prominentForeground #b1b8da
statusBarItem.prominentHoverBackground #ead266
statusBarItem.remoteBackground #b9b3ff
statusBarItem.remoteForeground #b1b8da
symbolIcon.arrayForeground #b1b8da
symbolIcon.booleanForeground #b1b8da
symbolIcon.classForeground #ee9d28
symbolIcon.colorForeground #b1b8da
symbolIcon.constantForeground #b1b8da
symbolIcon.constructorForeground #b180d7
symbolIcon.enumeratorForeground #ee9d28
symbolIcon.enumeratorMemberForeground #75beff
symbolIcon.eventForeground #ee9d28
symbolIcon.fieldForeground #75beff
symbolIcon.fileForeground #b1b8da
symbolIcon.folderForeground #b1b8da
symbolIcon.functionForeground #b180d7
symbolIcon.interfaceForeground #75beff
symbolIcon.keyForeground #b1b8da
symbolIcon.keywordForeground #b1b8da
symbolIcon.methodForeground #b180d7
symbolIcon.moduleForeground #b1b8da
symbolIcon.namespaceForeground #b1b8da
symbolIcon.nullForeground #b1b8da
symbolIcon.numberForeground #b1b8da
symbolIcon.objectForeground #b1b8da
symbolIcon.operatorForeground #b1b8da
symbolIcon.packageForeground #b1b8da
symbolIcon.propertyForeground #b1b8da
symbolIcon.referenceForeground #b1b8da
symbolIcon.snippetForeground #b1b8da
symbolIcon.stringForeground #b1b8da
symbolIcon.structForeground #b1b8da
symbolIcon.textForeground #b1b8da
symbolIcon.typeParameterForeground #b1b8da
symbolIcon.unitForeground #b1b8da
symbolIcon.variableForeground #75beff
tab.activeBackground #24283B
tab.activeBorder #667eea80
tab.activeForeground #b1b8da
tab.activeModifiedBorder #3399cc
tab.border #1F2335
tab.inactiveBackground #1F2335
tab.inactiveForeground #4D5980
tab.inactiveModifiedBorder #3399cc80
tab.unfocusedActiveBackground #24283B
tab.unfocusedActiveBorder #667eea40
tab.unfocusedActiveForeground #b1b8da80
tab.unfocusedActiveModifiedBorder #3399cc80
tab.unfocusedInactiveForeground #4D598080
tab.unfocusedInactiveModifiedBorder #3399cc40
terminal.ansiBlack #1F2335
terminal.ansiBlue #b9b3ff
terminal.ansiBrightBlack #4D5980
terminal.ansiBrightBlue #d6acff
terminal.ansiBrightCyan #a4ffff
terminal.ansiBrightGreen #69ff94
terminal.ansiBrightMagenta #ff92df
terminal.ansiBrightRed #ff6e6e
terminal.ansiBrightWhite #ffffff
terminal.ansiBrightYellow #ffffa5
terminal.ansiCyan #66ea90
terminal.ansiGreen #61F0FF
terminal.ansiMagenta #667eea
terminal.ansiRed #ff5555
terminal.ansiWhite #b1b8da
terminal.ansiYellow #FFFC59
terminal.background #24283B
terminal.border #b9b3ff
terminal.foreground #b1b8da
terminal.selectionBackground #b1b8da40
textBlockQuote.background #7f7f7f1a
textBlockQuote.border #007acc80
textCodeBlock.background #0a0a0a66
textLink.activeForeground #3794ff
textLink.foreground #3794ff
textPreformat.foreground #d7ba7d
textSeparator.foreground #b1b8da2e
titleBar.activeBackground #1F2335
titleBar.activeForeground #b1b8da
titleBar.inactiveBackground #1F2335
titleBar.inactiveForeground #4D5980
tree.indentGuidesStroke #585858
walkThrough.embeddedEditorBackground #1F2335
widget.shadow #000000 invalid #ff5555 underline italic
invalid.deprecated #caffea underline italic
entity.name.filename #f0ff61 —
markup.underline — underline
markup.heading #ffcdb2 bold
markup.italic #f0ff61 italic
beginning.punctuation.definition.list.markdown, beginning.punctuation.definition.quote.markdown, punctuation.definition.link.restructuredtext #66ea90 —
markup.inline.raw, markup.raw.restructuredtext #61F0FF —
markup.underline.link, markup.underline.link.image #66ea90 —
meta.link.reference.def.restructuredtext, punctuation.definition.directive.restructuredtext, string.other.link.description, string.other.link.title #667eea —
entity.name.directive.restructuredtext, markup.quote #f0ff61 italic
meta.separator.markdown #4D5980 —
fenced_code.block.language, markup.raw.inner.restructuredtext, markup.fenced_code.block.markdown punctuation.definition.markdown #61F0FF —
punctuation.definition.constant.restructuredtext #ffcdb2 —
markup.heading.markdown punctuation.definition.string.begin, markup.heading.markdown punctuation.definition.string.end #ffcdb2 —
meta.paragraph.markdown punctuation.definition.string.begin, meta.paragraph.markdown punctuation.definition.string.end #caffea —
markup.quote.markdown meta.paragraph.markdown punctuation.definition.string.begin, markup.quote.markdown meta.paragraph.markdown punctuation.definition.string.end #f0ff61 —
entity.name.type.class, entity.name.class #66ea90 normal
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 #ffcdb2 italic
entity.other.inherited-class #66ea90 italic
comment, punctuation.definition.comment, unused.comment, wildcard.comment #4D5980 —
comment keyword.codetag.notation, comment.block.documentation keyword, comment.block.documentation storage.type.class #667eea —
comment.block.documentation entity.name.type #66ea90 italic
comment.block.documentation entity.name.type punctuation.definition.bracket #66ea90 —
comment.block.documentation variable #ead266 italic
constant, variable.other.constant #ffcdb2 —
constant.character.escape, constant.character.string.escape, constant.regexp #667eea —
entity.other.attribute-name.parent-selector #667eea —
entity.other.attribute-name #FFFC59 italic
entity.name.function, meta.function-call.generic, 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 #61F0FF —
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 #ead266 italic
meta.decorator variable.other.readwrite, meta.decorator variable.other.property #61F0FF italic
meta.decorator variable.other.object #61F0FF —
keyword, punctuation.definition.keyword #667eea —
keyword.control.new, keyword.operator.new — bold
support.function.magic, support.variable, variable.other.predefined #ffcdb2 regular
support.function, support.type.property-name — regular
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 #667eea —
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 #caffea —
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 #667eea —
entity.name.function.target.makefile, entity.name.section.toml, entity.name.tag.yaml, variable.other.key.toml #66ea90 —
constant.other.date, constant.other.timestamp #ead266 —
variable.other.alias.yaml #61F0FF italic underline
storage, meta.implementation storage.type.objc, meta.interface-or-protocol storage.type.objc, source.groovy storage.type.def #667eea regular
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 #89d185 italic
entity.name.type.type-parameter, meta.indexer.mappedtype.declaration entity.name.type, meta.type.parameters entity.name.type #ead266 —
string.regexp, constant.other.character-class.set.regexp, constant.character.escape.backslash.regexp #f0ff61 —
punctuation.definition.group.capture.regexp #667eea —
string.regexp punctuation.definition.string.begin, string.regexp punctuation.definition.string.end #ff5555 —
punctuation.definition.character-class.regexp #66ea90 —
punctuation.definition.group.regexp #ead266 —
punctuation.definition.group.assertion.regexp, keyword.operator.negation.regexp #ff5555 —
meta.assertion.look-ahead.regexp #61F0FF —
punctuation.definition.string.begin, punctuation.definition.string.end #f0ff61 —
punctuation.support.type.property-name.begin, punctuation.support.type.property-name.end #f0ff61 —
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 #4D5980 —
variable, constant.other.key.perl, support.variable.property, variable.other.constant.js, variable.other.constant.ts, variable.other.constant.tsx #ffffff —
meta.import variable.other.readwrite, meta.object-binding-pattern-variable variable.object.property, meta.variable.assignment.destructured.object.coffee variable #ead266 italic
meta.import variable.other.readwrite.alias, meta.export variable.other.readwrite.alias, meta.variable.assignment.destructured.object.coffee variable variable #ffffff normal
meta.selectionset.graphql variable #f0ff61 —
meta.selectionset.graphql meta.arguments variable #caffea —
entity.name.fragment.graphql, variable.fragment.graphql #66ea90 —
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 #caffea —
source.shell variable.other #ffcdb2 —
support.constant #ffcdb2 normal
meta.scope.prerequisites.makefile #f0ff61 —
meta.attribute-selector.scss #f0ff61 —
punctuation.definition.attribute-selector.end.bracket.square.scss, punctuation.definition.attribute-selector.begin.bracket.square.scss #caffea —
meta.preprocessor.haskell #4D5980 —
token.error-token #f44747 —
token.debug-token #b267e6 —
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 } !` ;
}
Ln 5, Col 12
Spaces: 2
UTF-8
LF
TypeScript
Dark+
fetchUser.ts
index.ts
README.md
src
components
fetchUser.ts
Button.tsx
Modal.tsx
hooks
utils
index.ts
public
README.md
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
31
32
33
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 $
package.json
tsconfig.json
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 } !` ;
}