import { DcuplUpdateMessage } from '../changeDetection'; import { PivotOptions } from '../pivot'; import { AggregationOptions } from './aggregation.types'; import { DcuplFacetOptions } from './facets.types'; import { DcuplGroupByOptions } from './group-by.types'; import { DcuplItemsOptions } from './list.types'; import { DcuplGlobalQueryOptions } from './query.types'; import { SuggestionOptions } from './suggestion.types'; export type DcuplInitOptions = { config?: DcuplInitConfig; /** * deprecated - use config.quality instead */ errorTracking?: DcuplInitErrorTrackingConfig; /** * Enables/disables the model & data quality checks */ quality?: DcuplInitQualityConfig; /** * Fine tune performance settings */ performance?: DcuplInitPerformanceConfig; analytics?: DcuplInitErrorAnalyticsConfig; referenceMetadata?: DcuplInitReferenceMetadataConfig; }; export type DcuplInitPerformanceConfig = { /** * Enable/disable internal API caching */ cache?: { enabled: boolean; }; /** * Enable/disable usage of deep data clones * This can be useful to avoid side effects when altering data inside your application * If you are sure that you are not altering the data you can disable this feature to improve performance */ clone?: { enabled: boolean; }; }; export type DcuplInitQualityConfig = { enabled: boolean; }; export type DcuplInitErrorTrackingConfig = { enabled: boolean; }; export type DcuplInitErrorAnalyticsConfig = { enabled: boolean; }; export type DcuplInitReferenceMetadataConfig = { enabled: boolean; }; export type DcuplInitConfig = { /** * The project id optained from the dcupl console */ projectId?: string; /** * The read only API key optained from the dcupl console */ apiKey?: string; /** * The CDN version to use * If not set the latest 'draft' version is used */ version?: string; }; export type DcuplErrorResponse = { name?: string; message?: string; type?: 'fatal' | 'minor'; }; export type DcuplMetrics = { total?: number; core?: number; }; export interface DcuplFunction { name: string; args: Array; } export type DcuplResponse = { id?: string; func: DcuplFunction; result?: T; error?: DcuplErrorResponse; metrics: DcuplMetrics; }; export type DcuplGlobalItemsOptions = DcuplItemsOptions & { modelKey: string; }; export type CallbackFunction = (item: DcuplUpdateMessage) => void; export type DcuplGlobalPivotOptions = { modelKey: string; options: PivotOptions; query?: DcuplGlobalQueryOptions; }; export type DcuplGlobalAggregateOptions = { modelKey: string; options: AggregationOptions; query?: DcuplGlobalQueryOptions; }; export type DcuplGlobalSuggestionOptions = { modelKey: string; options: SuggestionOptions; query?: DcuplGlobalQueryOptions; }; export type DcuplGlobalGroupByOptions = { modelKey: string; options: DcuplGroupByOptions; query?: DcuplGlobalQueryOptions; }; export type DcuplGlobalFacetOptions = { modelKey: string; options: DcuplFacetOptions; query?: DcuplGlobalQueryOptions; }; export type DcuplGlobalMetadataOptions = { modelKey: string; query?: DcuplGlobalQueryOptions; };