import { GoogleDriveFile } from './GoogleDriveFilehandle';
import type { GoogleDriveOAuthInternetAccountConfigModel } from './configSchema';
import type { UriLocation } from '@jbrowse/core/util/types';
import type { Instance } from 'mobx-state-tree';
export interface RequestInitWithMetadata extends RequestInit {
    metadataOnly?: boolean;
}
export default function stateModelFactory(configSchema: GoogleDriveOAuthInternetAccountConfigModel): import("mobx-state-tree").IModelType<{
    id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
    type: import("mobx-state-tree").ISimpleType<string>;
    configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
        name: {
            description: string;
            type: string;
            defaultValue: string;
        };
        description: {
            description: string;
            type: string;
            defaultValue: string;
        };
        authHeader: {
            description: string;
            type: string;
            defaultValue: string;
        };
        tokenType: {
            description: string;
            type: string;
            defaultValue: string;
        };
        domains: {
            description: string;
            type: string;
            defaultValue: never[];
        };
    }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "internetAccountId">>;
} & {
    type: import("mobx-state-tree").ISimpleType<"OAuthInternetAccount">;
    configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
        tokenType: {
            description: string;
            type: string;
            defaultValue: string;
        };
        authEndpoint: {
            description: string;
            type: string;
            defaultValue: string;
        };
        tokenEndpoint: {
            description: string;
            type: string;
            defaultValue: string;
        };
        needsPKCE: {
            description: string;
            type: string;
            defaultValue: boolean;
        };
        clientId: {
            description: string;
            type: string;
            defaultValue: string;
        };
        scopes: {
            description: string;
            type: string;
            defaultValue: string;
        };
        state: {
            description: string;
            type: string;
            defaultValue: string;
        };
        responseType: {
            description: string;
            type: string;
            defaultValue: string;
        };
    }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
        name: {
            description: string;
            type: string;
            defaultValue: string;
        };
        description: {
            description: string;
            type: string;
            defaultValue: string;
        };
        authHeader: {
            description: string;
            type: string;
            defaultValue: string;
        };
        tokenType: {
            description: string;
            type: string;
            defaultValue: string;
        };
        domains: {
            description: string;
            type: string;
            defaultValue: never[];
        };
    }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "internetAccountId">>, undefined>>;
} & {
    type: import("mobx-state-tree").ISimpleType<"GoogleDriveOAuthInternetAccount">;
    configuration: import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
        authEndpoint: {
            description: string;
            type: string;
            defaultValue: string;
        };
        scopes: {
            description: string;
            type: string;
            defaultValue: string;
        };
        domains: {
            description: string;
            type: string;
            defaultValue: string[];
        };
        responseType: {
            description: string;
            type: string;
            defaultValue: string;
        };
    }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
        tokenType: {
            description: string;
            type: string;
            defaultValue: string;
        };
        authEndpoint: {
            description: string;
            type: string;
            defaultValue: string;
        };
        tokenEndpoint: {
            description: string;
            type: string;
            defaultValue: string;
        };
        needsPKCE: {
            description: string;
            type: string;
            defaultValue: boolean;
        };
        clientId: {
            description: string;
            type: string;
            defaultValue: string;
        };
        scopes: {
            description: string;
            type: string;
            defaultValue: string;
        };
        state: {
            description: string;
            type: string;
            defaultValue: string;
        };
        responseType: {
            description: string;
            type: string;
            defaultValue: string;
        };
    }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaType<{
        name: {
            description: string;
            type: string;
            defaultValue: string;
        };
        description: {
            description: string;
            type: string;
            defaultValue: string;
        };
        authHeader: {
            description: string;
            type: string;
            defaultValue: string;
        };
        tokenType: {
            description: string;
            type: string;
            defaultValue: string;
        };
        domains: {
            description: string;
            type: string;
            defaultValue: never[];
        };
    }, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "internetAccountId">>, undefined>>, undefined>>;
}, {
    readonly name: string;
    readonly description: string;
    readonly internetAccountId: string;
    readonly authHeader: string;
    readonly tokenType: string;
    readonly domains: string[];
    readonly toggleContents: React.ReactNode;
    readonly SelectorComponent: import("@jbrowse/core/util/types").AnyReactComponentType | undefined;
    readonly selectorLabel: string | undefined;
} & {
    handlesLocation(location: UriLocation): boolean;
    readonly tokenKey: string;
} & {
    getTokenFromUser(_resolve: (token: string) => void, _reject: (error: Error) => void): void;
    storeToken(token: string): void;
    removeToken(): void;
    retrieveToken(): string | null;
    validateToken(token: string, _loc: UriLocation): Promise<string>;
} & {
    getToken(location?: UriLocation): Promise<string>;
} & {
    addAuthHeaderToInit(init?: RequestInit, token?: string): {
        headers: Headers;
        body?: BodyInit | null;
        cache?: RequestCache;
        credentials?: RequestCredentials;
        integrity?: string;
        keepalive?: boolean;
        method?: string;
        mode?: RequestMode;
        priority?: RequestPriority;
        redirect?: RequestRedirect;
        referrer?: string;
        referrerPolicy?: ReferrerPolicy;
        signal?: AbortSignal | null;
        window?: null;
    };
    getPreAuthorizationInformation(location: UriLocation): Promise<{
        internetAccountType: string;
        authInfo: {
            token: string;
            configuration: any;
        };
    }>;
} & {
    getFetcher(loc?: UriLocation): (input: RequestInfo, init?: RequestInit) => Promise<Response>;
} & {
    openLocation(location: UriLocation): import("@jbrowse/core/util/io").RemoteFileWithRangeCache;
} & {
    readonly codeVerifierPKCE: string;
} & {
    readonly authEndpoint: string;
    readonly tokenEndpoint: string;
    readonly needsPKCE: boolean;
    readonly clientId: string;
    readonly scopes: string;
    state(): string | undefined;
    readonly responseType: "token" | "code";
    readonly refreshTokenKey: string;
} & {
    storeRefreshToken(refreshToken: string): void;
    removeRefreshToken(): void;
    retrieveRefreshToken(): string | null;
    exchangeAuthorizationForAccessToken(token: string, redirectUri: string): Promise<string>;
    exchangeRefreshForAccessToken(refreshToken: string): Promise<string>;
} & {
    addMessageChannel(resolve: (token: string) => void, reject: (error: Error) => void): void;
    deleteMessageChannel(): void;
    finishOAuthWindow(event: MessageEvent, resolve: (token: string) => void, reject: (error: Error) => void): Promise<void>;
    useEndpointForAuthorization(resolve: (token: string) => void, reject: (error: Error) => void): Promise<void>;
    getTokenFromUser(resolve: (token: string) => void, reject: (error: Error) => void): Promise<void>;
    validateToken(token: string, location: UriLocation): Promise<string>;
} & {
    getFetcher(loc?: UriLocation): (input: RequestInfo, init?: RequestInit) => Promise<Response>;
} & {
    readonly toggleContents: import("react/jsx-runtime").JSX.Element;
    readonly selectorLabel: string;
} & {
    getFetcher(location?: UriLocation): (input: RequestInfo, init?: RequestInitWithMetadata) => Promise<Response>;
    openLocation(location: UriLocation): GoogleDriveFile;
    validateToken(token: string, location: UriLocation): Promise<string>;
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
export type GoogleDriveOAuthStateModel = ReturnType<typeof stateModelFactory>;
export type GoogleDriveOAuthModel = Instance<GoogleDriveOAuthStateModel>;
