Skip to content

Commit 9268eb4

Browse files
committed
Add owner types
1 parent b303ec8 commit 9268eb4

File tree

16 files changed

+38
-22
lines changed

16 files changed

+38
-22
lines changed

packages/base/cards-grid.gts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { action } from '@ember/object';
2+
import type Owner from '@ember/owner';
23
import { on } from '@ember/modifier';
34
import { restartableTask } from 'ember-concurrency';
45
import {
@@ -176,7 +177,7 @@ class Isolated extends Component<typeof CardsGrid> {
176177
isLoading: boolean;
177178
};
178179

179-
constructor(owner: unknown, args: any) {
180+
constructor(owner: Owner, args: any) {
180181
super(owner, args);
181182
this.liveQuery = getLiveCards(
182183
{

packages/boxel-ui/addon/src/components/radio-input/index.gts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { hash } from '@ember/helper';
2+
import type Owner from '@ember/owner';
23
import Component from '@glimmer/component';
34

45
import cn from '../../helpers/cn.ts';
@@ -32,7 +33,7 @@ export interface Signature {
3233
}
3334

3435
export default class RadioInput extends Component<Signature> {
35-
constructor(owner: unknown, args: Signature['Args']) {
36+
constructor(owner: Owner, args: Signature['Args']) {
3637
super(owner, args);
3738
}
3839
<template>

packages/drafts-realm/utils/resources/metamask.gts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type Owner from '@ember/owner';
12
import { tracked } from '@glimmer/tracking';
23
import { Resource } from 'ember-resources';
34
// @ts-ignore
@@ -21,7 +22,7 @@ class MetamaskResource extends Resource {
2122
@tracked connected = false;
2223
@tracked chainId: number | undefined; // the chain id of the metamask connection (not the card)
2324

24-
constructor(owner: unknown) {
25+
constructor(owner: Owner) {
2526
super(owner);
2627
this.promptMetamaskInstallation();
2728
this.setup();

packages/host/app/components/operator-mode/edit-field-modal.gts

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { fn } from '@ember/helper';
22
import { hash } from '@ember/helper';
33
import { on } from '@ember/modifier';
44
import { action } from '@ember/object';
5+
import type Owner from '@ember/owner';
56
import { service } from '@ember/service';
67
import Component from '@glimmer/component';
78

@@ -77,7 +78,7 @@ export default class EditFieldModal extends Component<Signature> {
7778
},
7879
];
7980

80-
constructor(owner: unknown, args: Signature['Args']) {
81+
constructor(owner: Owner, args: Signature['Args']) {
8182
super(owner, args);
8283

8384
// This component has 2 flows - adding a new field, and editing an existing field. When adding a new field, this.args.field will be undefined and when editing, it will be present

packages/host/app/components/operator-mode/profile/profile-email.gts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { fn } from '@ember/helper';
22
import { on } from '@ember/modifier';
33
import { action } from '@ember/object';
4+
import type Owner from '@ember/owner';
45
import { inject as service } from '@ember/service';
56

67
import Component from '@glimmer/component';
@@ -408,7 +409,7 @@ export default class ProfileEmail extends Component<Signature> {
408409
password: string;
409410
} = { type: 'initial' };
410411

411-
constructor(owner: unknown, args: any) {
412+
constructor(owner: Owner, args: any) {
412413
super(owner, args);
413414
this.initialize.perform();
414415
this.args.onSetup(

packages/host/app/components/operator-mode/profile/profile-settings-modal.gts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { on } from '@ember/modifier';
22
import { action } from '@ember/object';
3+
import type Owner from '@ember/owner';
34
import { inject as service } from '@ember/service';
45

56
import Component from '@glimmer/component';
@@ -222,7 +223,7 @@ export default class ProfileSettingsModal extends Component<Signature> {
222223
private onSaveEmail: (() => void) | undefined;
223224
private resetChangeEmail: (() => void) | undefined;
224225

225-
constructor(owner: unknown, args: any) {
226+
constructor(owner: Owner, args: any) {
226227
super(owner, args);
227228
this.setInitialValues.perform();
228229
}

packages/host/app/components/realm-dropdown.gts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type Owner from '@ember/owner';
12
import { service } from '@ember/service';
23
import Component from '@glimmer/component';
34

@@ -112,7 +113,7 @@ export default class RealmDropdown extends Component<Signature> {
112113
defaultRealmIcon = '/default-realm-icon.png';
113114
@service declare realmInfoService: RealmInfoService;
114115

115-
constructor(owner: unknown, args: Signature['Args']) {
116+
constructor(owner: Owner, args: Signature['Args']) {
116117
super(owner, args);
117118
this.realmInfoService.fetchAllKnownRealmInfos.perform();
118119
}

packages/host/app/resources/directory.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { registerDestructor } from '@ember/destroyable';
2+
import type Owner from '@ember/owner';
23
import { service } from '@ember/service';
34
import { tracked } from '@glimmer/tracking';
45

@@ -37,7 +38,7 @@ export class DirectoryResource extends Resource<Args> {
3738
@service declare loaderService: LoaderService;
3839
@service declare messageService: MessageService;
3940

40-
constructor(owner: unknown) {
41+
constructor(owner: Owner) {
4142
super(owner);
4243
registerDestructor(this, () => {
4344
if (this.subscription) {

packages/host/app/resources/file.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { registerDestructor } from '@ember/destroyable';
2+
import type Owner from '@ember/owner';
23
import { service } from '@ember/service';
34

45
import { tracked } from '@glimmer/tracking';
@@ -83,7 +84,7 @@ class _FileResource extends Resource<Args> {
8384
@service declare recentFilesService: RecentFilesService;
8485
@service declare operatorModeStateService: OperatorModeStateService;
8586

86-
constructor(owner: unknown) {
87+
constructor(owner: Owner) {
8788
super(owner);
8889
registerDestructor(this, () => {
8990
if (this.subscription) {

packages/host/app/services/environment-service.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type Owner from '@ember/owner';
12
import Service from '@ember/service';
23

34
import config from '@cardstack/host/config/environment';
@@ -8,8 +9,8 @@ const { autoSaveDelayMs } = config;
89
export default class EnvironmentService extends Service {
910
autoSaveDelayMs: number;
1011

11-
constructor(properties: object) {
12-
super(properties);
12+
constructor(owner: Owner) {
13+
super(owner);
1314
this.autoSaveDelayMs = autoSaveDelayMs;
1415
}
1516
}

packages/host/app/services/matrix-service.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type Owner from '@ember/owner';
12
import type RouterService from '@ember/routing/router-service';
23
import Service, { service } from '@ember/service';
34
import { tracked } from '@glimmer/tracking';
@@ -87,8 +88,8 @@ export default class MatrixService extends Service {
8788
#matrixSDK: typeof MatrixSDK | undefined;
8889
#eventBindings: [EmittedEvents, (...arg: any[]) => void][] | undefined;
8990

90-
constructor(properties: object) {
91-
super(properties);
91+
constructor(owner: Owner) {
92+
super(owner);
9293
this.#ready = this.loadSDK.perform();
9394
}
9495

packages/host/app/services/monaco-service.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type Owner from '@ember/owner';
12
import Service, { service } from '@ember/service';
23
import { tracked } from '@glimmer/tracking';
34

@@ -31,8 +32,8 @@ export default class MonacoService extends Service {
3132
// this is in the service so that we can manipulate it in our tests
3233
serverEchoDebounceMs = serverEchoDebounceMs;
3334

34-
constructor(properties: object) {
35-
super(properties);
35+
constructor(owner: Owner) {
36+
super(owner);
3637
this.#ready = this.loadMonacoSDK.perform();
3738
}
3839

packages/host/app/services/recent-cards-service.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type Owner from '@ember/owner';
12
import Service from '@ember/service';
23
import { tracked } from '@glimmer/tracking';
34

@@ -12,8 +13,8 @@ import type { CardDef } from 'https://cardstack.com/base/card-api';
1213
export default class RecentCardsService extends Service {
1314
@tracked recentCards = new TrackedArray<CardDef>([]);
1415

15-
constructor(properties: object) {
16-
super(properties);
16+
constructor(owner: Owner) {
17+
super(owner);
1718
this.constructRecentCards.perform();
1819
}
1920

packages/host/app/services/recent-files-service.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type Owner from '@ember/owner';
12
import Service from '@ember/service';
23
import { service } from '@ember/service';
34

@@ -25,8 +26,8 @@ export default class RecentFilesService extends Service {
2526

2627
@tracked recentFiles = new TrackedArray<RecentFile>([]);
2728

28-
constructor(properties: object) {
29-
super(properties);
29+
constructor(owner: Owner) {
30+
super(owner);
3031
this.extractRecentFilesFromStorage();
3132
}
3233

packages/host/app/services/scroll-position-service.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type Owner from '@ember/owner';
12
import Service from '@ember/service';
23

34
import { tracked } from '@glimmer/tracking';
@@ -11,8 +12,8 @@ export default class ScrollPositionService extends Service {
1112
[string, number]
1213
>();
1314

14-
constructor(properties: object) {
15-
super(properties);
15+
constructor(owner: Owner) {
16+
super(owner);
1617
this.extractFromStorage();
1718
}
1819

packages/host/tests/integration/components/card-basics-test.gts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type Owner from '@ember/owner';
12
import {
23
waitUntil,
34
waitFor,
@@ -1907,7 +1908,7 @@ module('Integration | card-basics', function (hooks) {
19071908
static edit = class Edit extends Component<typeof this> {
19081909
private counter: number;
19091910
constructor(
1910-
owner: unknown,
1911+
owner: Owner,
19111912
args: SignatureFor<typeof TestString>['Args'],
19121913
) {
19131914
super(owner, args);

0 commit comments

Comments
 (0)