Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: include additional interfaces to 'rxjs' export site #6733

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
55 changes: 55 additions & 0 deletions api_guard/dist/types/index.d.ts
Expand Up @@ -29,6 +29,12 @@ export declare function audit<T>(durationSelector: (value: T) => ObservableInput

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

export interface BasicGroupByOptions<K, T> {
connector?: () => SubjectLike<T>;
duration?: (grouped: GroupedObservable<K, T>) => ObservableInput<any>;
element?: undefined;
}

export declare class BehaviorSubject<T> extends Subject<T> {
get value(): T;
constructor(_value: T);
Expand Down Expand Up @@ -131,6 +137,10 @@ export declare class ConnectableObservable<T> extends Observable<T> {
refCount(): Observable<T>;
}

export interface ConnectConfig<T> {
connector: () => SubjectLike<T>;
}

export declare type Cons<X, Y extends readonly any[]> = ((arg: X, ...rest: Y) => any) extends (...args: infer U) => any ? U : never;

export declare function count<T>(predicate?: (value: T, index: number) => boolean): OperatorFunction<T, number>;
Expand Down Expand Up @@ -290,6 +300,12 @@ export declare function groupBy<T, K>(key: (value: T) => K, element: void, durat
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>>;
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>>;

export interface GroupByOptionsWithElement<K, E, T> {
connector?: () => SubjectLike<E>;
duration?: (grouped: GroupedObservable<K, E>) => ObservableInput<any>;
element: (value: T) => E;
}

export interface GroupedObservable<K, T> extends Observable<T> {
readonly key: K;
}
Expand Down Expand Up @@ -571,6 +587,12 @@ export declare class ReplaySubject<T> extends Subject<T> {
export declare function retry<T>(count?: number): MonoTypeOperatorFunction<T>;
export declare function retry<T>(config: RetryConfig): MonoTypeOperatorFunction<T>;

export interface RetryConfig {
count?: number;
delay?: number | ((error: any, retryCount: number) => ObservableInput<any>);
resetOnSuccess?: boolean;
}

export declare function retryWhen<T>(notifier: (errors: Observable<any>) => Observable<any>): MonoTypeOperatorFunction<T>;

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

export interface ShareConfig<T> {
connector?: () => SubjectLike<T>;
resetOnComplete?: boolean | (() => Observable<any>);
resetOnError?: boolean | ((error: any) => Observable<any>);
resetOnRefCountZero?: boolean | (() => Observable<any>);
}

export declare function shareReplay<T>(config: ShareReplayConfig): MonoTypeOperatorFunction<T>;
export declare function shareReplay<T>(bufferSize?: number, windowTime?: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;

export interface ShareReplayConfig {
bufferSize?: number;
refCount: boolean;
scheduler?: SchedulerLike;
windowTime?: number;
}

export declare function single<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;
export declare function single<T>(predicate?: (value: T, index: number, source: Observable<T>) => boolean): MonoTypeOperatorFunction<T>;

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

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

export interface ThrottleConfig {
leading?: boolean;
trailing?: boolean;
}

export declare function throttleTime<T>(duration: number, scheduler?: SchedulerLike, config?: import("./throttle").ThrottleConfig): MonoTypeOperatorFunction<T>;

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

export interface TimeoutConfig<T, O extends ObservableInput<unknown> = ObservableInput<T>, M = unknown> {
each?: number;
first?: number | Date;
meta?: M;
scheduler?: SchedulerLike;
with?: (info: TimeoutInfo<T, M>) => O;
}

export interface TimeoutError<T = unknown, M = unknown> extends Error {
info: TimeoutInfo<T, M> | null;
}

export declare const TimeoutError: TimeoutErrorCtor;

export interface TimeoutInfo<T, M = unknown> {
readonly lastValue: T | null;
readonly meta: M;
readonly seen: number;
}

export declare function timeoutWith<T, R>(dueBy: Date, switchTo: ObservableInput<R>, scheduler?: SchedulerLike): OperatorFunction<T, T | R>;
export declare function timeoutWith<T, R>(waitFor: number, switchTo: ObservableInput<R>, scheduler?: SchedulerLike): OperatorFunction<T, T | R>;

Expand Down
14 changes: 7 additions & 7 deletions src/index.ts
Expand Up @@ -115,7 +115,7 @@ export { concatAll } from './internal/operators/concatAll';
export { concatMap } from './internal/operators/concatMap';
export { concatMapTo } from './internal/operators/concatMapTo';
export { concatWith } from './internal/operators/concatWith';
export { connect } from './internal/operators/connect';
export { connect, ConnectConfig } from './internal/operators/connect';
export { count } from './internal/operators/count';
export { debounce } from './internal/operators/debounce';
export { debounceTime } from './internal/operators/debounceTime';
Expand All @@ -138,7 +138,7 @@ export { finalize } from './internal/operators/finalize';
export { find } from './internal/operators/find';
export { findIndex } from './internal/operators/findIndex';
export { first } from './internal/operators/first';
export { groupBy } from './internal/operators/groupBy';
export { groupBy, BasicGroupByOptions, GroupByOptionsWithElement } from './internal/operators/groupBy';
export { ignoreElements } from './internal/operators/ignoreElements';
export { isEmpty } from './internal/operators/isEmpty';
export { last } from './internal/operators/last';
Expand All @@ -165,15 +165,15 @@ export { raceWith } from './internal/operators/raceWith';
export { reduce } from './internal/operators/reduce';
export { repeat } from './internal/operators/repeat';
export { repeatWhen } from './internal/operators/repeatWhen';
export { retry } from './internal/operators/retry';
export { retry, RetryConfig } from './internal/operators/retry';
export { retryWhen } from './internal/operators/retryWhen';
export { refCount } from './internal/operators/refCount';
export { sample } from './internal/operators/sample';
export { sampleTime } from './internal/operators/sampleTime';
export { scan } from './internal/operators/scan';
export { sequenceEqual } from './internal/operators/sequenceEqual';
export { share } from './internal/operators/share';
export { shareReplay } from './internal/operators/shareReplay';
export { share, ShareConfig } from './internal/operators/share';
export { shareReplay, ShareReplayConfig } from './internal/operators/shareReplay';
export { single } from './internal/operators/single';
export { skip } from './internal/operators/skip';
export { skipLast } from './internal/operators/skipLast';
Expand All @@ -190,11 +190,11 @@ export { takeLast } from './internal/operators/takeLast';
export { takeUntil } from './internal/operators/takeUntil';
export { takeWhile } from './internal/operators/takeWhile';
export { tap } from './internal/operators/tap';
export { throttle } from './internal/operators/throttle';
export { throttle, ThrottleConfig } from './internal/operators/throttle';
export { throttleTime } from './internal/operators/throttleTime';
export { throwIfEmpty } from './internal/operators/throwIfEmpty';
export { timeInterval } from './internal/operators/timeInterval';
export { timeout } from './internal/operators/timeout';
export { timeout, TimeoutConfig, TimeoutInfo } from './internal/operators/timeout';
export { timeoutWith } from './internal/operators/timeoutWith';
export { timestamp } from './internal/operators/timestamp';
export { toArray } from './internal/operators/toArray';
Expand Down