-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathspinner-data.ts
More file actions
66 lines (57 loc) · 1.98 KB
/
Copy pathspinner-data.ts
File metadata and controls
66 lines (57 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
* Spinner data module
*
* Frame presets for the integrated pi-animations + spinner extension.
*/
// ─── Types ────────────────────────────────────────────────────────
export type FramePreset = "claude" | "braille" | "pulse" | "dot" | "star" | "none";
export interface FrameConfig {
frames: string[];
intervalMs: number;
}
// ─── Frame Presets ────────────────────────────────────────────────
type FramePresets = Record<FramePreset, FrameConfig>;
export const FRAME_PRESETS: FramePresets = {
/** Claude Code's bespoke 6-frame asterisk/star sequence */
claude: {
frames: ["·", "✢", "✳", "✶", "✻", "✽"],
intervalMs: 100,
},
/** Standard Braille dots (pi's default) */
braille: {
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"],
intervalMs: 80,
},
/** Simple pulse animation */
pulse: {
frames: ["·", "•", "●", "•"],
intervalMs: 120,
},
/** Static dot — no animation */
dot: {
frames: ["●"],
intervalMs: 0,
},
/** Star / sparkle variants */
star: {
frames: ["✧", "★", "✦", "✶", "✹"],
intervalMs: 100,
},
/** Hidden — no indicator shown */
none: {
frames: [],
intervalMs: 0,
},
};
// ─── Helpers ──────────────────────────────────────────────────────
/** Pretty-print a frame list for display */
export function formatFrames(frames: string[]): string {
if (frames.length === 0) return "(none)";
if (frames.length === 1) return frames[0]!;
return frames.join(" ");
}
/** Get frame preset by key, fallback to braille */
export function getFrameConfig(key: string): FrameConfig {
const preset = FRAME_PRESETS[key as FramePreset];
return preset ?? FRAME_PRESETS.braille;
}