UNPKG

@rcsb/rcsb-saguaro-app

Version:
36 lines (35 loc) 2.94 kB
import { PolymerEntityInstanceTranslate } from "../../RcsbUtils/Translators/PolymerEntityInstanceTranslate"; import { RcsbFv } from "@rcsb/rcsb-saguaro/lib/RcsbFv/RcsbFv"; import { RcsbFvModuleBuildInterface, RcsbFvModuleInterface, RcsbFvModulePublicInterface } from "../RcsbFvModule/RcsbFvModuleInterface"; import { SelectButtonConfigInterface } from "../RcsbFvComponents/ComponentsManager"; import { GroupedOptionsInterface, SelectOptionInterface } from "../RcsbFvComponents/SelectButton"; export interface CreateFvInterface { elementId: string; fvModuleI: new (elementId: string, rcsbFv: RcsbFv) => RcsbFvModuleInterface; config: RcsbFvModuleBuildInterface; p?: PolymerEntityInstanceTranslate; } /** * This class provides static methods to build PFVs. PFVs should be always created using methods in this class * */ export declare class RcsbFvCoreBuilder { /** * @description The main purpose of this method is to have a unique point where Entity to Instance maps are collected. It forces to generate a <PolymerEntityInstanceTranslate> that will be passed to the PFV create method <getPolymerEntityInstanceMapAndBuildFv> * @param entryId PDB entry Id * @param createFvBuilder This is the function used to create the PFV. Cases where buttons are needed will be created in custom definitions of createFvBuilder. The PFV should be always created calling RcsbFvCoreBuilder.createFv * */ static getPolymerEntityInstanceMapAndCustomBuildFv(entryId: string, createFvBuilder: (p: PolymerEntityInstanceTranslate) => Promise<RcsbFvModulePublicInterface>): Promise<RcsbFvModulePublicInterface>; /** * @description Generic method to create PFVs. This method must be used if no other elements such as buttons are needed. * */ static getPolymerEntityInstanceMapAndBuildFv(elementId: string, entryId: string, fvModuleI: new (elementId: string, rcsbFv: RcsbFv) => RcsbFvModuleInterface, config: RcsbFvModuleBuildInterface): Promise<RcsbFvModulePublicInterface>; /** * @description This method implements a centralized point where PFVs are created. All PFV should be created using this method directly or through <CreateFvInterface.getPolymerEntityInstanceMapAndBuildFv>. In any case PFV should be built using a custom implementation. * */ static createFv(createFvI: CreateFvInterface): Promise<RcsbFvModulePublicInterface>; static unmount(elementId: string): void; static buildSelectButton(elementFvId: string, selectButtonId: string, options: Array<SelectOptionInterface> | Array<GroupedOptionsInterface>, config?: SelectButtonConfigInterface): void; static clearAdditionalSelectButton(elementFvId: string, selectButtonId: string): void; static addSelectButton(elementFvId: string, selectButtonId: string, options: Array<SelectOptionInterface>, config?: SelectButtonConfigInterface): void; static showMessage(elementId: string, message: string): void; }