import type { ApolloClient, TypePolicies } from '@apollo/client';
import type { ApolloController } from '@apollo-elements/core';
declare global {
interface HTMLElementTagNameMap {
'apollo-client': ApolloClientElement;
}
}
/**
* Provides an ApolloClient instance to all nested ApolloElement children,
* even across (open) shadow boundaries.
*
* @element apollo-client
*
* @fires {CustomEvent<{ client: ApolloClient}> client-changed - The client changed
*
* @example
Generate a simple ApolloClient instance
* ```html
*
* ```
*
* @example Prevent network calls when required variables are absent
* ```html
*
* ```
*
* @example Providing a client to a tree of Nodes
* ```html
*
*
*
*
*
* ```
*
* @example Nesting separate clients
* ```html
*
*
*
*
*
*
*
*
*
*
* ```
*/
export declare class ApolloClientElement extends HTMLElement {
#private;
static readonly is: "apollo-client";
static readonly observedAttributes: string[];
/**
* @summary Reference to the `ApolloClient` instance.
*
* Set the `client` property to update all of this element's deep children.
*/
get client(): ApolloClient | null;
set client(client: ApolloClient | null);
/** @summary List of all Apollo Controllers registered to this client. */
get controllers(): readonly (ApolloController)[];
/**
* @summary Type Policies for the client.
*
* Set this property with a `TypePolicies` object to add them to the cache.
*/
get typePolicies(): TypePolicies | undefined;
set typePolicies(typePolicies: TypePolicies | undefined);
/**
* When the URI attribute is set, `` will asynchronously
* create a new ApolloClient instance with some default parameters
*
* @summary URI to the GraphQL server.
* @attr uri
*/
get uri(): string | undefined;
set uri(uri: string | undefined);
/**
* When true, client will not fetch operations that do not have all their non-nullable variables set.
*
* @summary Whether to try to validate operations
* @attr validate-variables
*/
get validateVariables(): boolean;
set validateVariables(v: boolean);
constructor();
attributeChangedCallback(attr: string, oldValue: string, newValue: string): void;
connectedCallback(): void;
/**
* @summary Creates an Apollo client and assigns it to child elements
* @return An `ApolloClient` instance.
*/
createApolloClient(): Promise;
private findDeepInstances;
private addDeepInstance;
/**
* Assigns the element controller's client instance to the child,
* and registers the child to receive the element's new client when its set.
*/
private onElementConnected;
/**
* Performs clean up when the child disconnects
*/
private onElementDisconnected;
/**
* Set the client on the element's controller,
* and if it's a query or subscription controller, attempt to subscribe
*/
private initialize;
}