obsidian-dev-utils
Version:
This is the collection of useful functions that you can use for your Obsidian plugin development
43 lines (42 loc) • 1.22 kB
text/typescript
/**
* @packageDocumentation
*
* Contains a component that displays and edits a file.
*/
import { TypedTextComponent } from './TypedTextComponent.cjs';
/**
* A component that displays and edits a file.
*
* You can add this component using {@link SettingEx.addFile}.
*
* 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 FileComponent extends TypedTextComponent<File | null> {
/**
* Creates a new file component.
*
* @param containerEl - The container element of the component.
*/
constructor(containerEl: HTMLElement);
/**
* Gets the value of the component.
*
* @returns The value of the component.
*/
getValue(): File | null;
/**
* Converts a string to a file.
*
* @returns The file.
*/
valueFromString(): File | null;
/**
* Converts a file to a string.
*
* @param value - The file to convert.
* @returns The string.
*/
valueToString(value: File | null): string;
}