fleeta-lib
Version:
A comprehensive library for fleet management applications - API, Auth, Device management
95 lines • 2.84 kB
TypeScript
interface LoginApiResponse {
resultcode: string;
message?: string;
response?: {
user_token?: string;
jsonwebtoken?: string;
was_server?: string;
was_port?: string;
gps_server?: string;
gps_port?: string;
gps_tracking_server?: string;
gps_tracking_port?: string;
geo_fence_server?: string;
geo_fence_port?: string;
userType?: string;
subscribeinfo?: SubscribeInfo;
latestlogindt?: string;
lastMobileOS?: string;
lastAppVer?: string;
lastWebVer?: string;
'logged in list'?: {
ids?: Array<{
id: string;
mobile_name: string;
mobile_os_type: string;
}>;
};
};
user_token?: string;
jwt_token?: string;
jsonwebtoken?: string;
}
interface ServerConfig {
was_server: string;
was_port: string;
gps_server: string;
gps_port: string;
gps_tracking_server: string;
gps_tracking_port: string;
geo_fence_server: string;
geo_fence_port: string;
}
interface SubscribeInfo {
servicePlanID: number;
servicePlanName: string;
cameraLimit: number;
paymentMethod: string;
cancelled: number;
cancelDT: string;
startOfMonthDT: string;
endOfMonthDT: string;
tradeType: string;
registered: boolean;
firstTime: boolean;
masterEmail: string;
parentEmail: string;
userEmail: string;
userType: string;
}
interface AuthState {
isAuthenticated: boolean;
userToken: string | null;
jwtToken: string | null;
serverConfig: ServerConfig | null;
userType: string | null;
subscribeInfo: SubscribeInfo | null;
latestLoginInfo: {
timestamp: string;
mobileOS: string;
appVersion: string;
webVersion: string;
duplicateLogins?: Array<{
id: string;
mobile_name: string;
mobile_os_type: string;
}>;
} | null;
error: string | null;
setAuth: (data: LoginApiResponse) => void;
clearAuth: () => void;
setError: (error: string | null) => void;
}
export declare const useAuthStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<AuthState>, "persist"> & {
persist: {
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<AuthState, AuthState>>) => void;
clearStorage: () => void;
rehydrate: () => Promise<void> | void;
hasHydrated: () => boolean;
onHydrate: (fn: (state: AuthState) => void) => () => void;
onFinishHydration: (fn: (state: AuthState) => void) => () => void;
getOptions: () => Partial<import("zustand/middleware").PersistOptions<AuthState, AuthState>>;
};
}>;
export {};
//# sourceMappingURL=authStore.d.ts.map