poke 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ export declare class PokeAuthError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ export declare function fetchWithAuth({ path, options, token, baseUrl, }: {
5
+ path: string;
6
+ options?: RequestInit;
7
+ token?: string;
8
+ baseUrl?: string;
9
+ }): Promise<Response>;
package/dist/auth.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ export interface LoginOptions {
2
+ onCode?: (info: {
3
+ userCode: string;
4
+ loginUrl: string;
5
+ }) => void;
6
+ openBrowser?: boolean;
7
+ timeoutMs?: number;
8
+ baseUrl?: string;
9
+ frontendUrl?: string;
10
+ }
11
+ export interface LoginResult {
12
+ token: string;
13
+ }
14
+ export declare function login(options?: LoginOptions): Promise<LoginResult>;
15
+ export declare function logout(): Promise<void>;
16
+ export declare function isLoggedIn(): boolean;
17
+ export declare function getToken(): string | undefined;