stickyflow 0.0.0-stage → 0.2.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/CHANGELOG.md +157 -0
- package/LICENSE +202 -0
- package/README.md +167 -2
- package/dist/chunk-34PK7HEU.cjs +842 -0
- package/dist/chunk-34PK7HEU.cjs.map +1 -0
- package/dist/chunk-6JKNT2YC.js +4685 -0
- package/dist/chunk-6JKNT2YC.js.map +1 -0
- package/dist/chunk-6LQJUAD4.js +801 -0
- package/dist/chunk-6LQJUAD4.js.map +1 -0
- package/dist/chunk-IIOJFR73.cjs +3671 -0
- package/dist/chunk-IIOJFR73.cjs.map +1 -0
- package/dist/chunk-KFJIFHXG.js +8559 -0
- package/dist/chunk-KFJIFHXG.js.map +1 -0
- package/dist/chunk-N6WVHOUQ.js +3665 -0
- package/dist/chunk-N6WVHOUQ.js.map +1 -0
- package/dist/chunk-S5BVAAEF.cjs +8568 -0
- package/dist/chunk-S5BVAAEF.cjs.map +1 -0
- package/dist/chunk-YM3XFBI4.cjs +4814 -0
- package/dist/chunk-YM3XFBI4.cjs.map +1 -0
- package/dist/index.cjs +1167 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +335 -0
- package/dist/index.d.ts +335 -0
- package/dist/index.js +1097 -0
- package/dist/index.js.map +1 -0
- package/dist/interaction/index.cjs +7358 -0
- package/dist/interaction/index.cjs.map +1 -0
- package/dist/interaction/index.d.cts +273 -0
- package/dist/interaction/index.d.ts +273 -0
- package/dist/interaction/index.js +7333 -0
- package/dist/interaction/index.js.map +1 -0
- package/dist/render-r1GYvjNm.d.cts +970 -0
- package/dist/render-r1GYvjNm.d.ts +970 -0
- package/dist/runtimeTypes-ByiafBwg.d.ts +239 -0
- package/dist/runtimeTypes-DwLeD-em.d.cts +239 -0
- package/dist/stickyflow-diagram.global.js +1442 -0
- package/dist/stickyflow-diagram.global.js.map +1 -0
- package/dist/types-T7W2yTQF.d.cts +116 -0
- package/dist/types-ndGA1kbl.d.ts +116 -0
- package/dist/viewer/index.cjs +31 -0
- package/dist/viewer/index.cjs.map +1 -0
- package/dist/viewer/index.d.cts +44 -0
- package/dist/viewer/index.d.ts +44 -0
- package/dist/viewer/index.js +6 -0
- package/dist/viewer/index.js.map +1 -0
- package/dist/web-component/index.cjs +144 -0
- package/dist/web-component/index.cjs.map +1 -0
- package/dist/web-component/index.d.cts +31 -0
- package/dist/web-component/index.d.ts +31 -0
- package/dist/web-component/index.js +141 -0
- package/dist/web-component/index.js.map +1 -0
- package/package.json +81 -4
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { R as RenderInput, h as RenderResult, g as RenderOptions } from './render-r1GYvjNm.js';
|
|
2
|
+
|
|
3
|
+
declare const NAMED_BLOCK_KINDS: readonly ["Project", "Model", "Group", "Entity", "Container", "Path", "Chart", "Widget", "Shape", "Text", "Isometric", "Link", "Connection", "Layout", "Style", "Shader", "Axis", "Series", "Rule", "Net", "Symbol", "Port", "DataSource"];
|
|
4
|
+
type NamedBlockKind = (typeof NAMED_BLOCK_KINDS)[number];
|
|
5
|
+
type BlockKind = NamedBlockKind | 'data';
|
|
6
|
+
type Side = 'top' | 'bottom' | 'left' | 'right';
|
|
7
|
+
interface SflDocument {
|
|
8
|
+
version: string;
|
|
9
|
+
blocks: SflBlock[];
|
|
10
|
+
}
|
|
11
|
+
interface SflBlock {
|
|
12
|
+
kind: BlockKind;
|
|
13
|
+
name: string;
|
|
14
|
+
composition: string[];
|
|
15
|
+
entries: SflEntry[];
|
|
16
|
+
}
|
|
17
|
+
type SflEntry = {
|
|
18
|
+
type: 'property';
|
|
19
|
+
property: SflProperty;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'block';
|
|
22
|
+
block: SflBlock;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'layout';
|
|
25
|
+
layout: SflLayout;
|
|
26
|
+
} | {
|
|
27
|
+
type: 'style';
|
|
28
|
+
style: SflStyle;
|
|
29
|
+
} | {
|
|
30
|
+
type: 'data';
|
|
31
|
+
data: SflBlock;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'fields';
|
|
34
|
+
fields: SflProperty[];
|
|
35
|
+
} | {
|
|
36
|
+
type: 'binding';
|
|
37
|
+
binding: SflBinding;
|
|
38
|
+
} | {
|
|
39
|
+
type: 'handler';
|
|
40
|
+
handler: SflHandler;
|
|
41
|
+
};
|
|
42
|
+
type BindingOperator = '<-' | '<->' | '->';
|
|
43
|
+
type ExpressionOperator = '+' | '-' | '*' | '/' | '>' | '<' | '>=' | '<=' | '==' | '!=' | '&&' | '||';
|
|
44
|
+
type SflExpr = {
|
|
45
|
+
kind: 'number';
|
|
46
|
+
value: number;
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'string';
|
|
49
|
+
value: string;
|
|
50
|
+
} | {
|
|
51
|
+
kind: 'boolean';
|
|
52
|
+
value: boolean;
|
|
53
|
+
} | {
|
|
54
|
+
kind: 'ref';
|
|
55
|
+
path: string[];
|
|
56
|
+
} | {
|
|
57
|
+
kind: 'unary';
|
|
58
|
+
operator: '!' | '-';
|
|
59
|
+
operand: SflExpr;
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'binary';
|
|
62
|
+
operator: ExpressionOperator;
|
|
63
|
+
left: SflExpr;
|
|
64
|
+
right: SflExpr;
|
|
65
|
+
} | {
|
|
66
|
+
kind: 'call';
|
|
67
|
+
callee: string[];
|
|
68
|
+
args: SflExpr[];
|
|
69
|
+
};
|
|
70
|
+
interface SflBinding {
|
|
71
|
+
key: string;
|
|
72
|
+
operator: BindingOperator;
|
|
73
|
+
expr: SflExpr;
|
|
74
|
+
line: number;
|
|
75
|
+
col: number;
|
|
76
|
+
}
|
|
77
|
+
interface SflAssignment {
|
|
78
|
+
target: string[];
|
|
79
|
+
expr: SflExpr;
|
|
80
|
+
line: number;
|
|
81
|
+
col: number;
|
|
82
|
+
}
|
|
83
|
+
interface SflHandler {
|
|
84
|
+
event: string;
|
|
85
|
+
assignments: SflAssignment[];
|
|
86
|
+
line: number;
|
|
87
|
+
col: number;
|
|
88
|
+
}
|
|
89
|
+
interface SflProperty {
|
|
90
|
+
key: string;
|
|
91
|
+
value: SflValue;
|
|
92
|
+
}
|
|
93
|
+
interface SflLayout {
|
|
94
|
+
properties: SflProperty[];
|
|
95
|
+
}
|
|
96
|
+
interface SflStyle {
|
|
97
|
+
properties: SflProperty[];
|
|
98
|
+
bindings?: SflBinding[];
|
|
99
|
+
}
|
|
100
|
+
type SflValue = SflStringValue | SflNumberValue | SflTupleValue | SflListValue | SflIdentValue | SflEndpointValue;
|
|
101
|
+
interface SflStringValue {
|
|
102
|
+
type: 'string';
|
|
103
|
+
value: string;
|
|
104
|
+
}
|
|
105
|
+
interface SflNumberValue {
|
|
106
|
+
type: 'number';
|
|
107
|
+
value: number;
|
|
108
|
+
}
|
|
109
|
+
interface SflTupleValue {
|
|
110
|
+
type: 'tuple';
|
|
111
|
+
values: number[];
|
|
112
|
+
}
|
|
113
|
+
interface SflListValue {
|
|
114
|
+
type: 'list';
|
|
115
|
+
values: SflValue[];
|
|
116
|
+
}
|
|
117
|
+
interface SflIdentValue {
|
|
118
|
+
type: 'ident';
|
|
119
|
+
segments: string[];
|
|
120
|
+
}
|
|
121
|
+
interface SflEndpointValue {
|
|
122
|
+
type: 'endpoint';
|
|
123
|
+
segments: string[];
|
|
124
|
+
side?: Side;
|
|
125
|
+
fraction?: number;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
type ScalarType = 'number' | 'string' | 'boolean';
|
|
129
|
+
type BindingType = ScalarType | {
|
|
130
|
+
list: ScalarType;
|
|
131
|
+
};
|
|
132
|
+
type BindingValue = number | string | boolean | number[] | string[] | boolean[];
|
|
133
|
+
type SourceMode = 'table' | 'record';
|
|
134
|
+
type Row = Record<string, unknown>;
|
|
135
|
+
interface DataSourceContract {
|
|
136
|
+
name: string;
|
|
137
|
+
mode: SourceMode;
|
|
138
|
+
fields: Record<string, ScalarType>;
|
|
139
|
+
declared: Record<string, string>;
|
|
140
|
+
}
|
|
141
|
+
interface BindingDiagnostic {
|
|
142
|
+
severity: 'error' | 'warning';
|
|
143
|
+
code: string;
|
|
144
|
+
message: string;
|
|
145
|
+
line: number;
|
|
146
|
+
col: number;
|
|
147
|
+
}
|
|
148
|
+
interface BoundProperty {
|
|
149
|
+
id: string;
|
|
150
|
+
ownerKind: BlockKind;
|
|
151
|
+
ownerPath: string[];
|
|
152
|
+
property: string;
|
|
153
|
+
operator: BindingOperator;
|
|
154
|
+
expr: SflExpr;
|
|
155
|
+
type: BindingType;
|
|
156
|
+
dependencies: string[];
|
|
157
|
+
line: number;
|
|
158
|
+
col: number;
|
|
159
|
+
}
|
|
160
|
+
interface BoundAssignment {
|
|
161
|
+
source: string;
|
|
162
|
+
field: string;
|
|
163
|
+
expr: SflExpr;
|
|
164
|
+
type: ScalarType;
|
|
165
|
+
line: number;
|
|
166
|
+
col: number;
|
|
167
|
+
}
|
|
168
|
+
interface BoundHandler {
|
|
169
|
+
id: string;
|
|
170
|
+
ownerKind: BlockKind;
|
|
171
|
+
ownerPath: string[];
|
|
172
|
+
event: string;
|
|
173
|
+
assignments: BoundAssignment[];
|
|
174
|
+
line: number;
|
|
175
|
+
col: number;
|
|
176
|
+
}
|
|
177
|
+
interface ElementInfo {
|
|
178
|
+
kind: BlockKind;
|
|
179
|
+
widgetType?: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
type SourceListener = () => void;
|
|
183
|
+
interface DataSource {
|
|
184
|
+
get(): readonly Row[] | Row;
|
|
185
|
+
subscribe(listener: SourceListener): () => void;
|
|
186
|
+
}
|
|
187
|
+
interface MutableDataSource extends DataSource {
|
|
188
|
+
set(next: readonly Row[] | Row): void;
|
|
189
|
+
}
|
|
190
|
+
declare function createDataSource(initial: readonly Row[] | Row): MutableDataSource;
|
|
191
|
+
|
|
192
|
+
interface BindingGraph {
|
|
193
|
+
contracts: Map<string, DataSourceContract>;
|
|
194
|
+
bindings: BoundProperty[];
|
|
195
|
+
handlers: BoundHandler[];
|
|
196
|
+
elements: Map<string, ElementInfo>;
|
|
197
|
+
byField: Map<string, BoundProperty[]>;
|
|
198
|
+
diagnostics: BindingDiagnostic[];
|
|
199
|
+
}
|
|
200
|
+
declare function buildBindingGraph(sflDocument: SflDocument): BindingGraph;
|
|
201
|
+
|
|
202
|
+
interface InteractiveElements {
|
|
203
|
+
pressable: ReadonlySet<string>;
|
|
204
|
+
scales: ReadonlySet<string>;
|
|
205
|
+
}
|
|
206
|
+
declare function interactiveElements(graph: BindingGraph): InteractiveElements;
|
|
207
|
+
|
|
208
|
+
interface BindingRuntimeOptions {
|
|
209
|
+
renderOptions?: RenderOptions;
|
|
210
|
+
}
|
|
211
|
+
interface BindingTarget {
|
|
212
|
+
update(next: {
|
|
213
|
+
svg: string;
|
|
214
|
+
}): void;
|
|
215
|
+
setWidgetValue?(widgetId: string, value: string | number): unknown;
|
|
216
|
+
setShaderParameters?(ownerId: string, parameters: Record<string, number>): unknown;
|
|
217
|
+
}
|
|
218
|
+
interface ElementState {
|
|
219
|
+
pressed: boolean;
|
|
220
|
+
hovered: boolean;
|
|
221
|
+
pointer: number;
|
|
222
|
+
}
|
|
223
|
+
interface BindingRuntime {
|
|
224
|
+
readonly diagnostics: BindingDiagnostic[];
|
|
225
|
+
readonly graph: BindingGraph;
|
|
226
|
+
readonly interactive: InteractiveElements;
|
|
227
|
+
readonly input: RenderInput;
|
|
228
|
+
registerSource(name: string, source: DataSource): () => void;
|
|
229
|
+
setElementState(id: string, state: Partial<ElementState>): void;
|
|
230
|
+
press(id: string): void;
|
|
231
|
+
release(id: string, tapped: boolean): void;
|
|
232
|
+
drag(id: string, pointer?: number): void;
|
|
233
|
+
tick(seconds: number): void;
|
|
234
|
+
flush(): RenderResult | null;
|
|
235
|
+
onRender(listener: (result: RenderResult) => void): () => void;
|
|
236
|
+
attach(target: BindingTarget): () => void;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export { type BindingRuntimeOptions as B, type DataSource as D, type ElementInfo as E, type InteractiveElements as I, type MutableDataSource as M, type Row as R, type SflDocument as S, type Side as a, type BindingRuntime as b, type BindingDiagnostic as c, type BindingGraph as d, type BindingTarget as e, type BindingType as f, type BindingValue as g, type BoundAssignment as h, type BoundHandler as i, type BoundProperty as j, type DataSourceContract as k, type ElementState as l, buildBindingGraph as m, createDataSource as n, interactiveElements as o };
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { R as RenderInput, h as RenderResult, g as RenderOptions } from './render-r1GYvjNm.cjs';
|
|
2
|
+
|
|
3
|
+
declare const NAMED_BLOCK_KINDS: readonly ["Project", "Model", "Group", "Entity", "Container", "Path", "Chart", "Widget", "Shape", "Text", "Isometric", "Link", "Connection", "Layout", "Style", "Shader", "Axis", "Series", "Rule", "Net", "Symbol", "Port", "DataSource"];
|
|
4
|
+
type NamedBlockKind = (typeof NAMED_BLOCK_KINDS)[number];
|
|
5
|
+
type BlockKind = NamedBlockKind | 'data';
|
|
6
|
+
type Side = 'top' | 'bottom' | 'left' | 'right';
|
|
7
|
+
interface SflDocument {
|
|
8
|
+
version: string;
|
|
9
|
+
blocks: SflBlock[];
|
|
10
|
+
}
|
|
11
|
+
interface SflBlock {
|
|
12
|
+
kind: BlockKind;
|
|
13
|
+
name: string;
|
|
14
|
+
composition: string[];
|
|
15
|
+
entries: SflEntry[];
|
|
16
|
+
}
|
|
17
|
+
type SflEntry = {
|
|
18
|
+
type: 'property';
|
|
19
|
+
property: SflProperty;
|
|
20
|
+
} | {
|
|
21
|
+
type: 'block';
|
|
22
|
+
block: SflBlock;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'layout';
|
|
25
|
+
layout: SflLayout;
|
|
26
|
+
} | {
|
|
27
|
+
type: 'style';
|
|
28
|
+
style: SflStyle;
|
|
29
|
+
} | {
|
|
30
|
+
type: 'data';
|
|
31
|
+
data: SflBlock;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'fields';
|
|
34
|
+
fields: SflProperty[];
|
|
35
|
+
} | {
|
|
36
|
+
type: 'binding';
|
|
37
|
+
binding: SflBinding;
|
|
38
|
+
} | {
|
|
39
|
+
type: 'handler';
|
|
40
|
+
handler: SflHandler;
|
|
41
|
+
};
|
|
42
|
+
type BindingOperator = '<-' | '<->' | '->';
|
|
43
|
+
type ExpressionOperator = '+' | '-' | '*' | '/' | '>' | '<' | '>=' | '<=' | '==' | '!=' | '&&' | '||';
|
|
44
|
+
type SflExpr = {
|
|
45
|
+
kind: 'number';
|
|
46
|
+
value: number;
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'string';
|
|
49
|
+
value: string;
|
|
50
|
+
} | {
|
|
51
|
+
kind: 'boolean';
|
|
52
|
+
value: boolean;
|
|
53
|
+
} | {
|
|
54
|
+
kind: 'ref';
|
|
55
|
+
path: string[];
|
|
56
|
+
} | {
|
|
57
|
+
kind: 'unary';
|
|
58
|
+
operator: '!' | '-';
|
|
59
|
+
operand: SflExpr;
|
|
60
|
+
} | {
|
|
61
|
+
kind: 'binary';
|
|
62
|
+
operator: ExpressionOperator;
|
|
63
|
+
left: SflExpr;
|
|
64
|
+
right: SflExpr;
|
|
65
|
+
} | {
|
|
66
|
+
kind: 'call';
|
|
67
|
+
callee: string[];
|
|
68
|
+
args: SflExpr[];
|
|
69
|
+
};
|
|
70
|
+
interface SflBinding {
|
|
71
|
+
key: string;
|
|
72
|
+
operator: BindingOperator;
|
|
73
|
+
expr: SflExpr;
|
|
74
|
+
line: number;
|
|
75
|
+
col: number;
|
|
76
|
+
}
|
|
77
|
+
interface SflAssignment {
|
|
78
|
+
target: string[];
|
|
79
|
+
expr: SflExpr;
|
|
80
|
+
line: number;
|
|
81
|
+
col: number;
|
|
82
|
+
}
|
|
83
|
+
interface SflHandler {
|
|
84
|
+
event: string;
|
|
85
|
+
assignments: SflAssignment[];
|
|
86
|
+
line: number;
|
|
87
|
+
col: number;
|
|
88
|
+
}
|
|
89
|
+
interface SflProperty {
|
|
90
|
+
key: string;
|
|
91
|
+
value: SflValue;
|
|
92
|
+
}
|
|
93
|
+
interface SflLayout {
|
|
94
|
+
properties: SflProperty[];
|
|
95
|
+
}
|
|
96
|
+
interface SflStyle {
|
|
97
|
+
properties: SflProperty[];
|
|
98
|
+
bindings?: SflBinding[];
|
|
99
|
+
}
|
|
100
|
+
type SflValue = SflStringValue | SflNumberValue | SflTupleValue | SflListValue | SflIdentValue | SflEndpointValue;
|
|
101
|
+
interface SflStringValue {
|
|
102
|
+
type: 'string';
|
|
103
|
+
value: string;
|
|
104
|
+
}
|
|
105
|
+
interface SflNumberValue {
|
|
106
|
+
type: 'number';
|
|
107
|
+
value: number;
|
|
108
|
+
}
|
|
109
|
+
interface SflTupleValue {
|
|
110
|
+
type: 'tuple';
|
|
111
|
+
values: number[];
|
|
112
|
+
}
|
|
113
|
+
interface SflListValue {
|
|
114
|
+
type: 'list';
|
|
115
|
+
values: SflValue[];
|
|
116
|
+
}
|
|
117
|
+
interface SflIdentValue {
|
|
118
|
+
type: 'ident';
|
|
119
|
+
segments: string[];
|
|
120
|
+
}
|
|
121
|
+
interface SflEndpointValue {
|
|
122
|
+
type: 'endpoint';
|
|
123
|
+
segments: string[];
|
|
124
|
+
side?: Side;
|
|
125
|
+
fraction?: number;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
type ScalarType = 'number' | 'string' | 'boolean';
|
|
129
|
+
type BindingType = ScalarType | {
|
|
130
|
+
list: ScalarType;
|
|
131
|
+
};
|
|
132
|
+
type BindingValue = number | string | boolean | number[] | string[] | boolean[];
|
|
133
|
+
type SourceMode = 'table' | 'record';
|
|
134
|
+
type Row = Record<string, unknown>;
|
|
135
|
+
interface DataSourceContract {
|
|
136
|
+
name: string;
|
|
137
|
+
mode: SourceMode;
|
|
138
|
+
fields: Record<string, ScalarType>;
|
|
139
|
+
declared: Record<string, string>;
|
|
140
|
+
}
|
|
141
|
+
interface BindingDiagnostic {
|
|
142
|
+
severity: 'error' | 'warning';
|
|
143
|
+
code: string;
|
|
144
|
+
message: string;
|
|
145
|
+
line: number;
|
|
146
|
+
col: number;
|
|
147
|
+
}
|
|
148
|
+
interface BoundProperty {
|
|
149
|
+
id: string;
|
|
150
|
+
ownerKind: BlockKind;
|
|
151
|
+
ownerPath: string[];
|
|
152
|
+
property: string;
|
|
153
|
+
operator: BindingOperator;
|
|
154
|
+
expr: SflExpr;
|
|
155
|
+
type: BindingType;
|
|
156
|
+
dependencies: string[];
|
|
157
|
+
line: number;
|
|
158
|
+
col: number;
|
|
159
|
+
}
|
|
160
|
+
interface BoundAssignment {
|
|
161
|
+
source: string;
|
|
162
|
+
field: string;
|
|
163
|
+
expr: SflExpr;
|
|
164
|
+
type: ScalarType;
|
|
165
|
+
line: number;
|
|
166
|
+
col: number;
|
|
167
|
+
}
|
|
168
|
+
interface BoundHandler {
|
|
169
|
+
id: string;
|
|
170
|
+
ownerKind: BlockKind;
|
|
171
|
+
ownerPath: string[];
|
|
172
|
+
event: string;
|
|
173
|
+
assignments: BoundAssignment[];
|
|
174
|
+
line: number;
|
|
175
|
+
col: number;
|
|
176
|
+
}
|
|
177
|
+
interface ElementInfo {
|
|
178
|
+
kind: BlockKind;
|
|
179
|
+
widgetType?: string;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
type SourceListener = () => void;
|
|
183
|
+
interface DataSource {
|
|
184
|
+
get(): readonly Row[] | Row;
|
|
185
|
+
subscribe(listener: SourceListener): () => void;
|
|
186
|
+
}
|
|
187
|
+
interface MutableDataSource extends DataSource {
|
|
188
|
+
set(next: readonly Row[] | Row): void;
|
|
189
|
+
}
|
|
190
|
+
declare function createDataSource(initial: readonly Row[] | Row): MutableDataSource;
|
|
191
|
+
|
|
192
|
+
interface BindingGraph {
|
|
193
|
+
contracts: Map<string, DataSourceContract>;
|
|
194
|
+
bindings: BoundProperty[];
|
|
195
|
+
handlers: BoundHandler[];
|
|
196
|
+
elements: Map<string, ElementInfo>;
|
|
197
|
+
byField: Map<string, BoundProperty[]>;
|
|
198
|
+
diagnostics: BindingDiagnostic[];
|
|
199
|
+
}
|
|
200
|
+
declare function buildBindingGraph(sflDocument: SflDocument): BindingGraph;
|
|
201
|
+
|
|
202
|
+
interface InteractiveElements {
|
|
203
|
+
pressable: ReadonlySet<string>;
|
|
204
|
+
scales: ReadonlySet<string>;
|
|
205
|
+
}
|
|
206
|
+
declare function interactiveElements(graph: BindingGraph): InteractiveElements;
|
|
207
|
+
|
|
208
|
+
interface BindingRuntimeOptions {
|
|
209
|
+
renderOptions?: RenderOptions;
|
|
210
|
+
}
|
|
211
|
+
interface BindingTarget {
|
|
212
|
+
update(next: {
|
|
213
|
+
svg: string;
|
|
214
|
+
}): void;
|
|
215
|
+
setWidgetValue?(widgetId: string, value: string | number): unknown;
|
|
216
|
+
setShaderParameters?(ownerId: string, parameters: Record<string, number>): unknown;
|
|
217
|
+
}
|
|
218
|
+
interface ElementState {
|
|
219
|
+
pressed: boolean;
|
|
220
|
+
hovered: boolean;
|
|
221
|
+
pointer: number;
|
|
222
|
+
}
|
|
223
|
+
interface BindingRuntime {
|
|
224
|
+
readonly diagnostics: BindingDiagnostic[];
|
|
225
|
+
readonly graph: BindingGraph;
|
|
226
|
+
readonly interactive: InteractiveElements;
|
|
227
|
+
readonly input: RenderInput;
|
|
228
|
+
registerSource(name: string, source: DataSource): () => void;
|
|
229
|
+
setElementState(id: string, state: Partial<ElementState>): void;
|
|
230
|
+
press(id: string): void;
|
|
231
|
+
release(id: string, tapped: boolean): void;
|
|
232
|
+
drag(id: string, pointer?: number): void;
|
|
233
|
+
tick(seconds: number): void;
|
|
234
|
+
flush(): RenderResult | null;
|
|
235
|
+
onRender(listener: (result: RenderResult) => void): () => void;
|
|
236
|
+
attach(target: BindingTarget): () => void;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export { type BindingRuntimeOptions as B, type DataSource as D, type ElementInfo as E, type InteractiveElements as I, type MutableDataSource as M, type Row as R, type SflDocument as S, type Side as a, type BindingRuntime as b, type BindingDiagnostic as c, type BindingGraph as d, type BindingTarget as e, type BindingType as f, type BindingValue as g, type BoundAssignment as h, type BoundHandler as i, type BoundProperty as j, type DataSourceContract as k, type ElementState as l, buildBindingGraph as m, createDataSource as n, interactiveElements as o };
|