@types/nw.js 0.13.17 → 0.13.19
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.
- nw.js/LICENSE +0 -0
- nw.js/README.md +2 -3
- nw.js/index.d.ts +39 -45
- nw.js/package.json +4 -10
nw.js/LICENSE
CHANGED
|
File without changes
|
nw.js/README.md
CHANGED
|
@@ -8,9 +8,8 @@ This package contains type definitions for nw.js (http://nwjs.io).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nw.js.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Wed, 18 Oct 2023 05:47:08 GMT
|
|
12
12
|
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
|
13
|
-
* Global values: none
|
|
14
13
|
|
|
15
14
|
# Credits
|
|
16
|
-
These definitions were written by
|
|
15
|
+
These definitions were written by .
|
nw.js/index.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
// Type definitions for nw.js 0.13
|
|
2
|
-
// Project: http://nwjs.io
|
|
3
|
-
// Definitions by: DefinitelyTyped <https://github.com/DefinitelyTyped>
|
|
4
|
-
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
5
|
-
|
|
6
1
|
/// <reference types="node" />
|
|
7
|
-
import { EventEmitter } from
|
|
2
|
+
import { EventEmitter } from "events";
|
|
8
3
|
|
|
9
4
|
declare global {
|
|
10
5
|
/**
|
|
@@ -94,7 +89,7 @@ declare global {
|
|
|
94
89
|
/**
|
|
95
90
|
* {string} (Optional) The type of the item. Three types are accepted: normal, checkbox, separator
|
|
96
91
|
*/
|
|
97
|
-
type?: string |
|
|
92
|
+
type?: string | "normal" | "checkbox" | "separator" | undefined;
|
|
98
93
|
|
|
99
94
|
/**
|
|
100
95
|
* {Function} (Optional) The callback function when item is triggered by mouse click or keyboard shortcut
|
|
@@ -208,7 +203,7 @@ declare global {
|
|
|
208
203
|
* - (optional) primary {boolean} This will be true if the source is the primary monitor. (Windows OS only)
|
|
209
204
|
*/
|
|
210
205
|
on(
|
|
211
|
-
event:
|
|
206
|
+
event: "added",
|
|
212
207
|
listener: (id?: string, name?: string, order?: number, type?: string, primary?: boolean) => any,
|
|
213
208
|
): this;
|
|
214
209
|
|
|
@@ -219,7 +214,7 @@ declare global {
|
|
|
219
214
|
* @param listener {Function(order?)} The callback that handles the `remove` event.
|
|
220
215
|
* - (optional) order {number} Is the order of the media source that is no longer capturable.
|
|
221
216
|
*/
|
|
222
|
-
on(event:
|
|
217
|
+
on(event: "removed", listener: (order?: number) => any): this;
|
|
223
218
|
|
|
224
219
|
/**
|
|
225
220
|
* Emit when the Z-order of a source changed (this may change for windows as others are focused).
|
|
@@ -230,7 +225,7 @@ declare global {
|
|
|
230
225
|
* - (optional) new_order {number} Is the new z-order.
|
|
231
226
|
* - (optional) old_order {number} Is the old z-order.
|
|
232
227
|
*/
|
|
233
|
-
on(event:
|
|
228
|
+
on(event: "orderchanged", listener: (id?: string, new_order?: number, old_order?: number) => any): this;
|
|
234
229
|
|
|
235
230
|
/**
|
|
236
231
|
* Emit when the name of the source has changed. This can happen when a window changes title.
|
|
@@ -240,7 +235,7 @@ declare global {
|
|
|
240
235
|
* - (optional) id {string} Is the media id of the screen or window that has a name changed.
|
|
241
236
|
* - (optional) name {string} Is the new name of the screen or window.
|
|
242
237
|
*/
|
|
243
|
-
on(event:
|
|
238
|
+
on(event: "namechanged", listener: (id?: string, name?: string) => any): this;
|
|
244
239
|
|
|
245
240
|
/**
|
|
246
241
|
* Emit when the thumbnail of a source changed.
|
|
@@ -250,7 +245,7 @@ declare global {
|
|
|
250
245
|
* - (optional) id {string} Is the media id of the screen or window that has an updated thumbnail.
|
|
251
246
|
* - (optional) name {string} Is the base64 encoded png of the thumbnail.
|
|
252
247
|
*/
|
|
253
|
-
on(event:
|
|
248
|
+
on(event: "thumbnailchanged", listener: (id?: string, thumbnail?: string) => any): this;
|
|
254
249
|
}
|
|
255
250
|
|
|
256
251
|
/**
|
|
@@ -457,7 +452,7 @@ declare global {
|
|
|
457
452
|
/**
|
|
458
453
|
* The cookie's same-site status (i.e. whether the cookie is sent with cross-site requests).
|
|
459
454
|
*/
|
|
460
|
-
sameSite: string |
|
|
455
|
+
sameSite: string | "no_restriction" | "lax" | "strict";
|
|
461
456
|
|
|
462
457
|
/**
|
|
463
458
|
* True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date.
|
|
@@ -577,7 +572,7 @@ declare global {
|
|
|
577
572
|
/**
|
|
578
573
|
* The cookie's same-site status: defaults to 'no_restriction'.
|
|
579
574
|
*/
|
|
580
|
-
sameSite?: string |
|
|
575
|
+
sameSite?: string | "no_restriction" | "lax" | "strict" | undefined;
|
|
581
576
|
|
|
582
577
|
/**
|
|
583
578
|
* The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie.
|
|
@@ -647,7 +642,7 @@ declare global {
|
|
|
647
642
|
/**
|
|
648
643
|
* The underlying reason behind the cookie's change.
|
|
649
644
|
*/
|
|
650
|
-
cause: string |
|
|
645
|
+
cause: string | "evicted" | "expired" | "explicit" | "expired_overwrite" | "overwrite";
|
|
651
646
|
}
|
|
652
647
|
|
|
653
648
|
/**
|
|
@@ -682,7 +677,7 @@ declare global {
|
|
|
682
677
|
/**
|
|
683
678
|
* Control the options for the new popup window.
|
|
684
679
|
*
|
|
685
|
-
|
|
680
|
+
* @param m {Object} The object is in the same format as the Window subfields in manifest format.
|
|
686
681
|
*/
|
|
687
682
|
setNewWindowManifest(m: WindowOption): void;
|
|
688
683
|
}
|
|
@@ -1151,7 +1146,7 @@ declare global {
|
|
|
1151
1146
|
* @param listener {function(byCommandQ?)} The callback that handles the `close` event.
|
|
1152
1147
|
* - (optional) byCommandQ {string} Whether it’s being closed by ⌘+Q.
|
|
1153
1148
|
*/
|
|
1154
|
-
on(event:
|
|
1149
|
+
on(event: "close", listener: (byCommandQ?: string | any) => any): this;
|
|
1155
1150
|
|
|
1156
1151
|
/**
|
|
1157
1152
|
* The closed event is emitted after corresponding window is closed.
|
|
@@ -1159,7 +1154,7 @@ declare global {
|
|
|
1159
1154
|
* @param event {string} Event name
|
|
1160
1155
|
* @param listener {function} The callback that handles the `closed` event.
|
|
1161
1156
|
*/
|
|
1162
|
-
on(event:
|
|
1157
|
+
on(event: "closed", listener: () => any): this;
|
|
1163
1158
|
|
|
1164
1159
|
/**
|
|
1165
1160
|
* Emitted when the window starts to reload, normally you cannot catch this event because usually it’s emitted before you actually setup the callback.
|
|
@@ -1167,7 +1162,7 @@ declare global {
|
|
|
1167
1162
|
* @param event {string} Event name
|
|
1168
1163
|
* @param listener {function} The callback that handles the `loading` event.
|
|
1169
1164
|
*/
|
|
1170
|
-
on(event:
|
|
1165
|
+
on(event: "loading", listener: () => any): this;
|
|
1171
1166
|
|
|
1172
1167
|
/**
|
|
1173
1168
|
* Emitted when the window is fully loaded, this event behaves the same with window.onload, but doesn’t rely on the DOM.
|
|
@@ -1175,7 +1170,7 @@ declare global {
|
|
|
1175
1170
|
* @param event {string} Event name
|
|
1176
1171
|
* @param listener {function} The callback that handles the `loaded` event.
|
|
1177
1172
|
*/
|
|
1178
|
-
on(event:
|
|
1173
|
+
on(event: "loaded", listener: () => any): this;
|
|
1179
1174
|
|
|
1180
1175
|
/**
|
|
1181
1176
|
* Emitted when the document object in this window or a child iframe is available, after all files are loaded, but before DOM is constructed or any script is run.
|
|
@@ -1184,7 +1179,7 @@ declare global {
|
|
|
1184
1179
|
* @param listener {function(byCommandQ?)} The callback that handles the `document-start` event.
|
|
1185
1180
|
* - (optional) frame {HTMLIFrameElement|any} Is the iframe object, or null if the event is for the window..
|
|
1186
1181
|
*/
|
|
1187
|
-
on(event:
|
|
1182
|
+
on(event: "document-start", listener: (frame: HTMLIFrameElement | any) => any): this;
|
|
1188
1183
|
|
|
1189
1184
|
/**
|
|
1190
1185
|
* Emitted when the document object in this window or a child iframe is unloaded, but before the onunload event is emitted.
|
|
@@ -1193,7 +1188,7 @@ declare global {
|
|
|
1193
1188
|
* @param listener {function(byCommandQ?)} The callback that handles the `document-end` event.
|
|
1194
1189
|
* - (optional) frame {HTMLIFrameElement|any} Is the iframe object, or null if the event is for the window..
|
|
1195
1190
|
*/
|
|
1196
|
-
on(event:
|
|
1191
|
+
on(event: "document-end", listener: (frame: HTMLIFrameElement | any) => any): this;
|
|
1197
1192
|
|
|
1198
1193
|
/**
|
|
1199
1194
|
* Emitted when window gets focus.
|
|
@@ -1201,7 +1196,7 @@ declare global {
|
|
|
1201
1196
|
* @param event {string} Event name
|
|
1202
1197
|
* @param listener {function} The callback that handles the `focus` event.
|
|
1203
1198
|
*/
|
|
1204
|
-
on(event:
|
|
1199
|
+
on(event: "focus", listener: () => any): this;
|
|
1205
1200
|
|
|
1206
1201
|
/**
|
|
1207
1202
|
* Emitted when window loses focus.
|
|
@@ -1209,7 +1204,7 @@ declare global {
|
|
|
1209
1204
|
* @param event {string} Event name
|
|
1210
1205
|
* @param listener {function} The callback that handles the `blur` event.
|
|
1211
1206
|
*/
|
|
1212
|
-
on(event:
|
|
1207
|
+
on(event: "blur", listener: () => any): this;
|
|
1213
1208
|
|
|
1214
1209
|
/**
|
|
1215
1210
|
* Emitted when window is minimized.
|
|
@@ -1217,7 +1212,7 @@ declare global {
|
|
|
1217
1212
|
* @param event {string} Event name
|
|
1218
1213
|
* @param listener {function} The callback that handles the `minimize` event.
|
|
1219
1214
|
*/
|
|
1220
|
-
on(event:
|
|
1215
|
+
on(event: "minimize", listener: () => any): this;
|
|
1221
1216
|
|
|
1222
1217
|
/**
|
|
1223
1218
|
* Emitted when window is restored from minimize, maximize and fullscreen state.
|
|
@@ -1225,7 +1220,7 @@ declare global {
|
|
|
1225
1220
|
* @param event {string} Event name
|
|
1226
1221
|
* @param listener {function} The callback that handles the `restore` event.
|
|
1227
1222
|
*/
|
|
1228
|
-
on(event:
|
|
1223
|
+
on(event: "restore", listener: () => any): this;
|
|
1229
1224
|
|
|
1230
1225
|
/**
|
|
1231
1226
|
* Emitted when window is maximized.
|
|
@@ -1233,7 +1228,7 @@ declare global {
|
|
|
1233
1228
|
* @param event {string} Event name
|
|
1234
1229
|
* @param listener {function} The callback that handles the `maximize` event.
|
|
1235
1230
|
*/
|
|
1236
|
-
on(event:
|
|
1231
|
+
on(event: "maximize", listener: () => any): this;
|
|
1237
1232
|
|
|
1238
1233
|
/**
|
|
1239
1234
|
* Emitted after window is moved.
|
|
@@ -1243,7 +1238,7 @@ declare global {
|
|
|
1243
1238
|
* - (optional) x {Integer} The new location of the left corner of the window.
|
|
1244
1239
|
* - (optional) y {Integer} The new location of the top corner of the window.
|
|
1245
1240
|
*/
|
|
1246
|
-
on(event:
|
|
1241
|
+
on(event: "move", listener: (x?: number, y?: number) => any): this;
|
|
1247
1242
|
|
|
1248
1243
|
/**
|
|
1249
1244
|
* Emitted after window is resized.
|
|
@@ -1253,7 +1248,7 @@ declare global {
|
|
|
1253
1248
|
* - (optional) width {Integer} The new width of the window.
|
|
1254
1249
|
* - (optional) height {Integer} The new height of the window.
|
|
1255
1250
|
*/
|
|
1256
|
-
on(event:
|
|
1251
|
+
on(event: "resize", listener: (width?: number, height?: number) => any): this;
|
|
1257
1252
|
|
|
1258
1253
|
/**
|
|
1259
1254
|
* Emitted when window enters fullscreen state.
|
|
@@ -1261,7 +1256,7 @@ declare global {
|
|
|
1261
1256
|
* @param event {string} Event name
|
|
1262
1257
|
* @param listener {function} The callback that handles the `enter-fullscreen` event.
|
|
1263
1258
|
*/
|
|
1264
|
-
on(event:
|
|
1259
|
+
on(event: "enter-fullscreen", listener: () => any): this;
|
|
1265
1260
|
|
|
1266
1261
|
/**
|
|
1267
1262
|
* Emitted when window zooming changed.
|
|
@@ -1270,7 +1265,7 @@ declare global {
|
|
|
1270
1265
|
* @param listener {function(byCommandQ?)} The callback that handles the `zoom` event.
|
|
1271
1266
|
* - (optional) zoom {Integer} Indicating the new zoom level
|
|
1272
1267
|
*/
|
|
1273
|
-
on(event:
|
|
1268
|
+
on(event: "zoom", listener: (zoom?: number) => any): this;
|
|
1274
1269
|
|
|
1275
1270
|
/**
|
|
1276
1271
|
* Emitted after Devtools is closed.
|
|
@@ -1278,7 +1273,7 @@ declare global {
|
|
|
1278
1273
|
* @param event {string} Event name
|
|
1279
1274
|
* @param listener {function} The callback that handles the `devtools-closed` event.
|
|
1280
1275
|
*/
|
|
1281
|
-
on(event:
|
|
1276
|
+
on(event: "devtools-closed", listener: () => any): this;
|
|
1282
1277
|
|
|
1283
1278
|
/**
|
|
1284
1279
|
* Emitted when a new window is requested from this window or a child iframe.
|
|
@@ -1290,7 +1285,7 @@ declare global {
|
|
|
1290
1285
|
* - (optional) policy {Object} Is an object contain window policy.
|
|
1291
1286
|
*/
|
|
1292
1287
|
on(
|
|
1293
|
-
event:
|
|
1288
|
+
event: "new-win-policy",
|
|
1294
1289
|
listener: (frame?: HTMLIFrameElement | any, url?: string, policy?: WinPolicy) => any,
|
|
1295
1290
|
): this;
|
|
1296
1291
|
|
|
@@ -1304,7 +1299,7 @@ declare global {
|
|
|
1304
1299
|
* - (optional) policy {Object} Is an object contain window policy.
|
|
1305
1300
|
*/
|
|
1306
1301
|
on(
|
|
1307
|
-
event:
|
|
1302
|
+
event: "navigation",
|
|
1308
1303
|
listener: (frame?: HTMLIFrameElement | any, url?: string, policy?: WinNavigationPolicy) => any,
|
|
1309
1304
|
): this;
|
|
1310
1305
|
}
|
|
@@ -1434,7 +1429,7 @@ declare global {
|
|
|
1434
1429
|
* @param listener {Function(args?)} The callback that handles the `open` event.
|
|
1435
1430
|
* - (optional) args {string} the full command line of the program.
|
|
1436
1431
|
*/
|
|
1437
|
-
on(event:
|
|
1432
|
+
on(event: "open", listener: (args?: string) => any): this;
|
|
1438
1433
|
|
|
1439
1434
|
/**
|
|
1440
1435
|
* This event is sent when the user clicks the dock icon for an already running application. This is a Mac specific feature.
|
|
@@ -1442,7 +1437,7 @@ declare global {
|
|
|
1442
1437
|
* @param event {string} Event name
|
|
1443
1438
|
* @param listener {Function} The callback that handles the `reopen` event.
|
|
1444
1439
|
*/
|
|
1445
|
-
on(event:
|
|
1440
|
+
on(event: "reopen", listener: () => any): this;
|
|
1446
1441
|
}
|
|
1447
1442
|
|
|
1448
1443
|
/* Clipboard: http://docs.nwjs.io/en/latest/References/Clipboard/ */
|
|
@@ -1596,7 +1591,7 @@ declare global {
|
|
|
1596
1591
|
* @param event {string} Event name
|
|
1597
1592
|
* @param listener {Function} The callback that handles the `click` event.
|
|
1598
1593
|
*/
|
|
1599
|
-
on(event:
|
|
1594
|
+
on(event: "click", listener: () => any): this;
|
|
1600
1595
|
}
|
|
1601
1596
|
|
|
1602
1597
|
/* Screen: http://docs.nwjs.io/en/latest/References/Screen/ */
|
|
@@ -1616,7 +1611,6 @@ declare global {
|
|
|
1616
1611
|
screens: NWJS_Helpers.screen[];
|
|
1617
1612
|
|
|
1618
1613
|
/**
|
|
1619
|
-
*
|
|
1620
1614
|
* @param sources {string[]} Array of source types.
|
|
1621
1615
|
* @param callback {Function} callback function with chosed streamId.
|
|
1622
1616
|
* - (optional) streamId {string} streamId will be false if failed to execute or existing session is alive.
|
|
@@ -1637,7 +1631,7 @@ declare global {
|
|
|
1637
1631
|
* @param listener {Function(screen?)} The callback that handles the `displayBoundsChanged` event.
|
|
1638
1632
|
* - (optional) screen {screen} screen object
|
|
1639
1633
|
*/
|
|
1640
|
-
on(event:
|
|
1634
|
+
on(event: "displayBoundsChanged", listener: (screen: NWJS_Helpers.screen) => any): this;
|
|
1641
1635
|
|
|
1642
1636
|
/**
|
|
1643
1637
|
* Emitted when a new screen added.
|
|
@@ -1646,7 +1640,7 @@ declare global {
|
|
|
1646
1640
|
* @param listener {Function(screen?)} The callback that handles the `displayAdded` event.
|
|
1647
1641
|
* - (optional) screen {screen} screen object
|
|
1648
1642
|
*/
|
|
1649
|
-
on(event:
|
|
1643
|
+
on(event: "displayAdded ", listener: (screen: NWJS_Helpers.screen) => any): this;
|
|
1650
1644
|
|
|
1651
1645
|
/**
|
|
1652
1646
|
* Emitted when existing screen removed.
|
|
@@ -1655,7 +1649,7 @@ declare global {
|
|
|
1655
1649
|
* @param listener {Function(screen?)} The callback that handles the `displayRemoved` event.
|
|
1656
1650
|
* - (optional) screen {screen} screen object
|
|
1657
1651
|
*/
|
|
1658
|
-
on(event:
|
|
1652
|
+
on(event: "displayRemoved ", listener: (screen: NWJS_Helpers.screen) => any): this;
|
|
1659
1653
|
}
|
|
1660
1654
|
|
|
1661
1655
|
/* Shell: http://docs.nwjs.io/en/latest/References/Shell/ */
|
|
@@ -1722,7 +1716,7 @@ declare global {
|
|
|
1722
1716
|
* @param event {string} Event name
|
|
1723
1717
|
* @param listener {Function} The callback that handles the `active` event.
|
|
1724
1718
|
*/
|
|
1725
|
-
on(event:
|
|
1719
|
+
on(event: "active", listener: () => any): this;
|
|
1726
1720
|
|
|
1727
1721
|
/**
|
|
1728
1722
|
* Get or set the failed callback of a Shortcut. It will be called when application passes an invalid key, or failed to register the key.
|
|
@@ -1731,7 +1725,7 @@ declare global {
|
|
|
1731
1725
|
* @param listener {Function(msg?)} The callback that handles the `failed` event.
|
|
1732
1726
|
* - (optional) msg {string} Failure message
|
|
1733
1727
|
*/
|
|
1734
|
-
on(event:
|
|
1728
|
+
on(event: "failed", listener: (msg?: string) => any): this;
|
|
1735
1729
|
}
|
|
1736
1730
|
|
|
1737
1731
|
/* Tray: http://docs.nwjs.io/en/latest/References/Tray/ */
|
|
@@ -1788,7 +1782,7 @@ declare global {
|
|
|
1788
1782
|
* @param event {string} Event name
|
|
1789
1783
|
* @param listener {Function} The callback that handles the `click` event.
|
|
1790
1784
|
*/
|
|
1791
|
-
on(event:
|
|
1785
|
+
on(event: "click ", listener: () => any): this;
|
|
1792
1786
|
}
|
|
1793
1787
|
|
|
1794
1788
|
/* Window: http://docs.nwjs.io/en/latest/References/Window/ */
|
|
@@ -1835,7 +1829,7 @@ declare global {
|
|
|
1835
1829
|
}
|
|
1836
1830
|
}
|
|
1837
1831
|
|
|
1838
|
-
declare module
|
|
1832
|
+
declare module "nw.gui" {
|
|
1839
1833
|
export class Menu extends nw.Menu {}
|
|
1840
1834
|
export class MenuItem extends nw.MenuItem {}
|
|
1841
1835
|
export class Shortcut extends nw.Shortcut {}
|
nw.js/package.json
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/nw.js",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.19",
|
|
4
4
|
"description": "TypeScript definitions for nw.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nw.js",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"contributors": [
|
|
8
|
-
{
|
|
9
|
-
"name": "DefinitelyTyped",
|
|
10
|
-
"url": "https://github.com/DefinitelyTyped",
|
|
11
|
-
"githubUsername": "DefinitelyTyped"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
7
|
+
"contributors": [],
|
|
14
8
|
"main": "",
|
|
15
9
|
"types": "index.d.ts",
|
|
16
10
|
"repository": {
|
|
@@ -22,6 +16,6 @@
|
|
|
22
16
|
"dependencies": {
|
|
23
17
|
"@types/node": "*"
|
|
24
18
|
},
|
|
25
|
-
"typesPublisherContentHash": "
|
|
26
|
-
"typeScriptVersion": "4.
|
|
19
|
+
"typesPublisherContentHash": "7f2b7e6592a3cc9274e14ae53ceb6143c7bace8d1dd88f5079d51d74ea1c93a6",
|
|
20
|
+
"typeScriptVersion": "4.5"
|
|
27
21
|
}
|