-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jan Kumer
committed
Aug 1, 2024
1 parent
e4b7397
commit 1dc4837
Showing
6 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
import { AbstractLayer } from '../layer/AbstractLayer'; | ||
import { GetStatsParams, Stats } from '../layer/const'; | ||
import { RequestConfiguration } from '../utils/cancelRequests'; | ||
|
||
export enum StatisticsProviderType { | ||
FIS = 'FIS', | ||
STAPI = 'STAPI', | ||
} | ||
import { StatisticsProviderType } from './const'; | ||
import { Fis } from './Fis'; | ||
import { StatisticalApi } from './StatisticalApi'; | ||
|
||
export interface StatisticsProvider { | ||
getStats(layer: AbstractLayer, params: GetStatsParams, reqConfig?: RequestConfiguration): Promise<Stats>; | ||
} | ||
|
||
export function getStatisticsProvider(statsProvider: StatisticsProviderType): StatisticsProvider { | ||
switch (statsProvider) { | ||
case StatisticsProviderType.STAPI: | ||
return new StatisticalApi(); | ||
case StatisticsProviderType.FIS: | ||
return new Fis(); | ||
default: | ||
throw new Error(`Unknows statistics provider ${statsProvider}`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters