isa-auth 0.0.0-stage → 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +239 -2
- package/dist/index.d.mts +1109 -0
- package/dist/index.d.ts +1109 -0
- package/dist/index.js +2362 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2359 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +57 -4
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1109 @@
|
|
|
1
|
+
type AuthButtonType = 'rect' | 'rounded' | 'circle' | 'link' | 'brand';
|
|
2
|
+
type ButtonProviderType = 'default' | 'google' | 'apple' | 'kakao' | 'line' | 'naver' | 'facebook' | 'twitter' | 'wechat' | 'web3';
|
|
3
|
+
interface LoginButtonConfig {
|
|
4
|
+
id: string;
|
|
5
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
6
|
+
text?: string;
|
|
7
|
+
icon?: string;
|
|
8
|
+
fullWidth?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface LoginButtonProps {
|
|
11
|
+
type: AuthButtonType;
|
|
12
|
+
provider: ButtonProviderType;
|
|
13
|
+
action: Function;
|
|
14
|
+
config: LoginButtonConfig;
|
|
15
|
+
}
|
|
16
|
+
declare class LoginButton {
|
|
17
|
+
readonly type: AuthButtonType;
|
|
18
|
+
readonly provider: ButtonProviderType;
|
|
19
|
+
readonly action: Function;
|
|
20
|
+
readonly config: LoginButtonConfig;
|
|
21
|
+
constructor(props: LoginButtonProps);
|
|
22
|
+
private getDefaultText;
|
|
23
|
+
private getDefaultStyle;
|
|
24
|
+
private mergeStyles;
|
|
25
|
+
getButtonClass(): string;
|
|
26
|
+
toJSON(): {
|
|
27
|
+
id: string;
|
|
28
|
+
type: AuthButtonType;
|
|
29
|
+
provider: ButtonProviderType;
|
|
30
|
+
icon: string;
|
|
31
|
+
text: string;
|
|
32
|
+
style: Partial<CSSStyleDeclaration>;
|
|
33
|
+
fullWidth: boolean;
|
|
34
|
+
className: string;
|
|
35
|
+
onClick: Function;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface AuthProvider$1 {
|
|
40
|
+
init(): Promise<void>;
|
|
41
|
+
signIn(): void;
|
|
42
|
+
signOut(): void;
|
|
43
|
+
getAccessToken(): Promise<string | null>;
|
|
44
|
+
getUserInfo(): Promise<any>;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
declare global {
|
|
48
|
+
interface Window {
|
|
49
|
+
google?: any;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
declare class GoogleAuthProvider implements AuthProvider$1 {
|
|
53
|
+
private clientId;
|
|
54
|
+
private callback;
|
|
55
|
+
constructor({ clientId, callback, }: {
|
|
56
|
+
clientId: string;
|
|
57
|
+
callback: (token: string) => string | Promise<string>;
|
|
58
|
+
});
|
|
59
|
+
loadGoogleSdk(): Promise<void>;
|
|
60
|
+
init(): Promise<void>;
|
|
61
|
+
signIn(): void;
|
|
62
|
+
signOut(): void;
|
|
63
|
+
getAccessToken(): Promise<any>;
|
|
64
|
+
getUserInfo(): Promise<any>;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
declare global {
|
|
68
|
+
interface Window {
|
|
69
|
+
Kakao?: any;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
interface KakaoAuthOptions {
|
|
73
|
+
javascriptKey: string;
|
|
74
|
+
redirectUri?: string;
|
|
75
|
+
scope?: string;
|
|
76
|
+
onSuccess?: (authObj: any) => void;
|
|
77
|
+
onFail?: (error: any) => void;
|
|
78
|
+
}
|
|
79
|
+
declare class KakaoAuthProvider implements AuthProvider$1 {
|
|
80
|
+
private javascriptKey;
|
|
81
|
+
private redirectUri?;
|
|
82
|
+
private scope?;
|
|
83
|
+
private onSuccess?;
|
|
84
|
+
private onFail?;
|
|
85
|
+
constructor(options: KakaoAuthOptions);
|
|
86
|
+
loadKakaoSdk(): Promise<void>;
|
|
87
|
+
init(): Promise<void>;
|
|
88
|
+
signIn(): void;
|
|
89
|
+
signOut(): void;
|
|
90
|
+
getAccessToken(): Promise<string | null>;
|
|
91
|
+
getUserInfo(): Promise<any>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
declare global {
|
|
95
|
+
interface Window {
|
|
96
|
+
naver?: any;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
interface NaverAuthOptions {
|
|
100
|
+
clientId: string;
|
|
101
|
+
callbackUrl: string;
|
|
102
|
+
isPopup?: boolean;
|
|
103
|
+
loginButtonId?: string;
|
|
104
|
+
callbackHandle?: (status: boolean) => void;
|
|
105
|
+
}
|
|
106
|
+
declare class NaverAuthProvider implements AuthProvider$1 {
|
|
107
|
+
private clientId;
|
|
108
|
+
private callbackUrl;
|
|
109
|
+
private isPopup;
|
|
110
|
+
private loginButtonId;
|
|
111
|
+
private callbackHandle?;
|
|
112
|
+
private naverLoginInstance;
|
|
113
|
+
constructor(options: NaverAuthOptions);
|
|
114
|
+
loadNaverSdk(): Promise<void>;
|
|
115
|
+
init(): Promise<void>;
|
|
116
|
+
signIn(): void;
|
|
117
|
+
signOut(): void;
|
|
118
|
+
getAccessToken(): Promise<string | null>;
|
|
119
|
+
getUserInfo(): Promise<any>;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Web3 Authentication Provider (SIWE - EIP-4361 Sign-In with Ethereum)
|
|
124
|
+
*/
|
|
125
|
+
|
|
126
|
+
declare global {
|
|
127
|
+
interface Window {
|
|
128
|
+
ethereum?: any;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
interface Web3AuthOptions {
|
|
132
|
+
domain?: string;
|
|
133
|
+
statement?: string;
|
|
134
|
+
chainId?: number;
|
|
135
|
+
onSuccess?: (result: Web3AuthResult) => void;
|
|
136
|
+
onFail?: (error: any) => void;
|
|
137
|
+
nonceGenerator?: () => Promise<string> | string;
|
|
138
|
+
}
|
|
139
|
+
interface Web3AuthResult {
|
|
140
|
+
address: string;
|
|
141
|
+
signature: string;
|
|
142
|
+
message: string;
|
|
143
|
+
chainId: number;
|
|
144
|
+
}
|
|
145
|
+
declare class Web3AuthProvider implements AuthProvider$1 {
|
|
146
|
+
private domain;
|
|
147
|
+
private statement?;
|
|
148
|
+
private chainId;
|
|
149
|
+
private onSuccess?;
|
|
150
|
+
private onFail?;
|
|
151
|
+
private nonceGenerator?;
|
|
152
|
+
private connectedAddress;
|
|
153
|
+
private lastSignature;
|
|
154
|
+
constructor(options?: Web3AuthOptions);
|
|
155
|
+
init(): Promise<void>;
|
|
156
|
+
signIn(): Promise<void>;
|
|
157
|
+
signOut(): void;
|
|
158
|
+
getAccessToken(): Promise<string | null>;
|
|
159
|
+
getUserInfo(): Promise<any>;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* OAuth 2.0 PKCE (Proof Key for Code Exchange) utilities
|
|
164
|
+
* Compatible with modern browser Web Crypto API.
|
|
165
|
+
*/
|
|
166
|
+
/**
|
|
167
|
+
* Generates a cryptographically random code verifier string (43~128 chars).
|
|
168
|
+
*/
|
|
169
|
+
declare function generateCodeVerifier(length?: number): string;
|
|
170
|
+
/**
|
|
171
|
+
* Calculates SHA-256 hash of verifier and encodes it as base64url.
|
|
172
|
+
*/
|
|
173
|
+
declare function generateCodeChallenge(verifier: string): Promise<string>;
|
|
174
|
+
interface BuildAuthorizeUrlOptions {
|
|
175
|
+
authorizeUrl: string;
|
|
176
|
+
clientId: string;
|
|
177
|
+
redirectUri: string;
|
|
178
|
+
responseType?: string;
|
|
179
|
+
scope?: string;
|
|
180
|
+
state?: string;
|
|
181
|
+
codeChallenge?: string;
|
|
182
|
+
codeChallengeMethod?: 'S256' | 'plain';
|
|
183
|
+
extraParams?: Record<string, string>;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Builds an OAuth 2.0 authorization URL
|
|
187
|
+
*/
|
|
188
|
+
declare function buildAuthorizeUrl(options: BuildAuthorizeUrlOptions): string;
|
|
189
|
+
/**
|
|
190
|
+
* Parses query params from OAuth redirect callback URL
|
|
191
|
+
*/
|
|
192
|
+
declare function parseOAuthCallback(urlOrSearch?: string): {
|
|
193
|
+
code?: string;
|
|
194
|
+
state?: string;
|
|
195
|
+
error?: string;
|
|
196
|
+
error_description?: string;
|
|
197
|
+
token?: string;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
declare const providers: {
|
|
201
|
+
google: typeof GoogleAuthProvider;
|
|
202
|
+
kakao: typeof KakaoAuthProvider;
|
|
203
|
+
naver: typeof NaverAuthProvider;
|
|
204
|
+
web3: typeof Web3AuthProvider;
|
|
205
|
+
none: null;
|
|
206
|
+
};
|
|
207
|
+
type ProviderType = keyof typeof providers;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Browser-friendly JWT utilities (No Node.js dependencies)
|
|
211
|
+
* Fully compatible with Web Crypto API and modern browsers.
|
|
212
|
+
*/
|
|
213
|
+
interface JwtHeader {
|
|
214
|
+
alg: string;
|
|
215
|
+
typ?: string;
|
|
216
|
+
kid?: string;
|
|
217
|
+
[key: string]: any;
|
|
218
|
+
}
|
|
219
|
+
interface JwtPayload {
|
|
220
|
+
iss?: string;
|
|
221
|
+
sub?: string;
|
|
222
|
+
aud?: string | string[];
|
|
223
|
+
exp?: number;
|
|
224
|
+
nbf?: number;
|
|
225
|
+
iat?: number;
|
|
226
|
+
jti?: string;
|
|
227
|
+
roles?: string[];
|
|
228
|
+
permissions?: string[];
|
|
229
|
+
[key: string]: any;
|
|
230
|
+
}
|
|
231
|
+
interface DecodedToken<T = JwtPayload> {
|
|
232
|
+
header: JwtHeader;
|
|
233
|
+
payload: T;
|
|
234
|
+
signature: string;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Parses a JWT token into header, payload, and signature without verifying.
|
|
238
|
+
*/
|
|
239
|
+
declare function decodeToken<T = JwtPayload>(token: string): DecodedToken<T> | null;
|
|
240
|
+
/**
|
|
241
|
+
* Checks if a JWT token is expired.
|
|
242
|
+
* @param token JWT string
|
|
243
|
+
* @param clockToleranceSeconds optional clock skew tolerance in seconds (default: 0)
|
|
244
|
+
*/
|
|
245
|
+
declare function isExpiredToken(token: string, clockToleranceSeconds?: number): boolean;
|
|
246
|
+
/**
|
|
247
|
+
* Returns the expiration remaining time in milliseconds.
|
|
248
|
+
* Returns 0 if already expired or invalid.
|
|
249
|
+
*/
|
|
250
|
+
declare function getTokenTimeRemaining(token: string): number;
|
|
251
|
+
/**
|
|
252
|
+
* Extracts payload object from JWT token.
|
|
253
|
+
*/
|
|
254
|
+
declare function getTokenPayload<T = JwtPayload>(token: string): T | null;
|
|
255
|
+
/**
|
|
256
|
+
* Extracts bearer token string from HTTP Authorization header.
|
|
257
|
+
* Example: 'Bearer eyJhbGciOi...' -> 'eyJhbGciOi...'
|
|
258
|
+
*/
|
|
259
|
+
declare function getTokenFromHeader(header: string): string | null;
|
|
260
|
+
|
|
261
|
+
declare class AuthBaseService {
|
|
262
|
+
constructor();
|
|
263
|
+
initStore(prevState?: boolean): void;
|
|
264
|
+
getAuthState(): boolean;
|
|
265
|
+
setAuthState(value: boolean): void;
|
|
266
|
+
getAuthInfo<T = any>(): T | null;
|
|
267
|
+
setAuthInfo(value: any): void;
|
|
268
|
+
watchAuthState<T extends HTMLElement>(callback: (auth: boolean) => void): void | (() => void);
|
|
269
|
+
clearAuthState(): void;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
declare class JwtService extends AuthBaseService {
|
|
273
|
+
constructor(secretKey?: string);
|
|
274
|
+
initStore(prevState: boolean): void;
|
|
275
|
+
configureJwt(secretKey: string): void;
|
|
276
|
+
getAuthState(): boolean;
|
|
277
|
+
setAuthState(value: boolean): void;
|
|
278
|
+
getAuthInfo<T = any>(): T | null;
|
|
279
|
+
setAuthInfo(value: any): void;
|
|
280
|
+
watchAuthState<T extends HTMLElement>(callback: (auth: boolean) => void): void | (() => void);
|
|
281
|
+
clearAuthState(): void;
|
|
282
|
+
getAccessToken(): string | null;
|
|
283
|
+
setAccessToken(value: string): void;
|
|
284
|
+
isValidAccessToken(): boolean;
|
|
285
|
+
isExpiredAccessToken(): boolean;
|
|
286
|
+
getTimeRemaining(): number;
|
|
287
|
+
getAccessTokenPayload<T = JwtPayload>(): T | null;
|
|
288
|
+
setAccessTokenFromHeader(header: string): void;
|
|
289
|
+
hasRole(role: string): boolean;
|
|
290
|
+
hasPermission(permission: string): boolean;
|
|
291
|
+
refreshToken(refreshTokenFn: () => Promise<string>): Promise<string | null>;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
declare function addAuthEventListener(callback: (detail: any) => void, target?: EventTarget): () => void;
|
|
295
|
+
declare function removeAuthEventListener(callback: (detail: any) => void, target?: EventTarget): void;
|
|
296
|
+
declare function dispatchAuthEvent(eventNameOrDetail: string | any, detailOrTarget?: any, optionalTarget?: EventTarget): void;
|
|
297
|
+
|
|
298
|
+
declare const AuthService: {
|
|
299
|
+
base: typeof AuthBaseService;
|
|
300
|
+
jwt: typeof JwtService;
|
|
301
|
+
};
|
|
302
|
+
type AuthServiceType = keyof typeof AuthService;
|
|
303
|
+
|
|
304
|
+
type CoreProviderType = Exclude<ProviderType | AuthServiceType, 'none'>;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Authentication Lifecycle Event & Hook System
|
|
308
|
+
*/
|
|
309
|
+
type AuthLifecycleEvent = 'signIn' | 'signOut' | 'tokenExpired' | 'tokenRefreshed' | 'error';
|
|
310
|
+
type LifecycleListener<T = any> = (data?: T) => void | Promise<void>;
|
|
311
|
+
declare class AuthLifecycleManager {
|
|
312
|
+
private listeners;
|
|
313
|
+
on(event: AuthLifecycleEvent, listener: LifecycleListener): () => void;
|
|
314
|
+
onSignIn(listener: LifecycleListener<{
|
|
315
|
+
user?: any;
|
|
316
|
+
token?: string;
|
|
317
|
+
}>): () => void;
|
|
318
|
+
onSignOut(listener: LifecycleListener<void>): () => void;
|
|
319
|
+
onTokenExpired(listener: LifecycleListener<void>): () => void;
|
|
320
|
+
onTokenRefreshed(listener: LifecycleListener<{
|
|
321
|
+
token: string;
|
|
322
|
+
}>): () => void;
|
|
323
|
+
onError(listener: LifecycleListener<{
|
|
324
|
+
error: any;
|
|
325
|
+
phase?: string;
|
|
326
|
+
}>): () => void;
|
|
327
|
+
emit(event: AuthLifecycleEvent, data?: any): Promise<void>;
|
|
328
|
+
clear(): void;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Role-Based Access Control (RBAC) and Permission Guards
|
|
333
|
+
*/
|
|
334
|
+
interface AuthGuardOptions {
|
|
335
|
+
/**
|
|
336
|
+
* Whether authentication is strictly required
|
|
337
|
+
* @default true
|
|
338
|
+
*/
|
|
339
|
+
requireAuth?: boolean;
|
|
340
|
+
/**
|
|
341
|
+
* Allowed roles (e.g. ['ADMIN', 'MANAGER'])
|
|
342
|
+
*/
|
|
343
|
+
roles?: string | string[];
|
|
344
|
+
/**
|
|
345
|
+
* Required permissions (e.g. ['read:users', 'write:posts'])
|
|
346
|
+
*/
|
|
347
|
+
permissions?: string | string[];
|
|
348
|
+
/**
|
|
349
|
+
* Callback when authentication check fails (not logged in)
|
|
350
|
+
*/
|
|
351
|
+
onUnauthenticated?: () => void | Promise<void>;
|
|
352
|
+
/**
|
|
353
|
+
* Callback when authorization check fails (insufficient roles/permissions)
|
|
354
|
+
*/
|
|
355
|
+
onUnauthorized?: (reason: string) => void | Promise<void>;
|
|
356
|
+
}
|
|
357
|
+
interface AuthContext {
|
|
358
|
+
isAuthenticated: boolean;
|
|
359
|
+
roles?: string[];
|
|
360
|
+
permissions?: string[];
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Creates a reusable route/navigation guard
|
|
364
|
+
*/
|
|
365
|
+
declare function createAuthGuard(options: AuthGuardOptions): (context: AuthContext) => Promise<boolean>;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* HTTP Client utilities with automatic Authorization header injection and 401 retry
|
|
369
|
+
*/
|
|
370
|
+
interface AuthClientInterface {
|
|
371
|
+
getAccessToken(): string | null;
|
|
372
|
+
refreshToken?(refreshFn?: () => Promise<string>): Promise<string | null>;
|
|
373
|
+
clearAuthState?(): void;
|
|
374
|
+
}
|
|
375
|
+
interface AuthFetchOptions {
|
|
376
|
+
authClient: AuthClientInterface;
|
|
377
|
+
refreshFn?: () => Promise<string>;
|
|
378
|
+
baseUrl?: string;
|
|
379
|
+
onUnauthorized?: () => void;
|
|
380
|
+
headerName?: string;
|
|
381
|
+
tokenPrefix?: string;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Creates an authenticated fetch wrapper that injects Bearer token and automatically retries upon 401.
|
|
385
|
+
*/
|
|
386
|
+
declare function createAuthFetch(options: AuthFetchOptions): (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Storage adapter interface and implementations for persistence
|
|
390
|
+
*/
|
|
391
|
+
interface StorageAdapter {
|
|
392
|
+
getItem(key: string): string | null;
|
|
393
|
+
setItem(key: string, value: string): void;
|
|
394
|
+
removeItem(key: string): void;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
type StorageType = 'localStorage' | 'sessionStorage' | 'memory';
|
|
398
|
+
declare function configureStorage(type: StorageType | StorageAdapter): void;
|
|
399
|
+
declare function getAuthState(): boolean;
|
|
400
|
+
declare function getAccessToken(): string | null;
|
|
401
|
+
declare function getAuthInfo<T = any>(): T | null;
|
|
402
|
+
|
|
403
|
+
interface AuthCoreProps {
|
|
404
|
+
providerType?: CoreProviderType;
|
|
405
|
+
secret?: string;
|
|
406
|
+
storage?: StorageType;
|
|
407
|
+
}
|
|
408
|
+
declare class AuthCore {
|
|
409
|
+
private provider;
|
|
410
|
+
private button;
|
|
411
|
+
private serviceInstance;
|
|
412
|
+
lifecycle: AuthLifecycleManager;
|
|
413
|
+
constructor({ providerType, secret, storage, }?: AuthCoreProps);
|
|
414
|
+
getService(): AuthBaseService | JwtService;
|
|
415
|
+
getProvider(): typeof GoogleAuthProvider | typeof KakaoAuthProvider | typeof NaverAuthProvider | typeof Web3AuthProvider | null;
|
|
416
|
+
getButton(): LoginButton | null;
|
|
417
|
+
createGuard(options: AuthGuardOptions): Promise<boolean>;
|
|
418
|
+
createFetch(options?: Partial<AuthFetchOptions>): (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
419
|
+
getWebComponentAPI(): {
|
|
420
|
+
addAuthEventListener: typeof addAuthEventListener;
|
|
421
|
+
removeAuthEventListener: typeof removeAuthEventListener;
|
|
422
|
+
dispatchAuthEvent: typeof dispatchAuthEvent;
|
|
423
|
+
watchAuthState: (<T extends HTMLElement>(callback: (auth: boolean) => void) => void | (() => void)) | (<T extends HTMLElement>(callback: (auth: boolean) => void) => void | (() => void));
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
interface IAuthService {
|
|
428
|
+
initStore(prevState?: boolean): void;
|
|
429
|
+
getAuthState(): boolean;
|
|
430
|
+
setAuthState(value: boolean): void;
|
|
431
|
+
getAuthInfo<T = any>(): T | null;
|
|
432
|
+
setAuthInfo(value: any): void;
|
|
433
|
+
watchAuthState(callback: (auth: boolean) => void): void | (() => void);
|
|
434
|
+
clearAuthState(): void;
|
|
435
|
+
getAccessToken?(): string | null;
|
|
436
|
+
setAccessToken?(value: string): void;
|
|
437
|
+
isExpiredAccessToken?(): boolean;
|
|
438
|
+
getAccessTokenPayload?(): any;
|
|
439
|
+
setAccessTokenFromHeader?(header: string): void;
|
|
440
|
+
refreshToken?(refreshTokenFn: () => Promise<string>): Promise<string | null>;
|
|
441
|
+
hasRole?(role: string): boolean;
|
|
442
|
+
hasPermission?(permission: string): boolean;
|
|
443
|
+
}
|
|
444
|
+
interface IAuthProvider {
|
|
445
|
+
init(): Promise<void>;
|
|
446
|
+
signIn(): void | Promise<void>;
|
|
447
|
+
signOut(): void;
|
|
448
|
+
getAccessToken(): Promise<string | null> | string | null;
|
|
449
|
+
getUserInfo(): Promise<any>;
|
|
450
|
+
}
|
|
451
|
+
interface ILoginButton {
|
|
452
|
+
getButtonClass(): string;
|
|
453
|
+
toJSON(): {
|
|
454
|
+
id: string;
|
|
455
|
+
type: string;
|
|
456
|
+
provider: string;
|
|
457
|
+
icon: string;
|
|
458
|
+
text: string;
|
|
459
|
+
style: Partial<CSSStyleDeclaration>;
|
|
460
|
+
fullWidth: boolean;
|
|
461
|
+
className: string;
|
|
462
|
+
onClick: Function;
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
declare class AuthProvider<S extends IAuthService = IAuthService, P extends IAuthProvider | null = IAuthProvider | null, B extends ILoginButton | null = ILoginButton | null> {
|
|
466
|
+
private service;
|
|
467
|
+
private provider;
|
|
468
|
+
private button;
|
|
469
|
+
constructor(service: S, provider: P, button: B);
|
|
470
|
+
init(): Promise<void>;
|
|
471
|
+
getButton(): {
|
|
472
|
+
className: string;
|
|
473
|
+
onClick: () => Promise<void>;
|
|
474
|
+
id: string;
|
|
475
|
+
type: string;
|
|
476
|
+
provider: string;
|
|
477
|
+
icon: string;
|
|
478
|
+
text: string;
|
|
479
|
+
style: Partial<CSSStyleDeclaration>;
|
|
480
|
+
fullWidth: boolean;
|
|
481
|
+
};
|
|
482
|
+
onClick(): Promise<void>;
|
|
483
|
+
signIn(): Promise<void>;
|
|
484
|
+
signOut(): void;
|
|
485
|
+
refresh(refreshTokenFn: () => Promise<string>): Promise<string | null>;
|
|
486
|
+
restore(): void;
|
|
487
|
+
getUserInfo(): Promise<any>;
|
|
488
|
+
getAccessToken(): string | null;
|
|
489
|
+
getAuthState(): boolean;
|
|
490
|
+
watchAuthState(callback: (auth: boolean) => void): void | (() => void);
|
|
491
|
+
hasRole(role: string): boolean;
|
|
492
|
+
hasPermission(permission: string): boolean;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Framework-agnostic renderers for ISA-AUTH buttons
|
|
497
|
+
* Supports Vanilla JS, React, Vue, Angular, and Web Components
|
|
498
|
+
*/
|
|
499
|
+
interface ButtonRenderInfo {
|
|
500
|
+
onClick: () => void;
|
|
501
|
+
label?: string;
|
|
502
|
+
className?: string;
|
|
503
|
+
icon?: string;
|
|
504
|
+
style?: Partial<CSSStyleDeclaration>;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Creates and returns a native HTMLButtonElement
|
|
508
|
+
*/
|
|
509
|
+
declare function renderByJs(info: ButtonRenderInfo): HTMLButtonElement;
|
|
510
|
+
/**
|
|
511
|
+
* React createElement wrapper
|
|
512
|
+
*/
|
|
513
|
+
declare function renderByReact(info: ButtonRenderInfo): any;
|
|
514
|
+
/**
|
|
515
|
+
* Vue 3 / 2 Component definition object
|
|
516
|
+
*/
|
|
517
|
+
declare function renderByVue(info: ButtonRenderInfo): {
|
|
518
|
+
name: string;
|
|
519
|
+
props: {
|
|
520
|
+
label: {
|
|
521
|
+
type: StringConstructor;
|
|
522
|
+
default: string;
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
emits: string[];
|
|
526
|
+
template: string;
|
|
527
|
+
data(): {
|
|
528
|
+
className: string;
|
|
529
|
+
icon: string;
|
|
530
|
+
buttonStyle: {
|
|
531
|
+
accentColor?: string;
|
|
532
|
+
alignContent?: string;
|
|
533
|
+
alignItems: string;
|
|
534
|
+
alignSelf?: string;
|
|
535
|
+
alignmentBaseline?: string;
|
|
536
|
+
all?: string;
|
|
537
|
+
animation?: string;
|
|
538
|
+
animationComposition?: string;
|
|
539
|
+
animationDelay?: string;
|
|
540
|
+
animationDirection?: string;
|
|
541
|
+
animationDuration?: string;
|
|
542
|
+
animationFillMode?: string;
|
|
543
|
+
animationIterationCount?: string;
|
|
544
|
+
animationName?: string;
|
|
545
|
+
animationPlayState?: string;
|
|
546
|
+
animationTimingFunction?: string;
|
|
547
|
+
appearance?: string;
|
|
548
|
+
aspectRatio?: string;
|
|
549
|
+
backdropFilter?: string;
|
|
550
|
+
backfaceVisibility?: string;
|
|
551
|
+
background?: string;
|
|
552
|
+
backgroundAttachment?: string;
|
|
553
|
+
backgroundBlendMode?: string;
|
|
554
|
+
backgroundClip?: string;
|
|
555
|
+
backgroundColor?: string;
|
|
556
|
+
backgroundImage?: string;
|
|
557
|
+
backgroundOrigin?: string;
|
|
558
|
+
backgroundPosition?: string;
|
|
559
|
+
backgroundPositionX?: string;
|
|
560
|
+
backgroundPositionY?: string;
|
|
561
|
+
backgroundRepeat?: string;
|
|
562
|
+
backgroundSize?: string;
|
|
563
|
+
baselineShift?: string;
|
|
564
|
+
baselineSource?: string;
|
|
565
|
+
blockSize?: string;
|
|
566
|
+
border?: string;
|
|
567
|
+
borderBlock?: string;
|
|
568
|
+
borderBlockColor?: string;
|
|
569
|
+
borderBlockEnd?: string;
|
|
570
|
+
borderBlockEndColor?: string;
|
|
571
|
+
borderBlockEndStyle?: string;
|
|
572
|
+
borderBlockEndWidth?: string;
|
|
573
|
+
borderBlockStart?: string;
|
|
574
|
+
borderBlockStartColor?: string;
|
|
575
|
+
borderBlockStartStyle?: string;
|
|
576
|
+
borderBlockStartWidth?: string;
|
|
577
|
+
borderBlockStyle?: string;
|
|
578
|
+
borderBlockWidth?: string;
|
|
579
|
+
borderBottom?: string;
|
|
580
|
+
borderBottomColor?: string;
|
|
581
|
+
borderBottomLeftRadius?: string;
|
|
582
|
+
borderBottomRightRadius?: string;
|
|
583
|
+
borderBottomStyle?: string;
|
|
584
|
+
borderBottomWidth?: string;
|
|
585
|
+
borderCollapse?: string;
|
|
586
|
+
borderColor?: string;
|
|
587
|
+
borderEndEndRadius?: string;
|
|
588
|
+
borderEndStartRadius?: string;
|
|
589
|
+
borderImage?: string;
|
|
590
|
+
borderImageOutset?: string;
|
|
591
|
+
borderImageRepeat?: string;
|
|
592
|
+
borderImageSlice?: string;
|
|
593
|
+
borderImageSource?: string;
|
|
594
|
+
borderImageWidth?: string;
|
|
595
|
+
borderInline?: string;
|
|
596
|
+
borderInlineColor?: string;
|
|
597
|
+
borderInlineEnd?: string;
|
|
598
|
+
borderInlineEndColor?: string;
|
|
599
|
+
borderInlineEndStyle?: string;
|
|
600
|
+
borderInlineEndWidth?: string;
|
|
601
|
+
borderInlineStart?: string;
|
|
602
|
+
borderInlineStartColor?: string;
|
|
603
|
+
borderInlineStartStyle?: string;
|
|
604
|
+
borderInlineStartWidth?: string;
|
|
605
|
+
borderInlineStyle?: string;
|
|
606
|
+
borderInlineWidth?: string;
|
|
607
|
+
borderLeft?: string;
|
|
608
|
+
borderLeftColor?: string;
|
|
609
|
+
borderLeftStyle?: string;
|
|
610
|
+
borderLeftWidth?: string;
|
|
611
|
+
borderRadius?: string;
|
|
612
|
+
borderRight?: string;
|
|
613
|
+
borderRightColor?: string;
|
|
614
|
+
borderRightStyle?: string;
|
|
615
|
+
borderRightWidth?: string;
|
|
616
|
+
borderSpacing?: string;
|
|
617
|
+
borderStartEndRadius?: string;
|
|
618
|
+
borderStartStartRadius?: string;
|
|
619
|
+
borderStyle?: string;
|
|
620
|
+
borderTop?: string;
|
|
621
|
+
borderTopColor?: string;
|
|
622
|
+
borderTopLeftRadius?: string;
|
|
623
|
+
borderTopRightRadius?: string;
|
|
624
|
+
borderTopStyle?: string;
|
|
625
|
+
borderTopWidth?: string;
|
|
626
|
+
borderWidth?: string;
|
|
627
|
+
bottom?: string;
|
|
628
|
+
boxDecorationBreak?: string;
|
|
629
|
+
boxShadow?: string;
|
|
630
|
+
boxSizing?: string;
|
|
631
|
+
breakAfter?: string;
|
|
632
|
+
breakBefore?: string;
|
|
633
|
+
breakInside?: string;
|
|
634
|
+
captionSide?: string;
|
|
635
|
+
caretColor?: string;
|
|
636
|
+
clear?: string;
|
|
637
|
+
clip?: string;
|
|
638
|
+
clipPath?: string;
|
|
639
|
+
clipRule?: string;
|
|
640
|
+
color?: string;
|
|
641
|
+
colorInterpolation?: string;
|
|
642
|
+
colorInterpolationFilters?: string;
|
|
643
|
+
colorScheme?: string;
|
|
644
|
+
columnCount?: string;
|
|
645
|
+
columnFill?: string;
|
|
646
|
+
columnGap?: string;
|
|
647
|
+
columnRule?: string;
|
|
648
|
+
columnRuleColor?: string;
|
|
649
|
+
columnRuleStyle?: string;
|
|
650
|
+
columnRuleWidth?: string;
|
|
651
|
+
columnSpan?: string;
|
|
652
|
+
columnWidth?: string;
|
|
653
|
+
columns?: string;
|
|
654
|
+
contain?: string;
|
|
655
|
+
containIntrinsicBlockSize?: string;
|
|
656
|
+
containIntrinsicHeight?: string;
|
|
657
|
+
containIntrinsicInlineSize?: string;
|
|
658
|
+
containIntrinsicSize?: string;
|
|
659
|
+
containIntrinsicWidth?: string;
|
|
660
|
+
container?: string;
|
|
661
|
+
containerName?: string;
|
|
662
|
+
containerType?: string;
|
|
663
|
+
content?: string;
|
|
664
|
+
contentVisibility?: string;
|
|
665
|
+
counterIncrement?: string;
|
|
666
|
+
counterReset?: string;
|
|
667
|
+
counterSet?: string;
|
|
668
|
+
cssFloat?: string;
|
|
669
|
+
cssText?: string;
|
|
670
|
+
cursor: string;
|
|
671
|
+
cx?: string;
|
|
672
|
+
cy?: string;
|
|
673
|
+
d?: string;
|
|
674
|
+
direction?: string;
|
|
675
|
+
display: string;
|
|
676
|
+
dominantBaseline?: string;
|
|
677
|
+
emptyCells?: string;
|
|
678
|
+
fill?: string;
|
|
679
|
+
fillOpacity?: string;
|
|
680
|
+
fillRule?: string;
|
|
681
|
+
filter?: string;
|
|
682
|
+
flex?: string;
|
|
683
|
+
flexBasis?: string;
|
|
684
|
+
flexDirection?: string;
|
|
685
|
+
flexFlow?: string;
|
|
686
|
+
flexGrow?: string;
|
|
687
|
+
flexShrink?: string;
|
|
688
|
+
flexWrap?: string;
|
|
689
|
+
float?: string;
|
|
690
|
+
floodColor?: string;
|
|
691
|
+
floodOpacity?: string;
|
|
692
|
+
font?: string;
|
|
693
|
+
fontFamily?: string;
|
|
694
|
+
fontFeatureSettings?: string;
|
|
695
|
+
fontKerning?: string;
|
|
696
|
+
fontOpticalSizing?: string;
|
|
697
|
+
fontPalette?: string;
|
|
698
|
+
fontSize?: string;
|
|
699
|
+
fontSizeAdjust?: string;
|
|
700
|
+
fontStretch?: string;
|
|
701
|
+
fontStyle?: string;
|
|
702
|
+
fontSynthesis?: string;
|
|
703
|
+
fontSynthesisSmallCaps?: string;
|
|
704
|
+
fontSynthesisStyle?: string;
|
|
705
|
+
fontSynthesisWeight?: string;
|
|
706
|
+
fontVariant?: string;
|
|
707
|
+
fontVariantAlternates?: string;
|
|
708
|
+
fontVariantCaps?: string;
|
|
709
|
+
fontVariantEastAsian?: string;
|
|
710
|
+
fontVariantLigatures?: string;
|
|
711
|
+
fontVariantNumeric?: string;
|
|
712
|
+
fontVariantPosition?: string;
|
|
713
|
+
fontVariationSettings?: string;
|
|
714
|
+
fontWeight?: string;
|
|
715
|
+
forcedColorAdjust?: string;
|
|
716
|
+
gap: string;
|
|
717
|
+
grid?: string;
|
|
718
|
+
gridArea?: string;
|
|
719
|
+
gridAutoColumns?: string;
|
|
720
|
+
gridAutoFlow?: string;
|
|
721
|
+
gridAutoRows?: string;
|
|
722
|
+
gridColumn?: string;
|
|
723
|
+
gridColumnEnd?: string;
|
|
724
|
+
gridColumnGap?: string;
|
|
725
|
+
gridColumnStart?: string;
|
|
726
|
+
gridGap?: string;
|
|
727
|
+
gridRow?: string;
|
|
728
|
+
gridRowEnd?: string;
|
|
729
|
+
gridRowGap?: string;
|
|
730
|
+
gridRowStart?: string;
|
|
731
|
+
gridTemplate?: string;
|
|
732
|
+
gridTemplateAreas?: string;
|
|
733
|
+
gridTemplateColumns?: string;
|
|
734
|
+
gridTemplateRows?: string;
|
|
735
|
+
height?: string;
|
|
736
|
+
hyphenateCharacter?: string;
|
|
737
|
+
hyphens?: string;
|
|
738
|
+
imageOrientation?: string;
|
|
739
|
+
imageRendering?: string;
|
|
740
|
+
inlineSize?: string;
|
|
741
|
+
inset?: string;
|
|
742
|
+
insetBlock?: string;
|
|
743
|
+
insetBlockEnd?: string;
|
|
744
|
+
insetBlockStart?: string;
|
|
745
|
+
insetInline?: string;
|
|
746
|
+
insetInlineEnd?: string;
|
|
747
|
+
insetInlineStart?: string;
|
|
748
|
+
isolation?: string;
|
|
749
|
+
justifyContent: string;
|
|
750
|
+
justifyItems?: string;
|
|
751
|
+
justifySelf?: string;
|
|
752
|
+
left?: string;
|
|
753
|
+
length?: number;
|
|
754
|
+
letterSpacing?: string;
|
|
755
|
+
lightingColor?: string;
|
|
756
|
+
lineBreak?: string;
|
|
757
|
+
lineHeight?: string;
|
|
758
|
+
listStyle?: string;
|
|
759
|
+
listStyleImage?: string;
|
|
760
|
+
listStylePosition?: string;
|
|
761
|
+
listStyleType?: string;
|
|
762
|
+
margin?: string;
|
|
763
|
+
marginBlock?: string;
|
|
764
|
+
marginBlockEnd?: string;
|
|
765
|
+
marginBlockStart?: string;
|
|
766
|
+
marginBottom?: string;
|
|
767
|
+
marginInline?: string;
|
|
768
|
+
marginInlineEnd?: string;
|
|
769
|
+
marginInlineStart?: string;
|
|
770
|
+
marginLeft?: string;
|
|
771
|
+
marginRight?: string;
|
|
772
|
+
marginTop?: string;
|
|
773
|
+
marker?: string;
|
|
774
|
+
markerEnd?: string;
|
|
775
|
+
markerMid?: string;
|
|
776
|
+
markerStart?: string;
|
|
777
|
+
mask?: string;
|
|
778
|
+
maskClip?: string;
|
|
779
|
+
maskComposite?: string;
|
|
780
|
+
maskImage?: string;
|
|
781
|
+
maskMode?: string;
|
|
782
|
+
maskOrigin?: string;
|
|
783
|
+
maskPosition?: string;
|
|
784
|
+
maskRepeat?: string;
|
|
785
|
+
maskSize?: string;
|
|
786
|
+
maskType?: string;
|
|
787
|
+
mathDepth?: string;
|
|
788
|
+
mathStyle?: string;
|
|
789
|
+
maxBlockSize?: string;
|
|
790
|
+
maxHeight?: string;
|
|
791
|
+
maxInlineSize?: string;
|
|
792
|
+
maxWidth?: string;
|
|
793
|
+
minBlockSize?: string;
|
|
794
|
+
minHeight?: string;
|
|
795
|
+
minInlineSize?: string;
|
|
796
|
+
minWidth?: string;
|
|
797
|
+
mixBlendMode?: string;
|
|
798
|
+
objectFit?: string;
|
|
799
|
+
objectPosition?: string;
|
|
800
|
+
offset?: string;
|
|
801
|
+
offsetAnchor?: string;
|
|
802
|
+
offsetDistance?: string;
|
|
803
|
+
offsetPath?: string;
|
|
804
|
+
offsetPosition?: string;
|
|
805
|
+
offsetRotate?: string;
|
|
806
|
+
opacity?: string;
|
|
807
|
+
order?: string;
|
|
808
|
+
orphans?: string;
|
|
809
|
+
outline?: string;
|
|
810
|
+
outlineColor?: string;
|
|
811
|
+
outlineOffset?: string;
|
|
812
|
+
outlineStyle?: string;
|
|
813
|
+
outlineWidth?: string;
|
|
814
|
+
overflow?: string;
|
|
815
|
+
overflowAnchor?: string;
|
|
816
|
+
overflowClipMargin?: string;
|
|
817
|
+
overflowWrap?: string;
|
|
818
|
+
overflowX?: string;
|
|
819
|
+
overflowY?: string;
|
|
820
|
+
overscrollBehavior?: string;
|
|
821
|
+
overscrollBehaviorBlock?: string;
|
|
822
|
+
overscrollBehaviorInline?: string;
|
|
823
|
+
overscrollBehaviorX?: string;
|
|
824
|
+
overscrollBehaviorY?: string;
|
|
825
|
+
padding?: string;
|
|
826
|
+
paddingBlock?: string;
|
|
827
|
+
paddingBlockEnd?: string;
|
|
828
|
+
paddingBlockStart?: string;
|
|
829
|
+
paddingBottom?: string;
|
|
830
|
+
paddingInline?: string;
|
|
831
|
+
paddingInlineEnd?: string;
|
|
832
|
+
paddingInlineStart?: string;
|
|
833
|
+
paddingLeft?: string;
|
|
834
|
+
paddingRight?: string;
|
|
835
|
+
paddingTop?: string;
|
|
836
|
+
page?: string;
|
|
837
|
+
pageBreakAfter?: string;
|
|
838
|
+
pageBreakBefore?: string;
|
|
839
|
+
pageBreakInside?: string;
|
|
840
|
+
paintOrder?: string;
|
|
841
|
+
parentRule?: CSSRule | null;
|
|
842
|
+
perspective?: string;
|
|
843
|
+
perspectiveOrigin?: string;
|
|
844
|
+
placeContent?: string;
|
|
845
|
+
placeItems?: string;
|
|
846
|
+
placeSelf?: string;
|
|
847
|
+
pointerEvents?: string;
|
|
848
|
+
position?: string;
|
|
849
|
+
printColorAdjust?: string;
|
|
850
|
+
quotes?: string;
|
|
851
|
+
r?: string;
|
|
852
|
+
resize?: string;
|
|
853
|
+
right?: string;
|
|
854
|
+
rotate?: string;
|
|
855
|
+
rowGap?: string;
|
|
856
|
+
rubyAlign?: string;
|
|
857
|
+
rubyPosition?: string;
|
|
858
|
+
rx?: string;
|
|
859
|
+
ry?: string;
|
|
860
|
+
scale?: string;
|
|
861
|
+
scrollBehavior?: string;
|
|
862
|
+
scrollMargin?: string;
|
|
863
|
+
scrollMarginBlock?: string;
|
|
864
|
+
scrollMarginBlockEnd?: string;
|
|
865
|
+
scrollMarginBlockStart?: string;
|
|
866
|
+
scrollMarginBottom?: string;
|
|
867
|
+
scrollMarginInline?: string;
|
|
868
|
+
scrollMarginInlineEnd?: string;
|
|
869
|
+
scrollMarginInlineStart?: string;
|
|
870
|
+
scrollMarginLeft?: string;
|
|
871
|
+
scrollMarginRight?: string;
|
|
872
|
+
scrollMarginTop?: string;
|
|
873
|
+
scrollPadding?: string;
|
|
874
|
+
scrollPaddingBlock?: string;
|
|
875
|
+
scrollPaddingBlockEnd?: string;
|
|
876
|
+
scrollPaddingBlockStart?: string;
|
|
877
|
+
scrollPaddingBottom?: string;
|
|
878
|
+
scrollPaddingInline?: string;
|
|
879
|
+
scrollPaddingInlineEnd?: string;
|
|
880
|
+
scrollPaddingInlineStart?: string;
|
|
881
|
+
scrollPaddingLeft?: string;
|
|
882
|
+
scrollPaddingRight?: string;
|
|
883
|
+
scrollPaddingTop?: string;
|
|
884
|
+
scrollSnapAlign?: string;
|
|
885
|
+
scrollSnapStop?: string;
|
|
886
|
+
scrollSnapType?: string;
|
|
887
|
+
scrollbarColor?: string;
|
|
888
|
+
scrollbarGutter?: string;
|
|
889
|
+
scrollbarWidth?: string;
|
|
890
|
+
shapeImageThreshold?: string;
|
|
891
|
+
shapeMargin?: string;
|
|
892
|
+
shapeOutside?: string;
|
|
893
|
+
shapeRendering?: string;
|
|
894
|
+
stopColor?: string;
|
|
895
|
+
stopOpacity?: string;
|
|
896
|
+
stroke?: string;
|
|
897
|
+
strokeDasharray?: string;
|
|
898
|
+
strokeDashoffset?: string;
|
|
899
|
+
strokeLinecap?: string;
|
|
900
|
+
strokeLinejoin?: string;
|
|
901
|
+
strokeMiterlimit?: string;
|
|
902
|
+
strokeOpacity?: string;
|
|
903
|
+
strokeWidth?: string;
|
|
904
|
+
tabSize?: string;
|
|
905
|
+
tableLayout?: string;
|
|
906
|
+
textAlign?: string;
|
|
907
|
+
textAlignLast?: string;
|
|
908
|
+
textAnchor?: string;
|
|
909
|
+
textBox?: string;
|
|
910
|
+
textBoxEdge?: string;
|
|
911
|
+
textBoxTrim?: string;
|
|
912
|
+
textCombineUpright?: string;
|
|
913
|
+
textDecoration?: string;
|
|
914
|
+
textDecorationColor?: string;
|
|
915
|
+
textDecorationLine?: string;
|
|
916
|
+
textDecorationSkipInk?: string;
|
|
917
|
+
textDecorationStyle?: string;
|
|
918
|
+
textDecorationThickness?: string;
|
|
919
|
+
textEmphasis?: string;
|
|
920
|
+
textEmphasisColor?: string;
|
|
921
|
+
textEmphasisPosition?: string;
|
|
922
|
+
textEmphasisStyle?: string;
|
|
923
|
+
textIndent?: string;
|
|
924
|
+
textOrientation?: string;
|
|
925
|
+
textOverflow?: string;
|
|
926
|
+
textRendering?: string;
|
|
927
|
+
textShadow?: string;
|
|
928
|
+
textTransform?: string;
|
|
929
|
+
textUnderlineOffset?: string;
|
|
930
|
+
textUnderlinePosition?: string;
|
|
931
|
+
textWrap?: string;
|
|
932
|
+
textWrapMode?: string;
|
|
933
|
+
textWrapStyle?: string;
|
|
934
|
+
top?: string;
|
|
935
|
+
touchAction?: string;
|
|
936
|
+
transform?: string;
|
|
937
|
+
transformBox?: string;
|
|
938
|
+
transformOrigin?: string;
|
|
939
|
+
transformStyle?: string;
|
|
940
|
+
transition?: string;
|
|
941
|
+
transitionBehavior?: string;
|
|
942
|
+
transitionDelay?: string;
|
|
943
|
+
transitionDuration?: string;
|
|
944
|
+
transitionProperty?: string;
|
|
945
|
+
transitionTimingFunction?: string;
|
|
946
|
+
translate?: string;
|
|
947
|
+
unicodeBidi?: string;
|
|
948
|
+
userSelect?: string;
|
|
949
|
+
vectorEffect?: string;
|
|
950
|
+
verticalAlign?: string;
|
|
951
|
+
viewTransitionClass?: string;
|
|
952
|
+
viewTransitionName?: string;
|
|
953
|
+
visibility?: string;
|
|
954
|
+
webkitAlignContent?: string;
|
|
955
|
+
webkitAlignItems?: string;
|
|
956
|
+
webkitAlignSelf?: string;
|
|
957
|
+
webkitAnimation?: string;
|
|
958
|
+
webkitAnimationDelay?: string;
|
|
959
|
+
webkitAnimationDirection?: string;
|
|
960
|
+
webkitAnimationDuration?: string;
|
|
961
|
+
webkitAnimationFillMode?: string;
|
|
962
|
+
webkitAnimationIterationCount?: string;
|
|
963
|
+
webkitAnimationName?: string;
|
|
964
|
+
webkitAnimationPlayState?: string;
|
|
965
|
+
webkitAnimationTimingFunction?: string;
|
|
966
|
+
webkitAppearance?: string;
|
|
967
|
+
webkitBackfaceVisibility?: string;
|
|
968
|
+
webkitBackgroundClip?: string;
|
|
969
|
+
webkitBackgroundOrigin?: string;
|
|
970
|
+
webkitBackgroundSize?: string;
|
|
971
|
+
webkitBorderBottomLeftRadius?: string;
|
|
972
|
+
webkitBorderBottomRightRadius?: string;
|
|
973
|
+
webkitBorderRadius?: string;
|
|
974
|
+
webkitBorderTopLeftRadius?: string;
|
|
975
|
+
webkitBorderTopRightRadius?: string;
|
|
976
|
+
webkitBoxAlign?: string;
|
|
977
|
+
webkitBoxFlex?: string;
|
|
978
|
+
webkitBoxOrdinalGroup?: string;
|
|
979
|
+
webkitBoxOrient?: string;
|
|
980
|
+
webkitBoxPack?: string;
|
|
981
|
+
webkitBoxShadow?: string;
|
|
982
|
+
webkitBoxSizing?: string;
|
|
983
|
+
webkitFilter?: string;
|
|
984
|
+
webkitFlex?: string;
|
|
985
|
+
webkitFlexBasis?: string;
|
|
986
|
+
webkitFlexDirection?: string;
|
|
987
|
+
webkitFlexFlow?: string;
|
|
988
|
+
webkitFlexGrow?: string;
|
|
989
|
+
webkitFlexShrink?: string;
|
|
990
|
+
webkitFlexWrap?: string;
|
|
991
|
+
webkitJustifyContent?: string;
|
|
992
|
+
webkitLineClamp?: string;
|
|
993
|
+
webkitMask?: string;
|
|
994
|
+
webkitMaskBoxImage?: string;
|
|
995
|
+
webkitMaskBoxImageOutset?: string;
|
|
996
|
+
webkitMaskBoxImageRepeat?: string;
|
|
997
|
+
webkitMaskBoxImageSlice?: string;
|
|
998
|
+
webkitMaskBoxImageSource?: string;
|
|
999
|
+
webkitMaskBoxImageWidth?: string;
|
|
1000
|
+
webkitMaskClip?: string;
|
|
1001
|
+
webkitMaskComposite?: string;
|
|
1002
|
+
webkitMaskImage?: string;
|
|
1003
|
+
webkitMaskOrigin?: string;
|
|
1004
|
+
webkitMaskPosition?: string;
|
|
1005
|
+
webkitMaskRepeat?: string;
|
|
1006
|
+
webkitMaskSize?: string;
|
|
1007
|
+
webkitOrder?: string;
|
|
1008
|
+
webkitPerspective?: string;
|
|
1009
|
+
webkitPerspectiveOrigin?: string;
|
|
1010
|
+
webkitTextFillColor?: string;
|
|
1011
|
+
webkitTextSizeAdjust?: string;
|
|
1012
|
+
webkitTextStroke?: string;
|
|
1013
|
+
webkitTextStrokeColor?: string;
|
|
1014
|
+
webkitTextStrokeWidth?: string;
|
|
1015
|
+
webkitTransform?: string;
|
|
1016
|
+
webkitTransformOrigin?: string;
|
|
1017
|
+
webkitTransformStyle?: string;
|
|
1018
|
+
webkitTransition?: string;
|
|
1019
|
+
webkitTransitionDelay?: string;
|
|
1020
|
+
webkitTransitionDuration?: string;
|
|
1021
|
+
webkitTransitionProperty?: string;
|
|
1022
|
+
webkitTransitionTimingFunction?: string;
|
|
1023
|
+
webkitUserSelect?: string;
|
|
1024
|
+
whiteSpace?: string;
|
|
1025
|
+
whiteSpaceCollapse?: string;
|
|
1026
|
+
widows?: string;
|
|
1027
|
+
width?: string;
|
|
1028
|
+
willChange?: string;
|
|
1029
|
+
wordBreak?: string;
|
|
1030
|
+
wordSpacing?: string;
|
|
1031
|
+
wordWrap?: string;
|
|
1032
|
+
writingMode?: string;
|
|
1033
|
+
x?: string;
|
|
1034
|
+
y?: string;
|
|
1035
|
+
zIndex?: string;
|
|
1036
|
+
zoom?: string;
|
|
1037
|
+
getPropertyPriority?: (property: string) => string;
|
|
1038
|
+
getPropertyValue?: (property: string) => string;
|
|
1039
|
+
item?: (index: number) => string;
|
|
1040
|
+
removeProperty?: (property: string) => string;
|
|
1041
|
+
setProperty?: (property: string, value: string | null, priority?: string) => void;
|
|
1042
|
+
[Symbol.iterator]?: () => ArrayIterator<string>;
|
|
1043
|
+
};
|
|
1044
|
+
};
|
|
1045
|
+
methods: {
|
|
1046
|
+
handleClick(): void;
|
|
1047
|
+
};
|
|
1048
|
+
};
|
|
1049
|
+
/**
|
|
1050
|
+
* Registers custom Web Component <isa-auth-button>
|
|
1051
|
+
*/
|
|
1052
|
+
declare function registerWebComponent(): void;
|
|
1053
|
+
|
|
1054
|
+
type index_ButtonRenderInfo = ButtonRenderInfo;
|
|
1055
|
+
declare const index_registerWebComponent: typeof registerWebComponent;
|
|
1056
|
+
declare const index_renderByJs: typeof renderByJs;
|
|
1057
|
+
declare const index_renderByReact: typeof renderByReact;
|
|
1058
|
+
declare const index_renderByVue: typeof renderByVue;
|
|
1059
|
+
declare namespace index {
|
|
1060
|
+
export { type index_ButtonRenderInfo as ButtonRenderInfo, index_registerWebComponent as registerWebComponent, index_renderByJs as renderByJs, index_renderByReact as renderByReact, index_renderByVue as renderByVue };
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
interface IsaAuthConfig {
|
|
1064
|
+
provider?: CoreProviderType;
|
|
1065
|
+
secret?: string;
|
|
1066
|
+
clientId?: string;
|
|
1067
|
+
callbackUrl?: string;
|
|
1068
|
+
scope?: string;
|
|
1069
|
+
storage?: 'localStorage' | 'sessionStorage' | 'memory';
|
|
1070
|
+
extraOptions?: Record<string, any>;
|
|
1071
|
+
}
|
|
1072
|
+
/**
|
|
1073
|
+
* Main unified entry point for ISA-AUTH
|
|
1074
|
+
*/
|
|
1075
|
+
declare class IsaAuth {
|
|
1076
|
+
core: AuthCore;
|
|
1077
|
+
providerInstance: any;
|
|
1078
|
+
authProvider: AuthProvider;
|
|
1079
|
+
constructor(config?: IsaAuthConfig);
|
|
1080
|
+
isAuthenticated(): boolean;
|
|
1081
|
+
getAccessToken(): string | null;
|
|
1082
|
+
getUserInfo(): Promise<any>;
|
|
1083
|
+
setAccessToken(token: string): void;
|
|
1084
|
+
signIn(): Promise<void>;
|
|
1085
|
+
signOut(): void;
|
|
1086
|
+
refresh(refreshFn: () => Promise<string>): Promise<string>;
|
|
1087
|
+
getButton(): {
|
|
1088
|
+
className: string;
|
|
1089
|
+
onClick: () => Promise<void>;
|
|
1090
|
+
id: string;
|
|
1091
|
+
type: string;
|
|
1092
|
+
provider: string;
|
|
1093
|
+
icon: string;
|
|
1094
|
+
text: string;
|
|
1095
|
+
style: Partial<CSSStyleDeclaration>;
|
|
1096
|
+
fullWidth: boolean;
|
|
1097
|
+
};
|
|
1098
|
+
renderButton(container?: HTMLElement | null): HTMLButtonElement | null;
|
|
1099
|
+
hasRole(role: string): boolean;
|
|
1100
|
+
hasPermission(permission: string): boolean;
|
|
1101
|
+
createGuard(options: Parameters<typeof createAuthGuard>[0]): Promise<boolean>;
|
|
1102
|
+
createFetch(options?: {
|
|
1103
|
+
refreshFn?: () => Promise<string>;
|
|
1104
|
+
baseUrl?: string;
|
|
1105
|
+
}): (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
1106
|
+
subscribe(callback: (isAuthenticated: boolean) => void): void | (() => void);
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
export { AuthCore, AuthProvider, GoogleAuthProvider, IsaAuth, type IsaAuthConfig, KakaoAuthProvider, NaverAuthProvider, Web3AuthProvider, buildAuthorizeUrl, configureStorage, createAuthFetch, createAuthGuard, decodeToken, IsaAuth as default, generateCodeChallenge, generateCodeVerifier, getAccessToken, getAuthInfo, getAuthState, getTokenFromHeader, getTokenPayload, getTokenTimeRemaining, isExpiredToken, parseOAuthCallback, index as renderers };
|