import { AxiosInstance } from 'axios' ; import { SegmentQuery , SegmentsResponse } from '../@types' ; export default function ( client ) { return { async getSegments ( params = { } ) { const { data } = await this . getSegmentsRaw ( params ) ; return data ; } , async getSegmentsCount ( params = { } ) { const { meta } = await this . getSegmentsRaw ( params ) ; return meta . pagination . count ; } , async getSegmentsRaw ( params = { } ) { return await client . get ( 'segments' , { params } ) ; } , } ; }