@wizecorp/stratusjs
Version:
Stratus React Framework
52 lines • 1.38 kB
TypeScript
import type { AuthService as IAuthService, StorageService } from '../types';
interface AuthUser {
id: string;
email?: string;
name?: string;
[key: string]: any;
}
interface LoginCredentials {
email?: string;
username?: string;
password: string;
}
/**
* Authentication service
*/
export declare class AuthService implements IAuthService {
readonly name = "AuthService";
private user;
private token;
private storageService?;
private readonly TOKEN_KEY;
private readonly USER_KEY;
constructor(storageService?: StorageService);
initialize(): Promise<void>;
isAuthenticated(): boolean;
login(credentials: LoginCredentials): Promise<AuthUser>;
logout(): Promise<void>;
getUser(): AuthUser | null;
getToken(): string | null;
/**
* Update user information
*/
updateUser(userData: Partial<AuthUser>): void;
/**
* Check if user has specific permission
*/
hasPermission(permission: string): boolean;
/**
* Check if user has specific role
*/
hasRole(role: string): boolean;
/**
* Simulate login API call - replace with your actual implementation
*/
private callLoginAPI;
/**
* Simulate logout API call - replace with your actual implementation
*/
private callLogoutAPI;
}
export {};
//# sourceMappingURL=AuthService.d.ts.map