obsidian-dev-utils
Version:
This is the collection of useful functions that you can use for your Obsidian plugin development
49 lines (48 loc) • 1.54 kB
text/typescript
/**
* @packageDocumentation
*
* Contains a component that displays and edits an email address.
*/
import type { TextBasedComponent } from './TextBasedComponent.mjs';
import { TypedTextComponent } from './TypedTextComponent.mjs';
/**
* A component that displays and edits an email address.
*
* You can add this component using {@link SettingEx.addEmail}.
*
* In order to add the styles for the component, use {@link initPluginContext} in your plugin's `onload()` function.
*
* Alternatively, you can copy styles from {@link https://github.com/mnaoumov/obsidian-dev-utils/releases/latest/download/styles.css}.
*/
export declare class EmailComponent extends TypedTextComponent<string> implements TextBasedComponent<string> {
/**
* Creates a new email component.
*
* @param containerEl - The container element of the component.
*/
constructor(containerEl: HTMLElement);
/**
* Empties the component.
*/
empty(): void;
/**
* Checks if the component is empty.
*
* @returns `true` if the component is empty, `false` otherwise.
*/
isEmpty(): boolean;
/**
* Sets the placeholder value of the component.
*
* @param placeholderValue - The placeholder value to set.
* @returns The component.
*/
setPlaceholderValue(placeholderValue: string): this;
/**
* Converts a string to an email address.
*
* @param str - The string to convert.
* @returns The email address.
*/
valueFromString(str: string): string;
}