adaptivecards-react
Version:
React.js Adaptive Cards Javascript library for HTML Clients
57 lines (53 loc) • 3.04 kB
TypeScript
declare module 'adaptivecards-react/adaptive-card' {
/// <reference types="react" />
import * as PropTypes from 'adaptivecards-react/prop-types';
export interface Props {
payload: object;
onExecuteAction?: Function;
onActionSubmit?: Function;
onActionOpenUrl?: Function;
onActionShowCard?: Function;
onError?: Function;
style?: object;
hostConfig?: object;
}
export const AdaptiveCard: {
({ payload, onExecuteAction, onActionSubmit, onActionOpenUrl, onActionShowCard, onError, style, hostConfig, }: Props): JSX.Element;
propTypes: {
/** The card schema. It must comply with the card schema. [More Info](https://docs.microsoft.com/en-us/adaptive-cards/create/cardschema) */
payload: PropTypes.Validator<object>;
/** Method that will be invoked anytime a card action is executed. [More Info](https://docs.microsoft.com/en-us/adaptive-cards/display/implementingrenderer#actions) */
onExecuteAction: PropTypes.Requireable<(...args: any[]) => any>;
/** Method that will be invoked when a Submit action is executed. [More Info](https://docs.microsoft.com/en-us/adaptive-cards/display/implementingrenderer#actionsubmit) */
onActionSubmit: PropTypes.Requireable<(...args: any[]) => any>;
/** Method that will be invoked when an Open Url action is executed. [More Info](https://docs.microsoft.com/en-us/adaptive-cards/display/implementingrenderer#actionopenurl) */
onActionOpenUrl: PropTypes.Requireable<(...args: any[]) => any>;
/** Method that will be invoked when a Show Card action is executed. [More Info](https://docs.microsoft.com/en-us/adaptive-cards/display/implementingrenderer#actionshowcard) */
onActionShowCard: PropTypes.Requireable<(...args: any[]) => any>;
/** Method that will be invoked if an error is thrown while trying to render a card. */
onError: PropTypes.Requireable<(...args: any[]) => any>;
/** JSX styles that will be applied to the card conatiner */
style: PropTypes.Requireable<object>;
/** HostConfig. [More Info](https://docs.microsoft.com/en-us/adaptive-cards/rendering-cards/host-config) */
hostConfig: PropTypes.Requireable<object>;
};
};
}
declare module 'adaptivecards-react/host-config-context' {
import React, { FC } from 'adaptivecards-react/react';
import { Props } from 'adaptivecards-react/adaptive-card';
interface HostConfig {
hostConfig: object;
}
export const HostConfigContext: React.Context<HostConfig>;
export type PropsWithoutHostConfig = Omit<Props, 'hostConfig'>;
export const AdaptiveCardUsingHostConfigContext: (props: PropsWithoutHostConfig) => JSX.Element;
export const ProvidesHostConfigContext: FC<{
hostConfig: object;
}>;
export {};
}
declare module 'adaptivecards-react/adaptivecards-react' {
export * from 'adaptivecards-react/adaptive-card';
export * from 'adaptivecards-react/host-config-context';
}