From ddbac9e1eeef0d3adb858f845475d155353d1b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mladen=20Jakovljevi=C4=87?= Date: Mon, 10 May 2021 21:22:17 +0200 Subject: [PATCH] chore: move interfaces to operators/index.ts --- api_guard/dist/types/index.d.ts | 42 ----------------------- api_guard/dist/types/operators/index.d.ts | 42 +++++++++++++++++++++++ src/index.ts | 6 ---- src/operators/index.ts | 12 +++---- 4 files changed, 48 insertions(+), 54 deletions(-) diff --git a/api_guard/dist/types/index.d.ts b/api_guard/dist/types/index.d.ts index d7480c34612..24ba35fb295 100644 --- a/api_guard/dist/types/index.d.ts +++ b/api_guard/dist/types/index.d.ts @@ -86,10 +86,6 @@ export declare class ConnectableObservable extends Observable { refCount(): Observable; } -export interface ConnectConfig { - connector: () => SubjectLike; -} - export declare type Cons = ((arg: X, ...rest: Y) => any) extends (...args: infer U) => any ? U : never; export declare function defer>(observableFactory: () => R): Observable>; @@ -370,11 +366,6 @@ export declare class ReplaySubject extends Subject { next(value: T): void; } -export interface RetryConfig { - count: number; - resetOnSuccess?: boolean; -} - export declare function scheduled(input: ObservableInput, scheduler: SchedulerLike): Observable; export declare class Scheduler implements SchedulerLike { @@ -397,20 +388,6 @@ export interface SequenceError extends Error { export declare const SequenceError: SequenceErrorCtor; -export interface ShareConfig { - connector?: () => SubjectLike; - resetOnComplete?: boolean; - resetOnError?: boolean; - resetOnRefCountZero?: boolean; -} - -export interface ShareReplayConfig { - bufferSize?: number; - refCount: boolean; - scheduler?: SchedulerLike; - windowTime?: number; -} - export declare class Subject extends Observable implements SubscriptionLike { closed: boolean; hasError: boolean; @@ -468,11 +445,6 @@ export declare type Tail = ((...args: X) => any) exten export declare type TeardownLogic = Subscription | Unsubscribable | (() => void) | void; -export interface ThrottleConfig { - leading?: boolean; - trailing?: boolean; -} - export declare function throwError(errorFactory: () => any): Observable; export declare function throwError(error: any): Observable; export declare function throwError(errorOrErrorFactory: any, scheduler: SchedulerLike): Observable; @@ -482,26 +454,12 @@ export interface TimeInterval { value: T; } -export interface TimeoutConfig = ObservableInput, M = unknown> { - each?: number; - first?: number | Date; - meta?: M; - scheduler?: SchedulerLike; - with?: (info: TimeoutInfo) => O; -} - export interface TimeoutError extends Error { info: TimeoutInfo | null; } export declare const TimeoutError: TimeoutErrorCtor; -export interface TimeoutInfo { - readonly lastValue: T | null; - readonly meta: M; - readonly seen: number; -} - export declare function timer(due: number | Date, scheduler?: SchedulerLike): Observable<0>; export declare function timer(startDue: number | Date, intervalDuration: number, scheduler?: SchedulerLike): Observable; export declare function timer(dueTime: number | Date, unused: undefined, scheduler?: SchedulerLike): Observable<0>; diff --git a/api_guard/dist/types/operators/index.d.ts b/api_guard/dist/types/operators/index.d.ts index e5047d791ee..1e2e37dc1ca 100644 --- a/api_guard/dist/types/operators/index.d.ts +++ b/api_guard/dist/types/operators/index.d.ts @@ -47,6 +47,10 @@ export declare function concatWith(...otherSour export declare function connect>(selector: (shared: Observable) => O, config?: ConnectConfig): OperatorFunction>; +export interface ConnectConfig { + connector: () => SubjectLike; +} + export declare function count(predicate?: (value: T, index: number) => boolean): OperatorFunction; export declare function debounce(durationSelector: (value: T) => ObservableInput): MonoTypeOperatorFunction; @@ -218,6 +222,11 @@ export declare function repeatWhen(notifier: (notifications: Observable export declare function retry(count?: number): MonoTypeOperatorFunction; export declare function retry(config: RetryConfig): MonoTypeOperatorFunction; +export interface RetryConfig { + count: number; + resetOnSuccess?: boolean; +} + export declare function retryWhen(notifier: (errors: Observable) => Observable): MonoTypeOperatorFunction; export declare function sample(notifier: Observable): MonoTypeOperatorFunction; @@ -233,9 +242,23 @@ export declare function sequenceEqual(compareTo: Observable, comparator?: export declare function share(): MonoTypeOperatorFunction; export declare function share(options: ShareConfig): MonoTypeOperatorFunction; +export interface ShareConfig { + connector?: () => SubjectLike; + resetOnComplete?: boolean; + resetOnError?: boolean; + resetOnRefCountZero?: boolean; +} + export declare function shareReplay(config: ShareReplayConfig): MonoTypeOperatorFunction; export declare function shareReplay(bufferSize?: number, windowTime?: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction; +export interface ShareReplayConfig { + bufferSize?: number; + refCount: boolean; + scheduler?: SchedulerLike; + windowTime?: number; +} + export declare function single(predicate: BooleanConstructor): OperatorFunction>; export declare function single(predicate?: (value: T, index: number, source: Observable) => boolean): MonoTypeOperatorFunction; @@ -287,6 +310,11 @@ export declare function tap(next?: ((value: T) => void) | null, error?: ((err export declare function throttle(durationSelector: (value: T) => ObservableInput, config?: ThrottleConfig): MonoTypeOperatorFunction; +export interface ThrottleConfig { + leading?: boolean; + trailing?: boolean; +} + export declare function throttleTime(duration: number, scheduler?: SchedulerLike, config?: import("./throttle").ThrottleConfig): MonoTypeOperatorFunction; export declare function throwIfEmpty(errorFactory?: () => any): MonoTypeOperatorFunction; @@ -300,6 +328,20 @@ export declare function timeout(config: Omit(first: Date, scheduler?: SchedulerLike): MonoTypeOperatorFunction; export declare function timeout(each: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction; +export interface TimeoutConfig = ObservableInput, M = unknown> { + each?: number; + first?: number | Date; + meta?: M; + scheduler?: SchedulerLike; + with?: (info: TimeoutInfo) => O; +} + +export interface TimeoutInfo { + readonly lastValue: T | null; + readonly meta: M; + readonly seen: number; +} + export declare function timeoutWith(dueBy: Date, switchTo: ObservableInput, scheduler?: SchedulerLike): OperatorFunction; export declare function timeoutWith(waitFor: number, switchTo: ObservableInput, scheduler?: SchedulerLike): OperatorFunction; diff --git a/src/index.ts b/src/index.ts index 475b2c6980e..1e28bda97d1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -95,12 +95,6 @@ export { NEVER } from './internal/observable/never'; /* Types */ export * from './internal/types'; -export { ConnectConfig } from './internal/operators/connect'; -export { RetryConfig } from './internal/operators/retry'; -export { ShareConfig } from './internal/operators/share'; -export { ShareReplayConfig } from './internal/operators/shareReplay'; -export { ThrottleConfig } from './internal/operators/throttle'; -export { TimeoutConfig, TimeoutInfo } from './internal/operators/timeout'; /* Config */ export { config, GlobalConfig } from './internal/config'; diff --git a/src/operators/index.ts b/src/operators/index.ts index b98bcfab03f..fd5c9dd6c17 100644 --- a/src/operators/index.ts +++ b/src/operators/index.ts @@ -16,7 +16,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'; @@ -70,15 +70,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'; @@ -95,11 +95,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';