@@ -58,8 +58,9 @@ export class SelectionModel<T> {
58
58
* Selects a value or an array of values.
59
59
* @param values The values to select
60
60
* @return Whether the selection changed as a result of this call
61
+ * @breaking -change 16.0.0 make return type boolean
61
62
*/
62
- select ( ...values : T [ ] ) {
63
+ select ( ...values : T [ ] ) : boolean | void {
63
64
this . _verifyValueAssignment ( values ) ;
64
65
values . forEach ( value => this . _markSelected ( value ) ) ;
65
66
const changed = this . _hasQueuedChanges ( ) ;
@@ -71,8 +72,9 @@ export class SelectionModel<T> {
71
72
* Deselects a value or an array of values.
72
73
* @param values The values to deselect
73
74
* @return Whether the selection changed as a result of this call
75
+ * @breaking -change 16.0.0 make return type boolean
74
76
*/
75
- deselect ( ...values : T [ ] ) {
77
+ deselect ( ...values : T [ ] ) : boolean | void {
76
78
this . _verifyValueAssignment ( values ) ;
77
79
values . forEach ( value => this . _unmarkSelected ( value ) ) ;
78
80
const changed = this . _hasQueuedChanges ( ) ;
@@ -84,8 +86,9 @@ export class SelectionModel<T> {
84
86
* Sets the selected values
85
87
* @param values The new selected values
86
88
* @return Whether the selection changed as a result of this call
89
+ * @breaking -change 16.0.0 make return type boolean
87
90
*/
88
- setSelection ( ...values : T [ ] ) : boolean {
91
+ setSelection ( ...values : T [ ] ) : boolean | void {
89
92
this . _verifyValueAssignment ( values ) ;
90
93
const oldValues = this . selected ;
91
94
const newSelectedSet = new Set ( values ) ;
@@ -102,8 +105,9 @@ export class SelectionModel<T> {
102
105
* Toggles a value between selected and deselected.
103
106
* @param value The value to toggle
104
107
* @return Whether the selection changed as a result of this call
108
+ * @breaking -change 16.0.0 make return type boolean
105
109
*/
106
- toggle ( value : T ) {
110
+ toggle ( value : T ) : boolean | void {
107
111
return this . isSelected ( value ) ? this . deselect ( value ) : this . select ( value ) ;
108
112
}
109
113
@@ -112,8 +116,9 @@ export class SelectionModel<T> {
112
116
* @param flushEvent Whether to flush the changes in an event.
113
117
* If false, the changes to the selection will be flushed along with the next event.
114
118
* @return Whether the selection changed as a result of this call
119
+ * @breaking -change 16.0.0 make return type boolean
115
120
*/
116
- clear ( flushEvent = true ) {
121
+ clear ( flushEvent = true ) : boolean | void {
117
122
this . _unmarkAll ( ) ;
118
123
const changed = this . _hasQueuedChanges ( ) ;
119
124
if ( flushEvent ) {
0 commit comments