import { ApolloLink } from '@apollo/client/core'; import { AuthOptions } from 'aws-appsync-auth-link'; /*! * Copyright 2017-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 */ declare const CONTROL_EVENTS_KEY = "@@controlEvents"; type UrlInfo = { url: string; auth: AuthOptions; region: string; }; /** * Route connections through a proxy (e.g. CloudFront) instead of connecting * directly to AppSync. The library will send traffic to the proxy URL while * using the original AppSync host for authentication. * * @example * ```ts * { * url: 'https://xxx.appsync-api.us-east-1.amazonaws.com/graphql', * region: 'us-east-1', * auth: { type: AUTH_TYPE.API_KEY, apiKey: 'da2-xxx' }, * proxy: { url: 'https://d111111abcdef8.cloudfront.net/graphql' } * } * ``` */ type ProxyConfig = { /** The proxy endpoint that sits in front of AppSync (e.g. a CloudFront distribution URL). */ url: string; }; type AppSyncRealTimeSubscriptionConfig = UrlInfo & { keepAliveTimeoutMs?: number; /** Optional proxy configuration for routing through CloudFront or another CDN. */ proxy?: ProxyConfig; }; declare function createSubscriptionHandshakeLink(args: AppSyncRealTimeSubscriptionConfig, resultsFetcherLink?: ApolloLink): ApolloLink; declare function createSubscriptionHandshakeLink(url: string, resultsFetcherLink?: ApolloLink): ApolloLink; export { CONTROL_EVENTS_KEY, createSubscriptionHandshakeLink };