UNPKG

@adobe/ccweb-add-on-manifest

Version:

Manifest models and validation rules for Adobe Creative Cloud Web Add-on.

86 lines (84 loc) 3.89 kB
/******************************************************************************** * MIT License * © Copyright 2023 Adobe. All rights reserved. * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. ********************************************************************************/ import type { AddOnInfo, AddOnLogAction, AddOnLogLevel, AuthorInfo, EntrypointV1, EntrypointV2, IconType, LocalisedStrings, ManifestValidationResult, RequirementsV1, RequirementsV2 } from "./AddOnManifestTypes.js"; import { AddOnManifestEntrypoint } from "./manifest-field/AddOnManifestEntrypoint.js"; import { AddOnManifestRequirement } from "./manifest-field/AddOnManifestRequirement.js"; /** * Specifies the metadata and configuration information for Add-Ons * More details on the schema and fields are present here: * https://wiki.corp.adobe.com/display/WXP/Add-in+Manifest+and+Structure */ export type AddOnManifestV1 = { readonly id: string; readonly name: string | LocalisedStrings; readonly version: string; readonly manifestVersion: number; readonly requirements: RequirementsV1; readonly icon: IconType | readonly IconType[]; readonly entryPoints: readonly EntrypointV1[]; readonly authorInfo?: AuthorInfo; }; export type AddOnManifestV2 = { readonly testId?: string; readonly name?: string; readonly version: string; readonly manifestVersion: number; readonly requirements: RequirementsV2; readonly entryPoints: readonly EntrypointV2[]; }; export declare enum ManifestVersion { V1 = 1, V2 = 2 } interface AddOnManifestTypeMap { [ManifestVersion.V1]: AddOnManifestV1; [ManifestVersion.V2]: AddOnManifestV2; } export type AddOnManifestType<T extends ManifestVersion> = AddOnManifestTypeMap[T]; export type CreateManifestResult = { manifestValidationResult: ManifestValidationResult; manifest?: AddOnManifest; }; /** * Defines the getter methods for AddOn manifest fields */ export declare class AddOnManifest { private _requirement; private _entrypoints; private readonly _manifest; static createManifest(addOnInfo: AddOnInfo, addOnLogger?: Map<AddOnLogLevel, AddOnLogAction>): CreateManifestResult; /** * TODO: [WXP-1583] Updated the response type in [AddOnInfoApi.manifest] and remove the getter */ get manifestProperties(): Record<string, unknown>; private constructor(); get id(): Readonly<string>; get name(): Readonly<string | LocalisedStrings | undefined>; get version(): Readonly<string>; get manifestVersion(): Readonly<ManifestVersion>; get requirements(): Readonly<AddOnManifestRequirement>; get icon(): Readonly<IconType | IconType[] | undefined>; get entryPoints(): readonly AddOnManifestEntrypoint[]; get authorInfo(): Readonly<AuthorInfo | undefined>; } export {}; //# sourceMappingURL=AddOnManifest.d.ts.map