NDSDN Wiki
Publisher: SecodeThemes in package: 1
NDSDN Wiki
NDSDN Wiki
Full workbench mockup using this variant's colors and tokenColors.
Loading...
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| ndsdn.wiki.heading | #ff0000 | |
| markup.bold.ndsdn.wiki | #f92672 | bold |
| markup.italic.ndsdn.wiki | #e42e70 | italic |
| markup.underline.ndsdn.wiki | #e42e70 | underline |
| markup.ndsdn.wiki.question | #ff0000 | italic |
| markup.underline.link.ndsdn.wiki | #999 | |
| markup.underline.text.ndsdn.wiki | #e6db74ff | |
| markup.quote.ndsdn.wiki | #800000 | — |
| markup.ndsdn.wiki.remark.green | #00ff00 | — |
| markup.ndsdn.wiki.remark.red | #ff0000 | — |
| markup.ndsdn.wiki.remark.blue | #04b | — |
| markup.ndsdn.wiki.remark.gray | #808080 | — |
| markup.ndsdn.wiki.remark.yellow | #FFFF00 | — |
| markup.inline.raw.string, punctuation.definition.ndsdn.wiki | #fd971fff | — |
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}!`;
}