import React, { ReactElement } from 'react'; import { TranslationsPromises } from '../boot/server'; import { SchemaExtensions } from '../boot/server/createApolloServer'; import { DocumentNode } from 'graphql'; import { Tracker } from '../analytics/tracking'; import { PluginDefinition } from 'apollo-server-core'; import { PreLoaderProviderConfig } from '../hooks/useRoutePreload'; import { SubschemaConfig } from '@graphql-tools/delegate/types'; import { ServerTracker } from '../server/tracking/types'; export interface IntlOptions { translations: TranslationsPromises; defaultLocale: string; options?: any; } export interface ApolloConfig { useGraphQLProxyServer?: boolean; graphQLURI?: string; token?: string; shopid?: string; engineApiKey?: string; enableGateway?: boolean; channelsQuery?: DocumentNode; persistedQueries?: { query: DocumentNode; variables?: Record; }[]; } export interface ChannelOverrides { [id: number]: Omit; } export interface OptimizeConfig { container: string; experimentId: string; variantWeights: number[]; } export interface Routes { [routeName: string]: { path: string; [any: string]: any; }; } interface Theme { breakpoints: { [label: string]: string; }; [key: string]: any; } export interface BootOptions { theme: Theme; apolloConfig: ApolloConfig; /** Deprecated */ trackingID?: string; additionalGtagTrackingIds: string[]; brandCustomField?: string; useArticleNumberAsId?: boolean; tagManagerID: string; intl: IntlOptions; channelOverrides: ChannelOverrides; schemaExtensions?: SchemaExtensions; apolloServerplugins?: PluginDefinition[]; relewareEnabled?: boolean; disableGeoRedirect: boolean; singleDomainMode: boolean; tracking: { disableDefaultProductTracking?: boolean; }; trackers?: Tracker[]; serverTrackers?: ServerTracker[]; preserveRedirect: boolean; structuredData: { disableDefaultProductData?: boolean; disableDefaultCategoryData?: boolean; disableDefaultPageData?: boolean; }; openGraph: { disableDefaultProductData?: boolean; disableDefaultGeneralData?: boolean; }; googleMapsApiKey?: string; loginPath: string; pathsWithNoAuthRequired: string[]; optimize?: OptimizeConfig; routes?: Routes; preload?: PreLoaderProviderConfig; sentry?: Sentry; /** Server specific configuration */ server?: Server; usePrimaryRouteForProducts?: boolean; useTrackingConsentAPI?: boolean; useIndefinitelySavedCart?: boolean; /** Enable this if you want to use Polyfill.io service before booting shop on client */ usePolyfilling?: boolean; useMobileImageSizes?: boolean; /** Use Cloudflare image transformation instead of the default Akamai-based one. * Pass `true` to enable for every channel, or an array of channel IDs to enable * only on those channels. Defaults to `false` (Akamai). */ useCloudflareImageTransformation?: boolean | number[]; } interface Sentry { /** DSN used to track client side errors */ clientDSN?: string; /** DSN used to track server side errors */ serverDSN?: string; /** A list of strings or RegExps to filter errors to ignore */ ignoreErrors?: (string | RegExp)[]; } interface Server { /** GraphQL proxy server configuration */ graphql?: GraphQL; } interface GraphQL { /** Schema extensions to the GraphQL proxy server */ extensions: Promise>>[]; } export declare const ShopConfigContext: React.Context; export declare function ConfigProvider({ config: userConfig, children, ...rest }: { config: BootOptions; children: React.ReactNode; }): ReactElement; export {};