UNPKG

iobroker.telegram

Version:

The adapter allows to send and receive telegram messages from ioBroker and to be a broker.

39 lines (38 loc) 1.46 kB
import type { IobUri, IobUriParsed } from './types'; /** * Serialize a parsed ioBroker URI back to its string form. * * @param uri the parsed URI * @returns the URI in string form */ export declare function iobUriToString(uri: IobUriParsed): IobUri; /** * Whether the given string is an ioBroker URI that this adapter has to resolve before sending. * * @param text the candidate string * @returns true if the string uses one of the `iob*://` schemes */ export declare function isIobUri(text: string): boolean; /** * Parse an ioBroker URI string into its structured form. A string without a known scheme is treated * as a plain web URL (if it looks like one) or as a state id otherwise. * * @param uri the URI string * @returns the parsed URI */ export declare function iobUriFromString(uri: IobUri): IobUriParsed; /** * Derive the telegram media type (as used by the internal send dispatcher) from a file name or URL. * The mapping mirrors the extension checks used for filesystem paths in `sendMessageHelper`. * * @param name the file name, path or URL (query string is ignored) * @returns the media type or undefined if the extension is unknown */ export declare function detectMediaTypeFromName(name: string): string | undefined; /** * Map a MIME type to the internal telegram media type. * * @param mime the MIME type (e.g. `image/png`) * @returns the media type */ export declare function mimeToMediaType(mime: string): string;