Skip to content

Commit 3b3f642

Browse files
committed
add new externs to web
1 parent 1080df2 commit 3b3f642

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+11790
-0
lines changed

javascript/externs/web/es6_proxy.js

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
/*
2+
* Copyright 2018 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 ECMAScript 6 Proxy objects.
19+
* @see https://tc39.github.io/ecma262/#sec-proxy-objects
20+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
21+
* @externs
22+
*/
23+
24+
25+
/**
26+
* @record
27+
* @template TARGET
28+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots
29+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler
30+
*/
31+
function ProxyHandler() {}
32+
33+
/**
34+
* @type {(function(TARGET):?Object)|undefined}
35+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof
36+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getPrototypeOf
37+
*/
38+
ProxyHandler.prototype.getPrototypeOf /* = function(target) {} */;
39+
40+
/**
41+
* @type {(function(TARGET, ?Object):boolean)|undefined}
42+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-setprototypeof-v
43+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/setPrototypeOf
44+
*/
45+
ProxyHandler.prototype.setPrototypeOf /* = function(target, proto) {} */;
46+
47+
/**
48+
* @type {(function(TARGET):boolean)|undefined}
49+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-isextensible
50+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/isExtensible
51+
*/
52+
ProxyHandler.prototype.isExtensible /* = function(target) {} */;
53+
54+
/**
55+
* @type {(function(TARGET):boolean)|undefined}
56+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-preventextensions
57+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/preventExtensions
58+
*/
59+
ProxyHandler.prototype.preventExtensions /* = function(target) {} */;
60+
61+
/**
62+
* @type {(function(TARGET, (string|symbol)):(!ObjectPropertyDescriptor|undefined))|undefined}
63+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-getownproperty-p
64+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor
65+
*/
66+
ProxyHandler.prototype.getOwnPropertyDescriptor /* = function(target, prop) {} */;
67+
68+
/**
69+
* @type {(function(TARGET, (string|symbol), !ObjectPropertyDescriptor):boolean)|undefined}
70+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc
71+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/defineProperty
72+
*/
73+
ProxyHandler.prototype.defineProperty /* = function(target, prop, desc) {} */;
74+
75+
/**
76+
* @type {(function(TARGET, (string|symbol)):boolean)|undefined}
77+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-p
78+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/has
79+
*/
80+
ProxyHandler.prototype.has /* = function(target, prop) {} */;
81+
82+
/**
83+
* @type {(function(TARGET, (string|symbol), !Object):*)|undefined}
84+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver
85+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/get
86+
*/
87+
ProxyHandler.prototype.get /* = function(target, prop, receiver) {} */;
88+
89+
/**
90+
* @type {(function(TARGET, (string|symbol), *, !Object):boolean)|undefined}
91+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver
92+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/set
93+
*/
94+
ProxyHandler.prototype.set /* = function(target, prop, value, receiver) {} */;
95+
96+
/**
97+
* @type {(function(TARGET, (string|symbol)):boolean)|undefined}
98+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-delete-p
99+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/deleteProperty
100+
*/
101+
ProxyHandler.prototype.deleteProperty /* = function (target, prop) {} */;
102+
103+
/**
104+
* @type {(function(TARGET):!Array<(string|symbol)>)|undefined}
105+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
106+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/ownKeys
107+
*/
108+
ProxyHandler.prototype.ownKeys /* = function(target) {} */;
109+
110+
/**
111+
* @type {(function(TARGET, *, !Array):*)|undefined}
112+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-call-thisargument-argumentslist
113+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/apply
114+
*/
115+
ProxyHandler.prototype.apply /* = function(target, thisArg, argList) {} */;
116+
117+
/**
118+
* @type {(function(TARGET, !Array, function(new: ?, ...?)):!Object)|undefined}
119+
* @see https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtarget
120+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/construct
121+
*/
122+
ProxyHandler.prototype.construct /* = function(target, argList, newTarget) {} */;
123+
124+
125+
/**
126+
* @constructor
127+
* @param {TARGET} target
128+
* @param {!ProxyHandler<TARGET>} handler
129+
* @template TARGET
130+
* @see https://tc39.github.io/ecma262/#sec-proxy-constructor
131+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy#Syntax
132+
*/
133+
function Proxy(target, handler) {}
134+
135+
/**
136+
* @param {TARGET} target
137+
* @param {!ProxyHandler<TARGET>} handler
138+
* @return {{proxy: !Proxy<TARGET>, revoke: function():void}}
139+
* @template TARGET
140+
* @see https://tc39.github.io/ecma262/#sec-proxy.revocable
141+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/revocable
142+
*/
143+
Proxy.revocable = function(target, handler) {};

javascript/externs/web/fido.js

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* Copyright 2018 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 from the FIDO Specifications
19+
* @see https://fidoalliance.org/download/
20+
*
21+
* @externs
22+
* @author arnarbi@gmail.com (Arnar Birgisson)
23+
*/
24+
25+
/**
26+
* U2F JavaScript API namespace
27+
* @see https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-javascript-api-v1.2-ps-20170411.html
28+
* @const
29+
*/
30+
var u2f = {};
31+
32+
/**
33+
* Data object for a single sign request.
34+
* @typedef {string}
35+
*/
36+
u2f.Transport;
37+
38+
/**
39+
* Data object for a registered key.
40+
* @typedef {{
41+
* version: string,
42+
* keyHandle: string,
43+
* transports: (!Array<!u2f.Transport>|undefined),
44+
* appId: ?string
45+
* }}
46+
*/
47+
u2f.RegisteredKey;
48+
49+
/**
50+
* An error object for responses
51+
* @typedef {{
52+
* errorCode: number,
53+
* errorMessage: ?string
54+
* }}
55+
*/
56+
u2f.Error;
57+
58+
/**
59+
* Data object for a sign response.
60+
* @typedef {{
61+
* keyHandle: string,
62+
* signatureData: string,
63+
* clientData: string
64+
* }}
65+
*/
66+
u2f.SignResponse;
67+
68+
/**
69+
* @typedef {{
70+
* version: string,
71+
* challenge: string
72+
* }}
73+
*/
74+
u2f.RegisterRequest
75+
76+
/**
77+
* @param {string} appId
78+
* @param {string} challenge
79+
* @param {!Array<!u2f.RegisteredKey>} registeredKeys
80+
* @param {function((!u2f.Error|!u2f.SignResponse))} callback
81+
* @param {number=} opt_timeoutSeconds
82+
*/
83+
u2f.sign = function(
84+
appId, challenge, registeredKeys, callback, opt_timeoutSeconds) {};
85+
86+
/**
87+
* @param {string} appId
88+
* @param {!Array<!u2f.RegisterRequest>} registerRequests
89+
* @param {!Array<!u2f.RegisteredKey>} registeredKeys
90+
* @param {function((!u2f.Error|!u2f.SignResponse))} callback
91+
* @param {number=} opt_timeoutSeconds
92+
*/
93+
u2f.register = function(
94+
appId, registerRequests, registeredKeys, callback, opt_timeoutSeconds) {};
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright 2010 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 Declaration of the type level google namespace.
19+
* @externs
20+
* @author nicksantos@google.com (Nick Santos)
21+
*/
22+
23+
/**
24+
* Suppresses the compiler warning when multiple externs files declare the
25+
* google namespace.
26+
* @suppress {duplicate,strictMissingProperties}
27+
* NOTE: This definition should be marked \@const, and when it is we can remove
28+
* the "strictMissingProperties" suppression.
29+
*/
30+
// TODO(nicksantos): Consolidate to one google namespace declaration.
31+
var google = {};

0 commit comments

Comments
 (0)