Skip to content

Commit

Permalink
Add void type to dispose functions
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtelnov committed Sep 14, 2023
1 parent 2991358 commit 69b2b7c
Show file tree
Hide file tree
Showing 37 changed files with 47 additions and 47 deletions.
4 changes: 2 additions & 2 deletions src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class Dependencies {
target.registerPropertyChangedHandlers([property], this.currentDependency, this.id);

}
dispose(): void {
public dispose(): void {
this.dependencies.forEach(dependency => {
dependency.obj.unregisterPropertyChangedHandlers([dependency.prop], dependency.id);
});
Expand Down Expand Up @@ -303,7 +303,7 @@ export class Base {
this.onBaseCreating();
this.isCreating = false;
}
public dispose() {
public dispose(): void {
for (var i = 0; i < this.eventList.length; i++) {
this.eventList[i].clear();
}
Expand Down
2 changes: 1 addition & 1 deletion src/dropdownListModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ export class DropdownListModel extends Base {
}
}

dispose(): void {
public dispose(): void {
super.dispose();
this.question && this.question.onPropertyChanged.remove(this.qustionPropertyChangedHandler);
this.qustionPropertyChangedHandler = undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/components/action-bar/action-bar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class ActionContainerImplementor extends ImplementorBase {
});
}

dispose() {
public dispose(): void {
super.dispose();
this.itemsSubscription.dispose();
this.model.resetResponsivityManager();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/components/popup/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export class PopupViewModel {
this._popupImplementor = new ImplementorBase(popupViewModel);
popupViewModel.model.onVisibilityChanged.add(this.visibilityChangedHandler);
}
dispose() {
public dispose(): void {
this._popupModelImplementor.dispose();
this._popupModelImplementor = undefined;
this._popupImplementor.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/components/string-editor/string-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class StringEditorViewModel {
onClick(sender: StringEditorViewModel, event: any) {
event.stopPropagation();
}
dispose() {
public dispose(): void {
this.locString.onSearchChanged = undefined;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/kobase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class ImplementorBase {
};
(<any>element)[this.implementedMark] = true;
}
public dispose() {
public dispose(): void {
this.element.iteratePropertiesHash((hash, key) => {
hash[key] = ko.unwrap(hash[key]);
if(Array.isArray(hash[key])) {
Expand Down
6 changes: 3 additions & 3 deletions src/knockout/kopage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export class QuestionRow extends QuestionRowModel {
});
}
}
public dispose() {
public dispose(): void {
super.dispose();
this.koElementAfterRender = undefined;
}
Expand Down Expand Up @@ -87,7 +87,7 @@ export class Panel extends PanelModel {
protected onNumChanged(value: number) {
this.locTitle.strChanged();
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand All @@ -111,7 +111,7 @@ export class Page extends PageModel {
protected onNumChanged(value: number) {
this.locTitle.strChanged();
}
public dispose() {
public dispose(): void {
super.dispose();
this._implementor.dispose();
this._implementor = undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class QuestionImplementor extends ImplementorBase {
}
}, 0);
}
public dispose() {
public dispose(): void {
super.dispose();
for (let i = 0; i < this.disposedObjects.length; i++) {
const name = this.disposedObjects[i];
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_boolean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class QuestionBoolean extends QuestionBooleanModel {
public onKeyDown(data: any, event: any): boolean {
return this.onKeyDownCore(event);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_buttongroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class QuestionButtonGroup extends QuestionButtonGroupModel {
super.onBaseCreating();
this._implementor = new QuestionCheckboxBaseImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_checkbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class QuestionCheckbox extends QuestionCheckboxModel {
this.koAllSelected(this.isAllSelected);
this.isAllSelectedUpdating = false;
}
public dispose() {
public dispose(): void {
if(this._selectAllItemImpl) {
this._selectAllItemImpl.dispose();
this._selectAllItemImpl = undefined;
Expand Down
4 changes: 2 additions & 2 deletions src/knockout/koquestion_custom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class QuestionCustom extends QuestionCustomModel {
super.onBaseCreating();
this._implementor = new QuestionImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand All @@ -32,7 +32,7 @@ export class QuestionComposite extends QuestionCompositeModel {
super.onBaseCreating();
this._implementor = new QuestionImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class QuestionDropdown extends QuestionDropdownModel {
super.onBaseCreating();
this._implementor = new QuestionDropdownImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_empty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class QuestionEmpty extends QuestionEmptyModel {
super.onBaseCreating();
this._implementor = new QuestionImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_expression.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class QuestionExpression extends QuestionExpressionModel {
super.onBaseCreating();
this._implementor = new QuestionImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class QuestionFile extends QuestionFileModel {
super.onBaseCreating();
this._implementor = new QuestionFileImplementor(this);
}
public dispose() {
public dispose(): void {
this.onUploadStateChanged.remove(this.updateState);
this._implementor.dispose();
this._implementor = undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class QuestionHtml extends QuestionHtmlModel {
super.onBaseCreating();
this._implementor = new QuestionImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class QuestionImage extends QuestionImageModel {
super.onBaseCreating();
this._implementor = new QuestionImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_imagepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class QuestionImagePicker extends QuestionImagePickerModel {
super.onBaseCreating();
this._implementor = new QuestionImagePickerImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_matrix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class QuestionMatrix extends QuestionMatrixModel {
this.koVisibleRows(rows);
return rows;
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
this.koVisibleRows = undefined;
Expand Down
4 changes: 2 additions & 2 deletions src/knockout/koquestion_matrixdropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class QuestionMatrixBaseImplementor extends QuestionImplementor {
var el = SurveyElement.GetFirstNonTextElement(elements);
this.question.survey.afterRenderPanel(con, el);
}
public dispose() {
public dispose(): void {
if (!!this._tableImplementor) {
this._tableImplementor.dispose();
}
Expand All @@ -133,7 +133,7 @@ export class QuestionMatrixDropdown extends QuestionMatrixDropdownModel {
super.onBaseCreating();
this._implementor = new QuestionMatrixBaseImplementor(this);
}
public dispose() {
public dispose(): void {
super.dispose();
this._implementor.dispose();
this._implementor = undefined;
Expand Down
4 changes: 2 additions & 2 deletions src/knockout/koquestion_matrixdynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export class QuestionMatrixDynamicImplementor extends QuestionMatrixBaseImplemen
public getKoPopupIsVisible(row: MatrixDropdownRowModelBase) {
return <any>ko.observable(row.isDetailPanelShowing);
}
public dispose() {
public dispose(): void {
super.dispose();
(<any>this.question)["getKoPopupIsVisible"] = undefined;
}
Expand All @@ -46,7 +46,7 @@ export class QuestionMatrixDynamic extends QuestionMatrixDynamicModel {
super.onBaseCreating();
this._implementor = new QuestionMatrixDynamicImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
4 changes: 2 additions & 2 deletions src/knockout/koquestion_multipletext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class koMultipleTextEditorModel extends MultipleTextEditorModel {
super.onBaseCreating();
this._implementor = new QuestionTextImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down Expand Up @@ -73,7 +73,7 @@ export class QuestionMultipleText extends QuestionMultipleTextModel {
protected createTextItem(name: string, title: string): MultipleTextItemModel {
return new MultipleTextItem(name, title);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
this.koRows = undefined;
Expand Down
4 changes: 2 additions & 2 deletions src/knockout/koquestion_paneldynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export class QuestionPanelDynamicImplementor extends QuestionImplementor {
const el = SurveyElement.GetFirstNonTextElement(elements);
this.question.survey.afterRenderPanel(con, el);
}
public dispose() {
public dispose(): void {
this.question.panelCountChangedCallback = undefined;
this.question.renderModeChangedCallback = undefined;
this.question.currentIndexChangedCallback = undefined;
Expand All @@ -195,7 +195,7 @@ export class QuestionPanelDynamic extends QuestionPanelDynamicModel {
super.onBaseCreating();
this._implementor = new QuestionPanelDynamicImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_radiogroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class QuestionRadiogroup extends QuestionRadiogroupModel {
super.onBaseCreating();
this._implementor = new QuestionCheckboxBaseImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_ranking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class QuestionRanking extends QuestionRankingModel {
super.onBaseCreating();
this._implementor = new QuestionImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_rating.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class QuestionRating extends QuestionRatingModel {
super.onBaseCreating();
this._implementor = new QuestionRatingImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_signaturepad.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class QuestionSignaturePad extends QuestionSignaturePadModel {
super.onBaseCreating();
this._implementor = new QuestionImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_tagbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class QuestionTagbox extends QuestionTagboxModel {
this.koAllSelected(this.isAllSelected);
this.isAllSelectedUpdating = false;
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
this.koAllSelected = undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/koquestion_text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class QuestionText extends QuestionTextModel {
super.onBaseCreating();
this._implementor = new QuestionTextImplementor(this);
}
public dispose() {
public dispose(): void {
this._implementor.dispose();
this._implementor = undefined;
super.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/knockout/kosurvey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class Survey extends SurveyModel {
public makeReactive(obj: Base): void {
new ImplementorBase(obj);
}
public dispose() {
public dispose(): void {
super.dispose();
if(this.implementor) {
this.implementor.dispose();
Expand Down
2 changes: 1 addition & 1 deletion src/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export class ListModel<T extends BaseAction = Action> extends ActionContainer<T>
}
}

dispose(): void {
public dispose(): void {
super.dispose();
if(!!this.loadingIndicatorValue) {
this.loadingIndicatorValue.dispose();
Expand Down
4 changes: 2 additions & 2 deletions src/panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ export class QuestionRowModel extends Base {
return false;
}
@property({ defaultValue: null }) dragTypeOverMe: DragTypeOverMeEnum;
public dispose() {
public dispose(): void {
super.dispose();
this.stopLazyRendering();
}
Expand Down Expand Up @@ -1500,7 +1500,7 @@ export class PanelModelBase extends SurveyElement<Question>
}
//ITitleOwner
public get no(): string { return ""; }
public dispose() {
public dispose(): void {
super.dispose();
if (this.rows) {
for (var i = 0; i < this.rows.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/question_file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ export class FileLoader {
}
});
}
dispose(): void {
public dispose(): void {
this.fileQuestion = undefined;
this.callback = undefined;
}
Expand Down
Loading

0 comments on commit 69b2b7c

Please sign in to comment.