@draftwright/specify-core-wasm 0.0.0-stage → 0.1.18
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 +202 -0
- package/NOTICE +24 -0
- package/README.md +27 -2
- package/package.json +24 -4
- package/specify_core_wasm.d.ts +356 -0
- package/specify_core_wasm.js +900 -0
- package/specify_core_wasm_bg.wasm +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
specify-core-rust (a Rust port of specify-core)
|
|
2
|
+
Copyright (C) 2026 Betwixt Limited (trading as Draftwright)
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
5
|
+
this software except in compliance with the License. You may obtain a copy of the
|
|
6
|
+
License in LICENSE or at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
|
|
8
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
9
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
10
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
11
|
+
specific language governing permissions and limitations under the License.
|
|
12
|
+
|
|
13
|
+
Third-party material:
|
|
14
|
+
|
|
15
|
+
- tests/fixtures/freecad contains unmodified FreeCAD-library STEP files by
|
|
16
|
+
nicoguaro and Francisco, compressed for regression tests, under CC-BY-3.0.
|
|
17
|
+
Attribution, source links and the licence are in that directory.
|
|
18
|
+
|
|
19
|
+
- src/specify_core/fonts/futural.jhf is the Hershey "Futura Light" single-stroke
|
|
20
|
+
font in James Hurt's format, from https://github.com/kamalmostafa/hershey-fonts.
|
|
21
|
+
The Hershey Fonts were originally created by Dr. A. V. Hershey while working
|
|
22
|
+
at the U. S. National Bureau of Standards. The format of the Font data in this
|
|
23
|
+
distribution was originally created by James Hurt, Cognition, Inc., 900
|
|
24
|
+
Technology Park Drive, Billerica, MA 01821 (mit-eddie!ci-dandelion!hurt).
|
package/README.md
CHANGED
|
@@ -1,3 +1,28 @@
|
|
|
1
|
-
#
|
|
1
|
+
# specify-core-wasm
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Browser bindings for specify-core. See [the WASM guide](https://github.com/pzfreo/specify-core/blob/main/docs/wasm.md)
|
|
4
|
+
for the JSON API, build instructions and installation, from npm
|
|
5
|
+
(`npm install @draftwright/specify-core-wasm`) or from a release archive.
|
|
6
|
+
|
|
7
|
+
Initialize the web module, then use `IntentEngine`, `review` and `interpret`.
|
|
8
|
+
Errors are thrown as strings. STEP input must be decompressed. The constructor opens a file
|
|
9
|
+
of one distinct part with one placement; for an assembly or a part placed more than once, list
|
|
10
|
+
the parts with `IntentEngine.parts(name, bytes)` and open one with
|
|
11
|
+
`IntentEngine.openPart(name, bytes, part)`, whose `writePmi` writes that part into the
|
|
12
|
+
original file. `writePmi` uses the upstream verified writer and optionally stores the
|
|
13
|
+
base64 `draftwright editor project` attribute on the part.
|
|
14
|
+
|
|
15
|
+
Apache-2.0; see [LICENSE](https://github.com/pzfreo/specify-core/blob/main/LICENSE) and
|
|
16
|
+
[NOTICE](https://github.com/pzfreo/specify-core/blob/main/NOTICE). The bundled haecceity and
|
|
17
|
+
quiddity ([pzfreo/quiddity](https://github.com/pzfreo/quiddity)) are Apache-2.0 too.
|
|
18
|
+
|
|
19
|
+
Snapshot faces include usable unique authored STEP `f:` names.
|
|
20
|
+
Shared/generic labels retain geometric matching and are omitted from analysis. Keep the entire
|
|
21
|
+
`evidence()` object with external answers: named parts use schema 3; missing or
|
|
22
|
+
duplicate names are unresolved without geometric fallback. See
|
|
23
|
+
[face-name matching and compatibility](https://github.com/pzfreo/specify-core/blob/main/docs/face-names.md).
|
|
24
|
+
|
|
25
|
+
Complete answer sidecars (defaults explicit, with geometry evidence) can be exported
|
|
26
|
+
before writing: `engine.exportAnswers(answersJson)` returns an answer map as JSON.
|
|
27
|
+
Incomplete sets and unresolved carries are refused. See
|
|
28
|
+
[answer files](https://github.com/pzfreo/specify-core/blob/main/docs/answers.md#export-a-complete-sidecar).
|
package/package.json
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draftwright/specify-core-wasm",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"type": "module",
|
|
4
|
+
"description": "Browser bindings for Specify's questions and manufacturing intent",
|
|
5
|
+
"version": "0.1.18",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/pzfreo/specify-core"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"specify_core_wasm_bg.wasm",
|
|
13
|
+
"specify_core_wasm.js",
|
|
14
|
+
"specify_core_wasm.d.ts",
|
|
15
|
+
"NOTICE"
|
|
16
|
+
],
|
|
17
|
+
"main": "specify_core_wasm.js",
|
|
18
|
+
"types": "specify_core_wasm.d.ts",
|
|
19
|
+
"sideEffects": [
|
|
20
|
+
"./snippets/*"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public",
|
|
24
|
+
"provenance": true
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/** Document-local semantic or graphic identity; never a mesh face index. */
|
|
5
|
+
export type PmiSceneId = string;
|
|
6
|
+
export type PmiSceneVector = [number, number, number];
|
|
7
|
+
export type PmiSceneStatus = "answered" | "default" | "general" | "existing";
|
|
8
|
+
/** A lossless semantic/unit row. Values follow the packaged haecceity.pmi/1 schema;
|
|
9
|
+
* decimal quantities are strings and semantic references use PmiSceneId. */
|
|
10
|
+
export interface PmiSceneItem {
|
|
11
|
+
identifier?: string;
|
|
12
|
+
id: PmiSceneId;
|
|
13
|
+
value: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface PmiSceneItems {
|
|
16
|
+
standards: unknown[];
|
|
17
|
+
decimal_places: number | null;
|
|
18
|
+
features: PmiSceneItem[];
|
|
19
|
+
datum_targets: PmiSceneItem[];
|
|
20
|
+
datums: PmiSceneItem[];
|
|
21
|
+
dimensions: PmiSceneItem[];
|
|
22
|
+
tolerances: PmiSceneItem[];
|
|
23
|
+
tolerance_relations: PmiSceneItem[];
|
|
24
|
+
general: PmiSceneItem[];
|
|
25
|
+
threads: PmiSceneItem[];
|
|
26
|
+
knurls: PmiSceneItem[];
|
|
27
|
+
holes: unknown[];
|
|
28
|
+
material: unknown;
|
|
29
|
+
notes: PmiSceneItem[];
|
|
30
|
+
surface_textures: PmiSceneItem[];
|
|
31
|
+
attributes: PmiSceneItem[];
|
|
32
|
+
geometry: PmiSceneItem[];
|
|
33
|
+
derived_geometry: PmiSceneItem[];
|
|
34
|
+
}
|
|
35
|
+
/** Placement in model-space millimetres. A placeholder can omit text_index. */
|
|
36
|
+
export interface PmiSceneTextPlacement {
|
|
37
|
+
text_index?: number;
|
|
38
|
+
/** Lower-left / upper-right in plane mm relative to origin. */
|
|
39
|
+
cell_box?: [[number, number], [number, number]];
|
|
40
|
+
/** True when this run's glyphs are already drawn by the graphic's polylines.
|
|
41
|
+
* Absent or false means the host may render the text literal. */
|
|
42
|
+
stroked?: boolean;
|
|
43
|
+
origin: PmiSceneVector;
|
|
44
|
+
x_axis: PmiSceneVector;
|
|
45
|
+
normal: PmiSceneVector;
|
|
46
|
+
height?: number;
|
|
47
|
+
line_spacing?: number;
|
|
48
|
+
alignment?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface PmiSceneGraphic {
|
|
51
|
+
leader?: PmiSceneVector;
|
|
52
|
+
id?: PmiSceneId;
|
|
53
|
+
plane_id?: PmiSceneId;
|
|
54
|
+
text_placements?: PmiSceneTextPlacement[];
|
|
55
|
+
source: "generated" | "file";
|
|
56
|
+
name: string;
|
|
57
|
+
text: string[];
|
|
58
|
+
polylines: PmiSceneVector[][];
|
|
59
|
+
polyline_roles?: ("text" | "frame" | "leader" | "extension" | "symbol" | "dimension")[];
|
|
60
|
+
triangles: [PmiSceneVector, PmiSceneVector, PmiSceneVector][];
|
|
61
|
+
step_ids: number[];
|
|
62
|
+
unsupported: string[];
|
|
63
|
+
}
|
|
64
|
+
export interface PmiScenePlane {
|
|
65
|
+
id: PmiSceneId;
|
|
66
|
+
name: string;
|
|
67
|
+
origin: PmiSceneVector;
|
|
68
|
+
x_axis: PmiSceneVector;
|
|
69
|
+
normal: PmiSceneVector;
|
|
70
|
+
}
|
|
71
|
+
/** Saved/group or generated plane view; direction points into the scene. */
|
|
72
|
+
export interface PmiSceneView {
|
|
73
|
+
id: PmiSceneId;
|
|
74
|
+
name: string;
|
|
75
|
+
direction?: PmiSceneVector;
|
|
76
|
+
up?: PmiSceneVector;
|
|
77
|
+
graphics: PmiSceneId[];
|
|
78
|
+
}
|
|
79
|
+
export interface PmiSceneMetadata {
|
|
80
|
+
/** This requirement's semantic note wording, independent of shared graphics. */
|
|
81
|
+
notation?: string;
|
|
82
|
+
status: PmiSceneStatus;
|
|
83
|
+
question?: string;
|
|
84
|
+
number?: number;
|
|
85
|
+
origin?: "requirement" | "general_tolerance" | "imported";
|
|
86
|
+
source?: {schema: number; faces: string; support: number[]; parameter: string};
|
|
87
|
+
/** A basic (theoretically exact) dimension; absent otherwise. */
|
|
88
|
+
basic?: true;
|
|
89
|
+
}
|
|
90
|
+
/** JSON.parse of either pmiScene call. Supporting rows may lack a specify entry. */
|
|
91
|
+
export interface PmiScene {
|
|
92
|
+
pmi: {
|
|
93
|
+
schema: "haecceity.pmi/1";
|
|
94
|
+
units: {length: PmiSceneItem[]; angle: PmiSceneItem[]; density: PmiSceneItem[]; other: PmiSceneItem[]};
|
|
95
|
+
pmi: PmiSceneItems;
|
|
96
|
+
};
|
|
97
|
+
presentation: {
|
|
98
|
+
schema: "haecceity.presentation/1";
|
|
99
|
+
length_unit: string;
|
|
100
|
+
semantic_ids: PmiSceneId[];
|
|
101
|
+
items: Record<PmiSceneId, PmiSceneGraphic[]>;
|
|
102
|
+
unlinked: PmiSceneGraphic[];
|
|
103
|
+
planes?: PmiScenePlane[];
|
|
104
|
+
views?: PmiSceneView[];
|
|
105
|
+
};
|
|
106
|
+
specify: Record<PmiSceneId, PmiSceneMetadata>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
/** Faces in analysis/snapshot JSON; `name` is a unique authored STEP `f:` identity. */
|
|
112
|
+
export interface AnalysisFace {
|
|
113
|
+
id: number;
|
|
114
|
+
name?: string;
|
|
115
|
+
kind: string;
|
|
116
|
+
area: number;
|
|
117
|
+
centroid: [number, number, number];
|
|
118
|
+
direction?: [number, number, number];
|
|
119
|
+
origin?: [number, number, number];
|
|
120
|
+
radius?: number;
|
|
121
|
+
contact?: unknown;
|
|
122
|
+
}
|
|
123
|
+
export interface GeometryCarrierExemption {
|
|
124
|
+
part: number;
|
|
125
|
+
condition: "shared-carrier-controlled-pair" | "shared-carrier-datum-target-support" | "kept-carrier-datum-member" | "kept-carrier-independent-feature" | "kept-carrier-datum-feature" | "kept-carrier-datum-composite";
|
|
126
|
+
aspect: number;
|
|
127
|
+
feature: number;
|
|
128
|
+
}
|
|
129
|
+
export interface PreservedNormalization {
|
|
130
|
+
id: number;
|
|
131
|
+
normalization: string;
|
|
132
|
+
}
|
|
133
|
+
/** A kernel finding about the default Notes saved view. */
|
|
134
|
+
export interface SavedViewFinding {
|
|
135
|
+
kind: string;
|
|
136
|
+
part?: number;
|
|
137
|
+
ids: number[];
|
|
138
|
+
entity: string;
|
|
139
|
+
detail: string;
|
|
140
|
+
}
|
|
141
|
+
/** Report in writePmi JSON; optional diagnostic keys are absent when empty. */
|
|
142
|
+
export interface WriteReport {
|
|
143
|
+
output: string;
|
|
144
|
+
written: string[];
|
|
145
|
+
not_written: string[];
|
|
146
|
+
warnings: string[];
|
|
147
|
+
geometry_carrier_exemptions?: GeometryCarrierExemption[];
|
|
148
|
+
presentation_warnings?: string[];
|
|
149
|
+
preserved_normalizations?: PreservedNormalization[];
|
|
150
|
+
retained_shared?: number[];
|
|
151
|
+
saved_view_findings?: SavedViewFinding[];
|
|
152
|
+
}
|
|
153
|
+
/** JSON returned by evidence(), also embedded alongside stored answers. */
|
|
154
|
+
export interface AnswerEvidence {
|
|
155
|
+
schema: 1 | 2 | 3;
|
|
156
|
+
face_count: number;
|
|
157
|
+
faces: string;
|
|
158
|
+
face_names?: (string | null)[];
|
|
159
|
+
geometry?: unknown;
|
|
160
|
+
}
|
|
161
|
+
/** Optional reserved `_specify` member of an otherwise ordinary answer map. */
|
|
162
|
+
export interface AnswerFileMetadata {
|
|
163
|
+
evidence?: AnswerEvidence;
|
|
164
|
+
unresolved?: Record<string, string>;
|
|
165
|
+
}
|
|
166
|
+
export interface PmiItemChange {
|
|
167
|
+
class: "added" | "removed" | "changed" | "renumbered";
|
|
168
|
+
number?: number;
|
|
169
|
+
id: string;
|
|
170
|
+
old_id?: string;
|
|
171
|
+
faces: { old: { face: number }[]; new: { face: number }[] };
|
|
172
|
+
kind: string;
|
|
173
|
+
status: "answered" | "default" | "general" | "existing";
|
|
174
|
+
on: string;
|
|
175
|
+
old?: string;
|
|
176
|
+
new?: string;
|
|
177
|
+
reason?: string;
|
|
178
|
+
}
|
|
179
|
+
export interface DiffPmi {
|
|
180
|
+
items: PmiItemChange[];
|
|
181
|
+
scenes?: { old: PmiScene; new: PmiScene };
|
|
182
|
+
/** @deprecated Legacy answer comparison, retained for one release. */
|
|
183
|
+
stored: unknown[];
|
|
184
|
+
/** @deprecated Legacy CAD comparison, retained for one release. */
|
|
185
|
+
existing: unknown[];
|
|
186
|
+
existing_count: [number, number];
|
|
187
|
+
answers_from: "given" | "stored" | "none";
|
|
188
|
+
new_stored: boolean;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
export class IntentEngine {
|
|
194
|
+
free(): void;
|
|
195
|
+
[Symbol.dispose](): void;
|
|
196
|
+
acceptDefaults(answers: string): string;
|
|
197
|
+
/**
|
|
198
|
+
* Assembly BOM JSON; each field has value and file/answered/default source.
|
|
199
|
+
*/
|
|
200
|
+
static bom(bytes: Uint8Array): string;
|
|
201
|
+
/**
|
|
202
|
+
* `AnswerEvidence` JSON: keep it with answers saved outside the STEP.
|
|
203
|
+
*/
|
|
204
|
+
evidence(): string;
|
|
205
|
+
/**
|
|
206
|
+
* Complete answer map, with defaults explicit and `_specify.evidence`, for saving.
|
|
207
|
+
* Throws if any required answer or carry block remains unanswered.
|
|
208
|
+
*/
|
|
209
|
+
exportAnswers(answers: string): string;
|
|
210
|
+
/**
|
|
211
|
+
* Part `part` (an index from `IntentEngine.parts`) of any file, an assembly included.
|
|
212
|
+
*/
|
|
213
|
+
static openPart(name: string, bytes: Uint8Array, part: number): IntentEngine;
|
|
214
|
+
constructor(name: string, bytes: Uint8Array);
|
|
215
|
+
/**
|
|
216
|
+
* The part the opened STEP was first written from, if it records it.
|
|
217
|
+
*/
|
|
218
|
+
original(): Uint8Array | undefined;
|
|
219
|
+
/**
|
|
220
|
+
* The file's distinct parts, as `specify-core parts` lists them: `[{part, name,
|
|
221
|
+
* product_id, faces, instances, placements, written, same_as, faces_of_first}]`.
|
|
222
|
+
*/
|
|
223
|
+
static parts(name: string, bytes: Uint8Array): string;
|
|
224
|
+
/**
|
|
225
|
+
* The JSON payload `name` the opened STEP carries, if any.
|
|
226
|
+
*/
|
|
227
|
+
payload(name: string): string | undefined;
|
|
228
|
+
/**
|
|
229
|
+
* `PmiScene` JSON for current answers or `{answers, auto?, gdt?}` review state.
|
|
230
|
+
* Parse with `JSON.parse`; ids join semantic rows, graphics and Specify statuses.
|
|
231
|
+
*/
|
|
232
|
+
pmiScene(answers: string): string;
|
|
233
|
+
/**
|
|
234
|
+
* Saved answers matched to this part: `{answers, unresolved?, migrated?, unverified?,
|
|
235
|
+
* automatic?}`. `evidence` is what `evidence()` gave when they were saved; `automatic`
|
|
236
|
+
* a JSON list of the IDs the default path answered. Without evidence answers are
|
|
237
|
+
* matched by feature ID. Schema 3 matches exact authored names first; a missing or
|
|
238
|
+
* duplicate name is unresolved without geometric fallback. Unnamed faces use
|
|
239
|
+
* verified indices or saved geometric correspondence. Schema 1/2 retain their
|
|
240
|
+
* fingerprint checks. Extras and datum lists follow their face supports.
|
|
241
|
+
*/
|
|
242
|
+
rematchAnswers(answers: string, evidence?: string | null, automatic?: string | null): string;
|
|
243
|
+
review(answers: string): string;
|
|
244
|
+
/**
|
|
245
|
+
* The review settled to the default path, and the settled `{answers, auto, gdt}`.
|
|
246
|
+
*/
|
|
247
|
+
settle(state: string): string;
|
|
248
|
+
/**
|
|
249
|
+
* The session snapshot; `max_deviation_mm` (at least 0.001) meshes to a measured bound
|
|
250
|
+
* and throws if it cannot be met. Exact on planes, spheres, line and circle trims; a
|
|
251
|
+
* sampled maximum on cylinders, cones, tori, B-splines and ellipse/B-spline/NURBS trims.
|
|
252
|
+
*/
|
|
253
|
+
snapshot(max_deviation_mm?: number | null): string;
|
|
254
|
+
/**
|
|
255
|
+
* `project` is the editor's base64 project; `payload` is `{name, value}` JSON. At most one.
|
|
256
|
+
* Rewriting replaces what a previous write carried: without either, the written file
|
|
257
|
+
* carries no project, payload or original record, even if the opened one did.
|
|
258
|
+
*/
|
|
259
|
+
writePmi(answers: string, project?: string | null, payload?: string | null, bom?: boolean | null): string;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export function acceptDefaults(analysis: string, answers: string): string;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* The person's answers replace the state's (`tolerancing::answer_edit`).
|
|
266
|
+
*/
|
|
267
|
+
export function answerEdit(state: string, answers: string): string;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Two revisions of a part compared (`session::diff`): `{report, markdown, view}` JSON; of
|
|
271
|
+
* an assembly, `{report, markdown, parts}`, each changed part with its own `markdown` and
|
|
272
|
+
* `view`. `answers` is a JSON object (by part name for an assembly), `{}` to carry the old
|
|
273
|
+
* file's stored answers.
|
|
274
|
+
*/
|
|
275
|
+
export function diff(old_name: string, old: Uint8Array, new_name: string, _new: Uint8Array, answers: string, title: string, scenes?: boolean | null): string;
|
|
276
|
+
|
|
277
|
+
export function interpret(analysis: string, answers: string, question_id: string, text: string): string;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* The state a project opens with, given the answers a STEP Specify wrote resumes, if any.
|
|
281
|
+
*/
|
|
282
|
+
export function openedTolerancing(state: string, resume?: string | null): string;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* View-only `PmiScene` JSON without an interview; `part` selects an assembly part.
|
|
286
|
+
* Parse with `JSON.parse`; file graphics retain their text placement and saved views.
|
|
287
|
+
*/
|
|
288
|
+
export function pmiScene(bytes: Uint8Array, part?: number | null): string;
|
|
289
|
+
|
|
290
|
+
export function review(analysis: string, answers: string): string;
|
|
291
|
+
|
|
292
|
+
export function start(): void;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* A change of tolerancing mode (`plusminus`, `geometric`, or none for the default path).
|
|
296
|
+
*/
|
|
297
|
+
export function tolerancingEdit(state: string, mode: string | null | undefined, answers: string): string;
|
|
298
|
+
|
|
299
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
300
|
+
|
|
301
|
+
export interface InitOutput {
|
|
302
|
+
readonly memory: WebAssembly.Memory;
|
|
303
|
+
readonly __wbg_intentengine_free: (a: number, b: number) => void;
|
|
304
|
+
readonly acceptDefaults: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
305
|
+
readonly answerEdit: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
306
|
+
readonly diff: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number) => [number, number, number, number];
|
|
307
|
+
readonly intentengine_acceptDefaults: (a: number, b: number, c: number) => [number, number, number, number];
|
|
308
|
+
readonly intentengine_bom: (a: number, b: number) => [number, number, number, number];
|
|
309
|
+
readonly intentengine_evidence: (a: number) => [number, number, number, number];
|
|
310
|
+
readonly intentengine_exportAnswers: (a: number, b: number, c: number) => [number, number, number, number];
|
|
311
|
+
readonly intentengine_open: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
312
|
+
readonly intentengine_openPart: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
313
|
+
readonly intentengine_original: (a: number) => [number, number];
|
|
314
|
+
readonly intentengine_parts: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
315
|
+
readonly intentengine_payload: (a: number, b: number, c: number) => [number, number, number, number];
|
|
316
|
+
readonly intentengine_pmiScene: (a: number, b: number, c: number) => [number, number, number, number];
|
|
317
|
+
readonly intentengine_rematchAnswers: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
|
|
318
|
+
readonly intentengine_review: (a: number, b: number, c: number) => [number, number, number, number];
|
|
319
|
+
readonly intentengine_settle: (a: number, b: number, c: number) => [number, number, number, number];
|
|
320
|
+
readonly intentengine_snapshot: (a: number, b: number, c: number) => [number, number, number, number];
|
|
321
|
+
readonly intentengine_writePmi: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
322
|
+
readonly interpret: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
|
|
323
|
+
readonly openedTolerancing: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
324
|
+
readonly pmiScene: (a: number, b: number, c: number) => [number, number, number, number];
|
|
325
|
+
readonly review: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
326
|
+
readonly start: () => void;
|
|
327
|
+
readonly tolerancingEdit: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
328
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
329
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
330
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
331
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
332
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
333
|
+
readonly __wbindgen_start: () => void;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
340
|
+
* a precompiled `WebAssembly.Module`.
|
|
341
|
+
*
|
|
342
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
343
|
+
*
|
|
344
|
+
* @returns {InitOutput}
|
|
345
|
+
*/
|
|
346
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
350
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
351
|
+
*
|
|
352
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
353
|
+
*
|
|
354
|
+
* @returns {Promise<InitOutput>}
|
|
355
|
+
*/
|
|
356
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|