import { Observable } from 'rxjs' ; import { ODataApi } from '../../api' ; import { $COUNT } from '../../constants' ; import { PathSegmentNames , QueryOptionNames } from '../../types' ; import { ODataPathSegments } from '../path' ; import { ODataQueryOptions } from '../query' ; import { ODataResource } from '../resource' ; import { ODataOptions } from './options' ; export class ODataCountResource < T > extends ODataResource < T > { static factory < T > ( api , { segments , query , } ) { segments . add ( PathSegmentNames . count , $COUNT ) . type ( 'Edm.Int32' ) ; query ?. keep ( QueryOptionNames . filter , QueryOptionNames . search ) ; return new ODataCountResource < T > ( api , { segments , query } ) ; } protected override get ( options ? ) { return super . get ( { responseType : 'value' , ... options } ) ; } param options returns fetch ( options ? ) { return this . get ( options ) ; } }