@jirkasa/code-box
Version:
Showcase code samples on the web with a container that lets users select and display different samples.
45 lines (44 loc) • 2.1 kB
TypeScript
import ProjectCodeBox from "../../code-box/project-code-box/ProjectCodeBox";
import CodeBoxCodeView from "../CodeBoxCodeView";
/** Represents code view of project code box. */
declare class ProjectCodeBoxCodeView extends CodeBoxCodeView<ProjectCodeBox> {
/**
* Returns path to folder in which the code view is located.
* @returns Path to folder in which the code view is located.
*/
getFolderPath(): string | null;
/**
* Moves code view to folder (if folder does not exist, it is created; package is not changed).
* @param folderPath Path to folder.
* @returns Indicates whether code view has been successfully moved to folder (it can return false if there already is code view with the same name).
*/
moveToFolder(folderPath: string): boolean;
/**
* Returns file name of code view.
* @returns File name of code view.
*/
getFileName(): string | null;
/**
* Changes file name of code view.
* @param newName New file name.
* @returns Indicates whether file name of code view has been successfuly changed (it can return false if there already is code view with the same name in the same folder).
*/
changeFileName(newName: string): boolean;
/**
* Returns package of code view.
* @returns Package of code view. If null is returned, code view belongs to default package. If undefined is returned, code view doesn't belong to any package.
*/
getPackage(): string | null | undefined;
/**
* Changes package of code view.
* @param packageName Package name (null for default package). If package does not exist, it is created.
* @param keepFolderPath Determines whether code view should stay in the same folder (if false, code view can be moved to different folder based on package).
* @returns Indicates whether change has been successfully completed.
*/
changePackage(packageName: string | null, keepFolderPath: boolean): boolean;
/**
* Removes code view from package.
*/
removePackage(): void;
}
export default ProjectCodeBoxCodeView;