@selldone/sdk-storefront
Version:
A TypeScript SDK to connect to your shop and build a fully functional storefront and website by simply developing a frontend web application. All backend operations are seamlessly managed by the serverless Selldone solution.
39 lines (38 loc) • 1.45 kB
TypeScript
import { APIAbstract, type IErrorResponse } from "@selldone/core-js/server/APIAbstract";
import { AxiosError } from "axios";
import setUserCurrency from "./requests/xapi.user.currency.put";
import setFcmToken from "./requests/xapi.user.fcm.post";
import { UserProfile } from "@selldone/core-js/models/user/user_profile.model";
import { User } from "@selldone/core-js/models";
export declare class XapiUser extends APIAbstract {
/** Name of the shop for which the API operations will be performed. */
shop_name: string;
setUserCurrency: typeof setUserCurrency;
setFcmToken: typeof setFcmToken;
constructor(shop_name: string);
fetchMyInfo(onSuccess: (data: XapiUser.IMeServerResponse) => void, onError?: (error: IErrorResponse | AxiosError) => void): void;
/**
* Important set current user information!
* @param user
*/
setCurrentUser(user: User | null): void;
}
export declare namespace XapiUser {
interface IMeServerResponse {
error?: boolean;
error_msg?: string;
/** The unique identifier for the user. */
id: number;
/** The user's full name. */
name: string;
phone?: string;
phone_verified: boolean;
personal_information_verified: boolean;
email_verified: boolean;
subscribed: boolean;
chips: number;
profile: UserProfile | null;
block_at?: Date;
access: boolean;
}
}