Signal-iOS/SignalServiceKit/Storage/AxolotlStore/SSKPreKeyStore.h
2024-03-27 12:27:06 -05:00

44 lines
1.3 KiB
Objective-C

//
// Copyright 2018 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
#import <Foundation/Foundation.h>
#import <SignalServiceKit/OWSIdentity.h>
NS_ASSUME_NONNULL_BEGIN
@class PreKeyRecord;
@class SDSAnyReadTransaction;
@class SDSAnyWriteTransaction;
@class SDSKeyValueStore;
@interface SSKPreKeyStore : NSObject
- (instancetype)initForIdentity:(OWSIdentity)identity;
- (NSArray<PreKeyRecord *> *)generatePreKeyRecords;
- (NSArray<PreKeyRecord *> *)generatePreKeyRecordsWithTransaction:(SDSAnyWriteTransaction *)transaction
NS_SWIFT_NAME(generatePreKeyRecords(transaction:));
- (void)storePreKeyRecords:(NSArray<PreKeyRecord *> *)preKeyRecords
transaction:(SDSAnyWriteTransaction *)transaction NS_SWIFT_NAME(storePreKeyRecords(_:transaction:));
#if TESTABLE_BUILD
- (void)removeAll:(SDSAnyWriteTransaction *)transaction;
#endif
- (nullable PreKeyRecord *)loadPreKey:(int)preKeyId transaction:(SDSAnyReadTransaction *)transaction;
- (void)storePreKey:(int)preKeyId preKeyRecord:(PreKeyRecord *)record transaction:(SDSAnyWriteTransaction *)transaction;
- (void)removePreKey:(int)preKeyId transaction:(SDSAnyWriteTransaction *)transaction;
- (void)cullPreKeyRecordsWithTransaction:(SDSAnyWriteTransaction *)transaction
NS_SWIFT_NAME(cullPreKeyRecords(transaction:));
@end
NS_ASSUME_NONNULL_END