@particle-network/auth
Advanced tools
Comparing version 0.4.11 to 0.4.13
@@ -28,2 +28,3 @@ "use strict"; | ||
this._authResult = null; | ||
this.authTheme = "auto"; | ||
this.config = config; | ||
@@ -247,2 +248,5 @@ window.addEventListener("message", (event) => { | ||
} | ||
setAuthTheme(authTheme) { | ||
this.authTheme = authTheme; | ||
} | ||
on(event, listener) { | ||
@@ -312,3 +316,7 @@ this.events.on(event, listener); | ||
device_id: (0, utils_1.getDeviceId)(), | ||
theme_type: window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", | ||
theme_type: this.authTheme === "auto" | ||
? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches | ||
? "dark" | ||
: "light" | ||
: this.authTheme, | ||
}; | ||
@@ -315,0 +323,0 @@ Object.assign(params, Object.assign({}, extraParams)); |
@@ -37,4 +37,5 @@ "use strict"; | ||
"phone", | ||
"facebook", | ||
"twitter", | ||
"google", | ||
"facebook", | ||
"apple", | ||
@@ -46,4 +47,2 @@ "discord", | ||
"linkedin", | ||
"twitter", | ||
"telegram", | ||
]; | ||
@@ -50,0 +49,0 @@ exports.supportChains = { |
/// <reference types="node" /> | ||
import { EventEmitter } from "events"; | ||
import { Config, UserInfo, AuthType, Wallet, ChainInfo } from "./types"; | ||
import { Config, UserInfo, AuthType, Wallet, ChainInfo, AuthTheme } from "./types"; | ||
declare type PrefixedHexString = string; | ||
@@ -12,2 +12,3 @@ declare type Base58String = string; | ||
private _authResult; | ||
private authTheme; | ||
constructor(config: Config); | ||
@@ -29,2 +30,3 @@ login(config?: { | ||
wallet(chainType?: string): Wallet | null; | ||
setAuthTheme(authTheme: AuthTheme): void; | ||
on(event: string, listener: (...args: any[]) => void): void; | ||
@@ -31,0 +33,0 @@ once(event: string, listener: (...args: any[]) => void): void; |
@@ -34,3 +34,3 @@ export declare class AuthError { | ||
} | ||
export declare const AuthTypes: readonly ["email", "phone", "google", "facebook", "apple", "discord", "github", "twitch", "microsoft", "linkedin", "twitter", "telegram"]; | ||
export declare const AuthTypes: readonly ["email", "phone", "facebook", "twitter", "google", "apple", "discord", "github", "twitch", "microsoft", "linkedin"]; | ||
declare type AuthTypeTuple = typeof AuthTypes; | ||
@@ -77,2 +77,3 @@ export declare type AuthType = AuthTypeTuple[number]; | ||
} | ||
export declare type AuthTheme = "dark" | "light" | "auto"; | ||
export {}; |
{ | ||
"name": "@particle-network/auth", | ||
"version": "0.4.11", | ||
"version": "0.4.13", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "lib", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49853
622