Can Framework Official Tooling
Publisher: can-frameworkThemes in package: 1
Language support and themes for the Can Framework
Language support and themes for the Can Framework
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 |
|---|---|---|
| keyword, storage, storage.type, keyword.control | #C586C0 | — |
| keyword.other.can, source.can entity.name.function, source.can support.function, entity.name.function | #DCDCAA | — |
| source.can entity.name.type, source.can support.class, entity.name.type, support.class | #4EC9B0 | bold |
| source.can variable, source.can meta.definition.variable, variable, variable.object, variable.other.readwrite | #9CDCFE | — |
| variable.other.css, support.type.property-name.css | #9CDCFE | — |
| entity.other.attribute-name.class.css, entity.other.attribute-name.id.css | #DCDCAA | — |
| string | #CE9178 | — |
| meta.interpolation.can, meta.template.expression, punctuation.section.embedded | #FF9E64 | — |
| entity.name.tag, entity.name.tag.html, entity.name.tag.css | #569CD6 | — |
| comment | #6A9955 | — |
| entity.other.attribute-name, entity.other.attribute-name.html | #9CDCFE | — |
| keyword.control.directive.can | #FF9E64 | bold |
| entity.other.attribute-name.directive.can | #4EC9B0 | — |
| support.function.reactive.can, variable.language.signal.can | #4FC1FF | italic |
| variable.other.property.force-transform.can | #C586C0 | — |
| punctuation, keyword.operator | #D4D4D4 | — |
| variable.parameter | #9CDCFE | — |
| constant.numeric, constant.language, constant.character, constant.other, support.constant.property-value.css | #B5CEA8 | — |
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}!`;
}