darkwatch/client/src/dice-box.d.ts
Aaron Wood 51ffb0033a Add 3D dice rolling with predetermined outcomes and character colors
- dice-box-threejs for physics-based 3D dice with @ notation for forced values
- Server rolls dice, all clients animate 3D dice landing on exact values
- Dice color matches rolling character's color (darkened HSL as die body)
- Roll log entry delayed until dice animation completes for suspense
- Red pulsing crit glow on damage buttons (visible on all themes)
- Nat 20 roll entries use proper theme background
- Themed scrollbar on main content area
- Stone texture + metal material with white numbers/outlines

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:01:05 -04:00

61 lines
1.6 KiB
TypeScript

declare module "@3d-dice/dice-box" {
interface DiceBoxConfig {
container?: string;
assetPath?: string;
theme?: string;
themeColor?: string;
scale?: number;
enableShadows?: boolean;
shadowTransparency?: number;
lightIntensity?: number;
onRollComplete?: (results: unknown[]) => void;
onDieComplete?: (result: unknown) => void;
}
class DiceBox {
constructor(config: DiceBoxConfig);
init(): Promise<void>;
roll(notation: string): Promise<unknown[]>;
add(notation: string): Promise<unknown[]>;
clear(): void;
show(): void;
hide(): void;
updateConfig(config: Partial<DiceBoxConfig>): void;
}
export default DiceBox;
}
declare module "@3d-dice/dice-box-threejs" {
interface DiceBoxThreeConfig {
assetPath?: string;
shadows?: boolean;
theme_colorset?: string;
theme_texture?: string;
theme_material?: string;
theme_surface?: string;
theme_customColorset?: Record<string, string> | null;
gravity_multiplier?: number;
light_intensity?: number;
baseScale?: number;
strength?: number;
onRollComplete?: (results: unknown[]) => void;
}
class DiceBox {
constructor(container: string, config?: DiceBoxThreeConfig);
initialize(): Promise<void>;
roll(notation: string): Promise<unknown[]>;
clearDice(): void;
loadTheme(config: Record<string, string>): Promise<void>;
theme_customColorset: Record<string, string> | null;
DiceColors: {
makeColorSet(c: Record<string, string>): Promise<unknown>;
};
DiceFactory: {
applyColorSet(c: unknown): void;
};
}
export default DiceBox;
}