11import { QualifierValue } from "../internal/qualifier/QualifierValue" ;
22import { FocusOnValue } from "./focusOn" ;
33
4-
5- /**
6- * Accepts an AutoFocusObject (which is just a wrapper for a FocusOn object, but with extra method: avoid, weight)
7- * @param {AutoFocus } AutoFocusObjects
8- */
9-
104/**
115 * @summary qualifier
12- * @description A wrapper class around a FocusOn object.
136 * @namespace AutoFocus
147 * @memberOf Qualifiers
8+ * @see Visit {@link Qualifiers.Gravity|Gravity} for an example
9+ */
10+
11+
12+ /**
13+ * @memberOf Qualifiers.AutoFocus
1514 * @extends {SDK.QualifierValue }
15+ * @see Visit {@link Qualifiers.Gravity|Gravity} for an example
1616 */
1717class AutoFocus extends QualifierValue {
18- readonly focusOn :FocusOnValue ;
18+ readonly focusOn : FocusOnValue ;
1919 private _weight : number | string ;
20- private shouldAvoid :boolean ;
20+ private shouldAvoid : boolean ;
2121
2222 /**
23- * @summary qualifier
24- * @description Specifies the object to focus on automatically
23+ * @summary qualifier
24+ * @description Specifies the object to focus on automatically
25+ * Accepts an AutoFocusObject (which is just a wrapper for a FocusOn object, but with extra method: avoid, weight)
2526 * @param {Qualifiers.FocusOn } obj The object to focus on.
2627 * @param {number } weight
2728 */
2829 static focusOn ( obj : FocusOnValue , weight ?: number ) : AutoFocus {
2930 return new AutoFocus ( obj , weight ) ;
3031 }
3132
32- constructor ( focusOn :FocusOnValue , weight ?: number | string ) {
33+ constructor ( focusOn : FocusOnValue , weight ?: number | string ) {
3334 super ( ) ;
3435 this . _weight = weight ;
3536 this . focusOn = focusOn ;
@@ -41,18 +42,18 @@ class AutoFocus extends QualifierValue {
4142 }
4243
4344 /**
44- * @summary qualifier
45- * @desc Get the name of the of the object
45+ * @summary qualifier
46+ * @desc Get the name of the of the object
4647 */
47- private getName ( ) :string {
48+ private getName ( ) : string {
4849 return this . focusOn . name ;
4950 }
5051
5152 /**
52- * @summary qualifier
53- * @desc Get the weight for the object
53+ * @summary qualifier
54+ * @desc Get the weight for the object
5455 */
55- private getWeight ( ) :number | string {
56+ private getWeight ( ) : number | string {
5657 if ( this . shouldAvoid ) {
5758 return 'avoid' ;
5859 } else {
@@ -61,21 +62,21 @@ class AutoFocus extends QualifierValue {
6162 }
6263
6364 /**
64- * @summary qualifier
65- * @desc Return the string representation of this QualifierValue
65+ * @summary qualifier
66+ * @desc Return the string representation of this QualifierValue
6667 */
67- toString ( ) :string {
68+ toString ( ) : string {
6869 // Future proofing, in case we'd like to support some custom string in the future, or if data is coming from a DB
69- if ( this . shouldAddWeight ( ) ) {
70+ if ( this . shouldAddWeight ( ) ) {
7071 return `${ this . getName ( ) } _${ this . getWeight ( ) } ` ;
7172 } else {
7273 return `${ this . getName ( ) } ` ;
7374 }
7475 }
7576
7677 /**
77- * @summary qualifier
78- * @description Sets the importance level of the object within the automatic gravity algorithm
78+ * @summary qualifier
79+ * @description Sets the importance level of the object within the automatic gravity algorithm
7980 * @param {numebr } w The focus weight for the object
8081 * @return {this }
8182 */
@@ -85,8 +86,8 @@ class AutoFocus extends QualifierValue {
8586 }
8687
8788 /**
88- * @summary qualifier
89- * @description Attempts to avoid the detected object in the image
89+ * @summary qualifier
90+ * @description Attempts to avoid the detected object in the image
9091 * @return {this }
9192 */
9293 avoid ( ) : this {
0 commit comments