@pisell/pisellos
Version:
一个可扩展的前端模块化SDK框架,支持插件系统
47 lines (46 loc) • 1.72 kB
TypeScript
import { Module, PisellCore, ModuleOptions } from '../../types';
import { AccountModule, Account } from '../Account';
import { BaseModule } from '../BaseModule';
import { IFetchHolderAccountsParams, IHolder } from './types';
export declare class AccountListModule extends BaseModule implements Module {
protected defaultName: string;
protected defaultVersion: string;
private store;
private request;
private cacheId;
private openCache;
private fatherModule;
constructor(name?: string, version?: string);
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
/**
* 创建账号并添加到列表中
* @param account 账号信息
* @param needEmit 是否需要触发事件
* @param type 添加类型
*/
private createAccountAndAdd;
addAccount(account: Account): Promise<AccountModule>;
updateAccount(id: string, updates: Account): Promise<void>;
updateAccountListById(id: string | number, updates: Account): Promise<void>;
removeAccount(id: string): Promise<void>;
getAccounts(): AccountModule[];
getAccount(id: string): AccountModule | null;
clearAccounts(): Promise<void>;
setActiveAccount(id: string | number): void;
getActiveAccount(): AccountModule | null;
storeChange(): void;
/**
* 批量添加holder类型账号
*/
addHolderAccounts(params: {
holders: IHolder[];
customerId: number;
type?: 'unshift' | 'push';
}): Promise<AccountModule[]>;
/**
* 获取holder类型账户列表
* @param params
*/
fetchHolderAccounts(params: IFetchHolderAccountsParams): Promise<void>;
getLoginAccount(): AccountModule | undefined;
}