/**************************************************************************************************
*
* ADOBE SYSTEMS INCORPORATED
* Copyright 2013 Adobe Systems Incorporated
* 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.
*
**************************************************************************************************/ /** CSInterface - v8.0.0 */ declare global { interface Window { cep : any ; __adobe_cep__ : any ; } } /**
 * Stores constants for the window types supported by the CSXS infrastructure.
 */ function CSXSWindowType ( ) { } /** Constant for the CSXS window type Panel. */ CSXSWindowType . _PANEL = "Panel" ; /** Constant for the CSXS window type Modeless. */ CSXSWindowType . _MODELESS = "Modeless" ; /** Constant for the CSXS window type ModalDialog. */ CSXSWindowType . _MODAL_DIALOG = "ModalDialog" ; /** EvalScript error message */ const EvalScript_ErrMessage = "EvalScript error." ; class param major param minor param micro param special return function Version ( major , minor , micro , special ) { this . major = major ; this . minor = minor ; this . micro = micro ; this . special = special ; } /**
 * The maximum value allowed for a numeric version component.
 * This reflects the maximum value allowed in PlugPlug and the manifest schema.
 */ Version . MAX_NUM = 999999999 ; class param version param inclusive return function VersionBound ( version , inclusive ) { this . version = version ; this . inclusive = inclusive ; } class param lowerBound param upperBound return function VersionRange ( lowerBound , upperBound ) { this . lowerBound = lowerBound ; this . upperBound = upperBound ; } class param name param version return function Runtime ( name , versionRange ) { this . name = name ; this . versionRange = versionRange ; } class param id param name param mainPath param basePath param windowType param width param height param minWidth param minHeight param maxWidth param maxHeight param defaultExtensionDataXml param specialExtensionDataXml param requiredRuntimeList param isAutoVisible param isPluginExtension return function Extension ( id , name , mainPath , basePath , windowType , width , height , minWidth , minHeight , maxWidth , maxHeight , defaultExtensionDataXml , specialExtensionDataXml , requiredRuntimeList , isAutoVisible , isPluginExtension ) { this . id = id ; this . name = name ; this . mainPath = mainPath ; this . basePath = basePath ; this . windowType = windowType ; this . width = width ; this . height = height ; this . minWidth = minWidth ; this . minHeight = minHeight ; this . maxWidth = maxWidth ; this . maxHeight = maxHeight ; this . defaultExtensionDataXml = defaultExtensionDataXml ; this . specialExtensionDataXml = specialExtensionDataXml ; this . requiredRuntimeList = requiredRuntimeList ; this . isAutoVisible = isAutoVisible ; this . isPluginExtension = isPluginExtension ; } class param type param scope param appId param extensionId return function CSEvent ( type , scope , appId , extensionId ) { this . type = type ; this . scope = scope ; this . appId = appId ; this . extensionId = extensionId ; } /** Event-specific data. */ CSEvent . prototype . data = "" ; class return function SystemPath ( ) { } /** The path to user data.  */ SystemPath . USER_DATA = "userData" ; /** The path to common files for Adobe applications.  */ SystemPath . COMMON_FILES = "commonFiles" ; /** The path to the user's default document folder.  */ SystemPath . MY_DOCUMENTS = "myDocuments" ; deprecated SystemPath . APPLICATION = "application" ; /** The path to current extension.  */ SystemPath . EXTENSION = "extension" ; /** The path to hosting application's executable.  */ SystemPath . HOST_APPLICATION = "hostApplication" ; class function ColorType ( ) { } /** RGB color type. */ ColorType . RGB = "rgb" ; /** Gradient color type. */ ColorType . GRADIENT = "gradient" ; /** Null color type. */ ColorType . NONE = "none" ; class param red param green param blue param alpha return function RGBColor ( red , green , blue , alpha ) { this . red = red ; this . green = green ; this . blue = blue ; this . alpha = alpha ; } class param x param y return function Direction ( x , y ) { this . x = x ; this . y = y ; } class param offset param rgbColor return function GradientStop ( offset , rgbColor ) { this . offset = offset ; this . rgbColor = rgbColor ; } class param type param direction param numStops param gradientStopList return function GradientColor ( type , direction , numStops , arrGradientStop ) { this . type = type ; this . direction = direction ; this . numStops = numStops ; this . arrGradientStop = arrGradientStop ; } class param type param antialiasLevel param color return function UIColor ( type , antialiasLevel , color ) { this . type = type ; this . antialiasLevel = antialiasLevel ; this . color = color ; } class param baseFontFamily param baseFontSize param appBarBackgroundColor param panelBackgroundColor param appBarBackgroundColorSRGB param panelBackgroundColorSRGB param systemHighlightColor return function AppSkinInfo ( baseFontFamily , baseFontSize , appBarBackgroundColor , panelBackgroundColor , appBarBackgroundColorSRGB , panelBackgroundColorSRGB , systemHighlightColor ) { this . baseFontFamily = baseFontFamily ; this . baseFontSize = baseFontSize ; this . appBarBackgroundColor = appBarBackgroundColor ; this . panelBackgroundColor = panelBackgroundColor ; this . appBarBackgroundColorSRGB = appBarBackgroundColorSRGB ; this . panelBackgroundColorSRGB = panelBackgroundColorSRGB ; this . systemHighlightColor = systemHighlightColor ; } class param appName param appVersion param appLocale param appUILocale param appId param isAppOnline param appSkinInfo return function HostEnvironment ( appName , appVersion , appLocale , appUILocale , appId , isAppOnline , appSkinInfo ) { this . appName = appName ; this . appVersion = appVersion ; this . appLocale = appLocale ; this . appUILocale = appUILocale ; this . appId = appId ; this . isAppOnline = isAppOnline ; this . appSkinInfo = appSkinInfo ; } class param EXTENDED_PANEL_MENU param EXTENDED_PANEL_ICONS param DELEGATE_APE_ENGINE param SUPPORT_HTML_EXTENSIONS param DISABLE_FLASH_EXTENSIONS return function HostCapabilities ( EXTENDED_PANEL_MENU , EXTENDED_PANEL_ICONS , DELEGATE_APE_ENGINE , SUPPORT_HTML_EXTENSIONS , DISABLE_FLASH_EXTENSIONS ) { this . EXTENDED_PANEL_MENU = EXTENDED_PANEL_MENU ; this . EXTENDED_PANEL_ICONS = EXTENDED_PANEL_ICONS ; this . DELEGATE_APE_ENGINE = DELEGATE_APE_ENGINE ; this . SUPPORT_HTML_EXTENSIONS = SUPPORT_HTML_EXTENSIONS ; this . DISABLE_FLASH_EXTENSIONS = DISABLE_FLASH_EXTENSIONS ; } class param major param minor param micro return function ApiVersion ( major , minor , micro ) { this . major = major ; this . minor = minor ; this . micro = micro ; } class param menuItemLabel param enabled param checked return function MenuItemStatus ( menuItemLabel , enabled , checked ) { this . menuItemLabel = menuItemLabel ; this . enabled = enabled ; this . checked = checked ; } class param menuItemID param enabled param checked return function ContextMenuItemStatus ( menuItemID , enabled , checked ) { this . menuItemID = menuItemID ; this . enabled = enabled ; this . checked = checked ; } class return export default function CSInterface ( ) { } example CSInterface . THEME_COLOR_CHANGED_EVENT = "com.adobe.csxs.events.ThemeColorChanged" ; /** The host environment data object. */ CSInterface . prototype . hostEnvironment = window . __adobe_cep__ ? JSON . parse ( window . __adobe_cep__ . getHostEnvironment ( ) ) : null ; return CSInterface . prototype . getHostEnvironment = function ( ) { this . hostEnvironment = JSON . parse ( window . __adobe_cep__ . getHostEnvironment ( ) ) ; return this . hostEnvironment ; } ; /** Closes this extension. */ CSInterface . prototype . closeExtension = function ( ) { window . __adobe_cep__ . closeExtension ( ) ; } ; param pathType return CSInterface . prototype . getSystemPath = function ( pathType ) { var path = decodeURI ( window . __adobe_cep__ . getSystemPath ( pathType ) ) ; var OSVersion = this . getOSInformation ( ) ; if ( OSVersion . indexOf ( "Windows" ) >= 0 ) { path = path . replace ( "file:///" , "" ) ; } else if ( OSVersion . indexOf ( "Mac" ) >= 0 ) { path = path . replace ( "file://" , "" ) ; } return path ; } ; param script param callback CSInterface . prototype . evalScript = function ( script , callback ) { if ( callback === null || callback === undefined ) { callback = function ( result ) { } ; } window . __adobe_cep__ . evalScript ( script , callback ) ; } ; return CSInterface . prototype . getApplicationID = function ( ) { var appId = this . hostEnvironment . appId ; return appId ; } ; return CSInterface . prototype . getHostCapabilities = function ( ) { var hostCapabilities = JSON . parse ( window . __adobe_cep__ . getHostCapabilities ( ) ) ; return hostCapabilities ; } ; param event CSInterface . prototype . dispatchEvent = function ( event ) { if ( typeof event . data == "object" ) { event . data = JSON . stringify ( event . data ) ; } window . __adobe_cep__ . dispatchEvent ( event ) ; } ; param type param listener param obj CSInterface . prototype . addEventListener = function ( type , listener , obj ) { window . __adobe_cep__ . addEventListener ( type , listener , obj ) ; } ; param type param listener param obj CSInterface . prototype . removeEventListener = function ( type , listener , obj ) { window . __adobe_cep__ . removeEventListener ( type , listener , obj ) ; } ; param extensionId param startupParams example CSInterface . prototype . requestOpenExtension = function ( extensionId , params ) { window . __adobe_cep__ . requestOpenExtension ( extensionId , params ) ; } ; param extensionIds return CSInterface . prototype . getExtensions = function ( extensionIds ) { var extensionIdsStr = JSON . stringify ( extensionIds ) ; var extensionsStr = window . __adobe_cep__ . getExtensions ( extensionIdsStr ) ; var extensions = JSON . parse ( extensionsStr ) ; return extensions ; } ; return CSInterface . prototype . getNetworkPreferences = function ( ) { var result = window . __adobe_cep__ . getNetworkPreferences ( ) ; var networkPre = JSON . parse ( result ) ; return networkPre ; } ; return CSInterface . prototype . initResourceBundle = function ( ) { var resourceBundle = JSON . parse ( window . __adobe_cep__ . initResourceBundle ( ) ) ; var resElms = document . querySelectorAll ( '[data-locale]' ) ; for ( var n = 0 ; n < resElms . length ; n ++ ) { var resEl = resElms [ n ] ; var resKey = resEl . getAttribute ( 'data-locale' ) ; if ( resKey ) { for ( var key in resourceBundle ) { if ( key . indexOf ( resKey ) === 0 ) { var resValue = resourceBundle [ key ] ; if ( key . length == resKey . length ) { resEl . innerHTML = resValue ; } else if ( '.' == key . charAt ( resKey . length ) ) { var attrKey = key . substring ( resKey . length + 1 ) ; resEl [ attrKey ] = resValue ; } } } } } return resourceBundle ; } ; return CSInterface . prototype . dumpInstallationInfo = function ( ) { return window . __adobe_cep__ . dumpInstallationInfo ( ) ; } ; return CSInterface . prototype . getOSInformation = function ( ) { var userAgent = navigator . userAgent ; if ( ( navigator . platform == "Win32" ) || ( navigator . platform == "Windows" ) ) { var winVersion = "Windows" ; var winBit = "" ; if ( userAgent . indexOf ( "Windows" ) > - 1 ) { if ( userAgent . indexOf ( "Windows NT 5.0" ) > - 1 ) { winVersion = "Windows 2000" ; } else if ( userAgent . indexOf ( "Windows NT 5.1" ) > - 1 ) { winVersion = "Windows XP" ; } else if ( userAgent . indexOf ( "Windows NT 5.2" ) > - 1 ) { winVersion = "Windows Server 2003" ; } else if ( userAgent . indexOf ( "Windows NT 6.0" ) > - 1 ) { winVersion = "Windows Vista" ; } else if ( userAgent . indexOf ( "Windows NT 6.1" ) > - 1 ) { winVersion = "Windows 7" ; } else if ( userAgent . indexOf ( "Windows NT 6.2" ) > - 1 ) { winVersion = "Windows 8" ; } else if ( userAgent . indexOf ( "Windows NT 6.3" ) > - 1 ) { winVersion = "Windows 8.1" ; } else if ( userAgent . indexOf ( "Windows NT 10" ) > - 1 ) { winVersion = "Windows 10" ; } if ( userAgent . indexOf ( "WOW64" ) > - 1 || userAgent . indexOf ( "Win64" ) > - 1 ) { winBit = " 64-bit" ; } else { winBit = " 32-bit" ; } } return winVersion + winBit ; } else if ( ( navigator . platform == "MacIntel" ) || ( navigator . platform == "Macintosh" ) ) { var result = "Mac OS X" ; if ( userAgent . indexOf ( "Mac OS X" ) > - 1 ) { result = userAgent . substring ( userAgent . indexOf ( "Mac OS X" ) , userAgent . indexOf ( ")" ) ) ; result = result . replace ( /_/g , "." ) ; } return result ; } return "Unknown Operation System" ; } ; param url return CSInterface . prototype . openURLInDefaultBrowser = function ( url ) { return window . cep . util . openURLInDefaultBrowser ( url ) ; } ; return CSInterface . prototype . getExtensionID = function ( ) { return window . __adobe_cep__ . getExtensionId ( ) ; } ; return CSInterface . prototype . getScaleFactor = function ( ) { return window . __adobe_cep__ . getScaleFactor ( ) ; } ; param handler CSInterface . prototype . setScaleFactorChangedHandler = function ( handler ) { window . __adobe_cep__ . setScaleFactorChangedHandler ( handler ) ; } ; return CSInterface . prototype . getCurrentApiVersion = function ( ) { var apiVersion = JSON . parse ( window . __adobe_cep__ . getCurrentApiVersion ( ) ) ; return apiVersion ; } ; param menu CSInterface . prototype . setPanelFlyoutMenu = function ( menu ) { if ( "string" != typeof menu ) { return ; } window . __adobe_cep__ . invokeSync ( "setPanelFlyoutMenu" , menu ) ; } ; param menuItemLabel param enabled param checked return see HostCapabilities . EXTENDED_PANEL_MENU CSInterface . prototype . updatePanelMenuItem = function ( menuItemLabel , enabled , checked ) { var ret = false ; if ( this . getHostCapabilities ( ) . EXTENDED_PANEL_MENU ) { var itemStatus = new MenuItemStatus ( menuItemLabel , enabled , checked ) ; ret = window . __adobe_cep__ . invokeSync ( "updatePanelMenuItem" , JSON . stringify ( itemStatus ) ) ; } return ret ; } ; param menu param callback description CSInterface . prototype . setContextMenu = function ( menu , callback ) { if ( "string" != typeof menu ) { return ; } window . __adobe_cep__ . invokeAsync ( "setContextMenu" , menu , callback ) ; } ; param menu param callback description CSInterface . prototype . setContextMenuByJSON = function ( menu , callback ) { if ( "string" != typeof menu ) { return ; } window . __adobe_cep__ . invokeAsync ( "setContextMenuByJSON" , menu , callback ) ; } ; param menuItemID param enabled param checked CSInterface . prototype . updateContextMenuItem = function ( menuItemID , enabled , checked ) { var itemStatus = new ContextMenuItemStatus ( menuItemID , enabled , checked ) ; window . __adobe_cep__ . invokeSync ( "updateContextMenuItem" , JSON . stringify ( itemStatus ) ) ; } ; return CSInterface . prototype . isWindowVisible = function ( ) { return window . __adobe_cep__ . invokeSync ( "isWindowVisible" , "" ) ; } ; param width param height CSInterface . prototype . resizeContent = function ( width , height ) { window . __adobe_cep__ . resizeContent ( width , height ) ; } ; param callback CSInterface . prototype . registerInvalidCertificateCallback = function ( callback ) { return window . __adobe_cep__ . registerInvalidCertificateCallback ( callback ) ; } ; param keyEventsInterest CSInterface . prototype . registerKeyEventsInterest = function ( keyEventsInterest ) { return window . __adobe_cep__ . registerKeyEventsInterest ( keyEventsInterest ) ; } ; param title CSInterface . prototype . setWindowTitle = function ( title ) { window . __adobe_cep__ . invokeSync ( "setWindowTitle" , title ) ; } ; return CSInterface . prototype . getWindowTitle = function ( ) { return window . __adobe_cep__ . invokeSync ( "getWindowTitle" , "" ) ; } ;