Deep Dark Space
Publisher: smpl-ndrwThemes in package: 2
Syntax has never been so beautiful.
Syntax has never been so beautiful.
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 |
|---|---|---|
| string.quoted.double.json, entity.other.attribute-name, entity.other.attribute-name.id, entity.other.attribute-name.class.css, entity.other.attribute-name.class.scss, entity.other.attribute-name.directive.ts, entity.other.attribute-name.directive.tsx, punctuation.definition.entity, keyword.operator.combinator, support.type.vendored.property-name.css, support.type.vendored.property-name.scss, variable.other.readwrite.alias, keyword.operator.spread, keyword.operator.expression.infer, keyword.operator.expression.is, keyword.operator.rest, storage.type.accessor.get.cs, storage.type.accessor.set.cs, keyword.operator.ellipsis.go, keyword.operator.function.variadic-parameter.swift, support.type.property-name.table.toml, entity.name.type.type-parameter.cs | #278bd3 | — |
| constant.language, variable.language, keyword.control.flow, keyword.operator.expression.delete, keyword.operator.new, keyword.operator.increment, keyword.operator.decrement, keyword.operator.bitwise, keyword.operator.logical, keyword.operator.type, keyword.operator.expression.import, keyword.control.at-rule.import, keyword.other, punctuation.definition.string.template.begin, punctuation.definition.string.template.end, punctuation.definition.keyword, custom.punctuation.section.insertion.dollar.brackets, custom.punctuation.section.insertion.bracket, keyword.operator.expression.new.cs, keyword.operator.closure.dart, keyword.operator.increment-decrement.dart, keyword.operator.key.php, punctuation.definition.raw.markdown, punctuation.definition.italic.markdown, punctuation.definition.bold.markdown, punctuation.definition.strikethrough.markdown, punctuation.definition.quote.begin.markdown, punctuation.definition.link.markdown, keyword.operator.arrow.cs, invalid.illegal.operator.python, keyword.operator.arrow.fat.rust, keyword.operator.custom.prefix.swift, storage.type.modifier.access.control.public.cpp, storage.type.modifier.access.control.private.cpp, keyword.operator.channel.go | #dc312e | — |
| constant.other.color.rgb-value.hex, support.constant.property-value.css, support.constant.property-value.scss, support.constant.font-name.css, support.constant.font-name.scss, support.constant.color.w3c-extended-color-name.css, support.constant.color.w3c-extended-color-name.scss, support.constant.color.w3c-standard-color-name.css, support.constant.color.w3c-standard-color-name.scss, punctuation.definition.constant.css, punctuation.definition.constant.scss, punctuation.definition.string.begin.tsx, punctuation.definition.string.end.tsx, punctuation.definition.string.begin, punctuation.definition.string.end, markup.inline.raw.string.markdown, markup.underline.link.markdown, markup.underline.link.image.markdown | #2aa298 | — |
| entity.other.attribute-name.pseudo-class.css, entity.other.attribute-name.pseudo-element.css, entity.other.attribute-name.pseudo-class.scss, entity.other.attribute-name.pseudo-element.scss, support.type.object.module.js, entity.name.type.svelte, variable.language.svelte, meta.function.definition.parameters.c, entity.name.scope-resolution.parameter.cpp, entity.name.variable.parameter.cs, variable.parameter.java, variable.parameter.function.ruby, variable.parameter.function.swift, variable.parameter.go, variable.parameter.cpp, storage.modifier.sql | #ffbf00 | — |
| keyword.other.unit, entity.name.scope-resolution.cpp, variable.other.object.access.c, keyword.operator.unpacking.arguments.python, keyword.operator.unpacking.parameter.python, punctuation.definition.heading.markdown, punctuation.definition.variable.ruby, entity.name.scope-resolution.template.call.cpp, constant.other.placeholder.go, support.class.dart | #e35b00 | — |
| support.type.primitive.ts, support.type.primitive.tsx, support.type.builtin.ts, support.type.builtin.tsx, storage.type.string.go, storage.type.numeric.go, storage.type.boolean.go, storage.type.byte.go, storage.type.rune.go, storage.type.uintptr.go, entity.name.type.any.go, storage.type.error.go, keyword.type.string.cs, keyword.type.int.cs, keyword.type.short.cs, keyword.type.long.cs, keyword.type.uint.cs, keyword.type.ushort.cs, keyword.type.ulong.cs, keyword.type.void.cs, keyword.type.byte.cs, support.type.swift, support.type.python, storage.type.built-in.primitive.c, storage.type.primitive.dart, storage.type.primitive.java, keyword.other.type.php, storage.type.php, storage.type.built-in.primitive.cpp, entity.name.type.numeric.rust | #5b60be | italic underline |
| entity.name.type.rust, storage.type.sql, entity.name.type.anchor.yaml, variable.other.constant.ruby | #5b60be | — |
| entity.name.type.tsx, entity.name.type.go, entity.name.type.cs | #b67352 | — |
| storage.type, keyword.operator.expression.void, keyword.operator.expression.typeof, entity.other.inherited-class, variable.language.super, support.class, entity.name.type.class.java | #b67352 | italic bold |
| keyword.operator.arithmetic, keyword.operator.expression.instanceof, keyword.operator.ternary, keyword.operator.assignment, keyword.operator.comparison, keyword.operator.relational, punctuation.accessor.optional, keyword.operator.optional.ts, keyword.operator.optional.tsx, keyword.operator.type.modifier.ts, keyword.operator.type.modifier.tsx, keyword.operator.expression.keyof.ts, keyword.operator.expression.keyof.tsx, entity.other.attribute-name.class, entity.other.keyframe-offset.percentage.css, entity.other.keyframe-offset.percentage.scss, constant.other.character-class.range.regexp, constant.other.character-class.set.regexp, keyword.operator.quantifier.regexp, punctuation.definition.list.begin.markdown, custom.variable.other.normal.numeric.json.comments.snippets, keyword.operator.c, punctuation.separator.scope-resolution.cpp, punctuation.separator.scope-resolution.parameter.cpp, punctuation.definition.variable.php, keyword.operator.math.rust, keyword.operator.custom.infix.swift | #859900 | — |
| variable.css, variable.scss, variable.argument.css, variable.argument.scss, support.type.property-name.media.css, support.type.property-name.media.scss, entity.other.attribute-name.css, entity.other.attribute-name.scss | #d33682 | — |
| support.type.property-name.json, text.html.derivative, support.type.property-name, variable.parameter.keyframe-list.css, variable.parameter.keyframe-list.scss, source.css, source.scss, punctuation.separator.list.comma.css, punctuation.separator.list.comma.scss, punctuation.section.function.begin.bracket.round, punctuation.section.function.end.bracket.round, punctuation.separator.key-value, support.variable.property.js, , meta.brace.square, constant.language.import-export-all.ts, constant.language.import-export-all.tsx, meta.brace.round.ts, meta.brace.round.tsx, punctuation.definition.block.ts, punctuation.definition.block.tsx, punctuation.definition.parameters.begin.ts, punctuation.definition.parameters.begin.tsx, punctuation.definition.parameters.end.ts, punctuation.definition.parameters.end.tsx, keyword.operator.type.annotation.ts, keyword.operator.type.annotation.tsx, punctuation.section.embedded.begin.js, punctuation.section.embedded.end.js, punctuation.section.embedded.begin.ts, punctuation.section.embedded.end.ts, punctuation.section.embedded.begin.js.jsx, punctuation.section.embedded.end.js.jsx, punctuation.section.embedded.begin.ts.tsx, punctuation.section.embedded.end.ts.tsx, punctuation.section.embedded.begin.tsx, punctuation.section.embedded.end.tsx, punctuation.section.embedded.begin.svelte, punctuation.section.embedded.end.svelte, punctuation.definition.keyword.svelte, meta.tag.start.svelte, custom.punctuation.separator.colon.json.comments.snippets, punctuation.definition.entity.begin.bracket.square, punctuation.definition.entity.end.bracket.square, punctuation.definition.character-class.regexp, punctuation.definition.group.regexp, constant.character.escape, constant.character.escape.json.comments.snippets, punctuation.separator.pointer-access.c, markup.bold.markdown, meta.paragraph.markdown, entity.name.tag.yaml | #d7d7d7 | — |
| punctuation.support.type.property-name.begin.json, punctuation.support.type.property-name.end.json, punctuation.definition.string.begin.json, punctuation.definition.string.end.json, punctuation.definition.tag.begin, punctuation.definition.tag.end, punctuation.terminator.rule.css, punctuation.terminator.rule.scss, punctuation.terminator.statement, punctuation.definition.tag.directive.ts, punctuation.definition.tag.directive.tsx, punctuation.terminator.dart, punctuation.semi.rust, punctuation.terminator.statement.c, punctuation.terminator.go, punctuation.terminator.java, punctuation.terminator.expression.php, invalid.deprecated.semicolon.python, punctuation.separator.statement.ruby | #696969 | — |
| punctuation.definition.template-expression.begin, punctuation.definition.template-expression.end | #dc312e | italic bold |
| storage.type.js, storage.type.ts, storage.type.tsx, keyword.var.go, keyword.const.go, storage.type.var.cs, keyword.other.declaration-specifier.swift, storage.type.rust, storage.modifier.dart | #675D50 | italic bold underline |
| storage.type.class, storage.type.interface, storage.type.type, storage.type.function, keyword.function.go, keyword.type.go, keyword.struct.go, keyword.interface.go, entity.name.type.package.go, keyword.other.fn.rust, storage.type.struct.c, keyword.control.class.ruby, keyword.control.def.ruby, keyword.declaration.dart | #d7d7d7 | italic bold underline |
| variable.other.assignment.go, variable.other.constant.go, constant.language.symbol.hashkey.ruby, constant.language.symbol.ruby | #d7d7d7 | italic bold |
| entity.name.scope-resolution.parameter.cpp, entity.name.scope-resolution.template.call.cpp | #ffbf00 | italic bold underline |
| keyword.control.conditional, keyword.operator.expression.of, keyword.operator.expression.in, keyword.control.switch, keyword.control.loop, keyword.control.if.php | #859900 | italic bold underline |
| storage.type.function.arrow.tsx, storage.type.function.arrow.ts, storage.type.function.arrow | #dc312e | |
| punctuation.definition.delayed.unison,punctuation.definition.list.begin.unison,punctuation.definition.list.end.unison,punctuation.definition.ability.begin.unison,punctuation.definition.ability.end.unison,punctuation.operator.assignment.as.unison,punctuation.separator.pipe.unison,punctuation.separator.delimiter.unison,punctuation.definition.hash.unison | #d7d7d7 | — |
| variable.other.generic-type.haskell | #dc312e | — |
| support.variable.magic.python | #d7d7d7 | — |
| punctuation.separator.period.python,punctuation.separator.element.python,punctuation.parenthesis.begin.python,punctuation.parenthesis.end.python | #d7d7d7 | — |
| variable.parameter.function.language.special.self.python | #ffbf00 | italic bold underline |
| storage.modifier.lifetime.rust | #d7d7d7 | — |
| support.function.std.rust | #278bd3 | — |
| entity.name.lifetime.rust | #d33682 | — |
| support.constant.edge | #dc312e | — |
| constant.other.character-class.regexp | #d7d7d7 | — |
| variable.parameter.function | #d7d7d7 | — |
| comment markup.link | #696969 | — |
| markup.changed.diff | #d33682 | — |
| meta.diff.header.from-file,meta.diff.header.to-file,punctuation.definition.from-file.diff,punctuation.definition.to-file.diff | #278bd3 | — |
| markup.inserted.diff | #2aa298 | — |
| markup.deleted.diff | #d7d7d7 | — |
| meta.function.c,meta.function.cpp | #d7d7d7 | — |
| punctuation.section.block.begin.bracket.curly.cpp,punctuation.section.block.end.bracket.curly.cpp,punctuation.section.block.begin.bracket.curly.c,punctuation.section.block.end.bracket.curly.c,punctuation.section.parens.begin.bracket.round.c,punctuation.section.parens.end.bracket.round.c,punctuation.section.parameters.begin.bracket.round.c,punctuation.section.parameters.end.bracket.round.c | #d7d7d7 | — |
| support.constant.math | #d33682 | — |
| support.constant.property.math | #859900 | — |
| variable.other.constant | #b67352 | italic bold |
| storage.type.annotation.java, storage.type.object.array.java | #5b60be | — |
| source.java | #d7d7d7 | — |
| punctuation.section.block.begin.java,punctuation.section.block.end.java,punctuation.definition.method-parameters.begin.java,punctuation.definition.method-parameters.end.java,meta.method.identifier.java,punctuation.section.method.begin.java,punctuation.section.method.end.java,punctuation.section.class.begin.java,punctuation.section.class.end.java,punctuation.section.inner-class.begin.java,punctuation.section.inner-class.end.java,meta.method-call.java,punctuation.section.class.begin.bracket.curly.java,punctuation.section.class.end.bracket.curly.java,punctuation.section.method.begin.bracket.curly.java,punctuation.section.method.end.bracket.curly.java,punctuation.separator.period.java,punctuation.bracket.angle.java,punctuation.definition.annotation.java,meta.method.body.java | #d7d7d7 | — |
| meta.method.java | #278bd3 | — |
| storage.modifier.import.java,storage.type.java,storage.type.generic.java | #5b60be | — |
| keyword.operator.instanceof.java | #859900 | — |
| meta.definition.variable.name.java | #d7d7d7 | — |
| keyword.operator.channel | #859900 | — |
| keyword.operator.css,keyword.operator.scss,keyword.operator.less | #859900 | — |
| support.module.node,support.type.object.module,support.module.node | #d33682 | — |
| entity.name.type.module | #b67352 | italic bold |
| variable.other.readwrite,meta.object-literal.key,support.variable.property,support.variable.object.process,support.variable.object.node | #d7d7d7 | — |
| support.constant.json | #859900 | — |
| keyword.operator.optional, keyword.operator.expression.keyof | #dc312e | — |
| support.type.object.console | #d7d7d7 | — |
| support.variable.property.process | #859900 | — |
| entity.name.function,support.function.console | #278bd3 | — |
| keyword.operator.misc.rust | #d7d7d7 | — |
| keyword.operator.sigil.rust | #dc312e | — |
| keyword.operator.delete | #dc312e | — |
| support.type.object.dom | #859900 | — |
| support.variable.dom,support.variable.property.dom | #d7d7d7 | — |
| keyword.operator.bitwise.shift.c,keyword.operator.cpp,keyword.operator.bitwise.shift.cpp | #dc312e | — |
| punctuation.separator.delimiter | #d7d7d7 | — |
| support.type.posix-reserved.c,support.type.posix-reserved.cpp | #859900 | — |
| keyword.operator.sizeof.c,keyword.operator.sizeof.cpp | #dc312e | — |
| variable.parameter.function.language.python | #ffbf00 | — |
| variable.parameter.function.python | #859900 | — |
| punctuation.definition.arguments.begin.python,punctuation.definition.arguments.end.python,punctuation.separator.arguments.python,punctuation.definition.list.begin.python,punctuation.definition.list.end.python | #d7d7d7 | — |
| meta.function-call.generic.python | #278bd3 | — |
| constant.character.format.placeholder.other.python | #859900 | — |
| keyword.operator | #d7d7d7 | — |
| keyword.operator.assignment.compound.js,keyword.operator.assignment.compound.ts | #859900 | — |
| keyword | #dc312e | — |
| entity.name.namespace | #d33682 | — |
| variable | #d7d7d7 | — |
| variable.c | #d7d7d7 | — |
| token.variable.parameter.java | #d7d7d7 | — |
| import.storage.java | #d33682 | — |
| token.package.keyword | #dc312e | — |
| token.package | #d7d7d7 | — |
| entity.name.function, meta.require, support.function.any-method, variable.function | #278bd3 | — |
| entity.name.type.namespace | #d33682 | — |
| support.class, entity.name.type.class | #b67352 | italic bold |
| entity.name.class.identifier.namespace.type | #d33682 | — |
| entity.name.class, variable.other.class.js, variable.other.class.ts | #d33682 | — |
| variable.other.class.php | #d7d7d7 | — |
| entity.name.type | #d33682 | — |
| keyword.control | #dc312e | — |
| control.elements, keyword.operator.less | #859900 | — |
| storage | #dc312e | — |
| token.storage | #dc312e | — |
| token.storage.type.java | #d33682 | — |
| support.function | #278bd3 | — |
| support.constant.font-name | #2aa298 | — |
| meta.tag | #d7d7d7 | — |
| string | #2aa298 | — |
| constant.other.symbol | #859900 | — |
| constant.numeric | #859900 | — |
| constant | #859900 | — |
| punctuation.definition.constant | #859900 | — |
| entity.name.tag | #b67352 | — |
| meta.selector | #dc312e | — |
| markup.heading | #d7d7d7 | — |
| markup.heading punctuation.definition.heading, entity.name.section | #278bd3 | — |
| markup.bold,todo.bold | #859900 | — |
| punctuation.definition.bold | #d33682 | — |
| markup.italic, punctuation.definition.italic,todo.emphasis | #dc312e | — |
| emphasis md | #dc312e | — |
| entity.name.section.markdown | #e35b00 | — |
| markup.heading.setext | #d7d7d7 | — |
| markup.inline.raw.markdown | #2aa298 | — |
| punctuation.definition.list.markdown | #d7d7d7 | — |
| punctuation.definition.string.begin.markdown, punctuation.definition.string.end.markdown, punctuation.definition.metadata.markdown | #d7d7d7 | — |
| beginning.punctuation.definition.list.markdown | #d7d7d7 | — |
| punctuation.definition.metadata.markdown | #d7d7d7 | — |
| string.other.link.title.markdown,string.other.link.description.markdown | #278bd3 | — |
| string.regexp | #859900 | — |
| punctuation.section.embedded, variable.interpolation | #d7d7d7 | — |
| punctuation.section.embedded.begin,punctuation.section.embedded.end | #dc312e | — |
| invalid.illegal | #d7d7d7 | — |
| invalid.illegal.bad-ampersand.html | #d7d7d7 | — |
| invalid.broken | #d7d7d7 | — |
| invalid.deprecated | #d7d7d7 | — |
| invalid.unimplemented | #d7d7d7 | — |
| source.json meta.structure.dictionary.json > string.quoted.json | #d7d7d7 | — |
| source.json meta.structure.dictionary.json > string.quoted.json > punctuation.string | #d7d7d7 | — |
| source.json meta.structure.dictionary.json > value.json > string.quoted.json,source.json meta.structure.array.json > value.json > string.quoted.json,source.json meta.structure.dictionary.json > value.json > string.quoted.json > punctuation,source.json meta.structure.array.json > value.json > string.quoted.json > punctuation | #2aa298 | — |
| source.json meta.structure.dictionary.json > constant.language.json,source.json meta.structure.array.json > constant.language.json | #859900 | — |
| text.html.laravel-blade source.php.embedded.line.html entity.name.tag.laravel-blade | #dc312e | — |
| text.html.laravel-blade source.php.embedded.line.html support.constant.laravel-blade | #dc312e | — |
| support.other.namespace.use.php,support.other.namespace.use-as.php,support.other.namespace.php,entity.other.alias.php,meta.interface.php | #d33682 | — |
| keyword.operator.error-control.php | #dc312e | — |
| punctuation.section.array.begin.php | #d7d7d7 | — |
| punctuation.section.array.end.php | #d7d7d7 | — |
| invalid.illegal.non-null-typehinted.php | #dc312e | — |
| meta.other.type.phpdoc.php,keyword.other.array.phpdoc.php | #d33682 | — |
| meta.function-call.php,meta.function-call.object.php,meta.function-call.static.php | #278bd3 | — |
| punctuation.definition.parameters.begin.bracket.round.php,punctuation.definition.parameters.end.bracket.round.php,punctuation.separator.delimiter.php,punctuation.section.scope.begin.php,punctuation.section.scope.end.php,punctuation.definition.arguments.begin.bracket.round.php,punctuation.definition.arguments.end.bracket.round.php,punctuation.definition.storage-type.begin.bracket.round.php,punctuation.definition.storage-type.end.bracket.round.php,punctuation.definition.array.begin.bracket.round.php,punctuation.definition.array.end.bracket.round.php,punctuation.definition.begin.bracket.round.php,punctuation.definition.end.bracket.round.php,punctuation.definition.begin.bracket.curly.php,punctuation.definition.end.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php,punctuation.definition.section.switch-block.start.bracket.curly.php,punctuation.definition.section.switch-block.begin.bracket.curly.php,punctuation.definition.section.switch-block.end.bracket.curly.php | #d7d7d7 | — |
| support.constant.core.rust | #859900 | — |
| support.constant.ext.php,support.constant.std.php,support.constant.core.php,support.constant.parser-token.php | #859900 | — |
| entity.name.goto-label.php,support.other.php | #278bd3 | — |
| keyword.operator.regexp.php | #dc312e | — |
| keyword.operator.heredoc.php,keyword.operator.nowdoc.php | #dc312e | — |
| meta.function.decorator.python | #278bd3 | — |
| support.token.decorator.python,meta.function.decorator.identifier.python | #859900 | — |
| function.parameter | #d7d7d7 | — |
| function.brace | #d7d7d7 | — |
| function.parameter.ruby, function.parameter.cs | #d7d7d7 | — |
| rgb-value | #859900 | — |
| inline-color-decoration rgb-value | #859900 | — |
| less rgb-value | #859900 | — |
| selector.sass | #d7d7d7 | — |
| block.scope.end,block.scope.begin | #d7d7d7 | — |
| entity.name.variable.local.cs | #d7d7d7 | — |
| token.info-token | #278bd3 | — |
| token.warn-token | #859900 | — |
| token.error-token | #dc312e | — |
| token.debug-token | #e35b00 | — |
| meta.template.expression | #d7d7d7 | — |
| keyword.operator.module | #dc312e | — |
| support.type.type.flowtype | #278bd3 | — |
| meta.property.object | #d7d7d7 | — |
| variable.parameter.function.js | #d7d7d7 | — |
| keyword.operator.address.go | #dc312e | — |
| entity.name.package.go | #d33682 | — |
| support.type.prelude.elm | #859900 | — |
| support.constant.elm | #859900 | — |
| punctuation.quasi.element | #dc312e | — |
| constant.character.entity | #d7d7d7 | — |
| entity.global.clojure | #b67352 | — |
| meta.symbol.clojure | #d7d7d7 | — |
| constant.keyword.clojure | #ffbf00 | — |
| meta.arguments.coffee, variable.parameter.function.coffee | #d7d7d7 | — |
| source.ini | #2aa298 | — |
| meta.scope.prerequisites.makefile | #d7d7d7 | — |
| source.makefile | #d33682 | — |
| storage.modifier.import.groovy | #d33682 | — |
| meta.method.groovy | #278bd3 | — |
| meta.definition.variable.name.groovy | #d7d7d7 | — |
| meta.definition.class.inherited.classes.groovy | #2aa298 | — |
| support.variable.semantic.hlsl | #d33682 | — |
| support.type.texture.hlsl, support.type.sampler.hlsl, support.type.object.hlsl, support.type.object.rw.hlsl, support.type.fx.hlsl, support.type.object.hlsl | #dc312e | — |
| text.variable, text.bracketed | #d7d7d7 | — |
| support.type.vb.asp | #b67352 | — |
| entity.name.function.xi | #d33682 | — |
| entity.name.class.xi | #859900 | — |
| constant.character.character-class.regexp.xi | #d7d7d7 | — |
| constant.regexp.xi | #dc312e | — |
| keyword.control.xi | #859900 | — |
| invalid.xi | #d7d7d7 | — |
| beginning.punctuation.definition.quote.markdown.xi | #2aa298 | — |
| beginning.punctuation.definition.list.markdown.xi | #696969 | — |
| constant.character.xi | #278bd3 | — |
| accent.xi | #278bd3 | — |
| wikiword.xi | #859900 | — |
| constant.other.color.rgb-value.xi | #d7d7d7 | — |
| punctuation.definition.tag.xi | #696969 | — |
| entity.name.label.cs, entity.name.scope-resolution.function.call, entity.name.scope-resolution.function.definition | #d33682 | — |
| entity.name.label.cs, markup.heading.setext.1.markdown, markup.heading.setext.2.markdown | #d7d7d7 | — |
| comment, punctuation.definition.comment | #696969 | italic |
| markup.quote.markdown | #696969 | — |
| punctuation.definition.block.sequence.item.yaml | #d7d7d7 | — |
| constant.language.symbol.elixir | #859900 | — |
| comment.line.double-slash,comment.block.documentation | — | italic |
| keyword.control.import.python,keyword.control.flow.python | — | italic |
| markup.italic.markdown | #d7d7d7 | italic |
TypeScript sample highlighted with this variant's colors and tokenColors.
Loading...
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}!`;
}