#import NS_ASSUME_NONNULL_BEGIN @protocol UITextDocumentProxy; @interface KBInputBufferManager : NSObject + (instancetype)shared; @property (nonatomic, copy, readonly) NSString *liveText; @property (nonatomic, copy, readonly) NSString *manualSnapshot; @property (nonatomic, copy, readonly) NSString *pendingClearSnapshot; - (void)seedIfEmptyWithContextBefore:(nullable NSString *)before after:(nullable NSString *)after; - (void)updateFromExternalContextBefore:(nullable NSString *)before after:(nullable NSString *)after; - (void)refreshFromProxyIfPossible:(nullable id)proxy; - (void)prepareSnapshotForDeleteWithContextBefore:(nullable NSString *)before after:(nullable NSString *)after; - (void)beginPendingClearSnapshot; - (void)clearPendingClearSnapshot; - (void)resetWithText:(NSString *)text; - (void)appendText:(NSString *)text; - (void)deleteBackwardByCount:(NSUInteger)count; - (void)replaceTailWithText:(NSString *)text deleteCount:(NSUInteger)count; - (void)applyHoldDeleteCount:(NSUInteger)count; - (void)applyClearDeleteCount:(NSUInteger)count; - (void)clearAllLiveText; - (void)commitLiveToManual; - (void)restoreManualSnapshot; @end NS_ASSUME_NONNULL_END