/// <reference types="react" />
import * as React from 'react';
import { Playground as IPlayground } from './Playground';
import { GraphQLConfig } from '../graphqlConfig';
import { ISettings } from '../types';
export interface Props {
    endpoint?: string;
    endpointUrl?: string;
    subscriptionEndpoint?: string;
    setTitle?: boolean;
    settings?: ISettings;
    folderName?: string;
    configString?: string;
    showNewWorkspace?: boolean;
    isElectron?: boolean;
    canSaveConfig?: boolean;
    onSaveConfig?: (configString: string) => void;
    onNewWorkspace?: () => void;
    getRef?: (ref: any) => void;
    session?: any;
    env?: any;
    config?: GraphQLConfig;
    configPath?: string;
}
export interface State {
    endpoint: string;
    subscriptionPrefix?: string;
    subscriptionEndpoint?: string;
    shareUrl?: string;
    settingsString: string;
    settings: ISettings;
    configIsYaml?: boolean;
    configString?: string;
    activeProjectName?: string;
    activeEnv?: string;
    headers?: any;
}
export default class MiddlewareApp extends React.Component<Props, State> {
    playground: IPlayground;
    constructor(props: Props);
    getGraphcoolSubscriptionEndpoint(endpoint: any): any;
    migrateSettingsString(settingsString: string): string;
    componentWillReceiveProps(nextProps: Props): void;
    getInitialActiveEnv(config?: GraphQLConfig): {
        projectName?: string;
        activeEnv?: string;
    };
    isConfigYaml(configString: string): boolean;
    absolutizeUrl(url: any): any;
    normalizeSubscriptionUrl(endpoint: any, subscriptionEndpoint: any): any;
    componentDidMount(): void;
    render(): JSX.Element;
    handleUpdateSessionCount: () => void;
    getSessionCount: (endpoint: string) => number;
    getPlaygroundRef: (ref: any) => void;
    handleStartEditConfig: () => void;
    handleChangeConfig: (configString: string) => void;
    handleSaveConfig: () => void;
    handleSelectEnv: (env: string, projectName?: string | undefined) => void;
    private getSettings(settingsString?);
    private normalizeSettings(settings);
    private handleChangeSettings;
    private handleSaveSettings;
    private share;
    private normalizeEndpoint(endpoint);
    private handleChangeEndpoint;
    private handleChangeSubscriptionsEndpoint;
    private getTitle();
    private updateSubscriptionsUrl();
    private getSubscriptionsUrlCandidated(endpoint);
    private wsEndpointValid(url);
    private getProjectId(endpoint);
}
