Skip to content

Commit 4f4d629

Browse files
committed
Use ReactPyClient type hint instead of client interface
1 parent dfb9612 commit 4f4d629

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/js/packages/@reactpy/client/src/components.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import type {
66
ImportSourceBinding,
77
ReactPyComponent,
88
ReactPyVdom,
9-
ReactPyClientInterface,
109
} from "./types";
1110
import { createAttributes, createChildren, loadImportSource } from "./vdom";
11+
import type { ReactPyClient } from "./client";
1212

13-
const ClientContext = createContext<ReactPyClientInterface>(null as any);
13+
const ClientContext = createContext<ReactPyClient>(null as any);
1414

15-
export function Layout(props: { client: ReactPyClientInterface }): JSX.Element {
15+
export function Layout(props: { client: ReactPyClient }): JSX.Element {
1616
const currentModel: ReactPyVdom = useState({ tagName: "" })[0];
1717
const forceUpdate = useForceUpdate();
1818

src/js/packages/@reactpy/client/src/vdom.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { ReactPyClientInterface } from "./types";
21
import eventToObject from "event-to-object";
32
import type {
43
ReactPyVdom,
@@ -11,10 +10,11 @@ import type {
1110
} from "./types";
1211
import { infer_bind_from_environment } from "./bind";
1312
import log from "./logger";
13+
import type { ReactPyClient } from "./client";
1414

1515
export async function loadImportSource(
1616
vdomImportSource: ReactPyVdomImportSource,
17-
client: ReactPyClientInterface,
17+
client: ReactPyClient,
1818
): Promise<BindImportSource> {
1919
let module: ReactPyModule;
2020
if (vdomImportSource.sourceType === "URL") {
@@ -61,7 +61,7 @@ export async function loadImportSource(
6161
}
6262

6363
function createImportSourceElement(props: {
64-
client: ReactPyClientInterface;
64+
client: ReactPyClient;
6565
module: ReactPyModule;
6666
binding: ReactPyModuleBinding;
6767
model: ReactPyVdom;
@@ -180,7 +180,7 @@ export function createChildren<Child>(
180180

181181
export function createAttributes(
182182
model: ReactPyVdom,
183-
client: ReactPyClientInterface,
183+
client: ReactPyClient,
184184
): { [key: string]: any } {
185185
return Object.fromEntries(
186186
Object.entries({
@@ -203,7 +203,7 @@ export function createAttributes(
203203
}
204204

205205
function createEventHandler(
206-
client: ReactPyClientInterface,
206+
client: ReactPyClient,
207207
name: string,
208208
{ target, preventDefault, stopPropagation }: ReactPyVdomEventHandler,
209209
): [string, () => void] {
@@ -262,7 +262,7 @@ function createInlineJavaScript(
262262
class ReactPyChild extends HTMLElement {
263263
mountPoint: HTMLDivElement;
264264
binding: ImportSourceBinding | null = null;
265-
_client: ReactPyClientInterface | null = null;
265+
_client: ReactPyClient | null = null;
266266
_model: ReactPyVdom | null = null;
267267
currentImportSource: ReactPyVdomImportSource | null = null;
268268

@@ -276,7 +276,7 @@ class ReactPyChild extends HTMLElement {
276276
this.appendChild(this.mountPoint);
277277
}
278278

279-
set client(value: ReactPyClientInterface) {
279+
set client(value: ReactPyClient) {
280280
this._client = value;
281281
}
282282

0 commit comments

Comments
 (0)