@@ -50,6 +50,12 @@ export class ImageCrop implements ComponentFramework.StandardControl<IInputs, IO
50
50
this . _reactRoot = ReactDOM . createRoot ( this . _container ) ;
51
51
}
52
52
53
+ /**
54
+ * Returns the output schema for the control, used by Power Apps to validate the shape of output properties.
55
+ * This is required for controls with object-typed outputs (e.g., actionOutput).
56
+ * @param context The PCF context object
57
+ * @returns A promise resolving to the output schema object
58
+ */
53
59
public async getOutputSchema ( context : ComponentFramework . Context < IInputs > ) : Promise < Record < string , unknown > > {
54
60
return Promise . resolve ( {
55
61
actionOutput : ActionOutputSchema
@@ -74,14 +80,22 @@ export class ImageCrop implements ComponentFramework.StandardControl<IInputs, IO
74
80
) ;
75
81
}
76
82
77
- // Callback for crop complete
83
+ /**
84
+ * Callback invoked when a crop operation is completed.
85
+ * Sets the crop result and triggers output notification.
86
+ * @param results The base64 string of the cropped image
87
+ */
78
88
public onCropComplete = ( results : string ) => {
79
89
this . _actionCropComplete = true ;
80
90
this . _cropResults = results ;
81
91
this . _notifyOutputChanged ( ) ;
82
92
} ;
83
93
84
- // Callback for drag start
94
+ /**
95
+ * Callback invoked when a drag operation starts on the crop area.
96
+ * Sets the action output to 'dragStart' and pointer coordinates, then notifies output change.
97
+ * @param e PointerEvent from the drag start
98
+ */
85
99
public onDragStart = ( e : PointerEvent ) => {
86
100
this . _actionDragStart = true ;
87
101
this . _actionOutput = {
@@ -92,7 +106,11 @@ export class ImageCrop implements ComponentFramework.StandardControl<IInputs, IO
92
106
this . _notifyOutputChanged ( ) ;
93
107
} ;
94
108
95
- // Callback for drag end
109
+ /**
110
+ * Callback invoked when a drag operation ends on the crop area.
111
+ * Sets the action output to 'dragEnd' and pointer coordinates, then notifies output change.
112
+ * @param e PointerEvent from the drag end
113
+ */
96
114
public onDragEnd = ( e : PointerEvent ) => {
97
115
this . _actionDragEnd = true ;
98
116
this . _actionOutput = {
0 commit comments