Skip to content

Commit

Permalink
feat(interface): add new Image interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiarokh authored and Befkadu1 committed May 16, 2024
1 parent 88273c2 commit 106d4a8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions etc/lime-elements.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,14 @@ export interface Icon {
// @public (undocumented)
export type IconSize = 'x-small' | 'small' | 'medium' | 'large';

// @public
interface Image_2 {
alt: string;
loading?: 'lazy' | 'eager';
src: string;
}
export { Image_2 as Image }

// @public (undocumented)
export interface InfoTileProgress {
displayPercentageColors?: boolean;
Expand Down
23 changes: 23 additions & 0 deletions src/global/shared-types/image.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* This interface is used to specify a path to an image,
* along with related properties, like alt text.
* @public
*/
export interface Image {
/**
* The path to the image file.
*/
src: string;

/**
* The alternative text of the image, used to improve accessibility.
*/
alt: string;

/**
* The `loading` attribute of the image.
* - `lazy` means that the image will be loaded only when it is in the viewport.
* - `eager` means that the image will be loaded as soon as possible.
*/
loading?: 'lazy' | 'eager';
}
1 change: 1 addition & 0 deletions src/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ export * from './components/tab-panel/tab-panel.types';
export * from './components/table/table.types';
export * from './global/shared-types/separator.types';
export * from './global/shared-types/icon.types';
export * from './global/shared-types/image.types';

0 comments on commit 106d4a8

Please sign in to comment.