@microsoft/teams.cards
Version:
<p> <a href="https://www.npmjs.com/package/@microsoft/teams.cards" target="_blank"> <img src="https://img.shields.io/npm/v/@microsoft/teams.cards" /> </a> <a href="https://www.npmjs.com/package/@microsoft/teams.cards?activeTab=code" ta
57 lines (54 loc) • 2.18 kB
TypeScript
import { HorizontalAlignment } from '../common/horizontal-alignment.js';
import { VerticalAlignment } from '../common/vertical-alignment.js';
/**
* Specifies a background image. Acceptable formats are PNG, JPEG, and GIF
*/
interface IBackgroundImage {
type: 'BackgroundImage';
/**
* The URL (or data url) of the image. Acceptable formats are PNG, JPEG, and GIF
*/
url: string;
/**
* Describes how the image should fill the area.
*/
fillMode?: 'cover' | 'repeatHorizontally' | 'repeatVertically' | 'repeat';
/**
* Describes how the image should be aligned if it must be cropped or if using repeat fill mode.
*/
horizontalAlignment?: HorizontalAlignment;
/**
* Describes how the image should be aligned if it must be cropped or if using repeat fill mode.
*/
verticalAlignment?: VerticalAlignment;
}
type BackgroundImageOptions = Omit<IBackgroundImage, 'type' | 'url'>;
/**
* Specifies a background image. Acceptable formats are PNG, JPEG, and GIF
*/
declare class BackgroundImage implements IBackgroundImage {
type: 'BackgroundImage';
/**
* The URL (or data url) of the image. Acceptable formats are PNG, JPEG, and GIF
*/
url: string;
/**
* Describes how the image should fill the area.
*/
fillMode?: 'cover' | 'repeatHorizontally' | 'repeatVertically' | 'repeat';
/**
* Describes how the image should be aligned if it must be cropped or if using repeat fill mode.
*/
horizontalAlignment?: HorizontalAlignment;
/**
* Describes how the image should be aligned if it must be cropped or if using repeat fill mode.
*/
verticalAlignment?: VerticalAlignment;
constructor(url: string, options?: BackgroundImageOptions);
static from(options: Omit<IBackgroundImage, 'type'>): BackgroundImage;
withUrl(value: string): this;
withFillMode(value: 'cover' | 'repeatHorizontally' | 'repeatVertically' | 'repeat'): this;
withHorizontalAlignment(value: HorizontalAlignment): this;
withVerticalAlignment(value: VerticalAlignment): this;
}
export { BackgroundImage, type BackgroundImageOptions, type IBackgroundImage };