/// <reference types="react" />
/// <reference types="@staticcms/lite/types/semaphore" />
import { Cursor } from '@staticcms/lite/lib/util';
import API from './API';
import type { AuthScheme, BackendClass, BackendEntry, ConfigWithDefaults, Credentials, DisplayURL, ImplementationFile, PersistOptions, User } from '@staticcms/lite';
import type { AsyncLock } from '@staticcms/lite/lib/util';
import type AssetProxy from '@staticcms/lite/valueObjects/AssetProxy';
import type { Semaphore } from 'semaphore';
import type { GitHubUser } from './types';
type ApiFile = {
    id: string;
    type: string;
    name: string;
    path: string;
    size: number;
};
export default class GitHub implements BackendClass {
    lock: AsyncLock;
    api: API | null;
    options: {
        proxied: boolean;
        API: API | null;
    };
    repo: string;
    branch: string;
    apiRoot: string;
    mediaFolder?: string;
    token: string | null;
    authScheme: AuthScheme;
    _currentUserPromise?: Promise<GitHubUser>;
    _userIsOriginMaintainerPromises?: {
        [key: string]: Promise<boolean>;
    };
    _mediaDisplayURLSem?: Semaphore;
    constructor(config: ConfigWithDefaults, options?: {});
    status(): Promise<{
        auth: {
            status: boolean;
        };
        api: {
            status: any;
            statusPage: string;
        };
    }>;
    authComponent(): import("react").FC<import("@staticcms/lite").AuthenticationPageProps>;
    restoreUser(user: User): Promise<{
        token: string;
        name: string;
        login: string;
    }>;
    pollUntilForkExists({ repo, token }: {
        repo: string;
        token: string;
    }): Promise<void>;
    currentUser({ token }: {
        token: string;
    }): Promise<GitHubUser>;
    authenticate(state: Credentials): Promise<{
        token: string;
        name: string;
        login: string;
    }>;
    logout(): void;
    getToken(): Promise<string | null>;
    getCursorAndFiles: (files: ApiFile[], page: number) => {
        cursor: Cursor;
        files: ApiFile[];
    };
    entriesByFolder(folder: string, extension: string): Promise<import("@staticcms/lite").ImplementationEntry[]>;
    allEntriesByFolder(folder: string, extension: string, pathRegex?: RegExp): Promise<import("@staticcms/lite").ImplementationEntry[]>;
    entriesByFiles(files: ImplementationFile[]): Promise<import("@staticcms/lite").ImplementationEntry[]>;
    getEntry(path: string): Promise<{
        file: {
            path: string;
            id: null;
        };
        data: string;
    } | {
        file: {
            path: string;
            id: null;
        };
        data: string;
    }>;
    getMedia(mediaFolder?: string | undefined): Promise<{
        id: string;
        name: string;
        size: number;
        displayURL: {
            id: string;
            path: string;
        };
        path: string;
        isDirectory: boolean;
    }[]>;
    getMediaFile(path: string): Promise<{
        id: string;
        displayURL: string;
        path: string;
        name: string;
        size: number;
        file: File;
        url: string;
    }>;
    getMediaDisplayURL(displayURL: DisplayURL): Promise<string>;
    persistEntry(entry: BackendEntry, options: PersistOptions): Promise<any>;
    persistMedia(mediaFile: AssetProxy, options: PersistOptions): Promise<{
        id: string;
        name: string;
        size: number;
        displayURL: string;
        path: string;
    }>;
    deleteFiles(paths: string[], commitMessage: string): Promise<void>;
    traverseCursor(cursor: Cursor, action: string): Promise<{
        entries: import("@staticcms/lite").ImplementationEntry[];
        cursor: Cursor;
    }>;
}
export {};
