Welkin Tree Style
Publisher: guippThemes in package: 2
语法高亮、主题和代码片段支持,为 Welkin Tree 语言(.tree, .nd, .des, .shd, .srv)提供完整的开发体验
语法高亮、主题和代码片段支持,为 Welkin Tree 语言(.tree, .nd, .des, .shd, .srv)提供完整的开发体验
Full workbench mockup using this variant's colors and tokenColors.
Loading...
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| comment.line.number-sign.tree | #6A9955 | italic |
| keyword.control.sequence.tree, keyword.control.selector.tree, keyword.control.parallel.tree, keyword.control.ifelse.tree, keyword.control.while.tree | #C586C0 | — |
| keyword.control.root_node.tree | #00FF88 | bold |
| keyword.control.init_node.tree | #7DD3C0 | italic |
| keyword.control.finish_node.tree | #FF6B6B | bold |
| keyword.control.sequence.tree, keyword.control.selector.tree, keyword.control.parallel.tree | #4EC9B0 | — |
| keyword.control.while.tree | #C586C0 | bold |
| keyword.control.success.tree | #4EC9B0 | bold |
| keyword.control.failure.tree | #F48771 | bold |
| keyword.control.shared_node.tree, keyword.control.child_node.tree, keyword.control.composite.tree, keyword.control.decorator.tree | #4EC9B0 | — |
| keyword.control.name.tree, keyword.control.param.tree, keyword.control.shared_node.key.tree, keyword.control.condition.tree, keyword.control.action.tree | #9CDCFE | — |
| keyword.control.switcher.tree | #DCDCAA | — |
| keyword.other.header.tree | #569CD6 | — |
| keyword.other.namespace.tree | #4EC9B0 | — |
| keyword.other.file.tree, keyword.other.name.tree | #808080 | — |
| keyword.operator.arrow.tree, keyword.operator.arrow.method.tree, keyword.operator.arrow.return.tree | #D7BA7D | bold |
| keyword.operator.colon.tree, keyword.operator.ampersand.tree, keyword.operator.logical.and.tree, keyword.operator.logical.or.tree, keyword.operator.decorator.prefix.tree | #D4D4D4 | — |
| punctuation.separator.comma.tree, punctuation.separator.namespace.tree, punctuation.definition.parenthesis.begin.tree, punctuation.definition.parenthesis.end.tree | #808080 | — |
| entity.name.namespace.tree | #4EC9B0 | italic |
| entity.name.function.tree, entity.name.function.call.tree, entity.name.function.pid.tree | #DCDCAA | bold |
| entity.name.function.method.tree | #4EC9B0 | bold |
| entity.name.reference.tree | #4EC9B0 | — |
| meta.function-call.tree, meta.function-call.return-chain.tree, meta.method-call.tree, meta.return-chain.tree, meta.return-chain-args.tree | #D4D4D4 | — |
| string.quoted.double.tree | #D7BA7D | — |
| string.quoted.double.escaped.tree | #D7BA7D | italic |
| string.quoted.single.input.tree | #D7BA7D | italic |
| string.other.input-arg.tree | #D7BA7D | italic |
| meta.macro.tree, constant.other.macro-content.tree | #4EC9B0 | bold |
| constant.language.enum.tree | #569CD6 | bold |
| keyword.operator.param.tree, variable.parameter.key.tree, storage.type.tree, punctuation.separator.param.tree | #C586C0 | — |
| string.unquoted.file.tree, meta.file-reference.tree | #4EC9B0 | — |
| variable.name.file.tree | #4FC1FF | — |
| variable.name.local.tree | #9CDCFE | — |
| variable.name.shared.tree | #00B7FF | bold |
| variable.name.global.tree | #4A9EFF | bold |
| variable.name.member.tree | #5B9BD5 | bold |
| variable.other.object.tree | #6BA3D6 | bold |
| variable.name.tmp.tree | #3B7FC4 | italic |
| variable.other.brace.tree, variable.name.brace-content.tree | #6BA3D6 | bold |
| variable.interpolation.tree | #9CDCFE | — |
| variable.tree | #9CDCFE | — |
| constant.numeric.number.tree | #B5CEA8 | bold |
| constant.character.escape.tree | #D7BA7D | — |
| constant.language.true.tree | #4EC9B0 | — |
| constant.language.false.tree | #F48771 | — |
| constant.other.constant.tree | #4EC9B0 | — |
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}!`;
}