webpd
Version:
WebPd is a compiler for audio programming language Pure Data allowing to run .pd patches on web pages.
29 lines (28 loc) • 734 B
TypeScript
import { DspGraph } from "@webpd/compiler";
import { PdJson } from "@webpd/pd-parser";
export interface Point {
x: number;
y: number;
}
export interface Rectangle {
topLeft: Point;
bottomRight: Point;
}
interface PdGuiNodeBase {
patchId: PdJson.GlobalId;
pdNodeId: PdJson.LocalId;
nodeClass: PdJson.Node['nodeClass'];
}
export interface PdGuiControl extends PdGuiNodeBase {
nodeClass: 'control';
nodeId: DspGraph.NodeId;
}
export interface PdGuiSubpatch extends PdGuiNodeBase {
nodeClass: 'subpatch';
children: Array<PdGuiNode>;
}
export interface PdGuiComment extends PdGuiNodeBase {
nodeClass: 'text';
}
export type PdGuiNode = PdGuiControl | PdGuiSubpatch | PdGuiComment;
export {};