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
* Synchronize the asset with the parent application in the Contentstack UI.
29
+
* @returns {Promise<void>} A promise that resolves when the synchronization is complete.
30
+
*/
18
31
syncAsset(): Promise<void>;
32
+
/**
33
+
* Update the width of the Asset Sidebar widget in the Contentstack UI.
34
+
* @param {number} width - The new width of the asset sidebar.
35
+
* @throws {Error} Throws an error if the width parameter is not a number.
36
+
* @returns {Promise<void>} A promise that resolves when the width is updated successfully.
37
+
*/
19
38
updateWidth(width: number): Promise<void>;
20
-
replaceAsset(file: File): Promise<any>;
21
39
/**
22
-
* This function executes the callback function every time an asset is saved.
23
-
* @param {function} callback The function to be called when an asset is saved.
40
+
* Replace the current asset with a new file.
41
+
* @param {File} file - The file to be used as the replacement asset.
42
+
* @returns {Promise<void>} A promise that resolves when the replacement is complete.
43
+
*/
44
+
replaceAsset(file: File): Promise<void>;
45
+
/**
46
+
* Executes the provided callback function every time an asset is saved.
47
+
* @param {function} callback - The function to be called when an asset is saved.
48
+
* @param {AssetType} arg0 - The asset data passed as an argument to the callback function when an asset is saved.
24
49
*/
25
50
onSave(callback: (arg0: AssetType)=>void): void;
26
51
/**
27
-
* 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.
28
-
* @param {function} callback The function to be called when an asset is edited/changed.
52
+
* The `field.onChange()` function is called when another extension programmatically changes the data of the current extension field using the `field.setData()` function.
53
+
* This function is only available for extension fields that support the following data types: text, number, boolean, or date.
54
+
* @param {function} callback - The function to be called when the asset is edited/changed.
55
+
* @param {AssetType} arg0 - The asset data passed as an argument to the callback function when the asset is edited/changed.
* @param {Object|string|number} data Data to be set on the field
@@ -33,9 +29,7 @@ declare class Field {
33
29
* @param {boolean} options.resolved If the resolved parameter is set to true for the File field, then the method will return a resolved asset object along with all the field metadata, e.g. 'field.getData({resolved:true})'.
34
30
* @return {Object|string|number} Returns the field data.
0 commit comments