Skip to content

Commit cee2d68

Browse files
committed
Improve snek session begin return type
The return type of the snek session begin method has been improved.
1 parent c4ee278 commit cee2d68

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/session/sessions.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import InstagramTasks from "../templates/instagram/tasks";
2020
import { ApolloEndpoint, ScraperEndpoint } from "../endpoints/index";
2121
// Contains basic session interfaces
2222
import { User } from "./index";
23+
// Contains the session types
24+
import { SNEKAuth } from "./types";
2325
// Contains the snek template types
2426
import { TaskTypes } from "../templates/snek/types";
2527
//> Config
@@ -251,9 +253,9 @@ class SnekSession extends CookieSession {
251253
* Begin session.
252254
*
253255
* @param {string} user A User defined by username and password
254-
* @returns {Promise<any>} A UserData object
256+
* @returns {Promise<SNEKAuth>} A SNEKAuth object
255257
*/
256-
async begin(user?: User): Promise<any> {
258+
async begin(user?: User): Promise<SNEKAuth> {
257259
let anonymous = false;
258260

259261
if (!user && this.refreshToken) {

src/session/types.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface SNEKAuth {
2+
username?: string;
3+
anonymous: boolean;
4+
}

0 commit comments

Comments
 (0)