import { ComponentType, JSX } from 'react';

export interface CodeSyncModalProps {
    visible: boolean;
    codeSyncProgress?: number;
    otaUpdateError?: boolean;
    onCancelPress?: () => void;
    onRestartPress?: () => void;
    appLogo?: any;
    showCancelButton?: boolean;
    themeColor?: string;
    downloadCompleteMessage?: string;
    downloadingInProgressMessage?: string;
    downloadErrorMessage?: string;
    cancelButtonLabel?: string;
    restartButtonLabel?: string;
    percentageTextStyle?: object;
    messageStyle?: object;
    mainContaineStyle?: object;
    cancelButtonLabelStyle?: object;
    restartButtonLabelStyle?: object;
    customUI?: JSX.Element;
}

export interface CodeSyncConfig {
    /**
     * When true, allows code-sync functionality to run in development mode.
     * Defaults to false.
     */
    enableInDevMode?: boolean;
    baseUrl: string,
    checkForUpdateEndPoint: string
}


export const CodeSyncModal: ComponentType<CodeSyncModalProps>;

export function useCheckCodeSync(): {
    checkForCodeSync: (options: {
        params: { project_key: string; version: string };
        onDownloadProgress?: (val: number) => void;
        onStartUpdate?: () => void;
        onEndUpdate?: () => void;
        onUpdateFailed?: () => void;
        onUpdateNotAvailable?: () => void;
    }) => Promise<any>;
};

export class CheckCodeSyncClass {
    checkForCodeSync(options: {
        params: { project_key: string; version: string };
        onDownloadProgress?: (val: number) => void;
        onStartUpdate?: () => void;
        onEndUpdate?: () => void;
        onUpdateFailed?: () => void;
        onUpdateNotAvailable?: () => void;
    }): Promise<any>;
}

export function restartApp(): void;

export function setCodeSyncConfig(config: CodeSyncConfig): void;
