JSX component support and time command

This commit is contained in:
JB
2026-01-02 16:08:20 -05:00
parent eece9b1257
commit bba8c4f6f1
71 changed files with 1214 additions and 429 deletions

127
types/jsx.d.ts vendored
View File

@@ -53,25 +53,48 @@ declare namespace JSX {
props: {};
}
// This tells TypeScript to check children against the 'children' property
interface ElementChildrenAttribute {
children: {};
}
interface IntrinsicElements {
// Allow any element, but prefer known elements
[elemName: string]: any;
// Known elements
ActionRow: { children: any | any[] };
Button: {
// Known elements - no index signature to enforce type safety
actionRow: { children: Element | Element[] };
button: {
label: string;
customId: string;
style?: number;
style: number;
emoji?: PartialEmoji;
disabled?: boolean;
};
Container: { accent?: number; spoiler?: boolean; children: any | any[] };
TextDisplay: { content: string };
container: {
accent?: number;
spoiler?: boolean;
children: Element | Element[];
};
textDisplay: { content: string };
modal: { customId?: string; title?: string; children: Element | Element[] };
label: { label: string; children: Element };
stringSelect: {
customId: string;
placeholder?: string;
minValues?: number;
maxValues?: number;
children: Element | Element[];
};
option: {
label: string;
value: string;
description?: string;
emoji?: PartialEmoji;
default?: boolean;
};
}
}
declare module "@star-kitten/lib/discord/jsx-runtime" {
declare namespace JSX {
export namespace JSX {
type Component =
| Button
| StringSelectMenu
@@ -102,26 +125,52 @@ declare module "@star-kitten/lib/discord/jsx-runtime" {
props: {};
}
// This tells TypeScript to check children against the 'children' property
interface ElementChildrenAttribute {
children: {};
}
interface IntrinsicElements {
// Allow any element, but prefer known elements
[elemName: string]: any;
// Known elements
ActionRow: { children: any | any[] };
Button: {
actionRow: { children: Element | Element[] };
button: {
label: string;
customId: string;
style?: number;
style: number;
emoji?: PartialEmoji;
disabled?: boolean;
};
Container: { accent?: number; spoiler?: boolean; children: any | any[] };
TextDisplay: { content: string };
container: {
accent?: number;
spoiler?: boolean;
children: Element | Element[];
};
textDisplay: { content: string };
modal: {
customId?: string;
title?: string;
children: Element | Element[];
};
label: { label: string; children: Element };
stringSelect: {
customId: string;
placeholder?: string;
minValues?: number;
maxValues?: number;
children: Element | Element[];
};
option: {
label: string;
value: string;
description?: string;
emoji?: PartialEmoji;
default?: boolean;
};
}
}
}
declare module "@star-kitten/lib/discord/jsx-dev-runtime" {
declare namespace JSX {
export namespace JSX {
type Component =
| Button
| StringSelectMenu
@@ -152,20 +201,46 @@ declare module "@star-kitten/lib/discord/jsx-dev-runtime" {
props: {};
}
// This tells TypeScript to check children against the 'children' property
interface ElementChildrenAttribute {
children: {};
}
interface IntrinsicElements {
// Allow any element, but prefer known elements
[elemName: string]: any;
// Known elements
ActionRow: { children: any | any[] };
Button: {
actionRow: { children: Element | Element[] };
button: {
label: string;
customId: string;
style?: number;
style: number;
emoji?: PartialEmoji;
disabled?: boolean;
};
Container: { accent?: number; spoiler?: boolean; children: any | any[] };
TextDisplay: { content: string };
container: {
accent?: number;
spoiler?: boolean;
children: Element | Element[];
};
textDisplay: { content: string };
modal: {
customId?: string;
title?: string;
children: Element | Element[];
};
label: { label: string; children: Element };
stringSelect: {
customId: string;
placeholder?: string;
minValues?: number;
maxValues?: number;
children: Element | Element[];
};
option: {
label: string;
value: string;
description?: string;
emoji?: PartialEmoji;
default?: boolean;
};
}
}
}