You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* @param {File} file - The file to be used as the replacement asset.
101
+
* @returns {Promise<void>} A promise that resolves when the replacement is complete.
102
+
*/
103
+
asyncreplaceAsset(file: File): Promise<void>{
77
104
constasset=Asset(this._emitter);
78
-
returnasset.handleUpload([file],"replace");
105
+
awaitasset.handleUpload([file],"replace");
79
106
}
80
107
81
108
/**
82
-
* This function executes the callback function every time an asset is saved.
83
-
* @param {function} callback The function to be called when an asset is saved.
109
+
* Executes the provided callback function every time an asset is saved.
110
+
* @param {function} callback - The function to be called when an asset is saved.
111
+
* @param {AssetType} arg0 - The asset data passed as an argument to the callback function when an asset is saved.
84
112
*/
85
-
86
113
onSave(callback: (arg0: AssetType)=>void){
87
114
constassetObj=this;
88
115
if(callback&&typeofcallback==="function"){
@@ -95,10 +122,11 @@ class AssetSidebarWidget {
95
122
}
96
123
97
124
/**
98
-
* The field.onChange() function is called when another extension programmatically changes the data of the current extension field using the field.setData() function. This function is only available for extension fields that support the following data types: text, number, boolean, or date.
99
-
* @param {function} callback The function to be called when an asset is edited/changed.
125
+
* The `field.onChange()` function is called when another extension programmatically changes the data of the current extension field using the `field.setData()` function.
126
+
* This function is only available for extension fields that support the following data types: text, number, boolean, or date.
127
+
* @param {function} callback - The function to be called when the asset is edited/changed.
128
+
* @param {AssetType} arg0 - The asset data passed as an argument to the callback function when the asset is edited/changed.
100
129
*/
101
-
102
130
onChange(callback: (arg0: AssetType)=>void){
103
131
constassetObj=this;
104
132
if(callback&&typeofcallback==="function"){
@@ -112,9 +140,9 @@ class AssetSidebarWidget {
112
140
113
141
/**
114
142
* The onPublish() function executes the callback function every time an asset has been published with the respective payload.
115
-
* @param {function} callback The function to be called when an asset is published.
143
+
* @param {function} callback - The function to be called when an asset is published.
144
+
* @param {AssetType} arg0 - The data of the published asset passed as an argument to the callback function.
116
145
*/
117
-
118
146
onPublish(callback: (arg0: AssetType)=>void){
119
147
constassetObj=this;
120
148
if(callback&&typeofcallback==="function"){
@@ -127,10 +155,10 @@ class AssetSidebarWidget {
127
155
}
128
156
129
157
/**
130
-
* The onUnPublish() function executes the callback function every time an asset has been unpublished with the respective payload.
131
-
* @param {function} callback The function to be called when an asset is un published.
158
+
* The `onUnPublish()` function executes the provided callback every time an asset is unpublished.
159
+
* @param {function} callback - The function to be called when an asset is unpublished.
160
+
* @param {AssetType} arg0 - The data of the unpublished asset passed as an argument to the callback function.
0 commit comments