@ogabrielluiz/patchflow 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +119 -0
- package/dist/chunk-B7DUSPQH.js +42 -0
- package/dist/chunk-B7DUSPQH.js.map +1 -0
- package/dist/index.cjs +4702 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +4652 -0
- package/dist/index.js.map +1 -0
- package/dist/types.cjs +38 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +177 -0
- package/dist/types.d.ts +177 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +46 -0
package/dist/types.cjs
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/types.ts
|
|
21
|
+
var types_exports = {};
|
|
22
|
+
__export(types_exports, {
|
|
23
|
+
SIGNAL_OPERATORS: () => SIGNAL_OPERATORS
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(types_exports);
|
|
26
|
+
var SIGNAL_OPERATORS = {
|
|
27
|
+
"->": "audio",
|
|
28
|
+
">>": "cv",
|
|
29
|
+
"p>": "pitch",
|
|
30
|
+
"g>": "gate",
|
|
31
|
+
"t>": "trigger",
|
|
32
|
+
"c>": "clock"
|
|
33
|
+
};
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
SIGNAL_OPERATORS
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["// ── Signal Types ──\n\nexport type SignalType = 'audio' | 'cv' | 'pitch' | 'gate' | 'trigger' | 'clock';\n\nexport const SIGNAL_OPERATORS: Record<string, SignalType> = {\n '->': 'audio',\n '>>': 'cv',\n 'p>': 'pitch',\n 'g>': 'gate',\n 't>': 'trigger',\n 'c>': 'clock',\n};\n\n// ── Graph Primitives ──\n\nexport interface Port {\n id: string; // normalized key (lowercase, trimmed)\n display: string; // original form for rendering\n direction: 'in' | 'out';\n}\n\nexport interface Param {\n key: string;\n value: string;\n}\n\nexport interface Block {\n id: string;\n label: string;\n subLabel: string | null;\n params: Param[];\n ports: Port[];\n parentModule: string | null; // null for top-level modules, module name for sections\n voice: string | null;\n}\n\nexport interface ConnectionEndpoint {\n blockId: string;\n portId: string; // normalized key\n portDisplay: string; // original form\n}\n\nexport interface Connection {\n id: string;\n source: ConnectionEndpoint;\n target: ConnectionEndpoint;\n signalType: SignalType;\n annotation: string | null;\n graphvizExtras: Record<string, string> | null;\n}\n\n// ── Patch Graph (Parser Output) ──\n\nexport interface PatchGraph {\n declaredBlocks: Block[];\n stubBlocks: Block[];\n connections: Connection[];\n feedbackEdges: Connection[];\n signalTypeStats: Partial<Record<SignalType, number>>;\n voices: string[];\n}\n\n// ── Layout Types ──\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport interface LayoutPort extends Port {\n position: Point;\n signalType: SignalType | null;\n}\n\nexport interface LayoutBlock {\n id: string;\n label: string;\n subLabel: string | null;\n params: Param[];\n ports: LayoutPort[];\n parentModule: string | null;\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\nexport interface LayoutConnection {\n id: string;\n source: ConnectionEndpoint;\n target: ConnectionEndpoint;\n signalType: SignalType;\n annotation: string | null;\n path: string; // SVG path d attribute\n isFeedback: boolean;\n sourcePoint: Point;\n targetPoint: Point;\n}\n\nexport interface LayoutResult {\n blocks: LayoutBlock[];\n connections: LayoutConnection[];\n width: number;\n height: number;\n signalTypeStats: Partial<Record<SignalType, number>>;\n}\n\n// ── Theme Types ──\n\nexport interface CableColor {\n stroke: string;\n plugTip: string;\n}\n\nexport interface SocketColors {\n bezel: string;\n bezelStroke: string;\n ring: string;\n hole: string;\n pin: string;\n}\n\nexport interface Theme {\n background: string;\n panel: {\n fill: string;\n stroke: string;\n highlight: string;\n shadow: string;\n cornerRadius: number;\n shadowBlur: number;\n shadowOpacity: number;\n bevelWidth: number;\n };\n label: {\n fontFamily: string;\n color: string;\n subColor: string;\n plateFill: string;\n plateStroke: string;\n };\n param: {\n plateFill: string;\n plateStroke: string;\n textColor: string;\n };\n port: {\n fontFamily: string;\n fontSize: number;\n colors: SocketColors;\n hideSocket: boolean;\n labelColor: string;\n pill: {\n show: boolean;\n fontSize: number;\n textColor: string;\n cornerRadius: number;\n };\n };\n cable: {\n width: number;\n colors: Record<SignalType, CableColor>;\n plugTipRadius: number;\n };\n annotation: {\n fontFamily: string;\n fontSize: number;\n color: string;\n haloColor: string;\n };\n grid: {\n dotColor: string;\n dotRadius: number;\n spacing: number;\n opacity: number;\n } | null;\n}\n\n// ── Options ──\n\nexport interface RenderOptions {\n theme?: DeepPartial<Theme>;\n maxWidth?: number;\n padding?: number;\n legend?: boolean | 'auto';\n}\n\nexport interface LayoutOptions {\n direction?: 'LR' | 'TB';\n nodeSep?: number;\n rankSep?: number;\n feedbackSide?: 'top' | 'bottom';\n}\n\n// ── Parse Result ──\n\nexport type ErrorCode =\n | 'SYNTAX_ERROR'\n | 'UNKNOWN_OPERATOR'\n | 'MISSING_PORT'\n | 'UNCLOSED_PAREN'\n | 'DUPLICATE_MODULE'\n | 'UNKNOWN_MODULE'\n | 'INVALID_PORT';\n\nexport type ErrorSeverity = 'error' | 'warning';\n\nexport interface ParseDiagnostic {\n code: ErrorCode;\n message: string;\n line: number;\n column: number;\n length: number;\n severity: ErrorSeverity;\n}\n\nexport interface ParseResult {\n graph: PatchGraph;\n errors: ParseDiagnostic[];\n warnings: ParseDiagnostic[];\n}\n\n// ── Utility Types ──\n\nexport type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,IAAM,mBAA+C;AAAA,EAC1D,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AACR;","names":[]}
|
package/dist/types.d.cts
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
type SignalType = 'audio' | 'cv' | 'pitch' | 'gate' | 'trigger' | 'clock';
|
|
2
|
+
declare const SIGNAL_OPERATORS: Record<string, SignalType>;
|
|
3
|
+
interface Port {
|
|
4
|
+
id: string;
|
|
5
|
+
display: string;
|
|
6
|
+
direction: 'in' | 'out';
|
|
7
|
+
}
|
|
8
|
+
interface Param {
|
|
9
|
+
key: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
interface Block {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
subLabel: string | null;
|
|
16
|
+
params: Param[];
|
|
17
|
+
ports: Port[];
|
|
18
|
+
parentModule: string | null;
|
|
19
|
+
voice: string | null;
|
|
20
|
+
}
|
|
21
|
+
interface ConnectionEndpoint {
|
|
22
|
+
blockId: string;
|
|
23
|
+
portId: string;
|
|
24
|
+
portDisplay: string;
|
|
25
|
+
}
|
|
26
|
+
interface Connection {
|
|
27
|
+
id: string;
|
|
28
|
+
source: ConnectionEndpoint;
|
|
29
|
+
target: ConnectionEndpoint;
|
|
30
|
+
signalType: SignalType;
|
|
31
|
+
annotation: string | null;
|
|
32
|
+
graphvizExtras: Record<string, string> | null;
|
|
33
|
+
}
|
|
34
|
+
interface PatchGraph {
|
|
35
|
+
declaredBlocks: Block[];
|
|
36
|
+
stubBlocks: Block[];
|
|
37
|
+
connections: Connection[];
|
|
38
|
+
feedbackEdges: Connection[];
|
|
39
|
+
signalTypeStats: Partial<Record<SignalType, number>>;
|
|
40
|
+
voices: string[];
|
|
41
|
+
}
|
|
42
|
+
interface Point {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
}
|
|
46
|
+
interface LayoutPort extends Port {
|
|
47
|
+
position: Point;
|
|
48
|
+
signalType: SignalType | null;
|
|
49
|
+
}
|
|
50
|
+
interface LayoutBlock {
|
|
51
|
+
id: string;
|
|
52
|
+
label: string;
|
|
53
|
+
subLabel: string | null;
|
|
54
|
+
params: Param[];
|
|
55
|
+
ports: LayoutPort[];
|
|
56
|
+
parentModule: string | null;
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
}
|
|
62
|
+
interface LayoutConnection {
|
|
63
|
+
id: string;
|
|
64
|
+
source: ConnectionEndpoint;
|
|
65
|
+
target: ConnectionEndpoint;
|
|
66
|
+
signalType: SignalType;
|
|
67
|
+
annotation: string | null;
|
|
68
|
+
path: string;
|
|
69
|
+
isFeedback: boolean;
|
|
70
|
+
sourcePoint: Point;
|
|
71
|
+
targetPoint: Point;
|
|
72
|
+
}
|
|
73
|
+
interface LayoutResult {
|
|
74
|
+
blocks: LayoutBlock[];
|
|
75
|
+
connections: LayoutConnection[];
|
|
76
|
+
width: number;
|
|
77
|
+
height: number;
|
|
78
|
+
signalTypeStats: Partial<Record<SignalType, number>>;
|
|
79
|
+
}
|
|
80
|
+
interface CableColor {
|
|
81
|
+
stroke: string;
|
|
82
|
+
plugTip: string;
|
|
83
|
+
}
|
|
84
|
+
interface SocketColors {
|
|
85
|
+
bezel: string;
|
|
86
|
+
bezelStroke: string;
|
|
87
|
+
ring: string;
|
|
88
|
+
hole: string;
|
|
89
|
+
pin: string;
|
|
90
|
+
}
|
|
91
|
+
interface Theme {
|
|
92
|
+
background: string;
|
|
93
|
+
panel: {
|
|
94
|
+
fill: string;
|
|
95
|
+
stroke: string;
|
|
96
|
+
highlight: string;
|
|
97
|
+
shadow: string;
|
|
98
|
+
cornerRadius: number;
|
|
99
|
+
shadowBlur: number;
|
|
100
|
+
shadowOpacity: number;
|
|
101
|
+
bevelWidth: number;
|
|
102
|
+
};
|
|
103
|
+
label: {
|
|
104
|
+
fontFamily: string;
|
|
105
|
+
color: string;
|
|
106
|
+
subColor: string;
|
|
107
|
+
plateFill: string;
|
|
108
|
+
plateStroke: string;
|
|
109
|
+
};
|
|
110
|
+
param: {
|
|
111
|
+
plateFill: string;
|
|
112
|
+
plateStroke: string;
|
|
113
|
+
textColor: string;
|
|
114
|
+
};
|
|
115
|
+
port: {
|
|
116
|
+
fontFamily: string;
|
|
117
|
+
fontSize: number;
|
|
118
|
+
colors: SocketColors;
|
|
119
|
+
hideSocket: boolean;
|
|
120
|
+
labelColor: string;
|
|
121
|
+
pill: {
|
|
122
|
+
show: boolean;
|
|
123
|
+
fontSize: number;
|
|
124
|
+
textColor: string;
|
|
125
|
+
cornerRadius: number;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
cable: {
|
|
129
|
+
width: number;
|
|
130
|
+
colors: Record<SignalType, CableColor>;
|
|
131
|
+
plugTipRadius: number;
|
|
132
|
+
};
|
|
133
|
+
annotation: {
|
|
134
|
+
fontFamily: string;
|
|
135
|
+
fontSize: number;
|
|
136
|
+
color: string;
|
|
137
|
+
haloColor: string;
|
|
138
|
+
};
|
|
139
|
+
grid: {
|
|
140
|
+
dotColor: string;
|
|
141
|
+
dotRadius: number;
|
|
142
|
+
spacing: number;
|
|
143
|
+
opacity: number;
|
|
144
|
+
} | null;
|
|
145
|
+
}
|
|
146
|
+
interface RenderOptions {
|
|
147
|
+
theme?: DeepPartial<Theme>;
|
|
148
|
+
maxWidth?: number;
|
|
149
|
+
padding?: number;
|
|
150
|
+
legend?: boolean | 'auto';
|
|
151
|
+
}
|
|
152
|
+
interface LayoutOptions {
|
|
153
|
+
direction?: 'LR' | 'TB';
|
|
154
|
+
nodeSep?: number;
|
|
155
|
+
rankSep?: number;
|
|
156
|
+
feedbackSide?: 'top' | 'bottom';
|
|
157
|
+
}
|
|
158
|
+
type ErrorCode = 'SYNTAX_ERROR' | 'UNKNOWN_OPERATOR' | 'MISSING_PORT' | 'UNCLOSED_PAREN' | 'DUPLICATE_MODULE' | 'UNKNOWN_MODULE' | 'INVALID_PORT';
|
|
159
|
+
type ErrorSeverity = 'error' | 'warning';
|
|
160
|
+
interface ParseDiagnostic {
|
|
161
|
+
code: ErrorCode;
|
|
162
|
+
message: string;
|
|
163
|
+
line: number;
|
|
164
|
+
column: number;
|
|
165
|
+
length: number;
|
|
166
|
+
severity: ErrorSeverity;
|
|
167
|
+
}
|
|
168
|
+
interface ParseResult {
|
|
169
|
+
graph: PatchGraph;
|
|
170
|
+
errors: ParseDiagnostic[];
|
|
171
|
+
warnings: ParseDiagnostic[];
|
|
172
|
+
}
|
|
173
|
+
type DeepPartial<T> = {
|
|
174
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export { type Block, type CableColor, type Connection, type ConnectionEndpoint, type DeepPartial, type ErrorCode, type ErrorSeverity, type LayoutBlock, type LayoutConnection, type LayoutOptions, type LayoutPort, type LayoutResult, type Param, type ParseDiagnostic, type ParseResult, type PatchGraph, type Point, type Port, type RenderOptions, SIGNAL_OPERATORS, type SignalType, type SocketColors, type Theme };
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
type SignalType = 'audio' | 'cv' | 'pitch' | 'gate' | 'trigger' | 'clock';
|
|
2
|
+
declare const SIGNAL_OPERATORS: Record<string, SignalType>;
|
|
3
|
+
interface Port {
|
|
4
|
+
id: string;
|
|
5
|
+
display: string;
|
|
6
|
+
direction: 'in' | 'out';
|
|
7
|
+
}
|
|
8
|
+
interface Param {
|
|
9
|
+
key: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}
|
|
12
|
+
interface Block {
|
|
13
|
+
id: string;
|
|
14
|
+
label: string;
|
|
15
|
+
subLabel: string | null;
|
|
16
|
+
params: Param[];
|
|
17
|
+
ports: Port[];
|
|
18
|
+
parentModule: string | null;
|
|
19
|
+
voice: string | null;
|
|
20
|
+
}
|
|
21
|
+
interface ConnectionEndpoint {
|
|
22
|
+
blockId: string;
|
|
23
|
+
portId: string;
|
|
24
|
+
portDisplay: string;
|
|
25
|
+
}
|
|
26
|
+
interface Connection {
|
|
27
|
+
id: string;
|
|
28
|
+
source: ConnectionEndpoint;
|
|
29
|
+
target: ConnectionEndpoint;
|
|
30
|
+
signalType: SignalType;
|
|
31
|
+
annotation: string | null;
|
|
32
|
+
graphvizExtras: Record<string, string> | null;
|
|
33
|
+
}
|
|
34
|
+
interface PatchGraph {
|
|
35
|
+
declaredBlocks: Block[];
|
|
36
|
+
stubBlocks: Block[];
|
|
37
|
+
connections: Connection[];
|
|
38
|
+
feedbackEdges: Connection[];
|
|
39
|
+
signalTypeStats: Partial<Record<SignalType, number>>;
|
|
40
|
+
voices: string[];
|
|
41
|
+
}
|
|
42
|
+
interface Point {
|
|
43
|
+
x: number;
|
|
44
|
+
y: number;
|
|
45
|
+
}
|
|
46
|
+
interface LayoutPort extends Port {
|
|
47
|
+
position: Point;
|
|
48
|
+
signalType: SignalType | null;
|
|
49
|
+
}
|
|
50
|
+
interface LayoutBlock {
|
|
51
|
+
id: string;
|
|
52
|
+
label: string;
|
|
53
|
+
subLabel: string | null;
|
|
54
|
+
params: Param[];
|
|
55
|
+
ports: LayoutPort[];
|
|
56
|
+
parentModule: string | null;
|
|
57
|
+
x: number;
|
|
58
|
+
y: number;
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
}
|
|
62
|
+
interface LayoutConnection {
|
|
63
|
+
id: string;
|
|
64
|
+
source: ConnectionEndpoint;
|
|
65
|
+
target: ConnectionEndpoint;
|
|
66
|
+
signalType: SignalType;
|
|
67
|
+
annotation: string | null;
|
|
68
|
+
path: string;
|
|
69
|
+
isFeedback: boolean;
|
|
70
|
+
sourcePoint: Point;
|
|
71
|
+
targetPoint: Point;
|
|
72
|
+
}
|
|
73
|
+
interface LayoutResult {
|
|
74
|
+
blocks: LayoutBlock[];
|
|
75
|
+
connections: LayoutConnection[];
|
|
76
|
+
width: number;
|
|
77
|
+
height: number;
|
|
78
|
+
signalTypeStats: Partial<Record<SignalType, number>>;
|
|
79
|
+
}
|
|
80
|
+
interface CableColor {
|
|
81
|
+
stroke: string;
|
|
82
|
+
plugTip: string;
|
|
83
|
+
}
|
|
84
|
+
interface SocketColors {
|
|
85
|
+
bezel: string;
|
|
86
|
+
bezelStroke: string;
|
|
87
|
+
ring: string;
|
|
88
|
+
hole: string;
|
|
89
|
+
pin: string;
|
|
90
|
+
}
|
|
91
|
+
interface Theme {
|
|
92
|
+
background: string;
|
|
93
|
+
panel: {
|
|
94
|
+
fill: string;
|
|
95
|
+
stroke: string;
|
|
96
|
+
highlight: string;
|
|
97
|
+
shadow: string;
|
|
98
|
+
cornerRadius: number;
|
|
99
|
+
shadowBlur: number;
|
|
100
|
+
shadowOpacity: number;
|
|
101
|
+
bevelWidth: number;
|
|
102
|
+
};
|
|
103
|
+
label: {
|
|
104
|
+
fontFamily: string;
|
|
105
|
+
color: string;
|
|
106
|
+
subColor: string;
|
|
107
|
+
plateFill: string;
|
|
108
|
+
plateStroke: string;
|
|
109
|
+
};
|
|
110
|
+
param: {
|
|
111
|
+
plateFill: string;
|
|
112
|
+
plateStroke: string;
|
|
113
|
+
textColor: string;
|
|
114
|
+
};
|
|
115
|
+
port: {
|
|
116
|
+
fontFamily: string;
|
|
117
|
+
fontSize: number;
|
|
118
|
+
colors: SocketColors;
|
|
119
|
+
hideSocket: boolean;
|
|
120
|
+
labelColor: string;
|
|
121
|
+
pill: {
|
|
122
|
+
show: boolean;
|
|
123
|
+
fontSize: number;
|
|
124
|
+
textColor: string;
|
|
125
|
+
cornerRadius: number;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
cable: {
|
|
129
|
+
width: number;
|
|
130
|
+
colors: Record<SignalType, CableColor>;
|
|
131
|
+
plugTipRadius: number;
|
|
132
|
+
};
|
|
133
|
+
annotation: {
|
|
134
|
+
fontFamily: string;
|
|
135
|
+
fontSize: number;
|
|
136
|
+
color: string;
|
|
137
|
+
haloColor: string;
|
|
138
|
+
};
|
|
139
|
+
grid: {
|
|
140
|
+
dotColor: string;
|
|
141
|
+
dotRadius: number;
|
|
142
|
+
spacing: number;
|
|
143
|
+
opacity: number;
|
|
144
|
+
} | null;
|
|
145
|
+
}
|
|
146
|
+
interface RenderOptions {
|
|
147
|
+
theme?: DeepPartial<Theme>;
|
|
148
|
+
maxWidth?: number;
|
|
149
|
+
padding?: number;
|
|
150
|
+
legend?: boolean | 'auto';
|
|
151
|
+
}
|
|
152
|
+
interface LayoutOptions {
|
|
153
|
+
direction?: 'LR' | 'TB';
|
|
154
|
+
nodeSep?: number;
|
|
155
|
+
rankSep?: number;
|
|
156
|
+
feedbackSide?: 'top' | 'bottom';
|
|
157
|
+
}
|
|
158
|
+
type ErrorCode = 'SYNTAX_ERROR' | 'UNKNOWN_OPERATOR' | 'MISSING_PORT' | 'UNCLOSED_PAREN' | 'DUPLICATE_MODULE' | 'UNKNOWN_MODULE' | 'INVALID_PORT';
|
|
159
|
+
type ErrorSeverity = 'error' | 'warning';
|
|
160
|
+
interface ParseDiagnostic {
|
|
161
|
+
code: ErrorCode;
|
|
162
|
+
message: string;
|
|
163
|
+
line: number;
|
|
164
|
+
column: number;
|
|
165
|
+
length: number;
|
|
166
|
+
severity: ErrorSeverity;
|
|
167
|
+
}
|
|
168
|
+
interface ParseResult {
|
|
169
|
+
graph: PatchGraph;
|
|
170
|
+
errors: ParseDiagnostic[];
|
|
171
|
+
warnings: ParseDiagnostic[];
|
|
172
|
+
}
|
|
173
|
+
type DeepPartial<T> = {
|
|
174
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export { type Block, type CableColor, type Connection, type ConnectionEndpoint, type DeepPartial, type ErrorCode, type ErrorSeverity, type LayoutBlock, type LayoutConnection, type LayoutOptions, type LayoutPort, type LayoutResult, type Param, type ParseDiagnostic, type ParseResult, type PatchGraph, type Point, type Port, type RenderOptions, SIGNAL_OPERATORS, type SignalType, type SocketColors, type Theme };
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ogabrielluiz/patchflow",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Eurorack patch diagram renderer. Patchbook-compatible notation → skeuomorphic SVG.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.cjs",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
},
|
|
15
|
+
"./types": {
|
|
16
|
+
"import": "./dist/types.js",
|
|
17
|
+
"require": "./dist/types.cjs",
|
|
18
|
+
"types": "./dist/types.d.ts"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": ["dist"],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsup",
|
|
24
|
+
"test": "bun test",
|
|
25
|
+
"typecheck": "tsc --noEmit",
|
|
26
|
+
"samples": "bun scripts/generate-samples.ts",
|
|
27
|
+
"prepublishOnly": "bun run build"
|
|
28
|
+
},
|
|
29
|
+
"keywords": ["eurorack", "patchbook", "modular-synth", "svg", "diagram"],
|
|
30
|
+
"author": "ogabrielluiz",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/ogabrielluiz/patchflow"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@dagrejs/dagre": "^1.1.4"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@resvg/resvg-js": "^2.6.2",
|
|
41
|
+
"@types/bun": "latest",
|
|
42
|
+
"sharp": "^0.34.5",
|
|
43
|
+
"tsup": "^8.0.0",
|
|
44
|
+
"typescript": "^5.7.0"
|
|
45
|
+
}
|
|
46
|
+
}
|