Skip to content

Commit f3c51c7

Browse files
shickscopybara-github
authored andcommitted
Include some externs that were added to TS 5.8.
PiperOrigin-RevId: 734665722
1 parent ff349b9 commit f3c51c7

File tree

2 files changed

+286
-0
lines changed

2 files changed

+286
-0
lines changed

externs/browser/w3c_navigation.js

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* Copyright 2025 The Closure Compiler Authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/**
18+
* @fileoverview Definitions for HTML Navigation History APIs.
19+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API
20+
* @externs
21+
*/
22+
23+
// NavigationHistoryEntry
24+
25+
/**
26+
* @constructor
27+
* @implements {EventTarget}
28+
* @see https://html.spec.whatwg.org/multipage/nav-history-apis.html#navigationhistoryentry
29+
*/
30+
function NavigationHistoryEntry() {}
31+
32+
/**
33+
* @type {string}
34+
* @see https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationhistoryentry-id
35+
*/
36+
NavigationHistoryEntry.prototype.id;
37+
38+
/**
39+
* @type {number}
40+
* @see https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationhistoryentry-index
41+
*/
42+
NavigationHistoryEntry.prototype.index;
43+
44+
/**
45+
* @type {string}
46+
* @see https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationhistoryentry-key
47+
*/
48+
NavigationHistoryEntry.prototype.key;
49+
50+
/**
51+
* @type {string|null}
52+
* @see https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationhistoryentry-url
53+
*/
54+
NavigationHistoryEntry.prototype.url;
55+
56+
/**
57+
* @type {boolean}
58+
* @see https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationhistoryentry-samedocument
59+
*/
60+
NavigationHistoryEntry.prototype.sameDocument;
61+
62+
/**
63+
* @return {?}
64+
* @see https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationhistoryentry-getstate
65+
*/
66+
NavigationHistoryEntry.prototype.getState = function() {};
67+
68+
/**
69+
* @type {function(!Event)|undefined|null}
70+
* @see https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-navigationhistoryentry-ondispose
71+
*/
72+
NavigationHistoryEntry.prototype.ondispose;

externs/browser/w3c_webcodecs.js

+214
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,12 @@ var LatencyMode;
11351135
*/
11361136
var PredefinedColorSpace;
11371137

1138+
/**
1139+
* @typedef {string}
1140+
* @see https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html#colorspaceconversion
1141+
*/
1142+
var ColorSpaceConversion;
1143+
11381144
/**
11391145
* @typedef {string}
11401146
*/
@@ -1158,6 +1164,12 @@ var VideoColorPrimaries;
11581164
*/
11591165
var VideoTransferCharacteristics;
11601166

1167+
/**
1168+
* @typedef {ArrayBuffer|ArrayBufferView|ReadableStream}
1169+
* @see https://www.w3.org/TR/webcodecs/#typedefdef-imagebuffersource
1170+
*/
1171+
var ImageBufferSource;
1172+
11611173
/**
11621174
* Available only in secure contexts.
11631175
* @param {!VideoEncoderInit} init
@@ -1257,3 +1269,205 @@ EncodedVideoChunk.prototype.byteLength;
12571269
* @see https://www.w3.org/TR/webcodecs/#dom-encodedvideochunk-copyto
12581270
*/
12591271
EncodedVideoChunk.prototype.copyTo = function(destination) {};
1272+
1273+
/**
1274+
* @record
1275+
* @struct
1276+
* @see https://www.w3.org/TR/webcodecs/#dictdef-imagedecodeoptions
1277+
*/
1278+
function ImageDecodeOptions() {}
1279+
1280+
/**
1281+
* @type {boolean|undefined}
1282+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecodeoptions-completeframesonly
1283+
*/
1284+
ImageDecodeOptions.prototype.completeFramesOnly;
1285+
1286+
/**
1287+
* @type {number|undefined}
1288+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecodeoptions-frameindex
1289+
*/
1290+
ImageDecodeOptions.prototype.frameIndex;
1291+
1292+
/**
1293+
* @record
1294+
* @struct
1295+
* @see https://www.w3.org/TR/webcodecs/#dictdef-imagedecoderesult
1296+
*/
1297+
function ImageDecodeResult() {}
1298+
1299+
/**
1300+
* @type {boolean}
1301+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoderesult-complete
1302+
*/
1303+
ImageDecodeResult.prototype.complete;
1304+
1305+
/**
1306+
* @type {!VideoFrame}
1307+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoderesult-image
1308+
*/
1309+
ImageDecodeResult.prototype.image;
1310+
1311+
/**
1312+
* @record
1313+
* @struct
1314+
* @see https://www.w3.org/TR/webcodecs/#dictdef-imagedecoderinit
1315+
*/
1316+
function ImageDecoderInit() {}
1317+
1318+
/**
1319+
* @type {string}
1320+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoderinit-type
1321+
*/
1322+
ImageDecoderInit.prototype.type;
1323+
1324+
/**
1325+
* @type {!ImageBufferSource}
1326+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoderinit-data
1327+
*/
1328+
ImageDecoderInit.prototype.data;
1329+
1330+
/**
1331+
* @type {!ColorSpaceConversion|undefined}
1332+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoderinit-colorspaceconversion
1333+
*/
1334+
ImageDecoderInit.prototype.colorSpaceConversion;
1335+
1336+
/**
1337+
* @type {number|undefined}
1338+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoderinit-desiredwidth
1339+
*/
1340+
ImageDecoderInit.prototype.desiredWidth;
1341+
1342+
/**
1343+
* @type {number|undefined}
1344+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoderinit-desiredheight
1345+
*/
1346+
ImageDecoderInit.prototype.desiredHeight;
1347+
1348+
/**
1349+
* @type {boolean|undefined}
1350+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoderinit-preferanimation
1351+
*/
1352+
ImageDecoderInit.prototype.preferAnimation;
1353+
1354+
/**
1355+
* @type {!Array<!ArrayBuffer>|undefined}
1356+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoderinit-transfer
1357+
*/
1358+
ImageDecoderInit.prototype.transfer;
1359+
1360+
/**
1361+
* @constructor
1362+
* @param {!ImageDecoderInit} init
1363+
* @see https://www.w3.org/TR/webcodecs/#imagedecoder
1364+
*/
1365+
function ImageDecoder(init) {}
1366+
1367+
/**
1368+
* @const {boolean}
1369+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoder-complete
1370+
*/
1371+
ImageDecoder.prototype.complete;
1372+
1373+
/**
1374+
* @const {!Promise<undefined>}
1375+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoder-completed
1376+
*/
1377+
ImageDecoder.prototype.completed;
1378+
1379+
/**
1380+
* @const {!ImageTrackList}
1381+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoder-tracks
1382+
*/
1383+
ImageDecoder.prototype.tracks;
1384+
1385+
/**
1386+
* @const {string}
1387+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoder-type
1388+
*/
1389+
ImageDecoder.prototype.type;
1390+
1391+
/**
1392+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoder-close
1393+
*/
1394+
ImageDecoder.prototype.close = function() {};
1395+
1396+
/**
1397+
* @param {!ImageDecodeOptions=} options
1398+
* @return {!Promise<!ImageDecodeResult>}
1399+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoder-decode
1400+
*/
1401+
ImageDecoder.prototype.decode = function(options) {};
1402+
1403+
/**
1404+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoder-reset
1405+
*/
1406+
ImageDecoder.prototype.reset = function() {};
1407+
1408+
/**
1409+
* @param {string} type
1410+
* @return {!Promise<boolean>}
1411+
* @see https://www.w3.org/TR/webcodecs/#dom-imagedecoder-istypesupported
1412+
*/
1413+
ImageDecoder.isTypeSupported = function(type) {};
1414+
1415+
/**
1416+
* @constructor
1417+
* @see https://www.w3.org/TR/webcodecs/#imagetrack
1418+
*/
1419+
function ImageTrack() {}
1420+
1421+
/**
1422+
* @type {boolean}
1423+
* @see https://www.w3.org/TR/webcodecs/#dom-imagetrack-animated
1424+
*/
1425+
ImageTrack.prototype.animated;
1426+
1427+
/**
1428+
* @type {number}
1429+
* @see https://www.w3.org/TR/webcodecs/#dom-imagetrack-framecount
1430+
*/
1431+
ImageTrack.prototype.frameCount;
1432+
1433+
/**
1434+
* @type {number}
1435+
* @see https://www.w3.org/TR/webcodecs/#dom-imagetrack-repetitionCount
1436+
*/
1437+
ImageTrack.prototype.repetitionCount;
1438+
1439+
/**
1440+
* @type {boolean}
1441+
* @see https://www.w3.org/TR/webcodecs/#dom-imagetrack-selected
1442+
*/
1443+
ImageTrack.prototype.selected;
1444+
1445+
/**
1446+
* @constructor
1447+
* @see https://www.w3.org/TR/webcodecs/#imagetracklist
1448+
*/
1449+
function ImageTrackList() {}
1450+
1451+
/**
1452+
* @type {number}
1453+
* @see https://www.w3.org/TR/webcodecs/#dom-imagetracklist-length
1454+
*/
1455+
ImageTrackList.prototype.length;
1456+
1457+
/**
1458+
* @type {!Promise<undefined>}
1459+
* @see https://www.w3.org/TR/webcodecs/#dom-imagetracklist-ready
1460+
*/
1461+
ImageTrackList.prototype.ready;
1462+
1463+
/**
1464+
* @type {number}
1465+
* @see https://www.w3.org/TR/webcodecs/#dom-imagetracklist-selectedindex
1466+
*/
1467+
ImageTrackList.prototype.selectedIndex;
1468+
1469+
/**
1470+
* @type {!ImageTrack}
1471+
* @see https://www.w3.org/TR/webcodecs/#dom-imagetracklist-selectedtrack
1472+
*/
1473+
ImageTrackList.prototype.selectedTrack;

0 commit comments

Comments
 (0)