diff --git a/docs/api/ref/Icon.md b/docs/api/ref/Icon.md new file mode 100644 index 000000000..6621aafc1 --- /dev/null +++ b/docs/api/ref/Icon.md @@ -0,0 +1,55 @@ +--- +id: Icon +sidebar_label: Icon +title: Icon +hide_title: true +--- +# `Icon` + +```typescript +interface Icon { + src: string; + size: string; + type: string; +} +``` + +App Metadata icon's description. + +Various properties may be used by the Desktop Agent to decide which icon is the most suitable to be used considering the application chooser UI, device DPI and formats supported by the system. + +#### Example + +```js +"icons": [ + { + "src": "https://app.foo.icon/app_icons/lowres.webp", + "size": "48x48", + "type": "image/webp" + }, + { + "src": "https://app.foo.icon/app_icons/hd_hi.svg", + "size": "72x72" + } +] +``` + +## Properties + +### `src` + +The fully qualified url to the icon. + +### `size` + +The dimension of the icon using formatted as "x" + +### `type` + +The media type of the icon. If not provided the Desktop agent may refer to the src file extension. + + + +#### See also +* [`AppMetadata`](Metadata#appmetadata) + diff --git a/docs/api/ref/Metadata.md b/docs/api/ref/Metadata.md index d193215b5..10f310ad9 100644 --- a/docs/api/ref/Metadata.md +++ b/docs/api/ref/Metadata.md @@ -31,7 +31,7 @@ interface AppMetadata { title?: string; tooltip?: string; description?: string; - icons?: Array; + icons?: Array; images?: Array; } ``` @@ -47,6 +47,7 @@ In situations where a desktop agent connects to multiple app directories or mult #### See also * [`AppIntent.apps`](AppIntent) +* [`Icon`](Icon) ## `DisplayMetadata` diff --git a/src/api/AppMetadata.ts b/src/api/AppMetadata.ts index cc53c8101..952d9d30e 100644 --- a/src/api/AppMetadata.ts +++ b/src/api/AppMetadata.ts @@ -3,6 +3,8 @@ * Copyright 2019 FINOS FDC3 contributors - see NOTICE file */ +import { Icon } from './Icon'; + /** * App definition as provided by the application directory */ @@ -26,7 +28,7 @@ export interface AppMetadata { readonly description?: string; /** A list of icon URLs for the application that can be used to render UI elements */ - readonly icons?: Array; + readonly icons?: Array; /** A list of image URLs for the application that can be used to render UI elements */ readonly images?: Array; diff --git a/src/api/Icon.ts b/src/api/Icon.ts new file mode 100644 index 000000000..2d28fdf73 --- /dev/null +++ b/src/api/Icon.ts @@ -0,0 +1,15 @@ +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright 2019 FINOS FDC3 contributors - see NOTICE file + */ + +export interface Icon { + /** The icon url */ + readonly src: string; + + /** The icon dimension */ + readonly size?: string; + + /** The icon media type */ + readonly type?: string; +} diff --git a/src/app-directory/specification/appd.yaml b/src/app-directory/specification/appd.yaml index 1bb65de61..c0c68356d 100644 --- a/src/app-directory/specification/appd.yaml +++ b/src/app-directory/specification/appd.yaml @@ -347,9 +347,15 @@ components: Icon: description: Icon holder properties: - icon: + src: type: string description: Icon URL + size: + type: string + description: Icon dimension formatted as "x" + type: + type: string + description: Image media type. If not present the Desktop Agent may use the src file extension AppImage: description: App Image holder properties: