import { IEventEmitter } from '@breadstone/mosaik-elements'; import { CssColor } from '@breadstone/mosaik-themes'; import { type PointGroup } from 'signature_pad'; import { IClearable } from '../../../Behaviors/Clearable'; import { type IInvalidable } from '../../../Behaviors/Invalidable'; import { ISignEndedEventDetail, ISignStartedEventDetail, ISignStrokeEventDetail } from '../../../events'; import { CustomElement } from '../../Abstracts/CustomElement'; import type { ISignaturePadElementProps } from './ISignaturePadElementProps'; declare const SignaturePadElement_base: (abstract new (...args: Array) => import("../../../Behaviors/Themeable").IThemeableProps) & (abstract new (...args: Array) => import("../../../Behaviors/Clearable").IClearableProps & import("../../../Behaviors/Clearable").IClearableEvents & IClearable) & (abstract new (...args: Array) => import("../../../Behaviors/Disableable").IDisableableProps) & (abstract new (...args: Array) => import("../../../Behaviors/Focusable").IFocusableProps) & (abstract new (...args: Array) => import("../../../Behaviors/Variantable").IVariantableProps) & (abstract new (...args: Array) => IInvalidable & import("../../../Behaviors/Invalidable").IInvalidableProps) & (abstract new (...args: Array) => import("../../../Behaviors/Valueable").IValueableProps) & (abstract new (...args: Array) => import("../../../Behaviors/Labelable").ILabelableProps) & (abstract new (...args: Array) => import("../../../Behaviors/Appearanceable").IAppearanceableProps) & typeof CustomElement & import("../../../Behaviors/Themeable").IThemeableCtor; /** * Signature Pad - A user interface component for capturing and displaying digital signatures. * * @element mosaik-signaturepad * * @description * The Signature Pad component is designed to capture and display digital signatures. It provides a canvas or input area * where users can use a stylus, finger, or mouse to draw their signatures. Signature Pads are commonly used in various * applications, such as signing contracts, authorizing documents, or confirming transactions digitally. * * @category Forms * * @fires cleared {ClearedEvent} - Fired when the value is cleared. * @fires signStarted {SignStartedEvent} - Fired when the user starts signing. * @fires signEnded {SignEndedEvent} - Fired when the user ends signing. * @fires signStrokeBeforeUpdate {SignStrokeBeforeUpdateEvent} - Fired when the user starts signing. * @fires signStrokeAfterUpdate {SignStrokeAfterUpdateEvent} - Fired when the user ends signing. * * @example * ```html * * ``` * * @public */ export declare class SignaturePadElement extends SignaturePadElement_base implements ISignaturePadElementProps, IInvalidable, IClearable { private readonly _signStarted; private readonly _signEnded; private readonly _signStrokeBeforeUpdate; private readonly _signStrokeAfterUpdate; private _signaturePad; private _width; private _height; private _placeholder; private _minDistance; private _throttle; private _dotSize; private _minWidth; private _maxWidth; private _velocityFilterWeight; private _backgroundColor; private _penColor; private _required; /** * @public */ constructor(); /** * Returns the `is` property. * The `is` property represents natural name of this element. * * @public * @static * @readonly */ static get is(): string; /** * Gets or sets the `width` property. * * @public * @attr */ get width(): number; set width(value: number); /** * Gets or sets the `height` property. * * @public * @attr */ get height(): number; set height(value: number); /** * Gets or sets the `placeholder` property. * * @public * @attr */ get placeholder(): string; set placeholder(value: string); /** * Gets or sets the `minDistance` property. * * @public * @attr */ get minDistance(): number; set minDistance(value: number); /** * Gets or sets the `throttle` property. * * @public * @attr */ get throttle(): number; set throttle(value: number); /** * Gets or sets the `dotSize` property. * * @public * @attr */ get dotSize(): number; set dotSize(value: number); /** * Gets or sets the `minWidth` property. * * @public * @attr */ get minWidth(): number; set minWidth(value: number); /** * Gets or sets the `maxWidth` property. * * @public * @attr */ get maxWidth(): number; set maxWidth(value: number); /** * Gets or sets the `velocityFilterWeight` property. * * @public * @attr */ get velocityFilterWeight(): number; set velocityFilterWeight(value: number); /** * Gets or sets the `backgroundColor` property. * * @public * @attr */ get backgroundColor(): CssColor; set backgroundColor(value: CssColor); /** * Gets or sets the `penColor` property. * * @public * @attr */ get penColor(): CssColor; set penColor(value: CssColor); /** * Gets or sets the `required` property. * * @public * @attr */ get required(): boolean; set required(value: boolean); /** * Returns true if canvas is empty, otherwise returns false. * * @public * @readonly */ get isEmpty(): boolean; /** * Called when the signing starts. * Provides reference to `ISignStartedEventDetail` as event detail. * * @public * @readonly * @eventProperty */ get signStarted(): IEventEmitter; /** * Called when the signing ends. * Provides reference to `ISignEndedEventDetail` as event detail. * * @public * @readonly * @eventProperty */ get signEnded(): IEventEmitter; /** * Called before the signing stroke is updated. * Provides reference to `ISignStrokeEventDetail` as event detail. * * @public * @readonly * @eventProperty */ get signStrokeBeforeUpdate(): IEventEmitter; /** * Called after the signing stroke is updated. * Provides reference to `ISignStrokeEventDetail` as event detail. * * @public * @readonly * @eventProperty */ get signStrokeAfterUpdate(): IEventEmitter; /** * @public * @override */ connectedCallback(): void; /** * @public * @override */ disconnectedCallback(): void; /** * Checks the validity of the element and returns `true` if it is valid; otherwise, `false`. * * @public * @override */ checkValidity(): boolean; /** * Resets the value, all kinds of validation and errors. * * @public */ reset(): void; /** * Returns signature image as an array of point groups. * * @public */ toData(): Array; /** * Returns signature image as data URL (see https://mdn.io/todataurl for the list of possible parameters). * * @public */ toDataURL(imageType?: string, quality?: number): string; /** * Returns signature image as data URL trimmed from white space. * * @public */ toBlob(): Blob; /** * Draws signature image from an array of point groups. * * @public */ fromData(points: Array): void; /** * Draws signature image from data URL. * * @public */ fromDataURL(dataURL: string, options?: { ratio?: number; width?: number; height?: number; xOffset?: number; yOffset?: number; }): Promise; /** * Clears the value of the element but not the validation. * * @public * @override */ clear(force?: boolean): boolean; /** * @protected * @override */ protected onApplyTemplate(): void; /** * Emits the `signStarted` event. * * @protected */ protected onSignStarted(): void; /** * Emits the `signEnded` event. * * @protected */ protected onSignEnded(): void; /** * Emits the `signStrokeBeforeUpdated` event. * * @protected */ protected onSignStrokeBeforeUpdated(): void; /** * Emits the `signStrokeAfterUpdated` event. * * @protected */ protected onSignStrokeAfterUpdated(): void; /** * @protected */ protected onMinDistancePropertyChanged(_prev: number, newValue: number): void; /** * @protected */ protected onThrottlePropertyChanged(_prev: number, next: number): void; /** * @protected */ protected onDotSizePropertyChanged(_prev: number, next: number): void; /** * @protected */ protected onMinWidthPropertyChanged(_prev: number, next: number): void; /** * @protected */ protected onMaxWidthPropertyChanged(_prev: number, next: number): void; /** * @protected */ protected onVelocityFilterWeightPropertyChanged(_prev: number, next: number): void; /** * @protected */ protected onBackgroundColorPropertyChanged(_prev: CssColor, next: CssColor): void; /** * @protected */ protected onPenColorPropertyChanged(_prev: CssColor, next: CssColor): void; /** * @private */ private dataURLToBlob; /** * @private */ private trimCanvas; } /** * @public */ export declare namespace SignaturePadElement { type Props = ISignaturePadElementProps; } /** * @public */ declare global { interface HTMLElementTagNameMap { 'mosaik-signaturepad': SignaturePadElement; } } export {}; //# sourceMappingURL=SignaturePadElement.d.ts.map