import type CardFormatter from './card-formatter';
declare type PlainObject = {
    [key: string]: unknown;
};
export declare function isNull(value: unknown): boolean;
/**
 * Namespace for format objects.
 *
 * Classes in this namespace are not accessible directly, but objects
 * of this classes are returned by {@link Formatter} methods.
 *
 * @name FormatObjects
 * @namespace
 */
/**
 * The base class of all formatting objects.
 *
 * Formatting objects are created from spec objects provided in the `#_[formatted]`
 * function annotation.
 */
export declare abstract class BaseFormattedObject {
    /**
     * A string identifying the type of this formatted object.
     */
    abstract type: string;
    /**
     * Check if this formatted object is valid.
     *
     * A formatted object is valid if the required properties are substituted with
     * valid values (not null, undefined, empty or NaN). Invalid formatted objects
     * are not displayed to the user.
     *
     * @return {boolean} true if this formatted object is valid, false otherwise
     */
    abstract isValid(): boolean;
    /**
     * Convert this formatted object to a localized string.
     *
     * The resulting string is suitable for speech, or for displaying to user in
     * a text-only interface. It is also suitable as a fallback for all formatting
     * objects not recognized by the application.
     *
     * @param {string} locale - the locale to localize any message into
     * @return {string} a string representation of this formatted object
     */
    abstract toLocaleString(locale: string): string;
    /**
     * Replace all placeholders in this object, using the provided structured result.
     *
     * @param {Formatter} formatter - the formatter to use for replacement
     * @param {Object.<string,any>} argMap - the structured ThingTalk result with the values to substitute
     */
    replaceParameters(formatter: CardFormatter, argMap: PlainObject): void;
}
interface PictureSpec {
    type: 'picture';
    url: string;
}
/**
 * A simple still picture.
 *
 * @alias FormatObjects~Picture
 * @extends FormatObjects~FormattedObject
 */
declare class Picture extends BaseFormattedObject implements PictureSpec {
    type: 'picture';
    url: string;
    /**
     * Construct a new picture object.
     *
     * @param {Object} spec
     * @param {string} spec.url - the URL of the picture to display
     */
    constructor(spec: PictureSpec);
    isValid(): boolean;
    toLocaleString(locale: string): string;
}
interface RDLSpec {
    type: 'rdl';
    callback?: string;
    webCallback: string;
    displayTitle: string;
    displayText?: string;
    pictureUrl?: string;
}
/**
 * A rich deep link (also known as a card).
 *
 * An RDL is expected to be displayed as a clickable card with optional
 * description and picture.
 *
 * @alias FormatObjects~RDL
 * @extends FormatObjects~FormattedObject
 */
declare class RDL extends BaseFormattedObject implements RDLSpec {
    type: 'rdl';
    callback: string | undefined;
    webCallback: string;
    displayTitle: string;
    displayText: string | undefined;
    pictureUrl: string | undefined;
    /**
     * Construct a new RDL
     *
     * If displayTitle is unspecified but displayText is, displayText is moved to displayTitle.
     * If callback is not specified, it is set to the same value as webCallback.
     *
     * @param {Object} spec
     * @param {string} spec.displayTitle - the title of the link
     * @param {string} [spec.displayText] - the description associated with the link
     * @param {string} spec.webCallback - the link target
     * @param {string} [spec.callback] - a different link target, to use on plaforms where deep-linking is allowed (e.g. Android)
     * @param {string} [spec.pictureUrl] - a picture associated with this link
     */
    constructor(spec: RDLSpec);
    replaceParameters(formatter: CardFormatter, argMap: PlainObject): void;
    isValid(): boolean;
    toLocaleString(locale: string): string;
}
interface MapFOSpec {
    type: 'map';
    lat: number;
    lon: number;
    display?: string;
}
/**
 * A map, with a single pin at the specified location (indicated as latitude, longitude)
 *
 * Whether the map is interactive (can be panned, zoomed) is implementation-dependent.
 *
 * The name `MapFO` is chosen to avoid confusion by JavaScript's builtin
 * [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
 * data structure.
 *
 * @alias FormatObjects~MapFO
 * @extends FormatObjects~FormattedObject
 */
declare class MapFO extends BaseFormattedObject implements MapFOSpec {
    type: 'map';
    lat: number;
    lon: number;
    display: string | undefined;
    /**
     * Construct a new map format object.
     *
     * @param {Object} spec
     * @param {string|number} spec.lat - latitude; this can be a string with placeholders, or a number
     * @param {string|number} spec.lon - longitude; this can be a string with placeholders, or a number
     * @param {string} [spec.display] - a label for the pin (the name of the location being selected)
     */
    constructor(spec: MapFOSpec);
    replaceParameters(formatter: CardFormatter, argMap: PlainObject): void;
    isValid(): boolean;
    toLocaleString(locale: string): string;
}
interface SoundEffectSpec {
    type: 'sound';
    name: string;
}
/**
 * A short notification sound from a predefined library.
 *
 * @alias FormatObjects~SoundEffect
 * @extends FormatObjects~FormattedObject
*/
declare class SoundEffect extends BaseFormattedObject implements SoundEffectSpec {
    type: 'sound';
    name: string;
    /**
     * Construct a new sound effect object.
     *
     * @param {Object} spec
     * @param {string} spec.name - the name of the sound, from the {@link http://0pointer.de/public/sound-theme-spec.html|Freedesktop Sound Theme Spec}
     *                             (with a couple Almond-specific extensions)
     */
    constructor(spec: SoundEffectSpec);
    isValid(): boolean;
    toLocaleString(locale: string): string;
}
interface MediaSpec {
    type: 'media';
    url: string;
}
/**
 * Audio/video display with controls
 *
 * @alias FormatObjects~Media
 * @extends FormatObjects~FormattedObject
*/
declare class Media extends BaseFormattedObject implements MediaSpec {
    type: 'media';
    url: string;
    /**
     * Construct a new media object.
     *
     * Whether the URL is audio or video will be identified
     * based on Content-Type, URL patterns and potentially
     * file extension.
     *
     * @param {Object} spec
     * @param {string} spec.url - the URL of the music/video to display
     */
    constructor(spec: MediaSpec);
    isValid(): boolean;
    toLocaleString(locale: string): string;
}
interface ButtonSpec {
    type: 'button';
    title: string;
    code: string;
}
/**
 * A button that maps to a specific ThingTalk program, suggested to the user.
*/
declare class Button extends BaseFormattedObject implements ButtonSpec {
    type: 'button';
    title: string;
    code: string;
    /**
     * Construct a new button object.
     *
     * @param {Object} spec
     * @param {string} spec.title - the title of the button to show to the user
     * @param {string} spec.code - the associated ThingTalk code (which can be a control command or a program)
     */
    constructor(spec: ButtonSpec);
    isValid(): boolean;
    toLocaleString(locale: string): string;
}
export interface FormattedObjectClass {
    new (obj: FormattedObjectSpec): FormattedObject;
}
export declare const FORMAT_TYPES: {
    picture: typeof Picture;
    rdl: typeof RDL;
    map: typeof MapFO;
    sound: typeof SoundEffect;
    media: typeof Media;
    button: typeof Button;
};
export declare type FormattedObjectSpec = PictureSpec | RDLSpec | MapFOSpec | SoundEffectSpec | MediaSpec | ButtonSpec;
export declare type FormattedObject = Picture | RDL | MapFO | SoundEffect | Media | Button;
export {};
