import { ProjectParent } from './ProjectParent.js';
import { type IProjectDefinitionProperty } from './ProjectDefinitionProperty.js';
import { ProjectItem, type IProjectItem } from './ProjectItem.js';
import { type ProjectRequest, type IProjectRequest } from './ProjectRequest.js';
import { type HttpProject, type IEnvironmentCreateOptions } from './HttpProject.js';
import { type IThing } from './Thing.js';
import { Environment, type IEnvironment } from './Environment.js';
import { ProjectFolderKind } from './kinds.js';
export declare const DefaultFolderName = "New folder";
export interface IFolderAddOptions {
    /**
     * Optionally the position at which to add the request into the list of items.
     */
    index?: number;
}
export interface IFolderCloneOptions {
    /**
     * By default it clones the folder with all requests in it.
     * Set this to `true` to skip copying the requests along with the folder.
     */
    withoutRequests?: boolean;
    /**
     * By default it clones the folder with all folders in it.
     * Set this to `true` to skip copying the folders along with the folder.
     */
    withoutFolders?: boolean;
    /**
     * The target project where to put the copied folder.
     * When the target project is not the same as the source project then the folder
     * is put into the project root rather than the parent folder (as it would when cloning
     * a folder inside the same project).
     */
    targetProject?: HttpProject;
    /**
     * The **key** of the target folder.
     *
     * By default it clones the folder to its parent unless the clone is attached to another project.
     * When the target folder is set then it places the clone under the passed target folder.
     */
    targetFolder?: string;
}
export interface IProjectFolder extends IProjectDefinitionProperty {
    kind: typeof ProjectFolderKind;
    /**
     * The identifier of the folder.
     */
    key: string;
    /**
     * Folder meta
     */
    info: IThing;
    /**
     * The ordered list of HTTP requests / folders in the projects.
     * The UI uses this to manipulate the view without changing the definitions.
     */
    items: IProjectItem[];
    /**
     * Timestamp when the folder was last updated.
     */
    updated: number;
    /**
     * Timestamp when the folder was created.
     */
    created: number;
}
/**
 * Represents a folder, a group of requests or other folders, in a folder.
 */
export declare class ProjectFolder extends ProjectParent {
    /**
     * The default name of the folder.
     */
    static get defaultName(): string;
    kind: string;
    /**
     * A reference to the top level project object.
     */
    project: HttpProject;
    /**
     * Timestamp when the folder was last updated.
     */
    updated: number;
    /**
     * Timestamp when the folder was created.
     */
    created: number;
    constructor(project: HttpProject, input?: string | IProjectFolder);
    /**
     * Creates a new project folder clearing anything that is so far defined.
     *
     * Note, this throws an error when the project folder is not a project folder.
     */
    new(init: IProjectFolder): void;
    /**
     * Checks whether the input is a definition of a project folder.
     */
    static isProjectFolder(input: unknown): boolean;
    toJSON(): IProjectFolder;
    /**
     * Creates a new ProjectFolder object from a name.
     * @param project The top-most project.
     * @param name The name to set.
     */
    static fromName(project: HttpProject, name?: string): ProjectFolder;
    /**
     * Appends an instance of a folder to a project.
     *
     * @param folder The folder to add to this project.
     * @returns The added folder.
     */
    addFolder(folder: ProjectFolder | IProjectFolder): ProjectFolder;
    /**
     * Appends a new folder to the project or a sub-folder.
     *
     * @param name The name to set. Optional.
     * @returns The newly inserted folder. If the folder already existed it returns its instance.
     */
    addFolder(name?: string): ProjectFolder;
    /**
     * Appends a new request to the folder. It updates the project to add the request definition.
     * @param request The request to append to the folder.
     * @returns The key of newly inserted request.
     */
    addRequest(request: IProjectRequest | ProjectRequest | string, opts?: IFolderAddOptions): ProjectRequest;
    /**
     * Adds an environment to the project.
     * @param env The definition of the environment to use to create the environment or it's name
     * @returns The same or created environment.
     */
    addEnvironment(env: IEnvironment | Environment | string, opts?: IEnvironmentCreateOptions): Environment;
    /**
     * Lists items (not the actual definitions!) that are folders.
     */
    listFolderItems(): ProjectItem[];
    /**
     * Lists items (not the actual definitions!) that are requests.
     */
    listRequestItems(): ProjectItem[];
    /**
     * Lists folders in this folder.
     */
    listFolders(): ProjectFolder[];
    /**
     * Lists requests in this folder.
     */
    listRequests(): ProjectRequest[];
    /**
     * The callback called when the object is attached to a parent.
     * This is called when the object is created and inserted to a project or a folder
     * and when the object is moved between folders.
     */
    attachedCallback(): void;
    /**
     * The callback called when the object is detached from its parent.
     * This callback is called when the item is deleted from a folder or a project,
     * or when the item is about to be moved to another folder.
     */
    detachedCallback(): void;
    /**
     * @returns The instance of the HttpProject or a ProjectFolder that is a closes parent of this instance.
     */
    getParent(): ProjectFolder | HttpProject | undefined;
    /**
     * @returns A reference to the parent folder or the top-level HTTP project.
     */
    getProject(): HttpProject;
    /**
     * Removes this folder from the project.
     */
    remove(): void;
    /**
     * @returns The list of environments defined in this folder
     */
    getEnvironments(): Environment[];
    /**
     * @param key The environment key to read.
     */
    getEnvironment(key: string): Environment | undefined;
    /**
     * Removes an environment from the folder or a sub-folder.
     *
     * @param key the key of the environment to remove
     * @returns The removed environment, if any.
     */
    removeEnvironment(key: string): Environment | undefined;
    /**
     * This is a link to the `getEnvironments()`. The difference is that on the
     * project level it won't return environments defined with the class initialization.
     */
    listEnvironments(): Environment[];
    /**
     * Makes a copy of this folder.
     * By default it attaches the copied folder to the same parent.
     * It also, by default, copies requests declared in this folder.
     *
     * Use the options dictionary to control these behaviors.
     *
     * @param opts Cloning options
     */
    clone(opts?: IFolderCloneOptions): ProjectFolder;
    /**
     * Clones the current requests to the target folder.
     *
     * @param folder The target folder into which to put the requests. The folder has to have
     *               the target project attached to it.
     * @param project The originating project where the definitions are stored
     */
    protected cloneRequests(folder: ProjectFolder, project: HttpProject): void;
    /**
     * Clones the sub-folders to the target folder.
     *
     * @param folder The target folder into which to put the sub-folders. The folder has to have the target project
     *               attached to it.
     * @param project The originating project where the definitions are stored
     * @param withRequests Whether to clone requests with the folder.
     */
    protected cloneSubFolders(folder: ProjectFolder, project: HttpProject, withRequests?: boolean): void;
}
//# sourceMappingURL=ProjectFolder.d.ts.map