Skip to content

Commit bc9b6a2

Browse files
Closure Teamcopybara-github
authored andcommitted
Add externs for Ink API
PiperOrigin-RevId: 501366896
1 parent ea35c83 commit bc9b6a2

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

externs/browser/wicg_ink.js

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/*
2+
* Copyright 2022 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 The current draft spec of Ink API.
19+
* @see https://wicg.github.io/ink-enhancement/
20+
* @externs
21+
*/
22+
23+
/**
24+
* @see https://wicg.github.io/ink-enhancement/#ink-presenter-param
25+
* @record
26+
* @struct
27+
*/
28+
function InkPresenterParam() {}
29+
30+
/** @type {?Element} */
31+
InkPresenterParam.prototype.presentationArea;
32+
33+
/**
34+
* The Ink API provides the InkPresenter interface to expose the underlying
35+
* operating system API to achieve this and keeps the extensibility open in
36+
* order to support additional presenters in the future.
37+
* @see https://wicg.github.io/ink-enhancement/#ink-interface
38+
* @interface
39+
* @struct
40+
*/
41+
function Ink() {}
42+
43+
/**
44+
* @param {?InkPresenterParam=} param
45+
* @return {!Promise<!InkPresenter>}
46+
*/
47+
Ink.prototype.requestPresenter = function(param) {};
48+
49+
50+
/**
51+
* @see https://wicg.github.io/ink-enhancement/#ink-presenter
52+
* @interface
53+
* @struct
54+
*/
55+
function InkPresenter() {}
56+
57+
/** @type {?Element} */
58+
InkPresenter.prototype.presentationArea;
59+
60+
/** @type {number} */
61+
InkPresenter.prototype.expectedImprovement;
62+
63+
/**
64+
* @param {!PointerEvent} event
65+
* @param {!InkTrailStyle} style
66+
* @return {void}
67+
*/
68+
InkPresenter.prototype.updateInkTrailStartPoint = function(event, style) {};
69+
70+
71+
/**
72+
* @see https://wicg.github.io/ink-enhancement/#ink-trail-style
73+
* @record
74+
* @struct
75+
*/
76+
function InkTrailStyle() {}
77+
78+
/** @type {string} */
79+
InkTrailStyle.prototype.color;
80+
81+
/** @type {number} */
82+
InkTrailStyle.prototype.diameter;
83+
84+
85+
/**
86+
* @see https://wicg.github.io/ink-enhancement/#navigator-interface-extensions
87+
* @type {!Ink}
88+
*/
89+
Navigator.prototype.ink;

0 commit comments

Comments
 (0)