@openfin/fdc3-api 45.100.99 → 45.100.101

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5357,7 +5357,7 @@ declare type Event_4 = (WebContentsEvents.Event<'view'> & {
5357
5357
  */
5358
5358
  declare type Event_5<Topic extends string> = {
5359
5359
  topic: Topic;
5360
- } & (BlurredEvent | CertificateSelectionShownEvent | CrashedEvent_2 | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | UrlChangedEvent | DidFailLoadEvent | DidFinishLoadEvent | DidStartLoadingEvent | PageFaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent | ChildWindowCreatedEvent | FileDownloadStartedEvent | FileDownloadProgressEvent | FileDownloadCompletedEvent | FoundInPageEvent | CertificateErrorEvent | ContentBlockedEvent | WillRedirectEvent | ClipboardCopyBlockedEvent | ClipboardPasteBlockedEvent);
5360
+ } & (BlurredEvent | CertificateSelectionShownEvent | CrashedEvent_2 | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | UrlChangedEvent | DidFailLoadEvent | DidFinishLoadEvent | DidStartLoadingEvent | PageFaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent | ChildWindowCreatedEvent | FileDownloadStartedEvent | FileDownloadProgressEvent | FileDownloadCompletedEvent | FoundInPageEvent | CertificateErrorEvent | ContentBlockedEvent | WillRedirectEvent | ClipboardCopyBlockedEvent | ClipboardPasteBlockedEvent | TranslationStateChangedEvent);
5361
5361
 
5362
5362
  /**
5363
5363
  * [Union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) containing every possible event that can be emitted by a {@link Window}. Events are
@@ -5841,6 +5841,19 @@ declare type ExternalProcessStartedEvent = BaseEvent_5 & {
5841
5841
  processUuid: string;
5842
5842
  };
5843
5843
 
5844
+ /**
5845
+ * Translation status of a translatable WebContents whose translation attempt has failed.
5846
+ */
5847
+ declare type FailedTranslationStatus = {
5848
+ status: 'translation-failed';
5849
+ /** The language the page was being translated from. */
5850
+ sourceLanguage: LanguageInfo;
5851
+ /** The language the page was being translated to. */
5852
+ targetLanguage: LanguageInfo;
5853
+ /** Human-readable description of why the translation failed. */
5854
+ errorMessage: string;
5855
+ };
5856
+
5844
5857
  /**
5845
5858
  * @deprecated, use {@link PageFaviconUpdatedEvent}.
5846
5859
  */
@@ -8516,6 +8529,18 @@ declare type JumpListTask = {
8516
8529
  iconIndex?: number;
8517
8530
  };
8518
8531
 
8532
+ /**
8533
+ * Language metadata for content translation.
8534
+ */
8535
+ declare type LanguageInfo = {
8536
+ /** ISO language code (e.g. "fr"). */
8537
+ code: string;
8538
+ /** English display name of the language (e.g. "French"). */
8539
+ nameEn: string;
8540
+ /** Localized display name of the language (e.g. "Français"). */
8541
+ nameI18N: string;
8542
+ };
8543
+
8519
8544
  /**
8520
8545
  * The LaunchEmitter is an `EventEmitter`. It can listen to app version resolver events.
8521
8546
  *
@@ -11142,6 +11167,14 @@ declare namespace OpenFin {
11142
11167
  ClientChangedContextGroup,
11143
11168
  InteropClientEvents,
11144
11169
  ChromeBrowser,
11170
+ LanguageInfo,
11171
+ PageTranslateOptions,
11172
+ FailedTranslationStatus,
11173
+ TranslatedPageStatus,
11174
+ TranslationStatus,
11175
+ UntranslatableWebContentInfo,
11176
+ TranslatableWebContentInfo,
11177
+ WebContentTranslationInfo,
11145
11178
  ApplicationEvents,
11146
11179
  BaseEvents,
11147
11180
  ExternalApplicationEvents,
@@ -11208,6 +11241,16 @@ declare type PageTitleUpdatedEvent = NamedEvent & {
11208
11241
  title: string;
11209
11242
  };
11210
11243
 
11244
+ /**
11245
+ * Options for {@link OpenFin.WebContents.translatePage}.
11246
+ */
11247
+ declare type PageTranslateOptions = {
11248
+ /** BCP-47 language code of the source language, or empty string for auto-detect. */
11249
+ sourceLang: string;
11250
+ /** BCP-47 language code of the target language. */
11251
+ targetLang: string;
11252
+ };
11253
+
11211
11254
  /**
11212
11255
  * Reasons for a paste operation being blocked
11213
11256
  *
@@ -14256,6 +14299,12 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
14256
14299
  request: OpenFin.Identity;
14257
14300
  response: OpenFin.ScreenCapturePermission;
14258
14301
  };
14302
+ 'translate-page': IdentityCall<{
14303
+ sourceLang: string;
14304
+ targetLang: string;
14305
+ }, void>;
14306
+ 'revert-translation': IdentityCall<{}, void>;
14307
+ 'get-translation-state': IdentityCall<{}, OpenFin.WebContentTranslationInfo>;
14259
14308
  'render-overlay': {
14260
14309
  request: {
14261
14310
  bounds: OpenFin.Bounds;
@@ -17750,6 +17799,45 @@ declare type TransitionOptions = {
17750
17799
  tween?: tween;
17751
17800
  };
17752
17801
 
17802
+ /**
17803
+ * Describes a WebContents on which content translation is supported.
17804
+ */
17805
+ declare type TranslatableWebContentInfo = {
17806
+ /** Whether translation is supported on this WebContents. */
17807
+ translationEnabled: true;
17808
+ /** Detected WebContents language, or undefined if not yet determined. */
17809
+ detectedLanguage?: LanguageInfo;
17810
+ /** Translation status of the WebContents. */
17811
+ state: TranslationStatus;
17812
+ };
17813
+
17814
+ /**
17815
+ * Translation status of a translatable WebContents that is translated or is being translated.
17816
+ */
17817
+ declare type TranslatedPageStatus = {
17818
+ status: 'pending-translation' | 'translated';
17819
+ /** The language the page is being translated from. */
17820
+ sourceLanguage: LanguageInfo;
17821
+ /** The language the page is being translated to. */
17822
+ targetLanguage: LanguageInfo;
17823
+ };
17824
+
17825
+ /**
17826
+ * Generated when the translation state of a WebContents changes, such as when a page in a
17827
+ * foreign language is detected or when a translation completes.
17828
+ * @interface
17829
+ */
17830
+ declare type TranslationStateChangedEvent = NamedEvent & {
17831
+ type: 'translation-state-changed';
17832
+ } & OpenFin.WebContentTranslationInfo;
17833
+
17834
+ /**
17835
+ * The translation status of a translatable WebContents.
17836
+ */
17837
+ declare type TranslationStatus = {
17838
+ status: 'untranslated';
17839
+ } | FailedTranslationStatus | TranslatedPageStatus;
17840
+
17753
17841
  declare class Transport<MeType extends EntityType = EntityType> extends EventEmitter {
17754
17842
  #private;
17755
17843
  protected wireListeners: Map<number, {
@@ -17849,6 +17937,14 @@ declare type UnregisteredEvent = BaseEvent_8 & {
17849
17937
  type: 'unregistered';
17850
17938
  };
17851
17939
 
17940
+ /**
17941
+ * Describes a WebContents on which content translation is not supported (for example because no
17942
+ * translation API key is configured on the machine, or the current page is not translatable).
17943
+ */
17944
+ declare type UntranslatableWebContentInfo = {
17945
+ translationEnabled: false;
17946
+ };
17947
+
17852
17948
  /**
17853
17949
  * View options that can be updated after creation.
17854
17950
  *
@@ -19055,6 +19151,26 @@ declare class WebContents<T extends BaseEvent> extends EmitterBase<T> {
19055
19151
  * {@link OpenFin.WebContentsEvents event namespace}.
19056
19152
  */
19057
19153
  setZoomLevel(level: number): Promise<void>;
19154
+ /**
19155
+ * Translates the WebContents from the source language to the target language.
19156
+ *
19157
+ * Translation requires a translation API key to be configured on the machine. If translation is
19158
+ * unavailable, the call is a no-op and a `translation-state-changed` event is emitted describing
19159
+ * the failure.
19160
+ *
19161
+ * @param options Source and target languages for the translation.
19162
+ */
19163
+ translatePage(options: OpenFin.PageTranslateOptions): Promise<void>;
19164
+ /**
19165
+ * Reverts a previously translated WebContents back to its original language.
19166
+ *
19167
+ * If the WebContents is not currently translated, this is a no-op and resolves successfully.
19168
+ */
19169
+ revertTranslation(): Promise<void>;
19170
+ /**
19171
+ * Gets the current content-translation state of the WebContents.
19172
+ */
19173
+ getTranslationState(): Promise<OpenFin.WebContentTranslationInfo>;
19058
19174
  /**
19059
19175
  * Navigates the WebContents to a specified URL.
19060
19176
  *
@@ -19872,6 +19988,7 @@ declare namespace WebContentsEvents {
19872
19988
  ContentBlockedEvent,
19873
19989
  ClipboardCopyBlockedEvent,
19874
19990
  ClipboardPasteBlockedEvent,
19991
+ TranslationStateChangedEvent,
19875
19992
  Event_5 as Event,
19876
19993
  WebContentsEvent,
19877
19994
  WillPropagateWebContentsEvent,
@@ -19880,6 +19997,11 @@ declare namespace WebContentsEvents {
19880
19997
  }
19881
19998
  }
19882
19999
 
20000
+ /**
20001
+ * Describes the current content-translation state of a WebContents.
20002
+ */
20003
+ declare type WebContentTranslationInfo = UntranslatableWebContentInfo | TranslatableWebContentInfo;
20004
+
19883
20005
  declare type WebNotificationInfo = {
19884
20006
  notificationId: string;
19885
20007
  properties: WebNotificationProperties;
@@ -5357,7 +5357,7 @@ declare type Event_4 = (WebContentsEvents.Event<'view'> & {
5357
5357
  */
5358
5358
  declare type Event_5<Topic extends string> = {
5359
5359
  topic: Topic;
5360
- } & (BlurredEvent | CertificateSelectionShownEvent | CrashedEvent_2 | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | UrlChangedEvent | DidFailLoadEvent | DidFinishLoadEvent | DidStartLoadingEvent | PageFaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent | ChildWindowCreatedEvent | FileDownloadStartedEvent | FileDownloadProgressEvent | FileDownloadCompletedEvent | FoundInPageEvent | CertificateErrorEvent | ContentBlockedEvent | WillRedirectEvent | ClipboardCopyBlockedEvent | ClipboardPasteBlockedEvent);
5360
+ } & (BlurredEvent | CertificateSelectionShownEvent | CrashedEvent_2 | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | UrlChangedEvent | DidFailLoadEvent | DidFinishLoadEvent | DidStartLoadingEvent | PageFaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent | ChildWindowCreatedEvent | FileDownloadStartedEvent | FileDownloadProgressEvent | FileDownloadCompletedEvent | FoundInPageEvent | CertificateErrorEvent | ContentBlockedEvent | WillRedirectEvent | ClipboardCopyBlockedEvent | ClipboardPasteBlockedEvent | TranslationStateChangedEvent);
5361
5361
 
5362
5362
  /**
5363
5363
  * [Union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) containing every possible event that can be emitted by a {@link Window}. Events are
@@ -5841,6 +5841,19 @@ declare type ExternalProcessStartedEvent = BaseEvent_5 & {
5841
5841
  processUuid: string;
5842
5842
  };
5843
5843
 
5844
+ /**
5845
+ * Translation status of a translatable WebContents whose translation attempt has failed.
5846
+ */
5847
+ declare type FailedTranslationStatus = {
5848
+ status: 'translation-failed';
5849
+ /** The language the page was being translated from. */
5850
+ sourceLanguage: LanguageInfo;
5851
+ /** The language the page was being translated to. */
5852
+ targetLanguage: LanguageInfo;
5853
+ /** Human-readable description of why the translation failed. */
5854
+ errorMessage: string;
5855
+ };
5856
+
5844
5857
  /**
5845
5858
  * @deprecated, use {@link PageFaviconUpdatedEvent}.
5846
5859
  */
@@ -8516,6 +8529,18 @@ declare type JumpListTask = {
8516
8529
  iconIndex?: number;
8517
8530
  };
8518
8531
 
8532
+ /**
8533
+ * Language metadata for content translation.
8534
+ */
8535
+ declare type LanguageInfo = {
8536
+ /** ISO language code (e.g. "fr"). */
8537
+ code: string;
8538
+ /** English display name of the language (e.g. "French"). */
8539
+ nameEn: string;
8540
+ /** Localized display name of the language (e.g. "Français"). */
8541
+ nameI18N: string;
8542
+ };
8543
+
8519
8544
  /**
8520
8545
  * The LaunchEmitter is an `EventEmitter`. It can listen to app version resolver events.
8521
8546
  *
@@ -11142,6 +11167,14 @@ declare namespace OpenFin {
11142
11167
  ClientChangedContextGroup,
11143
11168
  InteropClientEvents,
11144
11169
  ChromeBrowser,
11170
+ LanguageInfo,
11171
+ PageTranslateOptions,
11172
+ FailedTranslationStatus,
11173
+ TranslatedPageStatus,
11174
+ TranslationStatus,
11175
+ UntranslatableWebContentInfo,
11176
+ TranslatableWebContentInfo,
11177
+ WebContentTranslationInfo,
11145
11178
  ApplicationEvents,
11146
11179
  BaseEvents,
11147
11180
  ExternalApplicationEvents,
@@ -11208,6 +11241,16 @@ declare type PageTitleUpdatedEvent = NamedEvent & {
11208
11241
  title: string;
11209
11242
  };
11210
11243
 
11244
+ /**
11245
+ * Options for {@link OpenFin.WebContents.translatePage}.
11246
+ */
11247
+ declare type PageTranslateOptions = {
11248
+ /** BCP-47 language code of the source language, or empty string for auto-detect. */
11249
+ sourceLang: string;
11250
+ /** BCP-47 language code of the target language. */
11251
+ targetLang: string;
11252
+ };
11253
+
11211
11254
  /**
11212
11255
  * Reasons for a paste operation being blocked
11213
11256
  *
@@ -14256,6 +14299,12 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
14256
14299
  request: OpenFin.Identity;
14257
14300
  response: OpenFin.ScreenCapturePermission;
14258
14301
  };
14302
+ 'translate-page': IdentityCall<{
14303
+ sourceLang: string;
14304
+ targetLang: string;
14305
+ }, void>;
14306
+ 'revert-translation': IdentityCall<{}, void>;
14307
+ 'get-translation-state': IdentityCall<{}, OpenFin.WebContentTranslationInfo>;
14259
14308
  'render-overlay': {
14260
14309
  request: {
14261
14310
  bounds: OpenFin.Bounds;
@@ -17750,6 +17799,45 @@ declare type TransitionOptions = {
17750
17799
  tween?: tween;
17751
17800
  };
17752
17801
 
17802
+ /**
17803
+ * Describes a WebContents on which content translation is supported.
17804
+ */
17805
+ declare type TranslatableWebContentInfo = {
17806
+ /** Whether translation is supported on this WebContents. */
17807
+ translationEnabled: true;
17808
+ /** Detected WebContents language, or undefined if not yet determined. */
17809
+ detectedLanguage?: LanguageInfo;
17810
+ /** Translation status of the WebContents. */
17811
+ state: TranslationStatus;
17812
+ };
17813
+
17814
+ /**
17815
+ * Translation status of a translatable WebContents that is translated or is being translated.
17816
+ */
17817
+ declare type TranslatedPageStatus = {
17818
+ status: 'pending-translation' | 'translated';
17819
+ /** The language the page is being translated from. */
17820
+ sourceLanguage: LanguageInfo;
17821
+ /** The language the page is being translated to. */
17822
+ targetLanguage: LanguageInfo;
17823
+ };
17824
+
17825
+ /**
17826
+ * Generated when the translation state of a WebContents changes, such as when a page in a
17827
+ * foreign language is detected or when a translation completes.
17828
+ * @interface
17829
+ */
17830
+ declare type TranslationStateChangedEvent = NamedEvent & {
17831
+ type: 'translation-state-changed';
17832
+ } & OpenFin.WebContentTranslationInfo;
17833
+
17834
+ /**
17835
+ * The translation status of a translatable WebContents.
17836
+ */
17837
+ declare type TranslationStatus = {
17838
+ status: 'untranslated';
17839
+ } | FailedTranslationStatus | TranslatedPageStatus;
17840
+
17753
17841
  declare class Transport<MeType extends EntityType = EntityType> extends EventEmitter {
17754
17842
  #private;
17755
17843
  protected wireListeners: Map<number, {
@@ -17849,6 +17937,14 @@ declare type UnregisteredEvent = BaseEvent_8 & {
17849
17937
  type: 'unregistered';
17850
17938
  };
17851
17939
 
17940
+ /**
17941
+ * Describes a WebContents on which content translation is not supported (for example because no
17942
+ * translation API key is configured on the machine, or the current page is not translatable).
17943
+ */
17944
+ declare type UntranslatableWebContentInfo = {
17945
+ translationEnabled: false;
17946
+ };
17947
+
17852
17948
  /**
17853
17949
  * View options that can be updated after creation.
17854
17950
  *
@@ -19055,6 +19151,26 @@ declare class WebContents<T extends BaseEvent> extends EmitterBase<T> {
19055
19151
  * {@link OpenFin.WebContentsEvents event namespace}.
19056
19152
  */
19057
19153
  setZoomLevel(level: number): Promise<void>;
19154
+ /**
19155
+ * Translates the WebContents from the source language to the target language.
19156
+ *
19157
+ * Translation requires a translation API key to be configured on the machine. If translation is
19158
+ * unavailable, the call is a no-op and a `translation-state-changed` event is emitted describing
19159
+ * the failure.
19160
+ *
19161
+ * @param options Source and target languages for the translation.
19162
+ */
19163
+ translatePage(options: OpenFin.PageTranslateOptions): Promise<void>;
19164
+ /**
19165
+ * Reverts a previously translated WebContents back to its original language.
19166
+ *
19167
+ * If the WebContents is not currently translated, this is a no-op and resolves successfully.
19168
+ */
19169
+ revertTranslation(): Promise<void>;
19170
+ /**
19171
+ * Gets the current content-translation state of the WebContents.
19172
+ */
19173
+ getTranslationState(): Promise<OpenFin.WebContentTranslationInfo>;
19058
19174
  /**
19059
19175
  * Navigates the WebContents to a specified URL.
19060
19176
  *
@@ -19872,6 +19988,7 @@ declare namespace WebContentsEvents {
19872
19988
  ContentBlockedEvent,
19873
19989
  ClipboardCopyBlockedEvent,
19874
19990
  ClipboardPasteBlockedEvent,
19991
+ TranslationStateChangedEvent,
19875
19992
  Event_5 as Event,
19876
19993
  WebContentsEvent,
19877
19994
  WillPropagateWebContentsEvent,
@@ -19880,6 +19997,11 @@ declare namespace WebContentsEvents {
19880
19997
  }
19881
19998
  }
19882
19999
 
20000
+ /**
20001
+ * Describes the current content-translation state of a WebContents.
20002
+ */
20003
+ declare type WebContentTranslationInfo = UntranslatableWebContentInfo | TranslatableWebContentInfo;
20004
+
19883
20005
  declare type WebNotificationInfo = {
19884
20006
  notificationId: string;
19885
20007
  properties: WebNotificationProperties;
@@ -5357,7 +5357,7 @@ declare type Event_4 = (WebContentsEvents.Event<'view'> & {
5357
5357
  */
5358
5358
  declare type Event_5<Topic extends string> = {
5359
5359
  topic: Topic;
5360
- } & (BlurredEvent | CertificateSelectionShownEvent | CrashedEvent_2 | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | UrlChangedEvent | DidFailLoadEvent | DidFinishLoadEvent | DidStartLoadingEvent | PageFaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent | ChildWindowCreatedEvent | FileDownloadStartedEvent | FileDownloadProgressEvent | FileDownloadCompletedEvent | FoundInPageEvent | CertificateErrorEvent | ContentBlockedEvent | WillRedirectEvent | ClipboardCopyBlockedEvent | ClipboardPasteBlockedEvent);
5360
+ } & (BlurredEvent | CertificateSelectionShownEvent | CrashedEvent_2 | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | UrlChangedEvent | DidFailLoadEvent | DidFinishLoadEvent | DidStartLoadingEvent | PageFaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent | ChildWindowCreatedEvent | FileDownloadStartedEvent | FileDownloadProgressEvent | FileDownloadCompletedEvent | FoundInPageEvent | CertificateErrorEvent | ContentBlockedEvent | WillRedirectEvent | ClipboardCopyBlockedEvent | ClipboardPasteBlockedEvent | TranslationStateChangedEvent);
5361
5361
 
5362
5362
  /**
5363
5363
  * [Union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) containing every possible event that can be emitted by a {@link Window}. Events are
@@ -5841,6 +5841,19 @@ declare type ExternalProcessStartedEvent = BaseEvent_5 & {
5841
5841
  processUuid: string;
5842
5842
  };
5843
5843
 
5844
+ /**
5845
+ * Translation status of a translatable WebContents whose translation attempt has failed.
5846
+ */
5847
+ declare type FailedTranslationStatus = {
5848
+ status: 'translation-failed';
5849
+ /** The language the page was being translated from. */
5850
+ sourceLanguage: LanguageInfo;
5851
+ /** The language the page was being translated to. */
5852
+ targetLanguage: LanguageInfo;
5853
+ /** Human-readable description of why the translation failed. */
5854
+ errorMessage: string;
5855
+ };
5856
+
5844
5857
  /**
5845
5858
  * @deprecated, use {@link PageFaviconUpdatedEvent}.
5846
5859
  */
@@ -8516,6 +8529,18 @@ declare type JumpListTask = {
8516
8529
  iconIndex?: number;
8517
8530
  };
8518
8531
 
8532
+ /**
8533
+ * Language metadata for content translation.
8534
+ */
8535
+ declare type LanguageInfo = {
8536
+ /** ISO language code (e.g. "fr"). */
8537
+ code: string;
8538
+ /** English display name of the language (e.g. "French"). */
8539
+ nameEn: string;
8540
+ /** Localized display name of the language (e.g. "Français"). */
8541
+ nameI18N: string;
8542
+ };
8543
+
8519
8544
  /**
8520
8545
  * The LaunchEmitter is an `EventEmitter`. It can listen to app version resolver events.
8521
8546
  *
@@ -11142,6 +11167,14 @@ declare namespace OpenFin {
11142
11167
  ClientChangedContextGroup,
11143
11168
  InteropClientEvents,
11144
11169
  ChromeBrowser,
11170
+ LanguageInfo,
11171
+ PageTranslateOptions,
11172
+ FailedTranslationStatus,
11173
+ TranslatedPageStatus,
11174
+ TranslationStatus,
11175
+ UntranslatableWebContentInfo,
11176
+ TranslatableWebContentInfo,
11177
+ WebContentTranslationInfo,
11145
11178
  ApplicationEvents,
11146
11179
  BaseEvents,
11147
11180
  ExternalApplicationEvents,
@@ -11208,6 +11241,16 @@ declare type PageTitleUpdatedEvent = NamedEvent & {
11208
11241
  title: string;
11209
11242
  };
11210
11243
 
11244
+ /**
11245
+ * Options for {@link OpenFin.WebContents.translatePage}.
11246
+ */
11247
+ declare type PageTranslateOptions = {
11248
+ /** BCP-47 language code of the source language, or empty string for auto-detect. */
11249
+ sourceLang: string;
11250
+ /** BCP-47 language code of the target language. */
11251
+ targetLang: string;
11252
+ };
11253
+
11211
11254
  /**
11212
11255
  * Reasons for a paste operation being blocked
11213
11256
  *
@@ -14256,6 +14299,12 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
14256
14299
  request: OpenFin.Identity;
14257
14300
  response: OpenFin.ScreenCapturePermission;
14258
14301
  };
14302
+ 'translate-page': IdentityCall<{
14303
+ sourceLang: string;
14304
+ targetLang: string;
14305
+ }, void>;
14306
+ 'revert-translation': IdentityCall<{}, void>;
14307
+ 'get-translation-state': IdentityCall<{}, OpenFin.WebContentTranslationInfo>;
14259
14308
  'render-overlay': {
14260
14309
  request: {
14261
14310
  bounds: OpenFin.Bounds;
@@ -17750,6 +17799,45 @@ declare type TransitionOptions = {
17750
17799
  tween?: tween;
17751
17800
  };
17752
17801
 
17802
+ /**
17803
+ * Describes a WebContents on which content translation is supported.
17804
+ */
17805
+ declare type TranslatableWebContentInfo = {
17806
+ /** Whether translation is supported on this WebContents. */
17807
+ translationEnabled: true;
17808
+ /** Detected WebContents language, or undefined if not yet determined. */
17809
+ detectedLanguage?: LanguageInfo;
17810
+ /** Translation status of the WebContents. */
17811
+ state: TranslationStatus;
17812
+ };
17813
+
17814
+ /**
17815
+ * Translation status of a translatable WebContents that is translated or is being translated.
17816
+ */
17817
+ declare type TranslatedPageStatus = {
17818
+ status: 'pending-translation' | 'translated';
17819
+ /** The language the page is being translated from. */
17820
+ sourceLanguage: LanguageInfo;
17821
+ /** The language the page is being translated to. */
17822
+ targetLanguage: LanguageInfo;
17823
+ };
17824
+
17825
+ /**
17826
+ * Generated when the translation state of a WebContents changes, such as when a page in a
17827
+ * foreign language is detected or when a translation completes.
17828
+ * @interface
17829
+ */
17830
+ declare type TranslationStateChangedEvent = NamedEvent & {
17831
+ type: 'translation-state-changed';
17832
+ } & OpenFin.WebContentTranslationInfo;
17833
+
17834
+ /**
17835
+ * The translation status of a translatable WebContents.
17836
+ */
17837
+ declare type TranslationStatus = {
17838
+ status: 'untranslated';
17839
+ } | FailedTranslationStatus | TranslatedPageStatus;
17840
+
17753
17841
  declare class Transport<MeType extends EntityType = EntityType> extends EventEmitter {
17754
17842
  #private;
17755
17843
  protected wireListeners: Map<number, {
@@ -17849,6 +17937,14 @@ declare type UnregisteredEvent = BaseEvent_8 & {
17849
17937
  type: 'unregistered';
17850
17938
  };
17851
17939
 
17940
+ /**
17941
+ * Describes a WebContents on which content translation is not supported (for example because no
17942
+ * translation API key is configured on the machine, or the current page is not translatable).
17943
+ */
17944
+ declare type UntranslatableWebContentInfo = {
17945
+ translationEnabled: false;
17946
+ };
17947
+
17852
17948
  /**
17853
17949
  * View options that can be updated after creation.
17854
17950
  *
@@ -19055,6 +19151,26 @@ declare class WebContents<T extends BaseEvent> extends EmitterBase<T> {
19055
19151
  * {@link OpenFin.WebContentsEvents event namespace}.
19056
19152
  */
19057
19153
  setZoomLevel(level: number): Promise<void>;
19154
+ /**
19155
+ * Translates the WebContents from the source language to the target language.
19156
+ *
19157
+ * Translation requires a translation API key to be configured on the machine. If translation is
19158
+ * unavailable, the call is a no-op and a `translation-state-changed` event is emitted describing
19159
+ * the failure.
19160
+ *
19161
+ * @param options Source and target languages for the translation.
19162
+ */
19163
+ translatePage(options: OpenFin.PageTranslateOptions): Promise<void>;
19164
+ /**
19165
+ * Reverts a previously translated WebContents back to its original language.
19166
+ *
19167
+ * If the WebContents is not currently translated, this is a no-op and resolves successfully.
19168
+ */
19169
+ revertTranslation(): Promise<void>;
19170
+ /**
19171
+ * Gets the current content-translation state of the WebContents.
19172
+ */
19173
+ getTranslationState(): Promise<OpenFin.WebContentTranslationInfo>;
19058
19174
  /**
19059
19175
  * Navigates the WebContents to a specified URL.
19060
19176
  *
@@ -19872,6 +19988,7 @@ declare namespace WebContentsEvents {
19872
19988
  ContentBlockedEvent,
19873
19989
  ClipboardCopyBlockedEvent,
19874
19990
  ClipboardPasteBlockedEvent,
19991
+ TranslationStateChangedEvent,
19875
19992
  Event_5 as Event,
19876
19993
  WebContentsEvent,
19877
19994
  WillPropagateWebContentsEvent,
@@ -19880,6 +19997,11 @@ declare namespace WebContentsEvents {
19880
19997
  }
19881
19998
  }
19882
19999
 
20000
+ /**
20001
+ * Describes the current content-translation state of a WebContents.
20002
+ */
20003
+ declare type WebContentTranslationInfo = UntranslatableWebContentInfo | TranslatableWebContentInfo;
20004
+
19883
20005
  declare type WebNotificationInfo = {
19884
20006
  notificationId: string;
19885
20007
  properties: WebNotificationProperties;
package/out/fdc3-api.d.ts CHANGED
@@ -5421,7 +5421,7 @@ declare type Event_4 = (WebContentsEvents.Event<'view'> & {
5421
5421
  */
5422
5422
  declare type Event_5<Topic extends string> = {
5423
5423
  topic: Topic;
5424
- } & (BlurredEvent | CertificateSelectionShownEvent | CrashedEvent_2 | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | UrlChangedEvent | DidFailLoadEvent | DidFinishLoadEvent | DidStartLoadingEvent | PageFaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent | ChildWindowCreatedEvent | FileDownloadStartedEvent | FileDownloadProgressEvent | FileDownloadCompletedEvent | FoundInPageEvent | CertificateErrorEvent | ContentBlockedEvent | WillRedirectEvent | ClipboardCopyBlockedEvent | ClipboardPasteBlockedEvent);
5424
+ } & (BlurredEvent | CertificateSelectionShownEvent | CrashedEvent_2 | DidChangeThemeColorEvent | FocusedEvent | NavigationRejectedEvent | UrlChangedEvent | DidFailLoadEvent | DidFinishLoadEvent | DidStartLoadingEvent | PageFaviconUpdatedEvent | PageTitleUpdatedEvent | ResourceLoadFailedEvent | ResourceResponseReceivedEvent | ChildContentBlockedEvent | ChildContentOpenedInBrowserEvent | ChildViewCreatedEvent | ChildWindowCreatedEvent | FileDownloadStartedEvent | FileDownloadProgressEvent | FileDownloadCompletedEvent | FoundInPageEvent | CertificateErrorEvent | ContentBlockedEvent | WillRedirectEvent | ClipboardCopyBlockedEvent | ClipboardPasteBlockedEvent | TranslationStateChangedEvent);
5425
5425
 
5426
5426
  /**
5427
5427
  * [Union](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) containing every possible event that can be emitted by a {@link Window}. Events are
@@ -5926,6 +5926,19 @@ declare type ExternalProcessStartedEvent = BaseEvent_5 & {
5926
5926
  processUuid: string;
5927
5927
  };
5928
5928
 
5929
+ /**
5930
+ * Translation status of a translatable WebContents whose translation attempt has failed.
5931
+ */
5932
+ declare type FailedTranslationStatus = {
5933
+ status: 'translation-failed';
5934
+ /** The language the page was being translated from. */
5935
+ sourceLanguage: LanguageInfo;
5936
+ /** The language the page was being translated to. */
5937
+ targetLanguage: LanguageInfo;
5938
+ /** Human-readable description of why the translation failed. */
5939
+ errorMessage: string;
5940
+ };
5941
+
5929
5942
  /**
5930
5943
  * @deprecated, use {@link PageFaviconUpdatedEvent}.
5931
5944
  */
@@ -8633,6 +8646,18 @@ declare type JumpListTask = {
8633
8646
  iconIndex?: number;
8634
8647
  };
8635
8648
 
8649
+ /**
8650
+ * Language metadata for content translation.
8651
+ */
8652
+ declare type LanguageInfo = {
8653
+ /** ISO language code (e.g. "fr"). */
8654
+ code: string;
8655
+ /** English display name of the language (e.g. "French"). */
8656
+ nameEn: string;
8657
+ /** Localized display name of the language (e.g. "Français"). */
8658
+ nameI18N: string;
8659
+ };
8660
+
8636
8661
  /**
8637
8662
  * The LaunchEmitter is an `EventEmitter`. It can listen to app version resolver events.
8638
8663
  *
@@ -11476,6 +11501,14 @@ declare namespace OpenFin {
11476
11501
  ClientChangedContextGroup,
11477
11502
  InteropClientEvents,
11478
11503
  ChromeBrowser,
11504
+ LanguageInfo,
11505
+ PageTranslateOptions,
11506
+ FailedTranslationStatus,
11507
+ TranslatedPageStatus,
11508
+ TranslationStatus,
11509
+ UntranslatableWebContentInfo,
11510
+ TranslatableWebContentInfo,
11511
+ WebContentTranslationInfo,
11479
11512
  ApplicationEvents,
11480
11513
  BaseEvents,
11481
11514
  ExternalApplicationEvents,
@@ -11542,6 +11575,16 @@ declare type PageTitleUpdatedEvent = NamedEvent & {
11542
11575
  title: string;
11543
11576
  };
11544
11577
 
11578
+ /**
11579
+ * Options for {@link OpenFin.WebContents.translatePage}.
11580
+ */
11581
+ declare type PageTranslateOptions = {
11582
+ /** BCP-47 language code of the source language, or empty string for auto-detect. */
11583
+ sourceLang: string;
11584
+ /** BCP-47 language code of the target language. */
11585
+ targetLang: string;
11586
+ };
11587
+
11545
11588
  /**
11546
11589
  * Reasons for a paste operation being blocked
11547
11590
  *
@@ -14673,6 +14716,12 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
14673
14716
  request: OpenFin.Identity;
14674
14717
  response: OpenFin.ScreenCapturePermission;
14675
14718
  };
14719
+ 'translate-page': IdentityCall<{
14720
+ sourceLang: string;
14721
+ targetLang: string;
14722
+ }, void>;
14723
+ 'revert-translation': IdentityCall<{}, void>;
14724
+ 'get-translation-state': IdentityCall<{}, OpenFin.WebContentTranslationInfo>;
14676
14725
  'render-overlay': {
14677
14726
  request: {
14678
14727
  bounds: OpenFin.Bounds;
@@ -18180,6 +18229,45 @@ declare type TransitionOptions = {
18180
18229
  tween?: tween;
18181
18230
  };
18182
18231
 
18232
+ /**
18233
+ * Describes a WebContents on which content translation is supported.
18234
+ */
18235
+ declare type TranslatableWebContentInfo = {
18236
+ /** Whether translation is supported on this WebContents. */
18237
+ translationEnabled: true;
18238
+ /** Detected WebContents language, or undefined if not yet determined. */
18239
+ detectedLanguage?: LanguageInfo;
18240
+ /** Translation status of the WebContents. */
18241
+ state: TranslationStatus;
18242
+ };
18243
+
18244
+ /**
18245
+ * Translation status of a translatable WebContents that is translated or is being translated.
18246
+ */
18247
+ declare type TranslatedPageStatus = {
18248
+ status: 'pending-translation' | 'translated';
18249
+ /** The language the page is being translated from. */
18250
+ sourceLanguage: LanguageInfo;
18251
+ /** The language the page is being translated to. */
18252
+ targetLanguage: LanguageInfo;
18253
+ };
18254
+
18255
+ /**
18256
+ * Generated when the translation state of a WebContents changes, such as when a page in a
18257
+ * foreign language is detected or when a translation completes.
18258
+ * @interface
18259
+ */
18260
+ declare type TranslationStateChangedEvent = NamedEvent & {
18261
+ type: 'translation-state-changed';
18262
+ } & OpenFin.WebContentTranslationInfo;
18263
+
18264
+ /**
18265
+ * The translation status of a translatable WebContents.
18266
+ */
18267
+ declare type TranslationStatus = {
18268
+ status: 'untranslated';
18269
+ } | FailedTranslationStatus | TranslatedPageStatus;
18270
+
18183
18271
  declare class Transport<MeType extends EntityType = EntityType> extends EventEmitter {
18184
18272
  #private;
18185
18273
  protected wireListeners: Map<number, {
@@ -18279,6 +18367,14 @@ declare type UnregisteredEvent = BaseEvent_8 & {
18279
18367
  type: 'unregistered';
18280
18368
  };
18281
18369
 
18370
+ /**
18371
+ * Describes a WebContents on which content translation is not supported (for example because no
18372
+ * translation API key is configured on the machine, or the current page is not translatable).
18373
+ */
18374
+ declare type UntranslatableWebContentInfo = {
18375
+ translationEnabled: false;
18376
+ };
18377
+
18282
18378
  /**
18283
18379
  * View options that can be updated after creation.
18284
18380
  *
@@ -19522,6 +19618,26 @@ declare class WebContents<T extends BaseEvent> extends EmitterBase<T> {
19522
19618
  * {@link OpenFin.WebContentsEvents event namespace}.
19523
19619
  */
19524
19620
  setZoomLevel(level: number): Promise<void>;
19621
+ /**
19622
+ * Translates the WebContents from the source language to the target language.
19623
+ *
19624
+ * Translation requires a translation API key to be configured on the machine. If translation is
19625
+ * unavailable, the call is a no-op and a `translation-state-changed` event is emitted describing
19626
+ * the failure.
19627
+ *
19628
+ * @param options Source and target languages for the translation.
19629
+ */
19630
+ translatePage(options: OpenFin.PageTranslateOptions): Promise<void>;
19631
+ /**
19632
+ * Reverts a previously translated WebContents back to its original language.
19633
+ *
19634
+ * If the WebContents is not currently translated, this is a no-op and resolves successfully.
19635
+ */
19636
+ revertTranslation(): Promise<void>;
19637
+ /**
19638
+ * Gets the current content-translation state of the WebContents.
19639
+ */
19640
+ getTranslationState(): Promise<OpenFin.WebContentTranslationInfo>;
19525
19641
  /**
19526
19642
  * Navigates the WebContents to a specified URL.
19527
19643
  *
@@ -20339,6 +20455,7 @@ declare namespace WebContentsEvents {
20339
20455
  ContentBlockedEvent,
20340
20456
  ClipboardCopyBlockedEvent,
20341
20457
  ClipboardPasteBlockedEvent,
20458
+ TranslationStateChangedEvent,
20342
20459
  Event_5 as Event,
20343
20460
  WebContentsEvent,
20344
20461
  WillPropagateWebContentsEvent,
@@ -20347,6 +20464,11 @@ declare namespace WebContentsEvents {
20347
20464
  }
20348
20465
  }
20349
20466
 
20467
+ /**
20468
+ * Describes the current content-translation state of a WebContents.
20469
+ */
20470
+ declare type WebContentTranslationInfo = UntranslatableWebContentInfo | TranslatableWebContentInfo;
20471
+
20350
20472
  declare type WebNotificationInfo = {
20351
20473
  notificationId: string;
20352
20474
  properties: WebNotificationProperties;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/fdc3-api",
3
- "version": "45.100.99",
3
+ "version": "45.100.101",
4
4
  "description": "OpenFin fdc3 module utilities and types.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "private": false,