@buerli.io/headless 0.3.0-beta.0 → 0.3.0-beta.1

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.
@@ -975,6 +975,14 @@ export declare type ApiHistory = {
975
975
  * @image // tbd
976
976
  */
977
977
  save: (type: DataTypes) => Promise<Uint8Array | null>;
978
+ /**
979
+ * POSTs the result to the given url.
980
+ * @param url The url to POST the model to.
981
+ * @param filetype The file type be saved (of1, stp).
982
+ * @example // tbd
983
+ * @image // tbd
984
+ */
985
+ saveToUrl: (url: string, filetype: 'of1' | 'stp') => Promise<boolean>;
978
986
  /**
979
987
  * Loads the given buffer.
980
988
  * @param content data as arraybuffer
@@ -983,6 +991,14 @@ export declare type ApiHistory = {
983
991
  * @image // tbd
984
992
  */
985
993
  load: (content: ArrayBuffer, type: DataTypes) => Promise<number[] | null>;
994
+ /**
995
+ * Loads from the given url.
996
+ * @param url The url to load data from.
997
+ * @param filetype The type of data delivered by the url (of1, stp).
998
+ * @example // tbd
999
+ * @image // tbd
1000
+ */
1001
+ loadFromUrl: (url: string, filetype: 'of1' | 'stp') => Promise<number[] | null>;
986
1002
  /**
987
1003
  * Loads a product into the current drawing.
988
1004
  * @param content data as arraybuffer
@@ -995,6 +1011,14 @@ export declare type ApiHistory = {
995
1011
  * @image // tbd
996
1012
  */
997
1013
  loadProduct: (content: ArrayBuffer, type: DataTypes) => Promise<number[] | null>;
1014
+ /**
1015
+ * Loads a product from the given URL into the current drawing.
1016
+ * @param url The url to load data from.
1017
+ * @param filetype The type of data delivered by the url (of1, stp).
1018
+ * @example // tbd
1019
+ * @image // tbd
1020
+ */
1021
+ loadProductFromUrl: (url: string, filetype: string) => Promise<number[] | null>;
998
1022
  /**
999
1023
  * Creates a new feature and appends geometry to it. This method can be used to import specific geometry
1000
1024
  * which can be used for further operations like boolean, translations and so on.
package/build/history.js CHANGED
@@ -1075,12 +1075,21 @@ export default class CAD {
1075
1075
  save: (type) => {
1076
1076
  return ccAPI.baseModeler.save(drawingId, type);
1077
1077
  },
1078
+ saveToUrl: (url, filetype) => {
1079
+ return ccAPI.baseModeler.saveToUrl(drawingId, url, filetype);
1080
+ },
1078
1081
  load: (content, type) => {
1079
1082
  return ccAPI.baseModeler.load(drawingId, content, type);
1080
1083
  },
1084
+ loadFromUrl: (url, filetype) => {
1085
+ return ccAPI.baseModeler.loadFromUrl(drawingId, url, filetype, true);
1086
+ },
1081
1087
  loadProduct: (content, type) => {
1082
1088
  return ccAPI.assemblyBuilder.loadProduct(drawingId, content, type);
1083
1089
  },
1090
+ loadProductFromUrl: (url, filetype) => {
1091
+ return ccAPI.assemblyBuilder.loadProductFromUrl(drawingId, url, filetype);
1092
+ },
1084
1093
  pick: (partId, type, points) => {
1085
1094
  return this.resolve(async ([rPartId]) => {
1086
1095
  const refs = await featureAPI.pick(drawingId, rPartId, type, points);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buerli.io/headless",
3
- "version": "0.3.0-beta.0",
3
+ "version": "0.3.0-beta.1",
4
4
  "description": "A non-manifold CAD workflow for the web",
5
5
  "author": "AWV Informatik AG <info@awv-informatik.ch>",
6
6
  "license": "ISC",
@@ -29,7 +29,7 @@
29
29
  "three": ">=0.138"
30
30
  },
31
31
  "dependencies": {
32
- "@buerli.io/classcad": "0.3.0-beta.0",
32
+ "@buerli.io/classcad": "0.3.0-beta.1",
33
33
  "flat-promise": "^1.0.3"
34
34
  }
35
35
  }