forked from nextauthjs/next-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.d.ts
52 lines (48 loc) · 1.39 KB
/
client.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/// <reference path="./index.d.ts" />
import { Store } from "express-session";
import { RequestHandler } from "express";
import { IpcNetConnectOpts } from "net";
declare namespace nextAuth {
interface ILinkedAccounts {
[name: string]: boolean;
}
interface IProviders {
[name: string]: {
signin: string;
callback: string;
};
}
interface NextAuthRequest<SessionType = nextAuth.NextAuthSession>
extends Express.Request {
session: NextAuthSession;
linked: () => Promise<ILinkedAccounts | Error>;
providers: () => Promise<IProviders | Error>;
}
interface IInitOptions {
req?: NextAuthRequest;
force: boolean;
}
interface IClientOptions {
req?: NextAuthRequest;
}
}
declare class Client {
static init(
opts: nextAuth.IInitOptions
): Promise<Partial<nextAuth.INextAuthSessionData>>;
static csrfToken(): Promise<string | Error>;
static linked(
opts: nextAuth.IClientOptions
): Promise<nextAuth.ILinkedAccounts | Error>;
static providers(
opts: nextAuth.IClientOptions
): Promise<nextAuth.IProviders | Error>;
static signin(
params: string | { [k: string]: string }
): Promise<boolean | Error>;
static signout(): Promise<true | Error>;
static _getLocalStore(): Promise<nextAuth.INextAuthSessionData | null>;
static _saveLocalStore(): Promise<boolean>;
static _removeLocalStore(): Promise<boolean>;
}
export = Client;