obsidian-dev-utils
Version:
This is the collection of useful functions that you can use for your Obsidian plugin development
51 lines (50 loc) • 1.68 kB
text/typescript
/**
* @packageDocumentation
*
* Contains a component that allows the user to enter a telephone number.
*/
import type { TextBasedComponent } from './TextBasedComponent.cjs';
import { TypedTextComponent } from './TypedTextComponent.cjs';
/**
* A component that allows the user to enter a telephone number.
*
* It looks like regular text component on desktop but changes keyboard to digits only on mobile.
*
* You can add this component using {@link SettingEx.addTelephone}.
*
* 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 TelephoneComponent extends TypedTextComponent<string> implements TextBasedComponent<string> {
/**
* Creates a new telephone component.
*
* @param container - The container element of the component.
*/
constructor(container: 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;
/**
* Gets the value from a string.
*
* @param str - The string to get the value from.
* @returns The value from the string.
*/
valueFromString(str: string): string;
}