@openfin/core 39.82.13 → 39.83.1

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.
@@ -102,7 +102,7 @@ declare type ApiInjection = DomainApiSettings;
102
102
  * Generated when a new Platform's API becomes responsive.
103
103
  * @interface
104
104
  */
105
- declare type ApiReadyEvent = BaseEvent & {
105
+ declare type ApiReadyEvent = BaseEvents.BaseEvent & {
106
106
  topic: 'application';
107
107
  type: 'platform-api-ready';
108
108
  };
@@ -914,7 +914,7 @@ declare namespace ApplicationEvents {
914
914
  PropagatedApplicationEvent,
915
915
  PropagatedEventType_3 as PropagatedEventType,
916
916
  PropagatedApplicationEventType,
917
- Payload_4 as Payload,
917
+ Payload_5 as Payload,
918
918
  ByType_3 as ByType
919
919
  }
920
920
  }
@@ -1707,7 +1707,7 @@ declare type BaseEvent_10 = Events.BaseEvents.BaseEvent;
1707
1707
  * A base Channel event.
1708
1708
  * @interface
1709
1709
  */
1710
- declare type BaseEvent_2 = NamedEvent & {
1710
+ declare type BaseEvent_2 = BaseEvents.NamedEvent & {
1711
1711
  channelName: string;
1712
1712
  channelId: string;
1713
1713
  };
@@ -1777,6 +1777,7 @@ declare namespace BaseEvents {
1777
1777
  NotCloseRequested,
1778
1778
  PropagatedEventType,
1779
1779
  PropagatedEvent,
1780
+ Payload_2 as Payload,
1780
1781
  EventHandler,
1781
1782
  BaseEvent,
1782
1783
  IdentityEvent,
@@ -1917,7 +1918,7 @@ declare type BrowserContentCreationRule = BaseContentCreationRule & {
1917
1918
  *
1918
1919
  * @typeParam Type String key specifying the event to extract
1919
1920
  */
1920
- declare type ByType<Type extends EventType> = Payload_2<Type>;
1921
+ declare type ByType<Type extends EventType> = Payload_3<Type>;
1921
1922
 
1922
1923
  /**
1923
1924
  * Extracts a single event type matching the given key from the Window {@link Event} union.
@@ -1926,7 +1927,7 @@ declare type ByType<Type extends EventType> = Payload_2<Type>;
1926
1927
  *
1927
1928
  * @typeParam Type String key specifying the event to extract
1928
1929
  */
1929
- declare type ByType_2<Type extends EventType_2> = Payload_3<Type>;
1930
+ declare type ByType_2<Type extends EventType_2> = Payload_4<Type>;
1930
1931
 
1931
1932
  /**
1932
1933
  * Extracts a single event type matching the given key from the Application {@link Event} union.
@@ -1935,7 +1936,7 @@ declare type ByType_2<Type extends EventType_2> = Payload_3<Type>;
1935
1936
  *
1936
1937
  * @typeParam Type String key specifying the event to extract
1937
1938
  */
1938
- declare type ByType_3<Type extends EventType_3> = Payload_4<Type>;
1939
+ declare type ByType_3<Type extends EventType_3> = Payload_5<Type>;
1939
1940
 
1940
1941
  /**
1941
1942
  * Extracts a single event type matching the given key from the ExternalApplication {@link Event} union.
@@ -1944,7 +1945,7 @@ declare type ByType_3<Type extends EventType_3> = Payload_4<Type>;
1944
1945
  *
1945
1946
  * @typeParam Type String key specifying the event to extract
1946
1947
  */
1947
- declare type ByType_4<Type extends EventType_4> = Payload_5<Type>;
1948
+ declare type ByType_4<Type extends EventType_4> = Payload_6<Type>;
1948
1949
 
1949
1950
  /**
1950
1951
  * Extracts a single event type matching the given key from the Frame {@link Event} union.
@@ -1953,7 +1954,7 @@ declare type ByType_4<Type extends EventType_4> = Payload_5<Type>;
1953
1954
  *
1954
1955
  * @typeParam Type String key specifying the event to extract
1955
1956
  */
1956
- declare type ByType_5<Type extends EventType_5> = Payload_6<Type>;
1957
+ declare type ByType_5<Type extends EventType_5> = Payload_7<Type>;
1957
1958
 
1958
1959
  /**
1959
1960
  * Extracts a single event type matching the given key from the GlobalHotkey {@link Event} union.
@@ -1962,7 +1963,7 @@ declare type ByType_5<Type extends EventType_5> = Payload_6<Type>;
1962
1963
  *
1963
1964
  * @typeParam Type String key specifying the event to extract
1964
1965
  */
1965
- declare type ByType_6<Type extends EventType_6> = Payload_7<Type>;
1966
+ declare type ByType_6<Type extends EventType_6> = Payload_8<Type>;
1966
1967
 
1967
1968
  /**
1968
1969
  * Extracts a single event type matching the given key from the Platform {@link Event} union.
@@ -1971,7 +1972,7 @@ declare type ByType_6<Type extends EventType_6> = Payload_7<Type>;
1971
1972
  *
1972
1973
  * @typeParam Type String key specifying the event to extract
1973
1974
  */
1974
- declare type ByType_7<Type extends EventType_7> = Payload_8<Type>;
1975
+ declare type ByType_7<Type extends EventType_7> = Payload_9<Type>;
1975
1976
 
1976
1977
  /**
1977
1978
  * Extracts a single event type matching the given key from the System {@link Event} union.
@@ -1980,7 +1981,7 @@ declare type ByType_7<Type extends EventType_7> = Payload_8<Type>;
1980
1981
  *
1981
1982
  * @typeParam Type String key specifying the event to extract
1982
1983
  */
1983
- declare type ByType_8<Type extends EventType_8> = Payload_9<Type>;
1984
+ declare type ByType_8<Type extends EventType_8> = Payload_10<Type>;
1984
1985
 
1985
1986
  /**
1986
1987
  * Extracts a single event type matching the given key from the Layout DOM {@link Event} union.
@@ -1989,7 +1990,7 @@ declare type ByType_8<Type extends EventType_8> = Payload_9<Type>;
1989
1990
  *
1990
1991
  * @typeParam Type String key specifying the event to extract
1991
1992
  */
1992
- declare type ByType_9<Type extends EventType_9> = Payload_10<Type>;
1993
+ declare type ByType_9<Type extends EventType_9> = Payload_11<Type>;
1993
1994
 
1994
1995
  /**
1995
1996
  * Configuration for page capture.
@@ -3701,6 +3702,7 @@ declare type ContainerCreatedEvent = LayoutDOMEvent & {
3701
3702
 
3702
3703
  /**
3703
3704
  * Generated when content navigation or redirection is blocked by {@link OpenFin.DomainSettings}.
3705
+ * @interface
3704
3706
  */
3705
3707
  declare type ContentBlockedEvent = NamedEvent & {
3706
3708
  type: 'content-blocked';
@@ -4805,9 +4807,7 @@ declare class EventAggregator extends EmitterMap {
4805
4807
  * @remarks Selects the correct type for the event
4806
4808
  * payload from the provided union based on the provided string literal type.
4807
4809
  */
4808
- declare type EventHandler<EmitterEvent extends BaseEvent, EventType extends string> = (payload: Extract<EmitterEvent, {
4809
- type: EventType;
4810
- }>, ...args: any[]) => void;
4810
+ declare type EventHandler<EmitterEvent extends BaseEvent, EventType extends string> = (payload: Payload_2<EmitterEvent, EventType>, ...args: any[]) => void;
4811
4811
 
4812
4812
  declare namespace Events {
4813
4813
  export {
@@ -4943,7 +4943,7 @@ declare namespace ExternalApplicationEvents {
4943
4943
  ExternalApplicationEvent,
4944
4944
  EventType_4 as EventType,
4945
4945
  ExternalApplicationEventType,
4946
- Payload_5 as Payload,
4946
+ Payload_6 as Payload,
4947
4947
  ByType_4 as ByType
4948
4948
  }
4949
4949
  }
@@ -5395,7 +5395,7 @@ declare namespace FrameEvents {
5395
5395
  FrameEvent,
5396
5396
  EventType_5 as EventType,
5397
5397
  FrameEventType,
5398
- Payload_6 as Payload,
5398
+ Payload_7 as Payload,
5399
5399
  ByType_5 as ByType
5400
5400
  }
5401
5401
  }
@@ -5635,7 +5635,7 @@ declare namespace GlobalHotkeyEvents {
5635
5635
  GlobalHotkeyEvent,
5636
5636
  EventType_6 as EventType,
5637
5637
  GlobalHotkeyEventType,
5638
- Payload_7 as Payload,
5638
+ Payload_8 as Payload,
5639
5639
  ByType_6 as ByType
5640
5640
  }
5641
5641
  }
@@ -7715,7 +7715,7 @@ declare namespace LayoutDOMEvents {
7715
7715
  LayoutStateChangedEvent,
7716
7716
  Event_12 as Event,
7717
7717
  EventType_9 as EventType,
7718
- Payload_10 as Payload,
7718
+ Payload_11 as Payload,
7719
7719
  ByType_9 as ByType
7720
7720
  }
7721
7721
  }
@@ -8910,6 +8910,34 @@ declare type NavigationRules = {
8910
8910
 
8911
8911
  declare type NewConnectConfig = ConfigWithUuid & ConfigWithRuntime;
8912
8912
 
8913
+ declare interface NodeNetworkInterfaceBase {
8914
+ address: string;
8915
+ netmask: string;
8916
+ mac: string;
8917
+ internal: boolean;
8918
+ cidr: string | null;
8919
+ }
8920
+
8921
+ declare type NodeNetworkInterfaceInfo = NodeNetworkInterfaceInfoIPv4 | NodeNetworkInterfaceInfoIPv6;
8922
+
8923
+ declare interface NodeNetworkInterfaceInfoIPv4 extends NodeNetworkInterfaceBase {
8924
+ family: 'IPv4';
8925
+ scopeid?: undefined;
8926
+ }
8927
+
8928
+ declare interface NodeNetworkInterfaceInfoIPv6 extends NodeNetworkInterfaceBase {
8929
+ family: 'IPv6';
8930
+ scopeid: number;
8931
+ }
8932
+
8933
+ declare interface NodeUserInfo {
8934
+ username: string;
8935
+ uid: number;
8936
+ gid: number;
8937
+ shell: string | null;
8938
+ homedir: string;
8939
+ }
8940
+
8913
8941
  /**
8914
8942
  * @interface
8915
8943
  */
@@ -9139,6 +9167,7 @@ declare namespace OpenFin_2 {
9139
9167
  Time,
9140
9168
  CpuInfo,
9141
9169
  GpuInfo,
9170
+ OSInfo,
9142
9171
  HostSpecs,
9143
9172
  PrinterInfo_2 as PrinterInfo,
9144
9173
  Dpi,
@@ -9348,6 +9377,25 @@ declare type OptionsChangedEvent = BaseEvent_5 & {
9348
9377
  diff: OpenFin_2.WindowOptionDiff;
9349
9378
  };
9350
9379
 
9380
+ /**
9381
+ * @interface
9382
+ * The keys represent the output from calling individual Node `os` APIs.
9383
+ * For example, `userInfo` will have the output of calling `os.userInfo()`. For more information
9384
+ * see [Node `os` API docs](https://nodejs.org/docs/latest-v20.x/api/os.html)
9385
+ */
9386
+ declare type OSInfo = {
9387
+ platform: string;
9388
+ release: string;
9389
+ version: string;
9390
+ /**
9391
+ * Throws if a user has no username or homedir.
9392
+ * See [Node os.userInfo docs for more info](https://nodejs.org/docs/latest-v20.x/api/os.html#osuserinfooptions)
9393
+ */
9394
+ userInfo: NodeUserInfo;
9395
+ hostname: string;
9396
+ networkInterfaces: Record<string, NodeNetworkInterfaceInfo[] | undefined>;
9397
+ };
9398
+
9351
9399
  declare type OverrideCallback<T extends any = PlatformProvider, U extends T = T> = (arg: Constructor<T>) => U | Promise<U>;
9352
9400
 
9353
9401
  /**
@@ -9376,86 +9424,110 @@ declare type Payload<Success extends boolean = boolean, Data = any> = {
9376
9424
  error?: Success extends false ? ErrorPlainObject | undefined : never;
9377
9425
  };
9378
9426
 
9427
+ /**
9428
+ * Extracts a single event type matching the given key from the System {@link Event} union.
9429
+ *
9430
+ * @see {@link ByType}
9431
+ *
9432
+ * @typeParam Type String key specifying the event to extract
9433
+ */
9434
+ declare type Payload_10<Type extends EventType_8> = BaseEvents.Payload<Event_11, Type>;
9435
+
9379
9436
  /**
9380
9437
  * Extracts a single event type matching the given key from the Layout DOM {@link Event} union.
9381
9438
  *
9382
9439
  * @typeParam Type String key specifying the event to extract
9383
9440
  */
9384
- declare type Payload_10<Type extends EventType_9> = Extract<Event_12, {
9441
+ declare type Payload_11<Type extends EventType_9> = Extract<Event_12, {
9385
9442
  type: Type;
9386
9443
  }>;
9387
9444
 
9445
+ /**
9446
+ * Extracts a single event type matching the given type key from the provided EmitterEvent union.
9447
+ *
9448
+ * @remarks Each event emitter namespace defines its own reduction of this type that fixes the Event parameter to
9449
+ * the appropriate payload union for that namespace.
9450
+ *
9451
+ * @typeParam Event Union of payloads for events on the given emitter
9452
+ * @see {@link ByType}
9453
+ *
9454
+ * @typeParam Type String key specifying the event to extract from the union
9455
+ *
9456
+ * @see {@link OpenFin.Events.ApplicationEvents.Payload}
9457
+ * @see {@link OpenFin.Events.ExternalApplicationEvents.Payload}
9458
+ * @see {@link OpenFin.Events.FrameEvents.Payload}
9459
+ * @see {@link OpenFin.Events.GlobalHotkeyEvents.Payload}
9460
+ * @see {@link OpenFin.Events.PlatformEvents.Payload}
9461
+ * @see {@link OpenFin.Events.SystemEvents.Payload}
9462
+ * @see {@link OpenFin.Events.ViewEvents.Payload}
9463
+ * @see {@link OpenFin.Events.WindowEvents.Payload}
9464
+ */
9465
+ declare type Payload_2<Event extends BaseEvent, EventType extends string> = Extract<Event, {
9466
+ type: EventType;
9467
+ }>;
9468
+
9388
9469
  /**
9389
9470
  * Extracts a single event type matching the given key from the View {@link Event} union.
9390
9471
  *
9472
+ * @see {@link ByType}
9473
+ *
9391
9474
  * @typeParam Type String key specifying the event to extract
9392
9475
  */
9393
- declare type Payload_2<Type extends EventType> = Extract<Event_4, {
9394
- type: Type;
9395
- }>;
9476
+ declare type Payload_3<Type extends EventType> = BaseEvents.Payload<Event_4, Type>;
9396
9477
 
9397
9478
  /**
9398
9479
  * Extracts a single event type matching the given key from the Window {@link Event} union.
9399
9480
  *
9481
+ * @see {@link ByType}
9482
+ *
9400
9483
  * @typeParam Type String key specifying the event to extract
9401
9484
  */
9402
- declare type Payload_3<Type extends EventType_2> = Extract<Event_6, {
9403
- type: Type;
9404
- }>;
9485
+ declare type Payload_4<Type extends EventType_2> = BaseEvents.Payload<Event_6, Type>;
9405
9486
 
9406
9487
  /**
9407
9488
  * Extracts a single event type matching the given key from the Application {@link Event} union.
9408
9489
  *
9490
+ * @see {@link ByType}
9491
+ *
9409
9492
  * @typeParam Type String key specifying the event to extract
9410
9493
  */
9411
- declare type Payload_4<Type extends EventType_3> = Extract<Event_3, {
9412
- type: Type;
9413
- }>;
9494
+ declare type Payload_5<Type extends EventType_3> = BaseEvents.Payload<Event_3, Type>;
9414
9495
 
9415
9496
  /**
9416
9497
  * Extracts a single event type matching the given key from the ExternalApplication {@link Event} union.
9417
9498
  *
9499
+ * @see {@link ByType}
9500
+ *
9418
9501
  * @typeParam Type String key specifying the event to extract
9419
9502
  */
9420
- declare type Payload_5<Type extends EventType_4> = Extract<Event_7, {
9421
- type: Type;
9422
- }>;
9503
+ declare type Payload_6<Type extends EventType_4> = BaseEvents.Payload<Event_7, Type>;
9423
9504
 
9424
9505
  /**
9425
9506
  * Extracts a single event type matching the given key from the Frame {@link Event} union.
9426
9507
  *
9508
+ * @see {@link ByType}
9509
+ *
9427
9510
  * @typeParam Type String key specifying the event to extract
9428
9511
  */
9429
- declare type Payload_6<Type extends EventType_5> = Extract<Event_8, {
9430
- type: Type;
9431
- }>;
9512
+ declare type Payload_7<Type extends EventType_5> = BaseEvents.Payload<Event_8, Type>;
9432
9513
 
9433
9514
  /**
9434
9515
  * Extracts a single event type matching the given key from the GlobalHotkey {@link Event} union.
9435
9516
  *
9517
+ * @see {@link ByType}
9518
+ *
9436
9519
  * @typeParam Type String key specifying the event to extract
9437
9520
  */
9438
- declare type Payload_7<Type extends EventType_6> = Extract<Event_9, {
9439
- type: Type;
9440
- }>;
9521
+ declare type Payload_8<Type extends EventType_6> = BaseEvents.Payload<Event_9, Type>;
9441
9522
 
9442
9523
  /**
9443
9524
  * Extracts a single event type matching the given key from the Platform {@link Event} union.
9444
9525
  *
9445
- * @typeParam Type String key specifying the event to extract
9446
- */
9447
- declare type Payload_8<Type extends EventType_7> = Extract<Event_10, {
9448
- type: Type;
9449
- }>;
9450
-
9451
- /**
9452
- * Extracts a single event type matching the given key from the System {@link Event} union.
9526
+ * @see {@link ByType}
9453
9527
  *
9454
9528
  * @typeParam Type String key specifying the event to extract
9455
9529
  */
9456
- declare type Payload_9<Type extends EventType_8> = Extract<Event_11, {
9457
- type: Type;
9458
- }>;
9530
+ declare type Payload_9<Type extends EventType_7> = BaseEvents.Payload<Event_10, Type>;
9459
9531
 
9460
9532
  /**
9461
9533
  * @interface
@@ -10150,7 +10222,7 @@ declare namespace PlatformEvents {
10150
10222
  PlatformEvent,
10151
10223
  EventType_7 as EventType,
10152
10224
  PlatformEventType,
10153
- Payload_8 as Payload,
10225
+ Payload_9 as Payload,
10154
10226
  ByType_7 as ByType
10155
10227
  }
10156
10228
  }
@@ -11585,6 +11657,8 @@ declare interface ProtocolMap extends ProtocolMapBase {
11585
11657
  };
11586
11658
  response: void;
11587
11659
  };
11660
+ 'get-host-specs': GetterCall<OpenFin_2.HostSpecs>;
11661
+ 'get-os-info': GetterCall<OpenFin_2.OSInfo>;
11588
11662
  'system-get-printers': GetterCall<OpenFin_2.PrinterInfo[]>;
11589
11663
  'system-register-shutdown-handler': VoidCall;
11590
11664
  'get-domain-settings': ApiCall<OpenFin_2.ApplicationIdentity, OpenFin_2.DefaultDomainSettings>;
@@ -12441,7 +12515,7 @@ declare type Snapshot = {
12441
12515
  * _Note_ - In the case of using a custom provider, if a window has a layout property but does not call _Layout.init_ this event may not fire.
12442
12516
  * @interface
12443
12517
  */
12444
- declare type SnapshotAppliedEvent = BaseEvent & {
12518
+ declare type SnapshotAppliedEvent = BaseEvents.BaseEvent & {
12445
12519
  topic: 'application';
12446
12520
  type: 'platform-snapshot-applied';
12447
12521
  };
@@ -12925,7 +12999,8 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
12925
12999
  */
12926
13000
  getRvmInfo(): Promise<OpenFin_2.RVMInfo>;
12927
13001
  /**
12928
- * Retrieves system information.
13002
+ * Retrieves general system information. If you need more detailed information about the
13003
+ * OS and the currently logged in user, use `fin.System.getOSInfo()` instead.
12929
13004
  *
12930
13005
  * @example
12931
13006
  * ```js
@@ -12933,6 +13008,15 @@ declare class System extends EmitterBase<OpenFin_2.SystemEvent> {
12933
13008
  * ```
12934
13009
  */
12935
13010
  getHostSpecs(): Promise<OpenFin_2.HostSpecs>;
13011
+ /**
13012
+ * Retrieves information about the OS and the currently logged in user.
13013
+ *
13014
+ * @example
13015
+ * ```js
13016
+ * fin.System.getOSInfo().then(specs => console.log(specs)).catch(err => console.log(err));
13017
+ * ```
13018
+ */
13019
+ getOSInfo(): Promise<OpenFin_2.OSInfo>;
12936
13020
  /**
12937
13021
  * Runs an executable or batch file. A path to the file must be included in options.
12938
13022
  * <br> A uuid may be optionally provided. If not provided, OpenFin will create a uuid for the new process.
@@ -14046,7 +14130,7 @@ declare namespace SystemEvents {
14046
14130
  SystemEvent,
14047
14131
  EventType_8 as EventType,
14048
14132
  SystemEventType,
14049
- Payload_9 as Payload,
14133
+ Payload_10 as Payload,
14050
14134
  ByType_8 as ByType
14051
14135
  }
14052
14136
  }
@@ -14060,6 +14144,7 @@ declare type SystemEventType = EventType_8;
14060
14144
  * @interface
14061
14145
  */
14062
14146
  declare type SystemPermissions = {
14147
+ getOSInfo: boolean;
14063
14148
  getAllExternalWindows: boolean;
14064
14149
  launchExternalProcess: boolean | {
14065
14150
  enabled: boolean;
@@ -15067,7 +15152,7 @@ declare namespace ViewEvents {
15067
15152
  PropagatedViewEvent,
15068
15153
  PropagatedEventType_2 as PropagatedEventType,
15069
15154
  PropagatedViewEventType,
15070
- Payload_2 as Payload,
15155
+ Payload_3 as Payload,
15071
15156
  ByType
15072
15157
  }
15073
15158
  }
@@ -17588,7 +17673,7 @@ declare namespace WindowEvents {
17588
17673
  PropagatedEvent_3 as PropagatedEvent,
17589
17674
  PropagatedWindowEvent,
17590
17675
  PropagatedWindowEventType,
17591
- Payload_3 as Payload,
17676
+ Payload_4 as Payload,
17592
17677
  ByType_2 as ByType
17593
17678
  }
17594
17679
  }