hunk.code_window: /* tslint:disable:max-line-length */
   export function publish<T>(): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
   export function publish<T, R>(selector: OperatorFunction<T, R>): OperatorFunction<T, R>;
   export function publish<T>(selector: MonoTypeOperatorFunction<T>): MonoTypeOperatorFunction<T>;
   /* tslint:enable:max-line-length */
   /**
    * Returns a ConnectableObservable, which is a variety of Observable that waits until its connect method is called
  
hunk.labels: keep keep keep replace keep keep keep keep keep
hunk.after_edit: export function publish<T, O extends ObservableInput<any>>(selector: (shared: Observable<T>) => O): OperatorFunction<T, ObservedValueOf<O>>;
  
hunk.file_path: src/internal/operators/publish.ts
hunk.type: replace
file: import { of } from 'rxjs';
  import { tap } from 'rxjs/operators';
  
  it('should infer correctly', () => {
    const a = of(1, 2, 3).pipe(tap()); // $ExpectType Observable<number>
  });
  
  it('should accept partial observer', () => {
    const a = of(1, 2, 3).pipe(tap({ next: (x: number) => { } })); // $ExpectType Observable<number>
    const b = of(1, 2, 3).pipe(tap({ error: (x: any) => { } })); // $ExpectType Observable<number>
    const c = of(1, 2, 3).pipe(tap({ complete: () => { } })); // $ExpectType Observable<number>
  });
  
  it('should not accept empty observer', () => {
    const a = of(1, 2, 3).pipe(tap({})); // $ExpectError
  });
  
  it('should enforce type for next observer function', () => {
    const a = of(1, 2, 3).pipe(tap({ next: (x: string) => { })); // $ExpectError
  });
  