Skip to content

Commit

Permalink
fix: fix return type of v2 mount
Browse files Browse the repository at this point in the history
  • Loading branch information
anilanar committed Jun 27, 2024
1 parent 34b86ac commit da5e725
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ module.exports = {
"@typescript-eslint/no-use-before-define": ["error", { functions: false }],
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-empty-interface": [
"error",
{ allowSingleExtends: true },
],
},
};
12 changes: 7 additions & 5 deletions packages/messenger-internal/src/v2/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
ActionResult,
Credentials,
MessengerApi,
MountOptions,
Observable,
} from "../shared";
Expand All @@ -12,13 +13,13 @@ export interface Api {
* Returns an observable. The messenger mounts when the observable is
* subscribed to and unmounts when the unsubscribing from the observable.
*
* When credentials are provided those will be used for authentication.
*
* The messenger can recreate itself under certain conditions. For example
* when a website router switches to another widget, the observable will emit
* a new {@link Api} instance.
*
* When credentials are provided those will be used for authentication.
* a new {@link Messenger} instance.
*/
mount(opts?: MountOptions): Observable<ActionResult<string, Api>>;
mount(opts?: MountOptions): Observable<ActionResult<string, Messenger>>;

/**
* Experimental.
Expand All @@ -29,4 +30,5 @@ export interface Api {
): Promise<ActionResult<string, Credentials>>;
}

export type { MessengerApi } from "../shared";
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Messenger extends MessengerApi {}

0 comments on commit da5e725

Please sign in to comment.