@threekit-tools/treble 0.0.10-alpha.13 → 0.0.12
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/README.md +163 -156
- package/dist/Treble/Snapshots.d.ts +28 -0
- package/dist/Treble/Snapshots.js +280 -0
- package/dist/Treble/Treble.d.ts +9 -27
- package/dist/Treble/Treble.js +34 -350
- package/dist/Treble/Wishlist.d.ts +18 -0
- package/dist/Treble/Wishlist.js +137 -0
- package/dist/Treble/index.d.ts +2 -0
- package/dist/Treble/index.js +2 -0
- package/dist/components/Accordion/accordion.styles.d.ts +5 -0
- package/dist/components/Accordion/accordion.styles.js +13 -0
- package/dist/components/Accordion/index.d.ts +14 -0
- package/dist/components/Accordion/index.js +63 -0
- package/dist/components/Cards/index.d.ts +2 -2
- package/dist/components/Drawer/index.js +0 -1
- package/dist/components/Dropdown/dropdown.styles.js +1 -3
- package/dist/components/Dropdown/index.d.ts +2 -2
- package/dist/components/FormComponentDescription/index.js +1 -1
- package/dist/components/Modal/index.js +3 -1
- package/dist/components/Share/index.d.ts +37 -0
- package/dist/components/Share/index.js +51 -0
- package/dist/components/Strips/index.d.ts +2 -2
- package/dist/components/Strips/index.js +1 -1
- package/dist/components/Swatch/index.d.ts +2 -2
- package/dist/components/Tabs/index.d.ts +14 -0
- package/dist/components/Tabs/index.js +53 -0
- package/dist/components/Tabs/tabs.styles.d.ts +8 -0
- package/dist/components/Tabs/tabs.styles.js +20 -0
- package/dist/components/ThreekitProvider/index.d.ts +11 -2
- package/dist/components/ThreekitProvider/index.js +3 -3
- package/dist/components/Tiles/index.d.ts +2 -2
- package/dist/components/TilesGroup/index.d.ts +2 -2
- package/dist/components/containers/formInputContainer.d.ts +1 -1
- package/dist/hooks/useShare/index.d.ts +3 -0
- package/dist/hooks/useShare/index.js +71 -0
- package/dist/hooks/useWishlist/index.d.ts +2 -3
- package/dist/index.d.ts +5 -1
- package/dist/index.js +9 -1
- package/dist/store/threekit.d.ts +5 -5
- package/dist/store/threekit.js +7 -6
- package/dist/threekit.d.ts +2 -0
- package/package.json +7 -5
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare type ISnapshotsCameras = undefined | string | Array<string | undefined>;
|
|
2
|
+
interface SnapshotSize {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}
|
|
6
|
+
export interface ITakeSnapshotsConfig {
|
|
7
|
+
attributeName?: string;
|
|
8
|
+
output?: string;
|
|
9
|
+
format?: string;
|
|
10
|
+
size?: SnapshotSize;
|
|
11
|
+
filename?: string;
|
|
12
|
+
}
|
|
13
|
+
interface IGetSnapshot {
|
|
14
|
+
size: SnapshotSize;
|
|
15
|
+
format: string;
|
|
16
|
+
}
|
|
17
|
+
interface ISnapshots {
|
|
18
|
+
getSnapshot(snapshotConfig: IGetSnapshot): Promise<string>;
|
|
19
|
+
getSnapshots(cameras: Array<string | undefined>, snapshotConfig: Pick<ITakeSnapshotsConfig, 'attributeName' | 'format' | 'size'>): Promise<Array<string>>;
|
|
20
|
+
takeSnapshots(cameras: ISnapshotsCameras, config: ITakeSnapshotsConfig): Promise<void | string[] | Blob[] | null>;
|
|
21
|
+
}
|
|
22
|
+
declare class Snapshots implements ISnapshots {
|
|
23
|
+
constructor();
|
|
24
|
+
getSnapshot: ({ size, format }: IGetSnapshot) => Promise<string>;
|
|
25
|
+
getSnapshots: (cameras: Array<string | undefined>, snapshotConfig: Pick<ITakeSnapshotsConfig, 'attributeName' | 'format' | 'size'>) => Promise<string[]>;
|
|
26
|
+
takeSnapshots: (camerasList: ISnapshotsCameras, snapshotsConfig: ITakeSnapshotsConfig) => Promise<void | string[] | Blob[] | null>;
|
|
27
|
+
}
|
|
28
|
+
export default Snapshots;
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var api_1 = __importDefault(require("../api"));
|
|
43
|
+
var connection_1 = __importDefault(require("../connection"));
|
|
44
|
+
var constants_1 = require("../constants");
|
|
45
|
+
var utils_1 = require("../utils");
|
|
46
|
+
var DEFAULT_CAMERA_CONFIG = {
|
|
47
|
+
filename: "snapshot",
|
|
48
|
+
size: { width: 1920, height: 1080 },
|
|
49
|
+
format: constants_1.SNAPSHOT_FORMATS.png,
|
|
50
|
+
attributeName: constants_1.ATTRIBUTES_RESERVED.camera,
|
|
51
|
+
output: constants_1.SNAPSHOT_OUTPUTS.blob,
|
|
52
|
+
};
|
|
53
|
+
var cameraValues;
|
|
54
|
+
var getCameraValue = function (cameraAttrName) {
|
|
55
|
+
if (cameraAttrName === void 0) { cameraAttrName = constants_1.ATTRIBUTES_RESERVED.camera; }
|
|
56
|
+
var attribute = window.threekit.configurator
|
|
57
|
+
.getDisplayAttributes()
|
|
58
|
+
.find(function (el) { return el.name === cameraAttrName; });
|
|
59
|
+
if (!attribute)
|
|
60
|
+
return undefined;
|
|
61
|
+
return attribute.value;
|
|
62
|
+
};
|
|
63
|
+
var getCamerasMap = function (cameraAttrName) {
|
|
64
|
+
if (cameraAttrName === void 0) { cameraAttrName = constants_1.ATTRIBUTES_RESERVED.camera; }
|
|
65
|
+
if (cameraValues)
|
|
66
|
+
return cameraValues;
|
|
67
|
+
var attribute = window.threekit.configurator
|
|
68
|
+
.getDisplayAttributes()
|
|
69
|
+
.find(function (el) { return el.name === cameraAttrName; });
|
|
70
|
+
if (!attribute) {
|
|
71
|
+
cameraValues = {};
|
|
72
|
+
return cameraValues;
|
|
73
|
+
}
|
|
74
|
+
var cameraAttribute = attribute;
|
|
75
|
+
cameraAttribute.values.forEach(function (el) {
|
|
76
|
+
var _a;
|
|
77
|
+
var value = cameraAttribute.type === constants_1.ATTRIBUTE_TYPES.asset
|
|
78
|
+
? { assetId: el.assetId }
|
|
79
|
+
: el.value;
|
|
80
|
+
cameraValues = Object.assign(cameraValues || {}, (_a = {},
|
|
81
|
+
_a[el.label] = value,
|
|
82
|
+
_a));
|
|
83
|
+
}, {});
|
|
84
|
+
return cameraValues;
|
|
85
|
+
};
|
|
86
|
+
var Snapshots = /** @class */ (function () {
|
|
87
|
+
function Snapshots() {
|
|
88
|
+
var _this = this;
|
|
89
|
+
this.getSnapshot = function (_a) {
|
|
90
|
+
var size = _a.size, format = _a.format;
|
|
91
|
+
return window.threekit.player.snapshotAsync({
|
|
92
|
+
size: size,
|
|
93
|
+
mimeType: "image/".concat(constants_1.SNAPSHOT_FORMATS[format]),
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
this.getSnapshots = function (cameras, snapshotConfig) {
|
|
97
|
+
var attributeName = snapshotConfig.attributeName || DEFAULT_CAMERA_CONFIG.attributeName;
|
|
98
|
+
var size = snapshotConfig.size || DEFAULT_CAMERA_CONFIG.size;
|
|
99
|
+
var format = snapshotConfig.format || DEFAULT_CAMERA_CONFIG.format;
|
|
100
|
+
var camerasMap = getCamerasMap(attributeName);
|
|
101
|
+
if (!camerasMap)
|
|
102
|
+
return Promise.resolve([]);
|
|
103
|
+
var snapshots = [];
|
|
104
|
+
return cameras.reduce(function (snapshotPromise, camera) {
|
|
105
|
+
return snapshotPromise.then(function () {
|
|
106
|
+
return new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {
|
|
107
|
+
var snapshotStr;
|
|
108
|
+
var _a;
|
|
109
|
+
return __generator(this, function (_b) {
|
|
110
|
+
switch (_b.label) {
|
|
111
|
+
case 0:
|
|
112
|
+
if (!camera) return [3 /*break*/, 2];
|
|
113
|
+
return [4 /*yield*/, window.threekit.configurator.setConfiguration((_a = {},
|
|
114
|
+
_a[attributeName] = camerasMap[camera],
|
|
115
|
+
_a))];
|
|
116
|
+
case 1:
|
|
117
|
+
_b.sent();
|
|
118
|
+
_b.label = 2;
|
|
119
|
+
case 2: return [4 /*yield*/, this.getSnapshot({ size: size, format: format })];
|
|
120
|
+
case 3:
|
|
121
|
+
snapshotStr = _b.sent();
|
|
122
|
+
snapshots.push(snapshotStr);
|
|
123
|
+
resolve(snapshots);
|
|
124
|
+
return [2 /*return*/];
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}); });
|
|
128
|
+
});
|
|
129
|
+
}, Promise.resolve(snapshots));
|
|
130
|
+
};
|
|
131
|
+
this.takeSnapshots = function (camerasList, snapshotsConfig) { return __awaiter(_this, void 0, void 0, function () {
|
|
132
|
+
// function getSnapshot() {
|
|
133
|
+
// return window.threekit.player.snapshotAsync({
|
|
134
|
+
// size,
|
|
135
|
+
// mimeType: `image/${SNAPSHOT_FORMATS[format]}`,
|
|
136
|
+
// })
|
|
137
|
+
// }
|
|
138
|
+
// function getSnapshots(
|
|
139
|
+
// cameras: Array<string | undefined>,
|
|
140
|
+
// camerasMap: CamerasMap
|
|
141
|
+
// ) {
|
|
142
|
+
// let snapshots: Array<string> = []
|
|
143
|
+
// return cameras.reduce((snapshotPromise, camera) => {
|
|
144
|
+
// return snapshotPromise.then(
|
|
145
|
+
// () =>
|
|
146
|
+
// new Promise(async (resolve) => {
|
|
147
|
+
// if (camera)
|
|
148
|
+
// await window.threekit.configurator.setConfiguration({
|
|
149
|
+
// [attributeName]: camerasMap[camera],
|
|
150
|
+
// })
|
|
151
|
+
// const snapshotStr = await getSnapshot()
|
|
152
|
+
// snapshots.push(snapshotStr)
|
|
153
|
+
// resolve(snapshots)
|
|
154
|
+
// })
|
|
155
|
+
// )
|
|
156
|
+
// }, Promise.resolve(snapshots))
|
|
157
|
+
// }
|
|
158
|
+
function saveSnapshotToPlatform(snapshot, filename) {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
160
|
+
var files, response;
|
|
161
|
+
return __generator(this, function (_a) {
|
|
162
|
+
switch (_a.label) {
|
|
163
|
+
case 0:
|
|
164
|
+
files = (0, utils_1.dataURItoFile)(snapshot, filename);
|
|
165
|
+
return [4 /*yield*/, api_1.default.configurations.save({
|
|
166
|
+
assetId: window.threekit.player.assetId,
|
|
167
|
+
configuration: window.threekit.configurator.getConfiguration(),
|
|
168
|
+
files: files,
|
|
169
|
+
})];
|
|
170
|
+
case 1:
|
|
171
|
+
response = _a.sent();
|
|
172
|
+
return [2 /*return*/, "".concat(threekitDomain, "/api/files/hash/").concat(response.data.thumbnail)];
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function downloadSnapshot(snapshot, filename) {
|
|
178
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
179
|
+
var blob, blobUrl, link, clickHandler;
|
|
180
|
+
return __generator(this, function (_a) {
|
|
181
|
+
blob = (0, utils_1.dataURItoBlob)(snapshot);
|
|
182
|
+
blobUrl = URL.createObjectURL(blob);
|
|
183
|
+
link = document.createElement('a');
|
|
184
|
+
link.href = blobUrl;
|
|
185
|
+
link.download = filename;
|
|
186
|
+
clickHandler = function () {
|
|
187
|
+
setTimeout(function () {
|
|
188
|
+
URL.revokeObjectURL(blobUrl);
|
|
189
|
+
link.removeEventListener('click', clickHandler);
|
|
190
|
+
}, 150);
|
|
191
|
+
};
|
|
192
|
+
link.addEventListener('click', clickHandler);
|
|
193
|
+
document.body.appendChild(link);
|
|
194
|
+
link.click();
|
|
195
|
+
return [2 /*return*/];
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
var threekitDomain, filename, size, format, attributeName, output, cameras, snapshotsRaw, snapshotData, camerasMap_1, currentCamera, cameraPosition, _a, savedSnapshots, snapshotBlobs, snapshotFiles;
|
|
200
|
+
var _b;
|
|
201
|
+
return __generator(this, function (_c) {
|
|
202
|
+
switch (_c.label) {
|
|
203
|
+
case 0:
|
|
204
|
+
threekitDomain = connection_1.default.getConnection().threekitDomain;
|
|
205
|
+
filename = (snapshotsConfig === null || snapshotsConfig === void 0 ? void 0 : snapshotsConfig.filename) || DEFAULT_CAMERA_CONFIG.filename;
|
|
206
|
+
size = (snapshotsConfig === null || snapshotsConfig === void 0 ? void 0 : snapshotsConfig.size) || DEFAULT_CAMERA_CONFIG.size;
|
|
207
|
+
format = (snapshotsConfig === null || snapshotsConfig === void 0 ? void 0 : snapshotsConfig.format) || DEFAULT_CAMERA_CONFIG.format;
|
|
208
|
+
attributeName = (snapshotsConfig === null || snapshotsConfig === void 0 ? void 0 : snapshotsConfig.attributeName) || DEFAULT_CAMERA_CONFIG.attributeName;
|
|
209
|
+
output = (snapshotsConfig === null || snapshotsConfig === void 0 ? void 0 : snapshotsConfig.output) || DEFAULT_CAMERA_CONFIG.output;
|
|
210
|
+
cameras = Array.isArray(camerasList) ? camerasList : [camerasList];
|
|
211
|
+
if (!(cameras.length === 1 && cameras[0] === undefined)) return [3 /*break*/, 2];
|
|
212
|
+
return [4 /*yield*/, this.getSnapshot({ size: size, format: format })];
|
|
213
|
+
case 1:
|
|
214
|
+
snapshotData = _c.sent();
|
|
215
|
+
snapshotsRaw = [snapshotData];
|
|
216
|
+
return [3 /*break*/, 5];
|
|
217
|
+
case 2:
|
|
218
|
+
camerasMap_1 = getCamerasMap(attributeName);
|
|
219
|
+
if (!camerasMap_1)
|
|
220
|
+
return [2 /*return*/, null];
|
|
221
|
+
cameras = cameras.filter(function (el) { return el === undefined || Object.keys(camerasMap_1).includes(el); });
|
|
222
|
+
currentCamera = getCameraValue(attributeName);
|
|
223
|
+
cameraPosition = (0, utils_1.getCameraPosition)(window.threekit.player.camera);
|
|
224
|
+
return [4 /*yield*/, this.getSnapshots(cameras, camerasMap_1)];
|
|
225
|
+
case 3:
|
|
226
|
+
snapshotsRaw = _c.sent();
|
|
227
|
+
return [4 /*yield*/, window.threekit.configurator.setConfiguration((_b = {},
|
|
228
|
+
_b[attributeName] = currentCamera,
|
|
229
|
+
_b))];
|
|
230
|
+
case 4:
|
|
231
|
+
_c.sent();
|
|
232
|
+
(0, utils_1.setCameraPosition)(window.threekit.player.camera, cameraPosition);
|
|
233
|
+
_c.label = 5;
|
|
234
|
+
case 5:
|
|
235
|
+
_a = output;
|
|
236
|
+
switch (_a) {
|
|
237
|
+
case constants_1.SNAPSHOT_OUTPUTS.url: return [3 /*break*/, 6];
|
|
238
|
+
case constants_1.SNAPSHOT_OUTPUTS.download: return [3 /*break*/, 8];
|
|
239
|
+
case constants_1.SNAPSHOT_OUTPUTS.blob: return [3 /*break*/, 9];
|
|
240
|
+
case constants_1.SNAPSHOT_OUTPUTS.file: return [3 /*break*/, 10];
|
|
241
|
+
case constants_1.SNAPSHOT_OUTPUTS.dataUrl: return [3 /*break*/, 11];
|
|
242
|
+
}
|
|
243
|
+
return [3 /*break*/, 11];
|
|
244
|
+
case 6: return [4 /*yield*/, Promise.all(snapshotsRaw.map(function (snapshotBlob, idx) {
|
|
245
|
+
var cameraName = (camerasList === null || camerasList === void 0 ? void 0 : camerasList[idx])
|
|
246
|
+
? "-".concat((0, utils_1.regularToKebabCase)(camerasList[idx] || 'default'))
|
|
247
|
+
: '';
|
|
248
|
+
return saveSnapshotToPlatform(snapshotBlob, "".concat(filename).concat(cameraName, ".").concat(format));
|
|
249
|
+
}))];
|
|
250
|
+
case 7:
|
|
251
|
+
savedSnapshots = _c.sent();
|
|
252
|
+
return [2 /*return*/, Promise.resolve(savedSnapshots)];
|
|
253
|
+
case 8:
|
|
254
|
+
snapshotsRaw.forEach(function (snapshotBlob, idx) {
|
|
255
|
+
var cameraName = (camerasList === null || camerasList === void 0 ? void 0 : camerasList[idx])
|
|
256
|
+
? "-".concat((0, utils_1.regularToKebabCase)(camerasList[idx] || 'default'))
|
|
257
|
+
: '';
|
|
258
|
+
downloadSnapshot(snapshotBlob, "".concat(filename).concat(cameraName, ".").concat(format));
|
|
259
|
+
});
|
|
260
|
+
return [2 /*return*/, Promise.resolve()];
|
|
261
|
+
case 9:
|
|
262
|
+
snapshotBlobs = snapshotsRaw.map(function (el) { return (0, utils_1.dataURItoBlob)(el); });
|
|
263
|
+
return [2 /*return*/, Promise.resolve(snapshotBlobs)];
|
|
264
|
+
case 10:
|
|
265
|
+
snapshotFiles = snapshotsRaw.map(function (el, idx) {
|
|
266
|
+
var cameraName = (camerasList === null || camerasList === void 0 ? void 0 : camerasList[idx])
|
|
267
|
+
? "-".concat((0, utils_1.regularToKebabCase)(camerasList[idx] || 'default'))
|
|
268
|
+
: '';
|
|
269
|
+
return (0, utils_1.dataURItoFile)(el, "".concat(filename).concat(cameraName, ".").concat(format));
|
|
270
|
+
});
|
|
271
|
+
return [2 /*return*/, Promise.resolve(snapshotFiles)];
|
|
272
|
+
case 11: return [2 /*return*/, Promise.resolve(snapshotsRaw)];
|
|
273
|
+
case 12: return [2 /*return*/];
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}); };
|
|
277
|
+
}
|
|
278
|
+
return Snapshots;
|
|
279
|
+
}());
|
|
280
|
+
exports.default = Snapshots;
|
package/dist/Treble/Treble.d.ts
CHANGED
|
@@ -1,44 +1,26 @@
|
|
|
1
1
|
import threekitAPI from '../api';
|
|
2
2
|
import { IThreekitPlayer, IMetadata } from '../threekit';
|
|
3
|
-
import {
|
|
3
|
+
import { IWishlist } from './Wishlist';
|
|
4
|
+
import Snapshots from './Snapshots';
|
|
4
5
|
interface ITreble {
|
|
5
6
|
player: IThreekitPlayer;
|
|
6
7
|
}
|
|
7
|
-
export declare type ISnapshotsCameras = undefined | string | Array<string | undefined>;
|
|
8
|
-
export interface ITakeSnapshotsConfig {
|
|
9
|
-
attributeName?: string;
|
|
10
|
-
output?: string;
|
|
11
|
-
format?: string;
|
|
12
|
-
size?: {
|
|
13
|
-
width: number;
|
|
14
|
-
height: number;
|
|
15
|
-
};
|
|
16
|
-
filename?: string;
|
|
17
|
-
}
|
|
18
8
|
export interface ISaveConfigurationConfig {
|
|
19
9
|
customerId?: string;
|
|
20
10
|
metadata?: IMetadata;
|
|
21
11
|
productVersion?: string;
|
|
22
|
-
snapshot?: true | {
|
|
23
|
-
camera: string | undefined;
|
|
24
|
-
config: ITakeSnapshotsConfig;
|
|
25
|
-
};
|
|
26
12
|
}
|
|
27
13
|
declare class Treble {
|
|
28
14
|
_api: typeof threekitAPI;
|
|
29
15
|
_player: IThreekitPlayer;
|
|
30
|
-
|
|
31
|
-
private
|
|
16
|
+
wishlist: IWishlist;
|
|
17
|
+
private _snapshots;
|
|
18
|
+
takeSnapshots: Snapshots['takeSnapshots'];
|
|
32
19
|
constructor({ player }: ITreble);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
saveConfiguration(config?: ISaveConfigurationConfig): Promise<(IConfigurationResponse & {
|
|
20
|
+
saveConfiguration: (config?: ISaveConfigurationConfig | undefined) => Promise<{
|
|
21
|
+
resumableUrl: string;
|
|
22
|
+
} & import("../http/configurations").IConfigurationResponse & {
|
|
37
23
|
thumbnail: string;
|
|
38
|
-
}
|
|
39
|
-
getWishlist(): Promise<IConfigurationResponse[]>;
|
|
40
|
-
addToWishlist(config?: ISaveConfigurationConfig): Promise<IConfigurationResponse[]>;
|
|
41
|
-
removeFromWishlist(idx: number): IConfigurationResponse[];
|
|
42
|
-
clearWishlist(): IConfigurationResponse[];
|
|
24
|
+
}>;
|
|
43
25
|
}
|
|
44
26
|
export default Treble;
|