Skip to content

Commit 55e17a4

Browse files
committed
Moves ReactiveElementHost typing to shared location
1 parent 887234e commit 55e17a4

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

src/webviews/apps/home/stateProvider.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { ContextProvider } from '@lit/context';
2-
import type { ReactiveControllerHost } from 'lit';
32
import type { State } from '../../home/protocol';
43
import {
54
DidChangeIntegrationsConnections,
@@ -10,13 +9,11 @@ import {
109
DidChangeWalkthroughProgress,
1110
DidCompleteDiscoveringRepositories,
1211
} from '../../home/protocol';
13-
import type { StateProvider } from '../shared/app';
12+
import type { ReactiveElementHost, StateProvider } from '../shared/app';
1413
import type { Disposable } from '../shared/events';
1514
import type { HostIpc } from '../shared/ipc';
1615
import { stateContext } from './context';
1716

18-
type ReactiveElementHost = Partial<ReactiveControllerHost> & HTMLElement;
19-
2017
export class HomeStateProvider implements StateProvider<State> {
2118
private readonly disposable: Disposable;
2219
private readonly provider: ContextProvider<{ __context__: State }, ReactiveElementHost>;
@@ -84,7 +81,7 @@ export class HomeStateProvider implements StateProvider<State> {
8481
this._state.timestamp = Date.now();
8582

8683
this.provider.setValue(this._state, true);
87-
host.requestUpdate?.();
84+
host.requestUpdate();
8885
break;
8986
}
9087
});

src/webviews/apps/plus/timeline/stateProvider.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import { ContextProvider } from '@lit/context';
2-
import type { ReactiveControllerHost } from 'lit';
32
import type { State } from '../../../plus/timeline/protocol';
43
import { DidChangeNotification } from '../../../plus/timeline/protocol';
5-
import type { StateProvider } from '../../shared/app';
4+
import type { ReactiveElementHost, StateProvider } from '../../shared/app';
65
import type { Disposable } from '../../shared/events';
76
import type { HostIpc } from '../../shared/ipc';
87
import { stateContext } from './context';
98

10-
type ReactiveElementHost = ReactiveControllerHost & HTMLElement;
11-
129
export class TimelineStateProvider implements StateProvider<State> {
1310
private readonly disposable: Disposable;
1411
private readonly provider: ContextProvider<{ __context__: State }, ReactiveElementHost>;

src/webviews/apps/shared/app.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { provide } from '@lit/context';
2+
import type { ReactiveControllerHost } from 'lit';
23
import { html, LitElement } from 'lit';
34
import { property } from 'lit/decorators.js';
45
import type { CustomEditorIds, WebviewIds, WebviewViewIds } from '../../../constants.views';
@@ -14,6 +15,8 @@ import { telemetryContext, TelemetryContext } from './contexts/telemetry';
1415
import type { Disposable } from './events';
1516
import { HostIpc } from './ipc';
1617

18+
export type ReactiveElementHost = ReactiveControllerHost & HTMLElement;
19+
1720
export interface StateProvider<State> extends Disposable {
1821
readonly state: State;
1922
// readonly signal?: ReturnType<typeof signal<State>>;

0 commit comments

Comments
 (0)