API reference
petty.pet
petty.pet.showBubble
showBubble(text: string, durationSec: number, style?: BubbleStyle): voidpetty.pet.animate
animate(state: string): voidpetty.pet.playSequence
playSequence(steps: AnimationStep[], callback?: () => void): voidpetty.pet.speak
speak(text: string, options?: SpeakOptions): voidpetty.pet.mood
mood(): PetMoodpetty.pet.setMood
setMood(mood: PetMood): voidpetty.pet.isMuted
isMuted(): booleanpetty.pet.isDoNotDisturb
isDoNotDisturb(): booleanTypes referenced
BubbleStyle
interface BubbleStyle {
background?: string; // hex with or without '#'
color?: string;
borderColor?: string;
borderWidth?: number; // 0 hides border
fontSize?: number;
fontWeight?:
| "ultralight" | "thin" | "light" | "regular"
| "medium" | "semibold" | "bold" | "heavy" | "black";
textAlign?: "left" | "center" | "right";
cornerRadius?: number;
padding?: number;
maxWidth?: number;
tail?: boolean;
tailWidth?: number;
tailHeight?: number;
shadow?: boolean;
shadowOffsetX?: number;
shadowOffsetY?: number;
shadowBlur?: number;
shadowOpacity?: number;
fadeDuration?: number;
}AnimationStep
interface AnimationStep {
scaleX?: number;
scaleY?: number;
rotate?: number; // degrees, relative
moveX?: number; // points, relative
moveY?: number; // points, relative
fade?: number; // absolute alpha 0..1
duration?: number; // seconds, default 0.15
}SpeakOptions
interface SpeakOptions {
/** "notification" (default), "quip", or "drop". Provider plugins inspect
* this to decide whether to synthesize or fall back to the system voice. */
category?: "notification" | "quip" | "drop";
}PetMood
type PetMood =
| "idle" | "excited" | "sleeping" | "yelling" | "thinking"
| string;