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. * * @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. * * @element mosaik-signaturepad * @category Forms * * @csspart canvas - The canvas part. * @csspart clear - The clear part. * @csspart focusRing - The focusRing part. * @csspart placeholder - The placeholder part. * * @cssprop {String} --signature-pad-background-color - The pad background color CSS custom property. * @cssprop {String} --signature-pad-border-color - The pad border color CSS custom property. * @cssprop {String} --signature-pad-border-radius - The pad border radius CSS custom property. * @cssprop {String} --signature-pad-border-style - The pad border style CSS custom property. * @cssprop {String} --signature-pad-border-width - The pad border width CSS custom property. * @cssprop {String} --signature-pad-font-family - The pad font family CSS custom property. * @cssprop {String} --signature-pad-font-letter-spacing - The pad font letter spacing CSS custom property. * @cssprop {String} --signature-pad-font-line-height - The pad font line height CSS custom property. * @cssprop {String} --signature-pad-font-size - The pad font size CSS custom property. * @cssprop {String} --signature-pad-font-text-decoration - The pad font text decoration CSS custom property. * @cssprop {String} --signature-pad-font-text-transform - The pad font text transform CSS custom property. * @cssprop {String} --signature-pad-font-weight - The pad font weight CSS custom property. * @cssprop {String} --signature-pad-foreground-color - The pad foreground color CSS custom property. * @cssprop {String} --signature-pad-gap - The pad gap CSS custom property. * @cssprop {String} --signature-pad-padding-bottom - The pad padding bottom CSS custom property. * @cssprop {String} --signature-pad-padding-left - The pad padding left CSS custom property. * @cssprop {String} --signature-pad-padding-right - The pad padding right CSS custom property. * @cssprop {String} --signature-pad-padding-top - The pad padding top CSS custom property. * @cssprop {String} --signature-pad-shadow - The pad shadow CSS custom property. * @cssprop {String} --signature-pad-shadow-blur - The pad shadow blur CSS custom property. * @cssprop {String} --signature-pad-shadow-color - The pad shadow color CSS custom property. * @cssprop {String} --signature-pad-shadow-offset-x - The pad shadow offset x CSS custom property. * @cssprop {String} --signature-pad-shadow-offset-y - The pad shadow offset y CSS custom property. * @cssprop {String} --signature-pad-shadow-spread - The pad shadow spread CSS custom property. * @cssprop {String} --signature-pad-transition-duration - The pad transition duration CSS custom property. * @cssprop {String} --signature-pad-transition-mode - The pad transition mode CSS custom property. * @cssprop {String} --signature-pad-transition-property - The pad transition property CSS custom property. * @cssprop {String} --signature-pad-translate - The pad translate CSS custom property. * * @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. * * @dependency mosaik-button - The Button element. * @dependency mosaik-focus-ring - The Focus Ring element. * @dependency mosaik-text - The Text element. * * @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