import React from "react";
import "../../../../../assets/css/dialogs.css";
interface IState {
    form: {
        name?: string;
        url?: string;
        tags?: string;
    };
    validation: {
        name: boolean;
        url: boolean;
    };
    validateOnInputChange: boolean;
}
interface IProps {
    onDone: () => void;
    customURLValidation: ((url: string) => [boolean, string]) | null;
    customAddComponent: ((formData: any, callback: (error: any | null) => void) => void) | null;
    beforeAddComponent: ((formData: any) => object) | null;
}
/**
 * A component that has a form to accept new app properties
 * like name, url and tags, validates user input then saves it
 * to persistent store. Showing or hiding this component is up to
 * parent component.
 * @example <AddNewAppForm onDone={this.someHandlerFunction}></AddNewAppForm>
 */
export default class AddNewAppForm extends React.Component<IProps, IState> {
    #private;
    constructor(props: IProps);
    /**
     * Calls the storeActions.addApp() method
     * to save the new app in store.
     */
    onSubmit(): void;
    addNewAppCallback(error: any): void;
    addNewApp(form: IState["form"], cb: (err?: any) => void): void;
    /**
     * Clears all form inputs
     */
    onClear(): void;
    /**
     * Just cancel and do not add the app
     */
    onCancel(): void;
    /**
     * Calls the passed onDone property to let the parent component
     * know that we finished processing user's request (submit/cancel)
     */
    done(): void;
    /**
     * When the url changes, validate it (after submit), or set state.
     * @param {keyboardEvent} e
     */
    onURLChanged(e: React.ChangeEvent<HTMLInputElement>): void;
    /**
     * When the name changes, validate it (after submit), or set state.
     * @param {keyboardEvent} e
     */
    onAppNameChanged(e: React.ChangeEvent<HTMLInputElement>): void;
    /**
     * Attempt to make a URL object, if successful the provided URL is valid.
     * If the URL constructor determines the provided string to be invalid it throws a TypeError.
     *
     * @param {string} url
     * @return boolean
     */
    validateURL(url?: string): boolean;
    /**
     * When the url changes, validate it (after submit), or set state.
     * @param {string} name
     */
    validateName(name?: string): boolean;
    /**
     * Allows user to skip the protocol. Puts one in there if they don't have it.
     */
    fixURL(): void;
    /**
     * Removes empty spaces from beginning and end of line
     */
    fixName(): void;
    /**
     * Hotkey handler
     * Escape clears the form and hides it.
     * Enter submits.
     * @param {} e
     */
    onKeyDown(e: any): void;
    componentDidMount(): void;
    componentWillUnmount(): void;
    render(): React.JSX.Element;
}
export {};
//# sourceMappingURL=AddNewAppForm.d.ts.map