Skip to content

Commit 299a1e1

Browse files
authoredDec 28, 2021
fix: export supporting interfaces from top-level rxjs site. (#6733)
1 parent 2e25e2e commit 299a1e1

File tree

2 files changed

+62
-7
lines changed

2 files changed

+62
-7
lines changed
 

‎api_guard/dist/types/index.d.ts

+55
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ export declare function audit<T>(durationSelector: (value: T) => ObservableInput
2929

3030
export declare function auditTime<T>(duration: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
3131

32+
export interface BasicGroupByOptions<K, T> {
33+
connector?: () => SubjectLike<T>;
34+
duration?: (grouped: GroupedObservable<K, T>) => ObservableInput<any>;
35+
element?: undefined;
36+
}
37+
3238
export declare class BehaviorSubject<T> extends Subject<T> {
3339
get value(): T;
3440
constructor(_value: T);
@@ -131,6 +137,10 @@ export declare class ConnectableObservable<T> extends Observable<T> {
131137
refCount(): Observable<T>;
132138
}
133139

140+
export interface ConnectConfig<T> {
141+
connector: () => SubjectLike<T>;
142+
}
143+
134144
export declare type Cons<X, Y extends readonly any[]> = ((arg: X, ...rest: Y) => any) extends (...args: infer U) => any ? U : never;
135145

136146
export declare function count<T>(predicate?: (value: T, index: number) => boolean): OperatorFunction<T, number>;
@@ -290,6 +300,12 @@ export declare function groupBy<T, K>(key: (value: T) => K, element: void, durat
290300
export declare function groupBy<T, K, R>(key: (value: T) => K, element?: (value: T) => R, duration?: (grouped: GroupedObservable<K, R>) => Observable<any>): OperatorFunction<T, GroupedObservable<K, R>>;
291301
export declare function groupBy<T, K, R>(key: (value: T) => K, element?: (value: T) => R, duration?: (grouped: GroupedObservable<K, R>) => Observable<any>, connector?: () => Subject<R>): OperatorFunction<T, GroupedObservable<K, R>>;
292302

303+
export interface GroupByOptionsWithElement<K, E, T> {
304+
connector?: () => SubjectLike<E>;
305+
duration?: (grouped: GroupedObservable<K, E>) => ObservableInput<any>;
306+
element: (value: T) => E;
307+
}
308+
293309
export interface GroupedObservable<K, T> extends Observable<T> {
294310
readonly key: K;
295311
}
@@ -571,6 +587,12 @@ export declare class ReplaySubject<T> extends Subject<T> {
571587
export declare function retry<T>(count?: number): MonoTypeOperatorFunction<T>;
572588
export declare function retry<T>(config: RetryConfig): MonoTypeOperatorFunction<T>;
573589

590+
export interface RetryConfig {
591+
count?: number;
592+
delay?: number | ((error: any, retryCount: number) => ObservableInput<any>);
593+
resetOnSuccess?: boolean;
594+
}
595+
574596
export declare function retryWhen<T>(notifier: (errors: Observable<any>) => Observable<any>): MonoTypeOperatorFunction<T>;
575597

576598
export declare function sample<T>(notifier: Observable<any>): MonoTypeOperatorFunction<T>;
@@ -610,9 +632,23 @@ export declare const SequenceError: SequenceErrorCtor;
610632
export declare function share<T>(): MonoTypeOperatorFunction<T>;
611633
export declare function share<T>(options: ShareConfig<T>): MonoTypeOperatorFunction<T>;
612634

635+
export interface ShareConfig<T> {
636+
connector?: () => SubjectLike<T>;
637+
resetOnComplete?: boolean | (() => Observable<any>);
638+
resetOnError?: boolean | ((error: any) => Observable<any>);
639+
resetOnRefCountZero?: boolean | (() => Observable<any>);
640+
}
641+
613642
export declare function shareReplay<T>(config: ShareReplayConfig): MonoTypeOperatorFunction<T>;
614643
export declare function shareReplay<T>(bufferSize?: number, windowTime?: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
615644

645+
export interface ShareReplayConfig {
646+
bufferSize?: number;
647+
refCount: boolean;
648+
scheduler?: SchedulerLike;
649+
windowTime?: number;
650+
}
651+
616652
export declare function single<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;
617653
export declare function single<T>(predicate?: (value: T, index: number, source: Observable<T>) => boolean): MonoTypeOperatorFunction<T>;
618654

@@ -722,6 +758,11 @@ export declare type TeardownLogic = Subscription | Unsubscribable | (() => void)
722758

723759
export declare function throttle<T>(durationSelector: (value: T) => ObservableInput<any>, config?: ThrottleConfig): MonoTypeOperatorFunction<T>;
724760

761+
export interface ThrottleConfig {
762+
leading?: boolean;
763+
trailing?: boolean;
764+
}
765+
725766
export declare function throttleTime<T>(duration: number, scheduler?: SchedulerLike, config?: import("./throttle").ThrottleConfig): MonoTypeOperatorFunction<T>;
726767

727768
export declare function throwError(errorFactory: () => any): Observable<never>;
@@ -744,12 +785,26 @@ export declare function timeout<T, M = unknown>(config: Omit<TimeoutConfig<T, an
744785
export declare function timeout<T>(first: Date, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
745786
export declare function timeout<T>(each: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
746787

788+
export interface TimeoutConfig<T, O extends ObservableInput<unknown> = ObservableInput<T>, M = unknown> {
789+
each?: number;
790+
first?: number | Date;
791+
meta?: M;
792+
scheduler?: SchedulerLike;
793+
with?: (info: TimeoutInfo<T, M>) => O;
794+
}
795+
747796
export interface TimeoutError<T = unknown, M = unknown> extends Error {
748797
info: TimeoutInfo<T, M> | null;
749798
}
750799

751800
export declare const TimeoutError: TimeoutErrorCtor;
752801

802+
export interface TimeoutInfo<T, M = unknown> {
803+
readonly lastValue: T | null;
804+
readonly meta: M;
805+
readonly seen: number;
806+
}
807+
753808
export declare function timeoutWith<T, R>(dueBy: Date, switchTo: ObservableInput<R>, scheduler?: SchedulerLike): OperatorFunction<T, T | R>;
754809
export declare function timeoutWith<T, R>(waitFor: number, switchTo: ObservableInput<R>, scheduler?: SchedulerLike): OperatorFunction<T, T | R>;
755810

‎src/index.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export { concatAll } from './internal/operators/concatAll';
115115
export { concatMap } from './internal/operators/concatMap';
116116
export { concatMapTo } from './internal/operators/concatMapTo';
117117
export { concatWith } from './internal/operators/concatWith';
118-
export { connect } from './internal/operators/connect';
118+
export { connect, ConnectConfig } from './internal/operators/connect';
119119
export { count } from './internal/operators/count';
120120
export { debounce } from './internal/operators/debounce';
121121
export { debounceTime } from './internal/operators/debounceTime';
@@ -138,7 +138,7 @@ export { finalize } from './internal/operators/finalize';
138138
export { find } from './internal/operators/find';
139139
export { findIndex } from './internal/operators/findIndex';
140140
export { first } from './internal/operators/first';
141-
export { groupBy } from './internal/operators/groupBy';
141+
export { groupBy, BasicGroupByOptions, GroupByOptionsWithElement } from './internal/operators/groupBy';
142142
export { ignoreElements } from './internal/operators/ignoreElements';
143143
export { isEmpty } from './internal/operators/isEmpty';
144144
export { last } from './internal/operators/last';
@@ -165,15 +165,15 @@ export { raceWith } from './internal/operators/raceWith';
165165
export { reduce } from './internal/operators/reduce';
166166
export { repeat } from './internal/operators/repeat';
167167
export { repeatWhen } from './internal/operators/repeatWhen';
168-
export { retry } from './internal/operators/retry';
168+
export { retry, RetryConfig } from './internal/operators/retry';
169169
export { retryWhen } from './internal/operators/retryWhen';
170170
export { refCount } from './internal/operators/refCount';
171171
export { sample } from './internal/operators/sample';
172172
export { sampleTime } from './internal/operators/sampleTime';
173173
export { scan } from './internal/operators/scan';
174174
export { sequenceEqual } from './internal/operators/sequenceEqual';
175-
export { share } from './internal/operators/share';
176-
export { shareReplay } from './internal/operators/shareReplay';
175+
export { share, ShareConfig } from './internal/operators/share';
176+
export { shareReplay, ShareReplayConfig } from './internal/operators/shareReplay';
177177
export { single } from './internal/operators/single';
178178
export { skip } from './internal/operators/skip';
179179
export { skipLast } from './internal/operators/skipLast';
@@ -190,11 +190,11 @@ export { takeLast } from './internal/operators/takeLast';
190190
export { takeUntil } from './internal/operators/takeUntil';
191191
export { takeWhile } from './internal/operators/takeWhile';
192192
export { tap } from './internal/operators/tap';
193-
export { throttle } from './internal/operators/throttle';
193+
export { throttle, ThrottleConfig } from './internal/operators/throttle';
194194
export { throttleTime } from './internal/operators/throttleTime';
195195
export { throwIfEmpty } from './internal/operators/throwIfEmpty';
196196
export { timeInterval } from './internal/operators/timeInterval';
197-
export { timeout } from './internal/operators/timeout';
197+
export { timeout, TimeoutConfig, TimeoutInfo } from './internal/operators/timeout';
198198
export { timeoutWith } from './internal/operators/timeoutWith';
199199
export { timestamp } from './internal/operators/timestamp';
200200
export { toArray } from './internal/operators/toArray';

0 commit comments

Comments
 (0)
Please sign in to comment.