@openfin/fdc3-api 46.100.40 → 46.100.43

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.
@@ -5360,7 +5360,7 @@ declare type Event_4 = (WebContentsEvents.Event<'view'> & {
5360
5360
  */
5361
5361
  declare type Event_5<Topic extends string> = {
5362
5362
  topic: Topic;
5363
- } & (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);
5363
+ } & (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);
5364
5364
 
5365
5365
  /**
5366
5366
  * [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
@@ -5880,6 +5880,19 @@ declare type ExternalProcessStartedEvent = BaseEvent_5 & {
5880
5880
  processUuid: string;
5881
5881
  };
5882
5882
 
5883
+ /**
5884
+ * Translation status of a translatable WebContents whose translation attempt has failed.
5885
+ */
5886
+ declare type FailedTranslationStatus = {
5887
+ status: 'translation-failed';
5888
+ /** The language the page was being translated from. */
5889
+ sourceLanguage: LanguageInfo;
5890
+ /** The language the page was being translated to. */
5891
+ targetLanguage: LanguageInfo;
5892
+ /** Human-readable description of why the translation failed. */
5893
+ errorMessage: string;
5894
+ };
5895
+
5883
5896
  /**
5884
5897
  * @deprecated, use {@link PageFaviconUpdatedEvent}.
5885
5898
  */
@@ -6912,7 +6925,7 @@ declare type HostSpecs = {
6912
6925
  */
6913
6926
  aeroGlassEnabled?: boolean;
6914
6927
  /**
6915
- * "x86" for 32-bit or "x86_64" for 64-bit
6928
+ * "x86_64" for 64-bit
6916
6929
  */
6917
6930
  arch: string;
6918
6931
  /**
@@ -8555,6 +8568,18 @@ declare type JumpListTask = {
8555
8568
  iconIndex?: number;
8556
8569
  };
8557
8570
 
8571
+ /**
8572
+ * Language metadata for content translation.
8573
+ */
8574
+ declare type LanguageInfo = {
8575
+ /** ISO language code (e.g. "fr"). */
8576
+ code: string;
8577
+ /** English display name of the language (e.g. "French"). */
8578
+ nameEn: string;
8579
+ /** Localized display name of the language (e.g. "Français"). */
8580
+ nameI18N: string;
8581
+ };
8582
+
8558
8583
  /**
8559
8584
  * The LaunchEmitter is an `EventEmitter`. It can listen to app version resolver events.
8560
8585
  *
@@ -11171,6 +11196,14 @@ declare namespace OpenFin {
11171
11196
  ClientChangedContextGroup,
11172
11197
  InteropClientEvents,
11173
11198
  ChromeBrowser,
11199
+ LanguageInfo,
11200
+ PageTranslateOptions,
11201
+ FailedTranslationStatus,
11202
+ TranslatedPageStatus,
11203
+ TranslationStatus,
11204
+ UntranslatableWebContentInfo,
11205
+ TranslatableWebContentInfo,
11206
+ WebContentTranslationInfo,
11174
11207
  ApplicationEvents,
11175
11208
  BaseEvents,
11176
11209
  ExternalApplicationEvents,
@@ -11237,6 +11270,16 @@ declare type PageTitleUpdatedEvent = NamedEvent & {
11237
11270
  title: string;
11238
11271
  };
11239
11272
 
11273
+ /**
11274
+ * Options for {@link OpenFin.WebContents.translatePage}.
11275
+ */
11276
+ declare type PageTranslateOptions = {
11277
+ /** BCP-47 language code of the source language, or empty string for auto-detect. */
11278
+ sourceLang: string;
11279
+ /** BCP-47 language code of the target language. */
11280
+ targetLang: string;
11281
+ };
11282
+
11240
11283
  /**
11241
11284
  * Reasons for a paste operation being blocked
11242
11285
  *
@@ -14285,6 +14328,12 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
14285
14328
  request: OpenFin.Identity;
14286
14329
  response: OpenFin.ScreenCapturePermission;
14287
14330
  };
14331
+ 'translate-page': IdentityCall<{
14332
+ sourceLang: string;
14333
+ targetLang: string;
14334
+ }, void>;
14335
+ 'revert-translation': IdentityCall<{}, void>;
14336
+ 'get-translation-state': IdentityCall<{}, OpenFin.WebContentTranslationInfo>;
14288
14337
  'render-overlay': {
14289
14338
  request: {
14290
14339
  bounds: OpenFin.Bounds;
@@ -17778,6 +17827,45 @@ declare type TransitionOptions = {
17778
17827
  tween?: tween;
17779
17828
  };
17780
17829
 
17830
+ /**
17831
+ * Describes a WebContents on which content translation is supported.
17832
+ */
17833
+ declare type TranslatableWebContentInfo = {
17834
+ /** Whether translation is supported on this WebContents. */
17835
+ translationEnabled: true;
17836
+ /** Detected WebContents language, or undefined if not yet determined. */
17837
+ detectedLanguage?: LanguageInfo;
17838
+ /** Translation status of the WebContents. */
17839
+ state: TranslationStatus;
17840
+ };
17841
+
17842
+ /**
17843
+ * Translation status of a translatable WebContents that is translated or is being translated.
17844
+ */
17845
+ declare type TranslatedPageStatus = {
17846
+ status: 'pending-translation' | 'translated';
17847
+ /** The language the page is being translated from. */
17848
+ sourceLanguage: LanguageInfo;
17849
+ /** The language the page is being translated to. */
17850
+ targetLanguage: LanguageInfo;
17851
+ };
17852
+
17853
+ /**
17854
+ * Generated when the translation state of a WebContents changes, such as when a page in a
17855
+ * foreign language is detected or when a translation completes.
17856
+ * @interface
17857
+ */
17858
+ declare type TranslationStateChangedEvent = NamedEvent & {
17859
+ type: 'translation-state-changed';
17860
+ } & OpenFin.WebContentTranslationInfo;
17861
+
17862
+ /**
17863
+ * The translation status of a translatable WebContents.
17864
+ */
17865
+ declare type TranslationStatus = {
17866
+ status: 'untranslated';
17867
+ } | FailedTranslationStatus | TranslatedPageStatus;
17868
+
17781
17869
  declare class Transport<MeType extends EntityType = EntityType> extends EventEmitter {
17782
17870
  #private;
17783
17871
  protected wireListeners: Map<number, {
@@ -17877,6 +17965,14 @@ declare type UnregisteredEvent = BaseEvent_8 & {
17877
17965
  type: 'unregistered';
17878
17966
  };
17879
17967
 
17968
+ /**
17969
+ * Describes a WebContents on which content translation is not supported (for example because no
17970
+ * translation API key is configured on the machine, or the current page is not translatable).
17971
+ */
17972
+ declare type UntranslatableWebContentInfo = {
17973
+ translationEnabled: false;
17974
+ };
17975
+
17880
17976
  /**
17881
17977
  * View options that can be updated after creation.
17882
17978
  *
@@ -19083,6 +19179,26 @@ declare class WebContents<T extends BaseEvent> extends EmitterBase<T> {
19083
19179
  * {@link OpenFin.WebContentsEvents event namespace}.
19084
19180
  */
19085
19181
  setZoomLevel(level: number): Promise<void>;
19182
+ /**
19183
+ * Translates the WebContents from the source language to the target language.
19184
+ *
19185
+ * Translation requires a translation API key to be configured on the machine. If translation is
19186
+ * unavailable, the call is a no-op and a `translation-state-changed` event is emitted describing
19187
+ * the failure.
19188
+ *
19189
+ * @param options Source and target languages for the translation.
19190
+ */
19191
+ translatePage(options: OpenFin.PageTranslateOptions): Promise<void>;
19192
+ /**
19193
+ * Reverts a previously translated WebContents back to its original language.
19194
+ *
19195
+ * If the WebContents is not currently translated, this is a no-op and resolves successfully.
19196
+ */
19197
+ revertTranslation(): Promise<void>;
19198
+ /**
19199
+ * Gets the current content-translation state of the WebContents.
19200
+ */
19201
+ getTranslationState(): Promise<OpenFin.WebContentTranslationInfo>;
19086
19202
  /**
19087
19203
  * Navigates the WebContents to a specified URL.
19088
19204
  *
@@ -19901,6 +20017,7 @@ declare namespace WebContentsEvents {
19901
20017
  ContentBlockedEvent,
19902
20018
  ClipboardCopyBlockedEvent,
19903
20019
  ClipboardPasteBlockedEvent,
20020
+ TranslationStateChangedEvent,
19904
20021
  Event_5 as Event,
19905
20022
  WebContentsEvent,
19906
20023
  WillPropagateWebContentsEvent,
@@ -19909,6 +20026,11 @@ declare namespace WebContentsEvents {
19909
20026
  }
19910
20027
  }
19911
20028
 
20029
+ /**
20030
+ * Describes the current content-translation state of a WebContents.
20031
+ */
20032
+ declare type WebContentTranslationInfo = UntranslatableWebContentInfo | TranslatableWebContentInfo;
20033
+
19912
20034
  declare type WebNotificationInfo = {
19913
20035
  notificationId: string;
19914
20036
  properties: WebNotificationProperties;
@@ -5360,7 +5360,7 @@ declare type Event_4 = (WebContentsEvents.Event<'view'> & {
5360
5360
  */
5361
5361
  declare type Event_5<Topic extends string> = {
5362
5362
  topic: Topic;
5363
- } & (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);
5363
+ } & (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);
5364
5364
 
5365
5365
  /**
5366
5366
  * [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
@@ -5880,6 +5880,19 @@ declare type ExternalProcessStartedEvent = BaseEvent_5 & {
5880
5880
  processUuid: string;
5881
5881
  };
5882
5882
 
5883
+ /**
5884
+ * Translation status of a translatable WebContents whose translation attempt has failed.
5885
+ */
5886
+ declare type FailedTranslationStatus = {
5887
+ status: 'translation-failed';
5888
+ /** The language the page was being translated from. */
5889
+ sourceLanguage: LanguageInfo;
5890
+ /** The language the page was being translated to. */
5891
+ targetLanguage: LanguageInfo;
5892
+ /** Human-readable description of why the translation failed. */
5893
+ errorMessage: string;
5894
+ };
5895
+
5883
5896
  /**
5884
5897
  * @deprecated, use {@link PageFaviconUpdatedEvent}.
5885
5898
  */
@@ -6912,7 +6925,7 @@ declare type HostSpecs = {
6912
6925
  */
6913
6926
  aeroGlassEnabled?: boolean;
6914
6927
  /**
6915
- * "x86" for 32-bit or "x86_64" for 64-bit
6928
+ * "x86_64" for 64-bit
6916
6929
  */
6917
6930
  arch: string;
6918
6931
  /**
@@ -8555,6 +8568,18 @@ declare type JumpListTask = {
8555
8568
  iconIndex?: number;
8556
8569
  };
8557
8570
 
8571
+ /**
8572
+ * Language metadata for content translation.
8573
+ */
8574
+ declare type LanguageInfo = {
8575
+ /** ISO language code (e.g. "fr"). */
8576
+ code: string;
8577
+ /** English display name of the language (e.g. "French"). */
8578
+ nameEn: string;
8579
+ /** Localized display name of the language (e.g. "Français"). */
8580
+ nameI18N: string;
8581
+ };
8582
+
8558
8583
  /**
8559
8584
  * The LaunchEmitter is an `EventEmitter`. It can listen to app version resolver events.
8560
8585
  *
@@ -11171,6 +11196,14 @@ declare namespace OpenFin {
11171
11196
  ClientChangedContextGroup,
11172
11197
  InteropClientEvents,
11173
11198
  ChromeBrowser,
11199
+ LanguageInfo,
11200
+ PageTranslateOptions,
11201
+ FailedTranslationStatus,
11202
+ TranslatedPageStatus,
11203
+ TranslationStatus,
11204
+ UntranslatableWebContentInfo,
11205
+ TranslatableWebContentInfo,
11206
+ WebContentTranslationInfo,
11174
11207
  ApplicationEvents,
11175
11208
  BaseEvents,
11176
11209
  ExternalApplicationEvents,
@@ -11237,6 +11270,16 @@ declare type PageTitleUpdatedEvent = NamedEvent & {
11237
11270
  title: string;
11238
11271
  };
11239
11272
 
11273
+ /**
11274
+ * Options for {@link OpenFin.WebContents.translatePage}.
11275
+ */
11276
+ declare type PageTranslateOptions = {
11277
+ /** BCP-47 language code of the source language, or empty string for auto-detect. */
11278
+ sourceLang: string;
11279
+ /** BCP-47 language code of the target language. */
11280
+ targetLang: string;
11281
+ };
11282
+
11240
11283
  /**
11241
11284
  * Reasons for a paste operation being blocked
11242
11285
  *
@@ -14285,6 +14328,12 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
14285
14328
  request: OpenFin.Identity;
14286
14329
  response: OpenFin.ScreenCapturePermission;
14287
14330
  };
14331
+ 'translate-page': IdentityCall<{
14332
+ sourceLang: string;
14333
+ targetLang: string;
14334
+ }, void>;
14335
+ 'revert-translation': IdentityCall<{}, void>;
14336
+ 'get-translation-state': IdentityCall<{}, OpenFin.WebContentTranslationInfo>;
14288
14337
  'render-overlay': {
14289
14338
  request: {
14290
14339
  bounds: OpenFin.Bounds;
@@ -17778,6 +17827,45 @@ declare type TransitionOptions = {
17778
17827
  tween?: tween;
17779
17828
  };
17780
17829
 
17830
+ /**
17831
+ * Describes a WebContents on which content translation is supported.
17832
+ */
17833
+ declare type TranslatableWebContentInfo = {
17834
+ /** Whether translation is supported on this WebContents. */
17835
+ translationEnabled: true;
17836
+ /** Detected WebContents language, or undefined if not yet determined. */
17837
+ detectedLanguage?: LanguageInfo;
17838
+ /** Translation status of the WebContents. */
17839
+ state: TranslationStatus;
17840
+ };
17841
+
17842
+ /**
17843
+ * Translation status of a translatable WebContents that is translated or is being translated.
17844
+ */
17845
+ declare type TranslatedPageStatus = {
17846
+ status: 'pending-translation' | 'translated';
17847
+ /** The language the page is being translated from. */
17848
+ sourceLanguage: LanguageInfo;
17849
+ /** The language the page is being translated to. */
17850
+ targetLanguage: LanguageInfo;
17851
+ };
17852
+
17853
+ /**
17854
+ * Generated when the translation state of a WebContents changes, such as when a page in a
17855
+ * foreign language is detected or when a translation completes.
17856
+ * @interface
17857
+ */
17858
+ declare type TranslationStateChangedEvent = NamedEvent & {
17859
+ type: 'translation-state-changed';
17860
+ } & OpenFin.WebContentTranslationInfo;
17861
+
17862
+ /**
17863
+ * The translation status of a translatable WebContents.
17864
+ */
17865
+ declare type TranslationStatus = {
17866
+ status: 'untranslated';
17867
+ } | FailedTranslationStatus | TranslatedPageStatus;
17868
+
17781
17869
  declare class Transport<MeType extends EntityType = EntityType> extends EventEmitter {
17782
17870
  #private;
17783
17871
  protected wireListeners: Map<number, {
@@ -17877,6 +17965,14 @@ declare type UnregisteredEvent = BaseEvent_8 & {
17877
17965
  type: 'unregistered';
17878
17966
  };
17879
17967
 
17968
+ /**
17969
+ * Describes a WebContents on which content translation is not supported (for example because no
17970
+ * translation API key is configured on the machine, or the current page is not translatable).
17971
+ */
17972
+ declare type UntranslatableWebContentInfo = {
17973
+ translationEnabled: false;
17974
+ };
17975
+
17880
17976
  /**
17881
17977
  * View options that can be updated after creation.
17882
17978
  *
@@ -19083,6 +19179,26 @@ declare class WebContents<T extends BaseEvent> extends EmitterBase<T> {
19083
19179
  * {@link OpenFin.WebContentsEvents event namespace}.
19084
19180
  */
19085
19181
  setZoomLevel(level: number): Promise<void>;
19182
+ /**
19183
+ * Translates the WebContents from the source language to the target language.
19184
+ *
19185
+ * Translation requires a translation API key to be configured on the machine. If translation is
19186
+ * unavailable, the call is a no-op and a `translation-state-changed` event is emitted describing
19187
+ * the failure.
19188
+ *
19189
+ * @param options Source and target languages for the translation.
19190
+ */
19191
+ translatePage(options: OpenFin.PageTranslateOptions): Promise<void>;
19192
+ /**
19193
+ * Reverts a previously translated WebContents back to its original language.
19194
+ *
19195
+ * If the WebContents is not currently translated, this is a no-op and resolves successfully.
19196
+ */
19197
+ revertTranslation(): Promise<void>;
19198
+ /**
19199
+ * Gets the current content-translation state of the WebContents.
19200
+ */
19201
+ getTranslationState(): Promise<OpenFin.WebContentTranslationInfo>;
19086
19202
  /**
19087
19203
  * Navigates the WebContents to a specified URL.
19088
19204
  *
@@ -19901,6 +20017,7 @@ declare namespace WebContentsEvents {
19901
20017
  ContentBlockedEvent,
19902
20018
  ClipboardCopyBlockedEvent,
19903
20019
  ClipboardPasteBlockedEvent,
20020
+ TranslationStateChangedEvent,
19904
20021
  Event_5 as Event,
19905
20022
  WebContentsEvent,
19906
20023
  WillPropagateWebContentsEvent,
@@ -19909,6 +20026,11 @@ declare namespace WebContentsEvents {
19909
20026
  }
19910
20027
  }
19911
20028
 
20029
+ /**
20030
+ * Describes the current content-translation state of a WebContents.
20031
+ */
20032
+ declare type WebContentTranslationInfo = UntranslatableWebContentInfo | TranslatableWebContentInfo;
20033
+
19912
20034
  declare type WebNotificationInfo = {
19913
20035
  notificationId: string;
19914
20036
  properties: WebNotificationProperties;
@@ -5360,7 +5360,7 @@ declare type Event_4 = (WebContentsEvents.Event<'view'> & {
5360
5360
  */
5361
5361
  declare type Event_5<Topic extends string> = {
5362
5362
  topic: Topic;
5363
- } & (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);
5363
+ } & (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);
5364
5364
 
5365
5365
  /**
5366
5366
  * [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
@@ -5880,6 +5880,19 @@ declare type ExternalProcessStartedEvent = BaseEvent_5 & {
5880
5880
  processUuid: string;
5881
5881
  };
5882
5882
 
5883
+ /**
5884
+ * Translation status of a translatable WebContents whose translation attempt has failed.
5885
+ */
5886
+ declare type FailedTranslationStatus = {
5887
+ status: 'translation-failed';
5888
+ /** The language the page was being translated from. */
5889
+ sourceLanguage: LanguageInfo;
5890
+ /** The language the page was being translated to. */
5891
+ targetLanguage: LanguageInfo;
5892
+ /** Human-readable description of why the translation failed. */
5893
+ errorMessage: string;
5894
+ };
5895
+
5883
5896
  /**
5884
5897
  * @deprecated, use {@link PageFaviconUpdatedEvent}.
5885
5898
  */
@@ -6912,7 +6925,7 @@ declare type HostSpecs = {
6912
6925
  */
6913
6926
  aeroGlassEnabled?: boolean;
6914
6927
  /**
6915
- * "x86" for 32-bit or "x86_64" for 64-bit
6928
+ * "x86_64" for 64-bit
6916
6929
  */
6917
6930
  arch: string;
6918
6931
  /**
@@ -8555,6 +8568,18 @@ declare type JumpListTask = {
8555
8568
  iconIndex?: number;
8556
8569
  };
8557
8570
 
8571
+ /**
8572
+ * Language metadata for content translation.
8573
+ */
8574
+ declare type LanguageInfo = {
8575
+ /** ISO language code (e.g. "fr"). */
8576
+ code: string;
8577
+ /** English display name of the language (e.g. "French"). */
8578
+ nameEn: string;
8579
+ /** Localized display name of the language (e.g. "Français"). */
8580
+ nameI18N: string;
8581
+ };
8582
+
8558
8583
  /**
8559
8584
  * The LaunchEmitter is an `EventEmitter`. It can listen to app version resolver events.
8560
8585
  *
@@ -11171,6 +11196,14 @@ declare namespace OpenFin {
11171
11196
  ClientChangedContextGroup,
11172
11197
  InteropClientEvents,
11173
11198
  ChromeBrowser,
11199
+ LanguageInfo,
11200
+ PageTranslateOptions,
11201
+ FailedTranslationStatus,
11202
+ TranslatedPageStatus,
11203
+ TranslationStatus,
11204
+ UntranslatableWebContentInfo,
11205
+ TranslatableWebContentInfo,
11206
+ WebContentTranslationInfo,
11174
11207
  ApplicationEvents,
11175
11208
  BaseEvents,
11176
11209
  ExternalApplicationEvents,
@@ -11237,6 +11270,16 @@ declare type PageTitleUpdatedEvent = NamedEvent & {
11237
11270
  title: string;
11238
11271
  };
11239
11272
 
11273
+ /**
11274
+ * Options for {@link OpenFin.WebContents.translatePage}.
11275
+ */
11276
+ declare type PageTranslateOptions = {
11277
+ /** BCP-47 language code of the source language, or empty string for auto-detect. */
11278
+ sourceLang: string;
11279
+ /** BCP-47 language code of the target language. */
11280
+ targetLang: string;
11281
+ };
11282
+
11240
11283
  /**
11241
11284
  * Reasons for a paste operation being blocked
11242
11285
  *
@@ -14285,6 +14328,12 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
14285
14328
  request: OpenFin.Identity;
14286
14329
  response: OpenFin.ScreenCapturePermission;
14287
14330
  };
14331
+ 'translate-page': IdentityCall<{
14332
+ sourceLang: string;
14333
+ targetLang: string;
14334
+ }, void>;
14335
+ 'revert-translation': IdentityCall<{}, void>;
14336
+ 'get-translation-state': IdentityCall<{}, OpenFin.WebContentTranslationInfo>;
14288
14337
  'render-overlay': {
14289
14338
  request: {
14290
14339
  bounds: OpenFin.Bounds;
@@ -17778,6 +17827,45 @@ declare type TransitionOptions = {
17778
17827
  tween?: tween;
17779
17828
  };
17780
17829
 
17830
+ /**
17831
+ * Describes a WebContents on which content translation is supported.
17832
+ */
17833
+ declare type TranslatableWebContentInfo = {
17834
+ /** Whether translation is supported on this WebContents. */
17835
+ translationEnabled: true;
17836
+ /** Detected WebContents language, or undefined if not yet determined. */
17837
+ detectedLanguage?: LanguageInfo;
17838
+ /** Translation status of the WebContents. */
17839
+ state: TranslationStatus;
17840
+ };
17841
+
17842
+ /**
17843
+ * Translation status of a translatable WebContents that is translated or is being translated.
17844
+ */
17845
+ declare type TranslatedPageStatus = {
17846
+ status: 'pending-translation' | 'translated';
17847
+ /** The language the page is being translated from. */
17848
+ sourceLanguage: LanguageInfo;
17849
+ /** The language the page is being translated to. */
17850
+ targetLanguage: LanguageInfo;
17851
+ };
17852
+
17853
+ /**
17854
+ * Generated when the translation state of a WebContents changes, such as when a page in a
17855
+ * foreign language is detected or when a translation completes.
17856
+ * @interface
17857
+ */
17858
+ declare type TranslationStateChangedEvent = NamedEvent & {
17859
+ type: 'translation-state-changed';
17860
+ } & OpenFin.WebContentTranslationInfo;
17861
+
17862
+ /**
17863
+ * The translation status of a translatable WebContents.
17864
+ */
17865
+ declare type TranslationStatus = {
17866
+ status: 'untranslated';
17867
+ } | FailedTranslationStatus | TranslatedPageStatus;
17868
+
17781
17869
  declare class Transport<MeType extends EntityType = EntityType> extends EventEmitter {
17782
17870
  #private;
17783
17871
  protected wireListeners: Map<number, {
@@ -17877,6 +17965,14 @@ declare type UnregisteredEvent = BaseEvent_8 & {
17877
17965
  type: 'unregistered';
17878
17966
  };
17879
17967
 
17968
+ /**
17969
+ * Describes a WebContents on which content translation is not supported (for example because no
17970
+ * translation API key is configured on the machine, or the current page is not translatable).
17971
+ */
17972
+ declare type UntranslatableWebContentInfo = {
17973
+ translationEnabled: false;
17974
+ };
17975
+
17880
17976
  /**
17881
17977
  * View options that can be updated after creation.
17882
17978
  *
@@ -19083,6 +19179,26 @@ declare class WebContents<T extends BaseEvent> extends EmitterBase<T> {
19083
19179
  * {@link OpenFin.WebContentsEvents event namespace}.
19084
19180
  */
19085
19181
  setZoomLevel(level: number): Promise<void>;
19182
+ /**
19183
+ * Translates the WebContents from the source language to the target language.
19184
+ *
19185
+ * Translation requires a translation API key to be configured on the machine. If translation is
19186
+ * unavailable, the call is a no-op and a `translation-state-changed` event is emitted describing
19187
+ * the failure.
19188
+ *
19189
+ * @param options Source and target languages for the translation.
19190
+ */
19191
+ translatePage(options: OpenFin.PageTranslateOptions): Promise<void>;
19192
+ /**
19193
+ * Reverts a previously translated WebContents back to its original language.
19194
+ *
19195
+ * If the WebContents is not currently translated, this is a no-op and resolves successfully.
19196
+ */
19197
+ revertTranslation(): Promise<void>;
19198
+ /**
19199
+ * Gets the current content-translation state of the WebContents.
19200
+ */
19201
+ getTranslationState(): Promise<OpenFin.WebContentTranslationInfo>;
19086
19202
  /**
19087
19203
  * Navigates the WebContents to a specified URL.
19088
19204
  *
@@ -19901,6 +20017,7 @@ declare namespace WebContentsEvents {
19901
20017
  ContentBlockedEvent,
19902
20018
  ClipboardCopyBlockedEvent,
19903
20019
  ClipboardPasteBlockedEvent,
20020
+ TranslationStateChangedEvent,
19904
20021
  Event_5 as Event,
19905
20022
  WebContentsEvent,
19906
20023
  WillPropagateWebContentsEvent,
@@ -19909,6 +20026,11 @@ declare namespace WebContentsEvents {
19909
20026
  }
19910
20027
  }
19911
20028
 
20029
+ /**
20030
+ * Describes the current content-translation state of a WebContents.
20031
+ */
20032
+ declare type WebContentTranslationInfo = UntranslatableWebContentInfo | TranslatableWebContentInfo;
20033
+
19912
20034
  declare type WebNotificationInfo = {
19913
20035
  notificationId: string;
19914
20036
  properties: WebNotificationProperties;
package/out/fdc3-api.d.ts CHANGED
@@ -5467,7 +5467,7 @@ declare type Event_4 = (WebContentsEvents.Event<'view'> & {
5467
5467
  */
5468
5468
  declare type Event_5<Topic extends string> = {
5469
5469
  topic: Topic;
5470
- } & (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);
5470
+ } & (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);
5471
5471
 
5472
5472
  /**
5473
5473
  * [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
@@ -6008,6 +6008,19 @@ declare type ExternalProcessStartedEvent = BaseEvent_5 & {
6008
6008
  processUuid: string;
6009
6009
  };
6010
6010
 
6011
+ /**
6012
+ * Translation status of a translatable WebContents whose translation attempt has failed.
6013
+ */
6014
+ declare type FailedTranslationStatus = {
6015
+ status: 'translation-failed';
6016
+ /** The language the page was being translated from. */
6017
+ sourceLanguage: LanguageInfo;
6018
+ /** The language the page was being translated to. */
6019
+ targetLanguage: LanguageInfo;
6020
+ /** Human-readable description of why the translation failed. */
6021
+ errorMessage: string;
6022
+ };
6023
+
6011
6024
  /**
6012
6025
  * @deprecated, use {@link PageFaviconUpdatedEvent}.
6013
6026
  */
@@ -7052,7 +7065,7 @@ declare type HostSpecs = {
7052
7065
  */
7053
7066
  aeroGlassEnabled?: boolean;
7054
7067
  /**
7055
- * "x86" for 32-bit or "x86_64" for 64-bit
7068
+ * "x86_64" for 64-bit
7056
7069
  */
7057
7070
  arch: string;
7058
7071
  /**
@@ -8721,6 +8734,18 @@ declare type JumpListTask = {
8721
8734
  iconIndex?: number;
8722
8735
  };
8723
8736
 
8737
+ /**
8738
+ * Language metadata for content translation.
8739
+ */
8740
+ declare type LanguageInfo = {
8741
+ /** ISO language code (e.g. "fr"). */
8742
+ code: string;
8743
+ /** English display name of the language (e.g. "French"). */
8744
+ nameEn: string;
8745
+ /** Localized display name of the language (e.g. "Français"). */
8746
+ nameI18N: string;
8747
+ };
8748
+
8724
8749
  /**
8725
8750
  * The LaunchEmitter is an `EventEmitter`. It can listen to app version resolver events.
8726
8751
  *
@@ -11554,6 +11579,14 @@ declare namespace OpenFin {
11554
11579
  ClientChangedContextGroup,
11555
11580
  InteropClientEvents,
11556
11581
  ChromeBrowser,
11582
+ LanguageInfo,
11583
+ PageTranslateOptions,
11584
+ FailedTranslationStatus,
11585
+ TranslatedPageStatus,
11586
+ TranslationStatus,
11587
+ UntranslatableWebContentInfo,
11588
+ TranslatableWebContentInfo,
11589
+ WebContentTranslationInfo,
11557
11590
  ApplicationEvents,
11558
11591
  BaseEvents,
11559
11592
  ExternalApplicationEvents,
@@ -11620,6 +11653,16 @@ declare type PageTitleUpdatedEvent = NamedEvent & {
11620
11653
  title: string;
11621
11654
  };
11622
11655
 
11656
+ /**
11657
+ * Options for {@link OpenFin.WebContents.translatePage}.
11658
+ */
11659
+ declare type PageTranslateOptions = {
11660
+ /** BCP-47 language code of the source language, or empty string for auto-detect. */
11661
+ sourceLang: string;
11662
+ /** BCP-47 language code of the target language. */
11663
+ targetLang: string;
11664
+ };
11665
+
11623
11666
  /**
11624
11667
  * Reasons for a paste operation being blocked
11625
11668
  *
@@ -14751,6 +14794,12 @@ declare type ProtocolMap = ExternalAdapterOnlyCallsMap & AnalyticsProtocolMap &
14751
14794
  request: OpenFin.Identity;
14752
14795
  response: OpenFin.ScreenCapturePermission;
14753
14796
  };
14797
+ 'translate-page': IdentityCall<{
14798
+ sourceLang: string;
14799
+ targetLang: string;
14800
+ }, void>;
14801
+ 'revert-translation': IdentityCall<{}, void>;
14802
+ 'get-translation-state': IdentityCall<{}, OpenFin.WebContentTranslationInfo>;
14754
14803
  'render-overlay': {
14755
14804
  request: {
14756
14805
  bounds: OpenFin.Bounds;
@@ -18257,6 +18306,45 @@ declare type TransitionOptions = {
18257
18306
  tween?: tween;
18258
18307
  };
18259
18308
 
18309
+ /**
18310
+ * Describes a WebContents on which content translation is supported.
18311
+ */
18312
+ declare type TranslatableWebContentInfo = {
18313
+ /** Whether translation is supported on this WebContents. */
18314
+ translationEnabled: true;
18315
+ /** Detected WebContents language, or undefined if not yet determined. */
18316
+ detectedLanguage?: LanguageInfo;
18317
+ /** Translation status of the WebContents. */
18318
+ state: TranslationStatus;
18319
+ };
18320
+
18321
+ /**
18322
+ * Translation status of a translatable WebContents that is translated or is being translated.
18323
+ */
18324
+ declare type TranslatedPageStatus = {
18325
+ status: 'pending-translation' | 'translated';
18326
+ /** The language the page is being translated from. */
18327
+ sourceLanguage: LanguageInfo;
18328
+ /** The language the page is being translated to. */
18329
+ targetLanguage: LanguageInfo;
18330
+ };
18331
+
18332
+ /**
18333
+ * Generated when the translation state of a WebContents changes, such as when a page in a
18334
+ * foreign language is detected or when a translation completes.
18335
+ * @interface
18336
+ */
18337
+ declare type TranslationStateChangedEvent = NamedEvent & {
18338
+ type: 'translation-state-changed';
18339
+ } & OpenFin.WebContentTranslationInfo;
18340
+
18341
+ /**
18342
+ * The translation status of a translatable WebContents.
18343
+ */
18344
+ declare type TranslationStatus = {
18345
+ status: 'untranslated';
18346
+ } | FailedTranslationStatus | TranslatedPageStatus;
18347
+
18260
18348
  declare class Transport<MeType extends EntityType = EntityType> extends EventEmitter {
18261
18349
  #private;
18262
18350
  protected wireListeners: Map<number, {
@@ -18356,6 +18444,14 @@ declare type UnregisteredEvent = BaseEvent_8 & {
18356
18444
  type: 'unregistered';
18357
18445
  };
18358
18446
 
18447
+ /**
18448
+ * Describes a WebContents on which content translation is not supported (for example because no
18449
+ * translation API key is configured on the machine, or the current page is not translatable).
18450
+ */
18451
+ declare type UntranslatableWebContentInfo = {
18452
+ translationEnabled: false;
18453
+ };
18454
+
18359
18455
  /**
18360
18456
  * View options that can be updated after creation.
18361
18457
  *
@@ -19599,6 +19695,26 @@ declare class WebContents<T extends BaseEvent> extends EmitterBase<T> {
19599
19695
  * {@link OpenFin.WebContentsEvents event namespace}.
19600
19696
  */
19601
19697
  setZoomLevel(level: number): Promise<void>;
19698
+ /**
19699
+ * Translates the WebContents from the source language to the target language.
19700
+ *
19701
+ * Translation requires a translation API key to be configured on the machine. If translation is
19702
+ * unavailable, the call is a no-op and a `translation-state-changed` event is emitted describing
19703
+ * the failure.
19704
+ *
19705
+ * @param options Source and target languages for the translation.
19706
+ */
19707
+ translatePage(options: OpenFin.PageTranslateOptions): Promise<void>;
19708
+ /**
19709
+ * Reverts a previously translated WebContents back to its original language.
19710
+ *
19711
+ * If the WebContents is not currently translated, this is a no-op and resolves successfully.
19712
+ */
19713
+ revertTranslation(): Promise<void>;
19714
+ /**
19715
+ * Gets the current content-translation state of the WebContents.
19716
+ */
19717
+ getTranslationState(): Promise<OpenFin.WebContentTranslationInfo>;
19602
19718
  /**
19603
19719
  * Navigates the WebContents to a specified URL.
19604
19720
  *
@@ -20417,6 +20533,7 @@ declare namespace WebContentsEvents {
20417
20533
  ContentBlockedEvent,
20418
20534
  ClipboardCopyBlockedEvent,
20419
20535
  ClipboardPasteBlockedEvent,
20536
+ TranslationStateChangedEvent,
20420
20537
  Event_5 as Event,
20421
20538
  WebContentsEvent,
20422
20539
  WillPropagateWebContentsEvent,
@@ -20425,6 +20542,11 @@ declare namespace WebContentsEvents {
20425
20542
  }
20426
20543
  }
20427
20544
 
20545
+ /**
20546
+ * Describes the current content-translation state of a WebContents.
20547
+ */
20548
+ declare type WebContentTranslationInfo = UntranslatableWebContentInfo | TranslatableWebContentInfo;
20549
+
20428
20550
  declare type WebNotificationInfo = {
20429
20551
  notificationId: string;
20430
20552
  properties: WebNotificationProperties;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/fdc3-api",
3
- "version": "46.100.40",
3
+ "version": "46.100.43",
4
4
  "description": "OpenFin fdc3 module utilities and types.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "private": false,