Skip to content

Commit 8a234b5

Browse files
authored
fix(typings): ensure abstract repeater typings compat (#418)
- resolve out of date deps
1 parent f1af4aa commit 8a234b5

34 files changed

+10215
-2223
lines changed

package-lock.json

Lines changed: 10142 additions & 2151 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"jasmine-core": "^3.99.1",
7272
"karma": "^6.3.17",
7373
"karma-chrome-launcher": "^3.1.1",
74-
"karma-coverage": "^1.1.2",
74+
"karma-coverage": "^2.2.0",
7575
"karma-jasmine": "^4.0.2",
7676
"karma-mocha-reporter": "^2.2.5",
7777
"karma-sourcemap-loader": "^0.3.8",
@@ -80,13 +80,10 @@
8080
"rollup": "^2.70.1",
8181
"standard-version": "^9.3.2",
8282
"ts-loader": "^9.2.8",
83+
"tslib": "^2.3.1",
8384
"typedoc": "^0.22.13",
8485
"typescript": "^4.6.3",
8586
"webpack": "^5.70.0",
8687
"webpack-cli": "^4.9.2"
87-
},
88-
"volta": {
89-
"node": "14.19.1",
90-
"npm": "6.14.16"
9188
}
9289
}

src/abstract-repeater.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-unused-vars */
12
import { View } from 'aurelia-templating';
23

34
/**
@@ -15,7 +16,7 @@ export class AbstractRepeater {
1516
/**
1617
* Returns the number of views the repeater knows about.
1718
*
18-
* @return {Number} the number of views.
19+
* @return the number of views.
1920
*/
2021
viewCount(): number {
2122
throw new Error('subclass must implement `viewCount`');
@@ -24,7 +25,7 @@ export class AbstractRepeater {
2425
/**
2526
* Returns all of the repeaters views as an array.
2627
*
27-
* @return {Array} The repeater's array of views;
28+
* @return The repeater's array of views;
2829
*/
2930
views(): any[] {
3031
throw new Error('subclass must implement `views`');
@@ -33,19 +34,19 @@ export class AbstractRepeater {
3334
/**
3435
* Returns a single view from the repeater at the provided index.
3536
*
36-
* @param {Number} index The index of the requested view.
37+
* @param index The index of the requested view.
3738
* @return {View|ViewSlot} The requested view.
3839
*/
39-
view(index): any {
40+
view(index: number): any {
4041
throw new Error('subclass must implement `view`');
4142
}
4243

4344
/**
4445
* Returns the matcher function to be used by the repeater, or null if strict matching is to be performed.
4546
*
46-
* @return {Function|null} The requested matcher function.
47+
* @return The requested matcher function.
4748
*/
48-
matcher() {
49+
matcher(): Function | null {
4950
throw new Error('subclass must implement `matcher`');
5051
}
5152

@@ -56,7 +57,7 @@ export class AbstractRepeater {
5657
* @param {Object} bindingContext The binding context to bind the new view to.
5758
* @param {Object} overrideContext A secondary binding context that can override the primary context.
5859
*/
59-
addView(bindingContext, overrideContext) {
60+
addView(bindingContext, overrideContext): any {
6061
throw new Error('subclass must implement `addView`');
6162
}
6263

@@ -68,7 +69,7 @@ export class AbstractRepeater {
6869
* @param {Object} bindingContext The binding context to bind the new view to.
6970
* @param {Object} overrideContext A secondary binding context that can override the primary context.
7071
*/
71-
insertView(index, bindingContext, overrideContext) {
72+
insertView(index, bindingContext, overrideContext): any {
7273
throw new Error('subclass must implement `insertView`');
7374
}
7475

@@ -78,7 +79,7 @@ export class AbstractRepeater {
7879
* @param {Number} sourceIndex The index of the view to be moved.
7980
* @param {Number} sourceIndex The index where the view should be placed at.
8081
*/
81-
moveView(sourceIndex, targetIndex) {
82+
moveView(sourceIndex, targetIndex): any {
8283
throw new Error('subclass must implement `moveView`');
8384
}
8485

@@ -88,7 +89,7 @@ export class AbstractRepeater {
8889
* @param {Boolean} skipAnimation Should the removal animation be skipped?
8990
* @return {Promise|null}
9091
*/
91-
removeAllViews(returnToCache?: boolean, skipAnimation?: boolean) {
92+
removeAllViews(returnToCache?: boolean, skipAnimation?: boolean): (any | Promise<any>)[] {
9293
throw new Error('subclass must implement `removeAllViews`');
9394
}
9495

@@ -98,9 +99,8 @@ export class AbstractRepeater {
9899
* @param {Array} viewsToRemove The array of views to be removed.
99100
* @param {Boolean} returnToCache Should the view be returned to the view cache?
100101
* @param {Boolean} skipAnimation Should the removal animation be skipped?
101-
* @return {Promise|null}
102102
*/
103-
removeViews(viewsToRemove: Array<View>, returnToCache?: boolean, skipAnimation?: boolean) {
103+
removeViews(viewsToRemove: Array<View>, returnToCache?: boolean, skipAnimation?: boolean): (any | Promise<any>)[] {
104104
throw new Error('subclass must implement `removeView`');
105105
}
106106

@@ -110,9 +110,8 @@ export class AbstractRepeater {
110110
* @param {Number} index The index of the view to be removed.
111111
* @param {Boolean} returnToCache Should the view be returned to the view cache?
112112
* @param {Boolean} skipAnimation Should the removal animation be skipped?
113-
* @return {Promise|null}
114113
*/
115-
removeView(index: number, returnToCache?: boolean, skipAnimation?: boolean) {
114+
removeView(index: number, returnToCache?: boolean, skipAnimation?: boolean): any | Promise<any> {
116115
throw new Error('subclass must implement `removeView`');
117116
}
118117

src/attr-binding-behavior.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-unused-vars */
12
import {DataAttributeObserver, bindingBehavior} from 'aurelia-binding';
23

34
@bindingBehavior('attr')

src/binding-mode-behaviors.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ import { bindingBehavior, bindingMode } from 'aurelia-binding';
22
import { mixin } from 'aurelia-metadata';
33

44
let modeBindingBehavior = {
5+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
56
bind(binding, source, lookupFunctions) {
67
binding.originalMode = binding.mode;
78
binding.mode = this.mode;
89
},
910

11+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1012
unbind(binding, source) {
1113
binding.mode = binding.originalMode;
1214
binding.originalMode = null;

src/compose.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ export class Compose {
193193
* @param newValue The new value.
194194
* @param oldValue The old value.
195195
*/
196+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
196197
modelChanged(newValue, oldValue) {
197198
this.changes.model = newValue;
198199
requestUpdate(this);
@@ -203,6 +204,7 @@ export class Compose {
203204
* @param newValue The new value.
204205
* @param oldValue The old value.
205206
*/
207+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
206208
viewChanged(newValue, oldValue) {
207209
this.changes.view = newValue;
208210
requestUpdate(this);
@@ -213,6 +215,7 @@ export class Compose {
213215
* @param newValue The new value.
214216
* @param oldValue The old value.
215217
*/
218+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
216219
viewModelChanged(newValue, oldValue) {
217220
this.changes.viewModel = newValue;
218221
requestUpdate(this);

src/css-resource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class CSSResource {
6060
load(container: Container): Promise<CSSResource> {
6161
return container.get(Loader)
6262
.loadText(this.address)
63-
.catch(err => null)
63+
.catch(() => null)
6464
.then(text => {
6565
text = fixupCSSUrls(this.address, text);
6666
this._scoped.css = text;

src/debounce-binding-behavior.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export class DebounceBindingBehavior {
5858
};
5959
}
6060

61+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6162
unbind(binding, source) {
6263
// restore the state of the binding.
6364
const methodToRestore = binding.debouncedMethod.originalName;

src/focus.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ export class Focus {
4747

4848
/**
4949
* Invoked everytime the bound value changes.
50-
* @param newValue The new value.
5150
*/
52-
valueChanged(newValue) {
51+
valueChanged() {
5352
if (this.isAttached) {
5453
this._apply();
5554
} else {

src/hide.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,12 @@ export class Hide {
6161
/**
6262
* Binds the Hide attribute.
6363
*/
64+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6465
bind(bindingContext) {
6566
this.valueChanged(this.value);
6667
}
68+
69+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
6770
value(value: any) {
6871
throw new Error('Method not implemented.');
6972
}

0 commit comments

Comments
 (0)