@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
78 lines (76 loc) • 1.69 kB
JavaScript
import { Element } from '../base';
class Image extends Element {
type;
/**
* The URL to the image. Supports data URI in version 1.2+
*/
url;
/**
* Alternate text describing the image.
*/
altText;
/**
* Controls if the image can be expanded to full screen.
*/
allowExpand;
/**
* Applies a background to a transparent image. This property will respect the image style.
*/
backgroundColor;
/**
* An Action that will be invoked when the Image is tapped or selected. Action.ShowCard is not supported.
*/
selectAction;
/**
* Controls the approximate size of the image. The physical dimensions will vary per host.
*/
size;
/**
* Controls how this Image is displayed.
*/
style;
/**
* The desired on-screen width of the image, ending in ‘px’. E.g., 50px. This overrides the size property.
*/
width;
constructor(url, options = {}) {
super();
this.type = "Image";
this.url = url;
Object.assign(this, options);
}
static from(options) {
return new Image(options.url, options);
}
withAltText(value) {
this.altText = value;
return this;
}
withAllowExpand(value = true) {
this.allowExpand = value;
return this;
}
withBackgroundColor(value) {
this.backgroundColor = value;
return this;
}
withSelectAction(value) {
this.selectAction = value;
return this;
}
withSize(value) {
this.size = value;
return this;
}
withStyle(value) {
this.style = value;
return this;
}
withWidth(value) {
this.width = value;
return this;
}
}
export { Image };
//# sourceMappingURL=image.mjs.map
//# sourceMappingURL=image.mjs.map