/** * Represents a value that may be of type T, or null. */ export type Nullable = T | null; /** * Represents the data to share. */ export type ShareData = { /** * - The URL to share. */ url?: string | undefined; /** * - The title to share. */ title?: string | undefined; /** * - The text to share. */ text?: string | undefined; /** * - The files to share. */ files?: File[] | undefined; }; /** * @summary A custom element that provides a button to share content. * @documentation https://github.com/georapbox/web-share-element#readme * * @tagname web-share - This is the default tag name, unless overridden by the `defineCustomElement` method. * * @property {boolean} disabled - Indicates whether the button is disabled. * @property {string} shareUrl - The URL to share. * @property {string} shareTitle - The title to share. * @property {string} shareText - The text to share. * @property {File[]} shareFiles - The files to share. * * @attribute {boolean} disabled - Reflects the disabled property. * @attribute {string} share-url - Reflects the shareUrl property. * @attribute {string} share-title - Reflects the shareTitle property. * @attribute {string} share-text - Reflects the shareText property. * * @slot button - The button to share content. * @slot button-content - The content of the button to share content. * * @csspart button - The button to share content. * @csspart button--disabled - The button to share content when disabled. * * @event web-share:success - Fired when the share operation is successful. * @event web-share:abort - Fired when the share operation is aborted. * @event web-share:error - Fired when the share operation fails. * * @method defineCustomElement - Static method. Defines the custom element with the given name. * @method share - Instance method. Shares the shareable data taken from the element's properties. */ export class WebShare extends HTMLElement { static get observedAttributes(): string[]; /** * Defines a custom element with the given name. * The name must contain a dash (-). * * @param {string} [elementName='web-share'] - The name of the custom element. * @example * * ClipboardCopy.defineCustomElement('my-web-share'); */ static defineCustomElement(elementName?: string | undefined): void; /** * Lifecycle method that is called when attributes are changed, added, removed, or replaced. * * @param {string} name - The name of the attribute. * @param {string} oldValue - The old value of the attribute. * @param {string} newValue - The new value of the attribute. */ attributeChangedCallback(name: string, oldValue: string, newValue: string): void; /** * Lifecycle method that is called when the element is added to the DOM. */ connectedCallback(): void; /** * Lifecycle method that is called when the element is removed from the DOM. */ disconnectedCallback(): void; set disabled(value: boolean); /** * @type {boolean} - Indicates whether the button is disabled. * @default false * @attribute disabled - Reflects the disabled property. */ get disabled(): boolean; set shareUrl(value: string); /** * @type {string} - The URL to share. * @attribute share-url - Reflects the shareUrl property. */ get shareUrl(): string; set shareTitle(value: string); /** * @type {string} - The title to share. * @attribute share-title - Reflects the shareTitle property. */ get shareTitle(): string; set shareText(value: string); /** * @type {string} - The text to share. * @attribute share-text - Reflects the shareText property. */ get shareText(): string; set shareFiles(value: File[]); /** * @type {File[]} - The files to share. */ get shareFiles(): File[]; /** * Shares the shareable data taken from the element's properties. * * @returns {Promise} - A promise that resolves when the share operation is complete. */ share(): Promise; #private; } //# sourceMappingURL=web-share.d.ts.map