-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
84 lines (77 loc) · 1.78 KB
/
Copy pathtypes.ts
File metadata and controls
84 lines (77 loc) · 1.78 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
* Algorithmic Visual Evolution - Type Definitions
*
* Central location for shared TypeScript interfaces and types used across the application:
* - Color types (RGB, HSB)
* - Cell structure definitions
* - Parameter and configuration interfaces
* - Function type signatures
*
* Ensures consistent typing across modules and improves code maintainability.
*/
// Import Direction from GridManager to ensure type consistency
import { Direction } from './utils/gridManager.js';
export interface RGB {
r: number;
g: number;
b: number;
a: number;
}
export interface HSB {
h: number;
s: number;
b: number;
}
export interface Cell {
state: number;
color?: RGB;
birth?: number;
prevDir?: Direction;
decayDelay?: number;
decaying?: boolean;
}
export interface Config {
canvasWidth: number;
canvasHeight: number;
cellSize: number;
minCellSize: number;
maxCellSize: number;
minTickRate: number;
maxTickRate: number;
decay: {
baseDelay: number;
baseDecayChance: number;
slowdownFactor: number;
minDecayChance: number;
edgeBreakChance: number;
randomRange: number;
};
creepingFig: {
baseActivations: number;
neighborRadius: number;
branchAge: number;
directionFollowChance: number;
};
binaryTransitions: {
enabled: boolean;
threshold: number;
};
colorSettings: {
baseH: number;
baseS: number;
baseB: number;
scheme?: string;
};
derivedColors?: HSB[];
_overrides: Record<string, boolean>;
}
export interface ParameterDefinition {
path: string;
label: string;
description: string;
min?: number;
max?: number;
step?: number;
type: "range" | "checkbox";
}
export type BounceFunction = (newI: number, newJ: number, offset: Direction) => { newI: number; newJ: number } | null;