UNPKG

comicaljs

Version:

Edit cartoon bubble frames around an HTML element

79 lines (78 loc) 3.18 kB
import { BubbleSpec, TailSpec, BubbleSpecPattern } from "bubbleSpec"; import { Tail } from "./tail"; export declare class Bubble { content: HTMLElement; static defaultBorderWidth: number; private spec; outline: paper.Item; private oulineStrokeColor; combinedShapes: paper.Item | undefined; private shadowShape; fillArea: paper.Item | undefined; private contentHolder; private tails; private observer; private hScale; private vScale; private lowerLayer; private upperLayer; private handleLayer; private shapeIsComputed; oldContentWidth: number; oldContentHeight: number; constructor(element: HTMLElement); usingOverlay(): boolean; static getBubbleSpec(element: HTMLElement): BubbleSpec; static getDefaultBubbleSpec(element: HTMLElement, style?: string): BubbleSpec; getSpecLevel(): number | undefined; getFullSpec(): BubbleSpec; getBubbleSpec(): BubbleSpec; setBubbleSpec(spec: BubbleSpec): void; persistBubbleSpecWithoutMonitoring(): void; persistBubbleSpec(): void; private comparePossibleArrays; mergeWithNewBubbleProps(newBubbleProps: BubbleSpecPattern): void; getStyle(): string; setStyle(style: string): void; setLayers(newLowerLayer: paper.Layer, newUpperLayer: paper.Layer, newHandleLayer: paper.Layer): void; getLowerLayer(): paper.Layer; setLowerLayer(layer: paper.Layer): void; getUpperLayer(): paper.Layer; setUpperLayer(layer: paper.Layer): void; setHandleLayer(layer: paper.Layer): void; private initializeLayers; initialize(): void; isTransparent(): boolean; static getShapeSvgString(bubbleStyle: string): string; private getComputedShape; private loadShapeAsync; private hasOuterBorder; private makeShapes; getDefaultContentHolder(): paper.Shape; getBorderWidth(): number; getBackgroundColor(): paper.Color; adjustSizeAndPosition(): void; private setOutline; uniteShapes(): void; uniteTails(combinedPath: paper.PathItem, tailsToClip: Tail[]): paper.PathItem; static almostInvisibleColor: paper.Color; hideShape(shape: paper.Item): void; getScaleFactors(): [number, number]; isOverlapping(otherBubble: Bubble): boolean; isHitByPoint(point: paper.Point): boolean; isContentHitByPoint(point: paper.Point): boolean; private adjustJoiners; private callWithMonitoringDisabled; stopMonitoring(): void; monitorContent(): void; private makeTail; showHandles(): void; calculateTailStartPoint(): paper.Point; static makeDefaultTail(targetDiv: HTMLElement): TailSpec; static adjustTowards(origin: paper.Point, target: paper.Point, originSize: paper.Size): paper.Point; static defaultMid(start: paper.Point, target: paper.Point, startSize: paper.Size, targetSize?: paper.Size): paper.Point; makeBubbleItem(padWidth: number, pathMaker: (points: paper.Point[], center: paper.Point) => paper.Path): paper.Item; makePointedArcBubble(): paper.Item; static ellipseBubble(): string; static shoutBubble(): string; }