Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define widget driver as an interface #128

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ SDK to provide an interface for other platforms.
TODO: Improve this

```typescript
const driver = new CustomDriver(); // an implementation of WidgetDriver
const driver = new CustomDriver(); // an implementation of IWidgetDriver
const api = new ClientWidgetApi(widget, iframe, driver);

// The API is automatically started, so we just have to wait for a ready before doing something
Expand Down
6 changes: 3 additions & 3 deletions src/ClientWidgetApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
getTimelineRoomIDFromCapability,
isTimelineCapability,
} from "./interfaces/Capabilities";
import { IOpenIDUpdate, ISendEventDetails, ISendDelayedEventDetails, WidgetDriver } from "./driver/WidgetDriver";
import { IOpenIDUpdate, ISendEventDetails, ISendDelayedEventDetails, IWidgetDriver } from "./driver/WidgetDriver";
import {
ICapabilitiesActionResponseData,
INotifyCapabilitiesActionRequestData,
Expand Down Expand Up @@ -158,12 +158,12 @@ export class ClientWidgetApi extends EventEmitter {
* conditions, a "ready" event will be raised.
* @param {Widget} widget The widget to communicate with.
* @param {HTMLIFrameElement} iframe The iframe the widget is in.
* @param {WidgetDriver} driver The driver for this widget/client.
* @param {IWidgetDriver} driver The driver for this widget/client.
*/
public constructor(
public readonly widget: Widget,
private iframe: HTMLIFrameElement,
private driver: WidgetDriver,
private driver: IWidgetDriver,
) {
super();
if (!iframe?.contentWindow) {
Expand Down
Loading
Loading