@bsv/wallet-toolbox-client
Version:
Client only Wallet Storage
34 lines • 1.39 kB
TypeScript
import { TrxToken } from '../../../sdk/WalletStorage.interfaces';
import { EntityBase, EntityStorage, EntitySyncMap, SyncMap } from './EntityBase';
import { EntityTimeStamp } from '../../../sdk/types';
/**
* @param API one of the storage table interfaces.
* @param DE the corresponding entity class
*/
export declare class MergeEntity<API extends EntityTimeStamp, DE extends EntityBase<API>> {
stateArray: API[] | undefined;
find: (storage: EntityStorage, userId: number, ei: API, syncMap: SyncMap, trx?: TrxToken) => Promise<{
found: boolean;
eo: DE;
eiId: number;
}>;
/** id map for primary id of API and DE object. */
esm: EntitySyncMap;
idMap: Record<number, number>;
constructor(stateArray: API[] | undefined, find: (storage: EntityStorage, userId: number, ei: API, syncMap: SyncMap, trx?: TrxToken) => Promise<{
found: boolean;
eo: DE;
eiId: number;
}>,
/** id map for primary id of API and DE object. */
esm: EntitySyncMap);
updateSyncMap(map: Record<number, number>, inId: number, outId: number): void;
/**
* @param since date of current sync chunk
*/
merge(since: Date | undefined, storage: EntityStorage, userId: number, syncMap: SyncMap, trx?: TrxToken): Promise<{
inserts: number;
updates: number;
}>;
}
//# sourceMappingURL=MergeEntity.d.ts.map