Skip to content

Commit 1711c97

Browse files
committed
Merge branch 'ClipboardEventInit' of github.com:Brcrwilliams/TSJS-lib-generator into Brcrwilliams-ClipboardEventInit
2 parents f197190 + 1bd4980 commit 1711c97

36 files changed

+268
-131
lines changed

baselines/dom.generated.d.ts

+16-5
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ interface ClientQueryOptions {
183183
type?: ClientTypes;
184184
}
185185

186+
interface ClipboardEventInit extends EventInit {
187+
clipboardData?: DataTransfer | null;
188+
}
189+
186190
interface CloseEventInit extends EventInit {
187191
code?: number;
188192
reason?: string;
@@ -3260,20 +3264,26 @@ declare var ClientRectList: {
32603264
new(): ClientRectList;
32613265
};
32623266

3267+
interface Clipboard extends EventTarget {
3268+
readText(): Promise<string>;
3269+
writeText(data: string): Promise<void>;
3270+
}
3271+
3272+
declare var Clipboard: {
3273+
prototype: Clipboard;
3274+
new(): Clipboard;
3275+
};
3276+
32633277
/** The ClipboardEvent interface represents events providing information related to modification of the clipboard, that is cut, copy, and paste events. */
32643278
interface ClipboardEvent extends Event {
3265-
readonly clipboardData: DataTransfer;
3279+
readonly clipboardData: DataTransfer | null;
32663280
}
32673281

32683282
declare var ClipboardEvent: {
32693283
prototype: ClipboardEvent;
32703284
new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent;
32713285
};
32723286

3273-
interface ClipboardEventInit extends EventInit {
3274-
data?: string;
3275-
dataType?: string;
3276-
}
32773287

32783288
/** A CloseEvent is sent to clients using WebSockets when the connection is closed. This is delivered to the listener indicated by the WebSocket object's onclose attribute. */
32793289
interface CloseEvent extends Event {
@@ -10494,6 +10504,7 @@ declare var NavigationPreloadManager: {
1049410504
interface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia, NavigatorLanguage, NavigatorStorage, NavigatorAutomationInformation {
1049510505
readonly activeVRDisplays: ReadonlyArray<VRDisplay>;
1049610506
readonly authentication: WebAuthentication;
10507+
readonly clipboard: Clipboard;
1049710508
readonly cookieEnabled: boolean;
1049810509
readonly doNotTrack: string | null;
1049910510
gamepadInputEmulation: GamepadInputEmulationType;

inputfiles/addedTypes.json

-20
Original file line numberDiff line numberDiff line change
@@ -832,26 +832,6 @@
832832
}
833833
}
834834
},
835-
"ClipboardEventInit": {
836-
"exposed": "Window",
837-
"name": "ClipboardEventInit",
838-
"extends": "EventInit",
839-
"properties": {
840-
"property": {
841-
"data": {
842-
"name": "data",
843-
"override-type": "string",
844-
"required": 0
845-
},
846-
"dataType": {
847-
"name": "dataType",
848-
"override-type": "string",
849-
"required": 0
850-
}
851-
}
852-
},
853-
"no-interface-object": "1"
854-
},
855835
"IDBArrayKey": {
856836
"name": "IDBArrayKey",
857837
"extends": "Array<IDBValidKey>",

inputfiles/idl/Clipboard.widl

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
dictionary ClipboardEventInit : EventInit {
2+
DataTransfer? clipboardData = null;
3+
};
4+
5+
[Constructor(DOMString type, optional ClipboardEventInit eventInitDict), Exposed=Window]
6+
interface ClipboardEvent : Event {
7+
readonly attribute DataTransfer? clipboardData;
8+
};
9+
10+
partial interface Navigator {
11+
[SecureContext, SameObject] readonly attribute Clipboard clipboard;
12+
};
13+
14+
[SecureContext, Exposed=Window] interface Clipboard : EventTarget {
15+
Promise<DataTransfer> read();
16+
Promise<DOMString> readText();
17+
Promise<void> write(DataTransfer data);
18+
Promise<void> writeText(DOMString data);
19+
};
20+
21+
dictionary ClipboardPermissionDescriptor : PermissionDescriptor {
22+
boolean allowWithoutGesture = false;
23+
};

inputfiles/idl/DOM.commentmap.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"document-createcdatasection": "Returns a CDATASection node whose data is data.",
8080
"document-createcomment": "Returns a Comment node whose data is data.",
8181
"document-createprocessinginstruction": "Returns a ProcessingInstruction node whose target is target and data is data.\nIf target does not match the Name production an\n\"InvalidCharacterError\" DOMException will be thrown.\nIf data contains \"?>\" an\n\"InvalidCharacterError\" DOMException will be thrown.",
82-
"document-importnode": "",
82+
"document-importnode": "Returns a copy of node. If deep is true, the copy also includes the node's descendants.\nIf node is a document or a shadow root, throws a\n\"NotSupportedError\" DOMException.",
8383
"document-adoptnode": "Moves node from another document and returns it.\nIf node is a document, throws a \"NotSupportedError\" DOMException or, if node is a shadow root, throws a\n\"HierarchyRequestError\" DOMException.",
8484
"documentfragment-documentfragment": "Returns a new DocumentFragment node.",
8585
"element-namespaceuri": "Returns the namespace.",
+8-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{
22
"textdecoder": "Returns a new TextDecoder object.\nIf label is either not a label or is a label for replacement, throws a RangeError.",
33
"textdecoder-encoding": "Returns encoding's name, lowercased.",
4-
"textdecoder-fatal": "Returns true if error mode is \"fatal\", and false\notherwise.",
5-
"textdecoder-ignorebom": "Returns true if ignore BOM flag is set, and false otherwise.",
6-
"textdecoder-decode": "Returns the result of running encoding's decoder. The\nmethod can be invoked zero or more times with options's stream set to\ntrue, and then once without options's stream (or set to false), to process\na fragmented stream. If the invocation without options's stream (or set to\nfalse) has no input, it's clearest to omit both arguments.\nvar string = \"\", decoder = new TextDecoder(encoding), buffer;\nwhile(buffer = next_chunk()) {\nstring += decoder.decode(buffer, {stream:true});\n}\nstring += decoder.decode(); // end-of-stream\nIf the error mode is \"fatal\" and encoding's decoder returns error, throws a TypeError.",
4+
"textdecoder-fatal": "Returns true if error mode is \"fatal\", and\nfalse otherwise.",
5+
"textdecoder-ignorebom": "Returns true if ignore BOM flag is set, and false\notherwise.",
6+
"textdecoder-decode": "Returns the result of running encoding's decoder.\nThe method can be invoked zero or more times with options's stream set to\ntrue, and then once without options's stream (or set to false), to process\na fragmented stream. If the invocation without options's stream (or set to\nfalse) has no input, it's clearest to omit both arguments.\nvar string = \"\", decoder = new TextDecoder(encoding), buffer;\nwhile(buffer = next_chunk()) {\nstring += decoder.decode(buffer, {stream:true});\n}\nstring += decoder.decode(); // end-of-stream\nIf the error mode is \"fatal\" and encoding's decoder returns error, throws a TypeError.",
77
"textencoder": "Returns a new TextEncoder object.",
88
"textencoder-encoding": "Returns \"utf-8\".",
9-
"textencoder-encode": "Returns the result of running UTF-8's encoder."
9+
"textencoder-encode": "Returns the result of running UTF-8's encoder.",
10+
"textencoder-encodeinto": "Runs the UTF-8 encoder on source, stores the result of that operation into destination, and returns the progress made as a dictionary whereby read is the number of converted code units of source and written is the number of bytes modified in destination.",
11+
"textdecoderstream": "Returns a new TextDecoderStream object.\nIf label is either not a label or is a label for replacement, throws a RangeError.",
12+
"generictransformstream-writable": "Returns a writable stream which accepts string chunks and runs them through UTF-8's encoder before making them available to readable.\nTypically this will be used via the pipeThrough() method on a ReadableStream source.\ntextReadable\n.pipeThrough(new TextEncoderStream())\n.pipeTo(byteWritable);",
13+
"textencoderstream": "Returns a new TextEncoderStream object."
1014
}

inputfiles/idl/Encoding.widl

+37-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
interface mixin TextDecoderCommon {
2+
readonly attribute DOMString encoding;
3+
readonly attribute boolean fatal;
4+
readonly attribute boolean ignoreBOM;
5+
};
6+
17
dictionary TextDecoderOptions {
28
boolean fatal = false;
39
boolean ignoreBOM = false;
@@ -10,15 +16,42 @@ dictionary TextDecodeOptions {
1016
[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
1117
Exposed=(Window,Worker)]
1218
interface TextDecoder {
13-
readonly attribute DOMString encoding;
14-
readonly attribute boolean fatal;
15-
readonly attribute boolean ignoreBOM;
1619
USVString decode(optional BufferSource input, optional TextDecodeOptions options);
1720
};
21+
TextDecoder includes TextDecoderCommon;
22+
23+
interface mixin TextEncoderCommon {
24+
readonly attribute DOMString encoding;
25+
};
26+
27+
dictionary TextEncoderEncodeIntoResult {
28+
unsigned long long read;
29+
unsigned long long written;
30+
};
1831

1932
[Constructor,
2033
Exposed=(Window,Worker)]
2134
interface TextEncoder {
22-
readonly attribute DOMString encoding;
2335
[NewObject] Uint8Array encode(optional USVString input = "");
36+
TextEncoderEncodeIntoResult encodeInto(USVString source, Uint8Array destination);
37+
};
38+
TextEncoder includes TextEncoderCommon;
39+
40+
interface mixin GenericTransformStream {
41+
readonly attribute ReadableStream readable;
42+
readonly attribute WritableStream writable;
43+
};
44+
45+
[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options),
46+
Exposed=(Window,Worker)]
47+
interface TextDecoderStream {
48+
};
49+
TextDecoderStream includes TextDecoderCommon;
50+
TextDecoderStream includes GenericTransformStream;
51+
52+
[Constructor,
53+
Exposed=(Window,Worker)]
54+
interface TextEncoderStream {
2455
};
56+
TextEncoderStream includes TextEncoderCommon;
57+
TextEncoderStream includes GenericTransformStream;

inputfiles/idl/Fetch.widl

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Response includes Body;
9292

9393
dictionary ResponseInit {
9494
unsigned short status = 200;
95-
ByteString statusText = "OK";
95+
ByteString statusText = "";
9696
HeadersInit headers;
9797
};
9898

inputfiles/idl/Fullscreen.commentmap.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"element-requestfullscreen": "Displays element fullscreen and resolves promise when done.",
2+
"element-requestfullscreen": "Displays element fullscreen and resolves promise when done.\nWhen supplied, options's navigationUI member indicates whether showing\nnavigation UI while in fullscreen is preferred or not. If set to \"show\", navigation\nsimplicity is preferred over screen space, and if set to \"hide\", more screen space\nis preferred. User agents are always free to honor user preference over the application's. The\ndefault value \"auto\" indicates no application preference.",
33
"document-fullscreenenabled": "Returns true if document has the ability to display elements fullscreen\nand fullscreen is supported, or false otherwise.",
44
"document-exitfullscreen": "Stops document's fullscreen element from being displayed fullscreen and\nresolves promise when done.",
55
"document-fullscreenelement": "Returns shadowroot's fullscreen element."

inputfiles/idl/Fullscreen.widl

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
enum FullscreenNavigationUI {
2+
"auto",
3+
"show",
4+
"hide"
5+
};
6+
7+
dictionary FullscreenOptions {
8+
FullscreenNavigationUI navigationUI = "auto";
9+
};
10+
111
partial interface Element {
2-
Promise<void> requestFullscreen();
12+
Promise<void> requestFullscreen(optional FullscreenOptions options);
313

414
attribute EventHandler onfullscreenchange;
515
attribute EventHandler onfullscreenerror;
@@ -15,6 +25,6 @@ partial interface Document {
1525
attribute EventHandler onfullscreenerror;
1626
};
1727

18-
partial interface DocumentOrShadowRoot {
28+
partial interface mixin DocumentOrShadowRoot {
1929
[LenientSetter] readonly attribute Element? fullscreenElement;
2030
};

inputfiles/idl/Geometry Interfaces.widl

+2
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ interface DOMMatrixReadOnly {
151151
optional unrestricted double originX = 0,
152152
optional unrestricted double originY = 0,
153153
optional unrestricted double originZ = 0);
154+
[NewObject] DOMMatrix scaleNonUniform(optional unrestricted double scaleX = 1,
155+
optional unrestricted double scaleY = 1);
154156
[NewObject] DOMMatrix scale3d(optional unrestricted double scale = 1,
155157
optional unrestricted double originX = 0,
156158
optional unrestricted double originY = 0,

inputfiles/idl/HTML - Canvas.commentmap.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"imagebitmaprenderingcontext-canvas": "Returns the canvas element that the context is bound to.",
1515
"imagebitmaprenderingcontext-transferfromimagebitmap": "Replaces contents of the canvas element to which context\nis bound with a transparent black bitmap whose size corresponds to the width and height\ncontent attributes of the canvas element.",
1616
"offscreencanvas": "",
17-
"offscreencanvas-getcontext": "Returns an object that exposes an API for drawing on the OffscreenCanvas\nobject. contextId specifies the desired API: \"2d\" or \"webgl\". options is handled by that\nAPI.\nThis specification defines the \"2d\" context below,\nwhich is similar but distinct from the \"2d\"\ncontext that is created from a canvas element. There is also a specification that\ndefines a \"webgl\" context. [WEBGL]\nReturns null if the canvas has already been initialized with another context type (e.g.,\ntrying to get a \"2d\" context after getting a\n\"webgl\" context).",
17+
"offscreencanvas-getcontext": "Returns an object that exposes an API for drawing on the OffscreenCanvas\nobject. contextId specifies the desired API: \"2d\", \"webgl\", or \"webgl2\". options is handled by that\nAPI.\nThis specification defines the \"2d\" context below,\nwhich is similar but distinct from the \"2d\"\ncontext that is created from a canvas element. The WebGL specifications define the\n\"webgl\" and \"webgl2\" contexts. [WEBGL]\nReturns null if the canvas has already been initialized with another context type (e.g.,\ntrying to get a \"2d\" context after getting a\n\"webgl\" context).",
1818
"offscreencanvas-height": "These attributes return the dimensions of the OffscreenCanvas object's bitmap.\nThey can be set, to replace the bitmap with a\nnew, transparent black bitmap of the specified dimensions (effectively resizing\nit).",
1919
"offscreencanvas-converttoblob": "Returns a promise that will fulfill with a new Blob object representing a file\ncontaining the image in the OffscreenCanvas object.\nThe argument, if provided, is a dictionary that controls the encoding options of the image\nfile to be created. The type\nfield specifies the file format and has a default value of \"image/png\"; that type\nis also used if the requested type isn't supported. If the image format supports variable\nquality (such as \"image/jpeg\"), then the quality field is a number in the range 0.0\nto 1.0 inclusive indicating the desired quality level for the resulting image.",
2020
"offscreencanvas-transfertoimagebitmap": "Returns a newly created ImageBitmap object with the image in the\nOffscreenCanvas object. The image in the OffscreenCanvas object is\nreplaced with a new blank image."

inputfiles/idl/HTML - Canvas.widl

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
typedef (CanvasRenderingContext2D or ImageBitmapRenderingContext or WebGLRenderingContext) RenderingContext;
1+
typedef (CanvasRenderingContext2D or ImageBitmapRenderingContext or WebGLRenderingContext or WebGL2RenderingContext) RenderingContext;
22

33
[Exposed=Window,
44
HTMLConstructor]
@@ -36,6 +36,8 @@ enum ImageSmoothingQuality { "low", "medium", "high" };
3636
interface CanvasRenderingContext2D {
3737
// back-reference to the canvas
3838
readonly attribute HTMLCanvasElement canvas;
39+
40+
CanvasRenderingContext2DSettings getContextAttributes();
3941
};
4042
CanvasRenderingContext2D includes CanvasState;
4143
CanvasRenderingContext2D includes CanvasTransform;
@@ -260,20 +262,19 @@ dictionary ImageBitmapRenderingContextSettings {
260262
boolean alpha = true;
261263
};
262264

263-
typedef (OffscreenCanvasRenderingContext2D or
264-
WebGLRenderingContext) OffscreenRenderingContext;
265+
typedef (OffscreenCanvasRenderingContext2D or WebGLRenderingContext or WebGL2RenderingContext) OffscreenRenderingContext;
265266

266267
dictionary ImageEncodeOptions {
267268
DOMString type = "image/png";
268269
unrestricted double quality = 1.0;
269270
};
270271

271-
enum OffscreenRenderingContextId { "2d", "webgl" };
272+
enum OffscreenRenderingContextId { "2d", "webgl", "webgl2" };
272273

273274
[Constructor([EnforceRange] unsigned long long width, [EnforceRange] unsigned long long height), Exposed=(Window,Worker), Transferable]
274275
interface OffscreenCanvas : EventTarget {
275-
attribute unsigned long long width;
276-
attribute unsigned long long height;
276+
attribute [EnforceRange] unsigned long long width;
277+
attribute [EnforceRange] unsigned long long height;
277278

278279
OffscreenRenderingContext? getContext(OffscreenRenderingContextId contextId, optional any options = null);
279280
ImageBitmap transferToImageBitmap();

inputfiles/idl/HTML - Embedded content.commentmap.json

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"img-naturalheight": "These attributes return the intrinsic dimensions of the image,\nor zero if the dimensions are not known.",
44
"img-complete": "Returns true if the image has been completely downloaded or if\nno image is specified; otherwise, returns false.",
55
"img-currentsrc": "Returns the image's absolute URL.",
6-
"img-decoding": "Returns the image decoding hint set for this image.",
76
"img-decode": "This method causes the user agent to decode the\nimage in parallel, returning a promise that fulfills when decoding is complete.\nThe promise will be rejected with an \"EncodingError\"\nDOMException if the image cannot be decoded.",
87
"image": "Returns a new img element, with the width and height attributes set to the values\npassed in the relevant arguments, if applicable."
98
}

inputfiles/idl/HTML - Form control infrastructure.commentmap.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"cva-validity": "Returns true if the element's value has no validity problems; false otherwise.",
77
"cva-checkvalidity": "Returns true if the element's value has no validity problems; false otherwise. Fires an invalid event at the element in the latter case.",
88
"cva-reportvalidity": "Returns true if the element's value has no validity problems; otherwise, returns false, fires\nan invalid event at the element, and (if the event isn't\ncanceled) reports the problem to the user.",
9-
"cva-validationmessage": "Returns the error message that would be shown to the user if the element was to be checked\nfor validity."
9+
"cva-validationmessage": "Returns the error message that would be shown to the user if the element was to be checked\nfor validity.",
10+
"formdataevent-formdata": "Returns a FormData object representing names and values of elements associated\nto the target form. Operations on the FormData object will affect\nform data to be submitted."
1011
}

inputfiles/idl/HTML - Form control infrastructure.widl

+10
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,13 @@ interface ValidityState {
1919
readonly attribute boolean customError;
2020
readonly attribute boolean valid;
2121
};
22+
23+
[Exposed=Window,
24+
Constructor(DOMString type, optional FormDataEventInit eventInitDict)]
25+
interface FormDataEvent : Event {
26+
readonly attribute FormData formData;
27+
};
28+
29+
dictionary FormDataEventInit : EventInit {
30+
required FormData formData;
31+
};

inputfiles/idl/HTML - ImageBitmap and animations.widl

+9
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,12 @@ dictionary ImageBitmapOptions {
2222
[EnforceRange] unsigned long resizeHeight;
2323
ResizeQuality resizeQuality = "low";
2424
};
25+
26+
callback FrameRequestCallback = void (DOMHighResTimeStamp time);
27+
28+
interface mixin AnimationFrameProvider {
29+
unsigned long requestAnimationFrame(FrameRequestCallback callback);
30+
void cancelAnimationFrame(unsigned long handle);
31+
};
32+
Window includes AnimationFrameProvider;
33+
DedicatedWorkerGlobalScope includes AnimationFrameProvider;

inputfiles/idl/HTML - Obsolete features.widl

+1-2
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@ partial interface Window {
286286
[Replaceable, SameObject] readonly attribute External external;
287287
};
288288

289-
[Exposed=Window,
290-
NoInterfaceObject]
289+
[Exposed=Window]
291290
interface External {
292291
void AddSearchProvider();
293292
void IsSearchProviderInstalled();

inputfiles/idl/HTML - Offline Web applications.widl

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
[Exposed=Window]
1+
[SecureContext,
2+
Exposed=Window]
23
interface ApplicationCache : EventTarget {
34

45
// update status

inputfiles/idl/HTML - User interaction.widl

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dictionary FocusOptions {
44

55
interface mixin ElementContentEditable {
66
[CEReactions] attribute DOMString contentEditable;
7+
[CEReactions] attribute DOMString enterKeyHint;
78
readonly attribute boolean isContentEditable;
89
[CEReactions] attribute DOMString inputMode;
910
};

0 commit comments

Comments
 (0)