deepar 5.0.0 → 5.1.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.
@@ -2,6 +2,7 @@ import { ARTouchInfo } from "./touchType";
2
2
  import { DeepARCallbacks } from "./callbacks";
3
3
  import { DeepARParams } from "./initParams";
4
4
  import { LogType } from "./logType";
5
+ import { ScriptingAPI } from "./scriptingApi";
5
6
  /**
6
7
  * Initialize the DeepAR SDK.<br><br>
7
8
  * @param params Initialization parameters.
@@ -39,6 +40,13 @@ export declare class DeepAR {
39
40
  * ```
40
41
  */
41
42
  callbacks: DeepARCallbacks;
43
+ /**
44
+ * Scripting API property used to access all the scripting interop methods.
45
+ *
46
+ * @example
47
+ * let scriptingVariable = deepAR.ScriptingAPI.getStringVar('variableName');
48
+ */
49
+ ScriptingAPI: ScriptingAPI;
42
50
  /**
43
51
  * @internal
44
52
  * @param module
@@ -4,5 +4,6 @@ export * from './initParams';
4
4
  export * from './callbacks';
5
5
  export * from './faceData';
6
6
  export * from './footData';
7
+ export * from './scriptingApi';
7
8
  export * as errors from './errors';
8
9
  export * from './touchType';
@@ -0,0 +1,107 @@
1
+ /**
2
+ * DeepAR Scripting API interop variable types.
3
+ */
4
+ export declare enum VarType {
5
+ Bool = 0,
6
+ Int = 1,
7
+ Double = 2,
8
+ String = 3
9
+ }
10
+ /**
11
+ * A DeepAR Scripting API interop namespace.
12
+ */
13
+ export declare class ScriptingAPI {
14
+ private module;
15
+ /**
16
+ * @internal
17
+ * @param module DeepAR emscripten module.
18
+ */
19
+ constructor(module: any);
20
+ /**
21
+ * Check if variable with the given name is already created.
22
+ * @param name The variable name.
23
+ * @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
24
+ * @return boolean True if the variable is already created, false otherwise.
25
+ */
26
+ hasVar(name: string, slot?: string): boolean;
27
+ /**
28
+ * Get the type of the variable with the given name.
29
+ * @param name The variable name.
30
+ * @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
31
+ * @return VarType The variable type.
32
+ */
33
+ getVarType(name: string, slot?: string): VarType;
34
+ /**
35
+ * Get boolean variable with the given name.
36
+ * @param name The variable name.
37
+ * @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
38
+ * @return boolean Value of the variable with the specified name.
39
+ */
40
+ getBoolVar(name: string, slot?: string): boolean;
41
+ /**
42
+ * Get int variable with the given name.
43
+ * @param name The variable name.
44
+ * @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
45
+ * @return int Value of the variable with the specified name.
46
+ */
47
+ getIntVar(name: string, slot?: string): number;
48
+ /**
49
+ * Get the double variable with the given name.
50
+ * @param name The variable name.
51
+ * @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
52
+ * @return double Value of the variable with the specified name.
53
+ */
54
+ getDoubleVar(name: string, slot?: string): number;
55
+ /**
56
+ * Get the string variable with the given name.
57
+ * @param name The variable name.
58
+ * @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
59
+ * @return string Value of the variable with the specified name.
60
+ */
61
+ getStringVar(name: string, slot?: number): string;
62
+ /**
63
+ * Set the boolean variable with the given name.
64
+ * @param name The variable name.
65
+ * @param value Value to be set.
66
+ * @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
67
+ * @return True if the variable is created, false if the variable already exists and the new value is set.
68
+ */
69
+ setBoolVar(name: string, value: boolean, slot?: string): boolean;
70
+ /**
71
+ * Set the int variable with the given name.
72
+ * @param name The variable name.
73
+ * @param value Value to be set.
74
+ * @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
75
+ * @return True if the variable is created, false if the variable already exists and the new value is set.
76
+ */
77
+ setIntVar(name: string, value: number, slot?: string): boolean;
78
+ /**
79
+ * Set the double variable with the given name.
80
+ * @param name The variable name.
81
+ * @param value Value to be set.
82
+ * @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
83
+ * @return True if the variable is created, false if the variable already exists and the new value is set.
84
+ */
85
+ setDoubleVar(name: string, value: number, slot?: string): boolean;
86
+ /**
87
+ * Set the string variable with the given name.
88
+ * @param name The variable name.
89
+ * @param value Value to be set.
90
+ * @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
91
+ * @return True if the variable is created, false if the variable already exists and the new value is set.
92
+ */
93
+ setStringVar(name: string, value: string, slot?: string): boolean;
94
+ /**
95
+ * Delete variable with the given name.
96
+ * @param name The variable name.
97
+ * @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
98
+ * @return boolean True if the variable is deleted, false otherwise.
99
+ */
100
+ deleteVar(name: string, slot?: string): boolean;
101
+ /**
102
+ * Clear all variables or variables from the specified effect.
103
+ * @param slot The slot of the effect in which to search the variable. If it is not given, variable will be searched for in all the effects.
104
+ * @return boolean True if one or more variables are deleted, false otherwise.
105
+ */
106
+ clearVars(slot?: string): boolean;
107
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * DeepAR Web SDK version.
3
3
  */
4
- declare const version = "5.0.0";
4
+ declare const version = "5.1.1";
5
5
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepar",
3
- "version": "5.0.0",
3
+ "version": "5.1.1",
4
4
  "description": "The official DeepAR Web SDK",
5
5
  "main": "js/deepar.esm.js",
6
6
  "jsdelivr": "js/deepar.js",
package/wasm/deepar.wasm CHANGED
Binary file