UNPKG

@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

1 lines 3.33 kB
{"version":3,"sources":["../../src/medias/background-image.ts"],"names":[],"mappings":"AAkCO,MAAM,eAA4C,CAAA;AAAA,EACvD,IAAA;AAAA;AAAA;AAAA;AAAA,EAKA,GAAA;AAAA;AAAA;AAAA;AAAA,EAKA,QAAA;AAAA;AAAA;AAAA;AAAA,EAKA,mBAAA;AAAA;AAAA;AAAA;AAAA,EAKA,iBAAA;AAAA,EAEA,WAAY,CAAA,GAAA,EAAa,OAAkC,GAAA,EAAI,EAAA;AAC7D,IAAA,IAAA,CAAK,IAAO,GAAA,iBAAA;AACZ,IAAA,IAAA,CAAK,GAAM,GAAA,GAAA;AACX,IAAO,MAAA,CAAA,MAAA,CAAO,MAAM,OAAO,CAAA;AAAA;AAC7B,EAEA,OAAO,KAAK,OAAyC,EAAA;AACnD,IAAA,OAAO,IAAI,eAAA,CAAgB,OAAQ,CAAA,GAAA,EAAK,OAAO,CAAA;AAAA;AACjD,EAEA,QAAQ,KAAe,EAAA;AACrB,IAAA,IAAA,CAAK,GAAM,GAAA,KAAA;AACX,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,aAAa,KAAuE,EAAA;AAClF,IAAA,IAAA,CAAK,QAAW,GAAA,KAAA;AAChB,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,wBAAwB,KAA4B,EAAA;AAClD,IAAA,IAAA,CAAK,mBAAsB,GAAA,KAAA;AAC3B,IAAO,OAAA,IAAA;AAAA;AACT,EAEA,sBAAsB,KAA0B,EAAA;AAC9C,IAAA,IAAA,CAAK,iBAAoB,GAAA,KAAA;AACzB,IAAO,OAAA,IAAA;AAAA;AAEX","file":"background-image.mjs","sourcesContent":["import { HorizontalAlignment, VerticalAlignment } from '../common';\n\n/**\n * Specifies a background image. Acceptable formats are PNG, JPEG, and GIF\n */\nexport interface IBackgroundImage {\n type: 'BackgroundImage';\n\n /**\n * The URL (or data url) of the image. Acceptable formats are PNG, JPEG, and GIF\n */\n url: string;\n\n /**\n * Describes how the image should fill the area.\n */\n fillMode?: 'cover' | 'repeatHorizontally' | 'repeatVertically' | 'repeat';\n\n /**\n * Describes how the image should be aligned if it must be cropped or if using repeat fill mode.\n */\n horizontalAlignment?: HorizontalAlignment;\n\n /**\n * Describes how the image should be aligned if it must be cropped or if using repeat fill mode.\n */\n verticalAlignment?: VerticalAlignment;\n}\n\nexport type BackgroundImageOptions = Omit<IBackgroundImage, 'type' | 'url'>;\n\n/**\n * Specifies a background image. Acceptable formats are PNG, JPEG, and GIF\n */\nexport class BackgroundImage implements IBackgroundImage {\n type: 'BackgroundImage';\n\n /**\n * The URL (or data url) of the image. Acceptable formats are PNG, JPEG, and GIF\n */\n url: string;\n\n /**\n * Describes how the image should fill the area.\n */\n fillMode?: 'cover' | 'repeatHorizontally' | 'repeatVertically' | 'repeat';\n\n /**\n * Describes how the image should be aligned if it must be cropped or if using repeat fill mode.\n */\n horizontalAlignment?: HorizontalAlignment;\n\n /**\n * Describes how the image should be aligned if it must be cropped or if using repeat fill mode.\n */\n verticalAlignment?: VerticalAlignment;\n\n constructor(url: string, options: BackgroundImageOptions = {}) {\n this.type = 'BackgroundImage';\n this.url = url;\n Object.assign(this, options);\n }\n\n static from(options: Omit<IBackgroundImage, 'type'>) {\n return new BackgroundImage(options.url, options);\n }\n\n withUrl(value: string) {\n this.url = value;\n return this;\n }\n\n withFillMode(value: 'cover' | 'repeatHorizontally' | 'repeatVertically' | 'repeat') {\n this.fillMode = value;\n return this;\n }\n\n withHorizontalAlignment(value: HorizontalAlignment) {\n this.horizontalAlignment = value;\n return this;\n }\n\n withVerticalAlignment(value: VerticalAlignment) {\n this.verticalAlignment = value;\n return this;\n }\n}\n"]}