leaflet-styleeditor-minified
Version:
Edit the style of features drawn within Leaflet.
60 lines (59 loc) • 2.44 kB
TypeScript
import { FormElement, FormElementClass } from '../formElements';
import { StyleEditorClass } from '../StyleEditorClass';
import { StyleEditorImpl } from '../StyleEditorImpl';
export interface FormClass {
new (styleEditor: StyleEditorImpl, parentUiElement: HTMLElement): Form;
}
/**
* Forms consist of FormElements and are shown in the StyleForm
* There exists a MarkerForm to modify Markers and a GeometryForm to modify Geometries (i.e. rectangles...)
* Style options based on:
* - path: https://leafletjs.com/reference.html#path-options
* - icon: https://leafletjs.com/reference.html#icon
*/
export declare abstract class Form extends StyleEditorClass {
constructor(styleEditor: StyleEditorImpl, parentUiElement: HTMLElement);
protected formOptionsKey: String;
protected formElements: Record<string, FormElementClass>;
private parentUiElement;
protected initializedElements: Record<string, FormElement>;
/** create every FormElement in the parentUiElement */
create(): void;
/** hide the Form including its FormElements */
hide(): void;
/** hide the FormElements */
hideFormElements(): void;
/** hide the Form */
hideForm(): void;
/** make FormElements and Form visible */
show(): void;
/** hook which is called at the beginning of the show function */
preShow(): void;
/** make every FormElement visible */
showFormElements(): void;
/** make the Form visible */
showForm(): void;
/** inform FormElements the selected style has changed, so they can adapt */
style(): void;
/** inform Form it lost it's focus */
lostFocus(): void;
/**
* @returns a Boolean indicating if the @param formElement should be shown
*/
showFormElement(formElement: FormElement): void;
/**
* get the Class of the Formelement to instanciate
* @param {*} styleOption, the styleOption to get the FormElement for
*/
getFormElementClass(styleOption: string): FormElementClass;
/**
* check whether a FormElement should be shown
* @param {*} styleOption, the styleOption to check
*/
showFormElementForStyleOption(styleOption: any): boolean;
/**
* get Leaflet.StyleEditor standard FormElement class for given styleOption
* @param {*} styleOption, the styleOption to get the standard class for
*/
getFormElementStandardClass(styleOption: string): FormElementClass;
}