UNPKG

2.19 kBTypeScriptView Raw
1import React from 'react';
2import { TranslationsPromises } from '../boot/server';
3import { SchemaExtensions } from '../boot/server/createApolloServer';
4import { DocumentNode } from 'graphql';
5import { Tracker } from '../analytics/tracking';
6import { PluginDefinition } from 'apollo-server-core';
7import { PreLoaderProviderConfig } from '../hooks/useRoutePreload';
8export interface IntlOptions {
9 translations: TranslationsPromises;
10 defaultLocale: string;
11 options?: any;
12}
13export interface ApolloConfig {
14 graphQLURI?: string;
15 token?: string;
16 shopid?: string;
17 engineApiKey?: string;
18 enableGateway?: boolean;
19 channelsQuery?: DocumentNode;
20 persistedQueries?: {
21 query: DocumentNode;
22 variables?: {};
23 }[];
24}
25export interface ChannelOverrides {
26 [channelName: string]: BootOptions;
27}
28export interface OptimizeConfig {
29 container: string;
30 experimentId: string;
31 variantWeights: number[];
32}
33export interface Routes {
34 [routeName: string]: {
35 path: string;
36 [any: string]: any;
37 };
38}
39interface Theme {
40 breakpoints: {
41 [label: string]: string;
42 };
43 [key: string]: any;
44}
45export interface BootOptions {
46 theme: Theme;
47 apolloConfig: ApolloConfig;
48 trackingID: string;
49 useArticleNumberAsId?: boolean;
50 tagManagerID: string;
51 sentryClientDSN: string;
52 sentryServerDSN: string;
53 intl: IntlOptions;
54 channelOverrides: ChannelOverrides;
55 schemaExtensions?: SchemaExtensions;
56 apolloServerplugins?: PluginDefinition[];
57 relewareEnabled?: boolean;
58 disableGeoRedirect: boolean;
59 singleDomainMode: boolean;
60 trackers?: Tracker[];
61 preserveRedirect: boolean;
62 structuredData: {
63 disableDefaultProductData?: boolean;
64 };
65 googleMapsApiKey?: string;
66 loginPath: string;
67 pathsWithNoAuthRequired: string[];
68 optimize?: OptimizeConfig;
69 routes?: Routes;
70 preload?: PreLoaderProviderConfig;
71}
72export declare const ShopConfigContext: React.Context<BootOptions>;
73export declare function ConfigProvider({ config: userConfig, children, ...rest }: {
74 config: BootOptions;
75 children: React.ReactNode;
76}): JSX.Element;
77export {};