123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419 |
- #import <Foundation/Foundation.h>
- #import "RACStream.h"
- @class RACTuple;
- @class RACScheduler;
- @class RACSignal<__covariant ValueType>;
- NS_ASSUME_NONNULL_BEGIN
- @interface RACSequence<__covariant ValueType> : RACStream <NSCoding, NSCopying, NSFastEnumeration>
- @property (nonatomic, strong, readonly, nullable) ValueType head;
- @property (nonatomic, strong, readonly, nullable) RACSequence<ValueType> *tail;
- @property (nonatomic, copy, readonly) NSArray<ValueType> *array;
- @property (nonatomic, copy, readonly) NSEnumerator<ValueType> *objectEnumerator;
- @property (nonatomic, copy, readonly) RACSequence<ValueType> *eagerSequence;
- @property (nonatomic, copy, readonly) RACSequence<ValueType> *lazySequence;
- - (RACSignal<ValueType> *)signal;
- - (RACSignal<ValueType> *)signalWithScheduler:(RACScheduler *)scheduler;
- - (id)foldLeftWithStart:(nullable id)start reduce:(id _Nullable (^)(id _Nullable accumulator, ValueType _Nullable value))reduce;
- - (id)foldRightWithStart:(nullable id)start reduce:(id _Nullable (^)(id _Nullable first, RACSequence *rest))reduce;
- - (BOOL)any:(BOOL (^)(ValueType _Nullable value))block;
- - (BOOL)all:(BOOL (^)(ValueType _Nullable value))block;
- - (nullable ValueType)objectPassingTest:(BOOL (^)(ValueType _Nullable value))block;
- + (RACSequence<ValueType> *)sequenceWithHeadBlock:(ValueType _Nullable (^)(void))headBlock tailBlock:(nullable RACSequence<ValueType> *(^)(void))tailBlock;
- @end
- @interface RACSequence<__covariant ValueType> (RACStream)
- + (RACSequence<ValueType> *)return:(nullable ValueType)value;
- + (RACSequence<ValueType> *)empty;
- typedef RACSequence * _Nullable (^RACSequenceBindBlock)(ValueType _Nullable value, BOOL *stop);
- - (RACSequence *)bind:(RACSequenceBindBlock (^)(void))block;
- - (RACSequence *)concat:(RACSequence *)sequence;
- - (RACSequence<RACTuple *> *)zipWith:(RACSequence *)sequence;
- @end
- @interface RACSequence<__covariant ValueType> (RACStreamOperations)
- - (RACSequence *)flattenMap:(__kindof RACSequence * _Nullable (^)(ValueType _Nullable value))block;
- - (RACSequence *)flatten;
- - (RACSequence *)map:(id _Nullable (^)(ValueType _Nullable value))block;
- - (RACSequence *)mapReplace:(nullable id)object;
- - (RACSequence<ValueType> *)filter:(BOOL (^)(id _Nullable value))block;
- - (RACSequence *)ignore:(nullable ValueType)value;
- - (RACSequence *)reduceEach:(RACReduceBlock)reduceBlock;
- - (RACSequence<ValueType> *)startWith:(nullable ValueType)value;
- - (RACSequence<ValueType> *)skip:(NSUInteger)skipCount;
- - (RACSequence<ValueType> *)take:(NSUInteger)count;
- + (RACSequence<RACTuple *> *)zip:(id<NSFastEnumeration>)sequence;
- + (RACSequence<ValueType> *)zip:(id<NSFastEnumeration>)sequences reduce:(RACReduceBlock)reduceBlock;
- + (RACSequence<ValueType> *)concat:(id<NSFastEnumeration>)sequences;
- - (RACSequence *)scanWithStart:(nullable id)startingValue reduce:(id _Nullable (^)(id _Nullable running, ValueType _Nullable next))reduceBlock;
- - (RACSequence *)scanWithStart:(nullable id)startingValue reduceWithIndex:(id _Nullable (^)(id _Nullable running, ValueType _Nullable next, NSUInteger index))reduceBlock;
- - (RACSequence *)combinePreviousWithStart:(nullable ValueType)start reduce:(id _Nullable (^)(ValueType _Nullable previous, ValueType _Nullable current))reduceBlock;
- - (RACSequence<ValueType> *)takeUntilBlock:(BOOL (^)(ValueType _Nullable x))predicate;
- - (RACSequence<ValueType> *)takeWhileBlock:(BOOL (^)(ValueType _Nullable x))predicate;
- - (RACSequence<ValueType> *)skipUntilBlock:(BOOL (^)(ValueType _Nullable x))predicate;
- - (RACSequence<ValueType> *)skipWhileBlock:(BOOL (^)(ValueType _Nullable x))predicate;
- - (RACSequence<ValueType> *)distinctUntilChanged;
- @end
- NS_ASSUME_NONNULL_END
|