/************************************************************************* * Copyright 2024 Adobe * All Rights Reserved. * * NOTICE: Adobe permits you to use, modify, and distribute this file in * accordance with the terms of the Adobe license agreement accompanying * it. If you have received this file from a source other than Adobe, * then your use, modification, or distribution of it requires the prior * written permission of Adobe. **************************************************************************/ export declare enum AGREEMENT_TYPE { AI = "AI", BETA = "BETA", GENSTUDIO = "GENSTUDIO" } export declare enum GLOBAL_AGREEMENTS { AI_ASSISTANT = "gen-ai-ga-agreement", AI_GENERAL = "gen-ai-general-agreement" } export interface AgreementKeyOptions { /** * True if the same key will be used in multiple places to show the same agreement. * False if the agreement will only be used in one place. */ shared?: boolean; } export interface AgreementOptions extends AgreementKeyOptions { /** * Feature name of the agreement that will be used in the default dialog text. */ feature?: string; /** * If the agreement is actionable. */ isReadOnly?: boolean; /** * Link to learn more about the feature. */ learnMoreLink?: string; /** * If the beta agreement addendum should be truncated. */ truncateAddendum?: boolean; /** * Type defines what non-configurable text displays in the dialog. */ type: AGREEMENT_TYPE; } export interface AgreementResponse { /** * Boolean that is true if the user has accepted the beta agreement */ accepted: boolean; /** * Date of last action (accept or reject) */ date: number; } export declare enum OPERATIONS { CLEAR = "clear", GET = "get", SHOW = "show" } /** * APIs to get beta agreements. */ export interface AgreementsApi { /** * Clears the users agreement response from settings. * @param key Application defined key to map results in settings * @returns A promise containing true if the setting was cleared and false if an error occurred. */ clearResponse(key: string | GLOBAL_AGREEMENTS, options?: AgreementKeyOptions): Promise; /** * Returns the users agreement response from settings, but does not show the modal in either response case. * @param key Application defined key to map results in settings * @returns A promise containing the users response if one exists in settings */ getResponse(key: string | GLOBAL_AGREEMENTS, options?: AgreementKeyOptions): Promise; /** * Shows a beta agreement dialog to the user. Using the key parameter, checks in settings if the user has accepted the agreement and * shows the dialog to the user if they have. * @param key Application defined key to map results in settings * @param options List of configurable options such as agreement type and feature name * @returns A promise that is fulfilled once the user takes action from within the dialog (or immediately with the settings response if the user has already accepted the agreement) */ showAgreement(key: string | GLOBAL_AGREEMENTS, options?: AgreementOptions): Promise; } declare const agreements: AgreementsApi; export default agreements;