comicaljs
Version: 
Edit cartoon bubble frames around an HTML element
52 lines (51 loc) • 3.32 kB
TypeScript
import { Bubble } from "./bubble";
import { ContainerData } from "./containerData";
interface IUserInterfaceProperties {
    tailHandleColor: string;
}
export declare class Comical {
    static backColor: paper.Color;
    static tailHandleColor: paper.Color;
    private static selectorForBubblesWhichTailMidpointMayOverlap;
    static activeContainers: Map<Element, ContainerData>;
    static activeBubble: Bubble | undefined;
    static activeBubbleListener: ((active: HTMLElement | undefined) => void) | undefined;
    static setUserInterfaceProperties(props: IUserInterfaceProperties): void;
    static setSelectorForBubblesWhichTailMidpointMayOverlap(selector: string): void;
    static getSelectorForBubblesWhichTailMidpointMayOverlap(): string;
    static startEditing(parents: HTMLElement[]): void;
    static stopEditing(): void;
    static convertCanvasToSvgImg(parent: HTMLElement): void;
    private static isAnyBubbleVisible;
    private static stopMonitoring;
    static activateElement(contentElement: HTMLElement | undefined): void;
    static activateBubble(newActiveBubble: Bubble | undefined): void;
    static hideHandles(): void;
    static update(container: HTMLElement): void;
    private static sortBubbleListTopLevelFirst;
    static getMaxLevel(element: HTMLElement): number;
    static setItemOnClick(item: paper.Item, clickAction: () => void): void;
    static isDraggableNear(element: HTMLElement, x: number, y: number): boolean;
    static convertBubbleJsonToCanvas(parent: HTMLElement): void;
    private static getScaling;
    static setActiveBubbleListener(listener: ((selected: HTMLElement | undefined) => void) | undefined): void;
    static initializeChild(childElement: HTMLElement, parentElement: HTMLElement): void;
    static somethingHit(element: HTMLElement, x: number, y: number): boolean;
    static isAreaCompletelyIntersected(element: HTMLElement, left: number, right: number, top: number, bottom: number): boolean;
    static getBubbleHit(parentContainer: HTMLElement, x: number, y: number, onlyIfEnabled?: boolean, ignoreSelector?: string): Bubble | undefined;
    static comicalParentOf(element: HTMLElement): [HTMLElement | undefined, ContainerData | undefined];
    static bubbleWithContentAtPoint(parentContainer: HTMLElement, x: number, y: number): Bubble | undefined;
    static getBoundsRelativeToParent(parentContainer: HTMLElement, target: HTMLElement): ClientRect;
    static getPointOutsideBubblesAlong(parentContainer: HTMLElement, start: paper.Point, end: paper.Point, tries: number): paper.Point | undefined;
    static movePointOutsideBubble(element: HTMLElement, position: paper.Point, towards: paper.Point, from: paper.Point, ignoreSelector?: string): paper.Point;
    static okToMoveTo(element: HTMLElement, dest: paper.Point): boolean;
    private static getBubblesInSameCanvas;
    private static getLastInFamily;
    static findChild(bubble: Bubble): Bubble | undefined;
    static findParent(bubble: Bubble): Bubble | undefined;
    static findAncestors(bubble: Bubble): Bubble[];
    static findRelatives(bubble: Bubble, includeSelf?: boolean): Bubble[];
    static deleteBubbleFromFamily(elementToDelete: HTMLElement, container: HTMLElement): void;
    static bubbleVersion: string;
}
export {};