From 2f956a7956f8c55f615090f4d81f6f8eccbd4089 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sat, 15 Jun 2019 16:55:58 +0900 Subject: [PATCH] Sort `implements` --- baselines/dom.generated.d.ts | 26 +++++++++++++------------- baselines/webworker.generated.d.ts | 12 ++++++------ src/emitter.ts | 2 +- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/baselines/dom.generated.d.ts b/baselines/dom.generated.d.ts index e29445f74..a16e2f00a 100644 --- a/baselines/dom.generated.d.ts +++ b/baselines/dom.generated.d.ts @@ -3425,7 +3425,7 @@ interface CanvasRect { } /** The CanvasRenderingContext2D interface, part of the Canvas API, provides the 2D rendering context for the drawing surface of a element. It is used for drawing shapes, text, images, and other objects. */ -interface CanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasUserInterface, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { +interface CanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform, CanvasUserInterface { readonly canvas: HTMLCanvasElement; } @@ -3507,7 +3507,7 @@ declare var ChannelSplitterNode: { }; /** The CharacterData abstract interface represents a Node object that contains characters. This is an abstract interface, meaning there aren't any object of type CharacterData: it is implemented by other interfaces, like Text, Comment, or ProcessingInstruction which aren't abstract. */ -interface CharacterData extends Node, NonDocumentTypeChildNode, ChildNode { +interface CharacterData extends Node, ChildNode, NonDocumentTypeChildNode { data: string; readonly length: number; appendData(data: string): void; @@ -4449,7 +4449,7 @@ interface DocumentEventMap extends GlobalEventHandlersEventMap, DocumentAndEleme } /** Any web page loaded in the browser and serves as an entry point into the web page's content, which is the DOM tree. */ -interface Document extends Node, NonElementParentNode, DocumentOrShadowRoot, ParentNode, XPathEvaluatorBase, GlobalEventHandlers, DocumentAndElementEventHandlers { +interface Document extends Node, DocumentAndElementEventHandlers, DocumentOrShadowRoot, GlobalEventHandlers, NonElementParentNode, ParentNode, XPathEvaluatorBase { /** * Sets or gets the URL for the current document. */ @@ -5140,7 +5140,7 @@ interface ElementEventMap { } /** Element is the most general base class from which all objects in a Document inherit. It only has methods and properties common to all kinds of elements. More specific classes inherit from Element. */ -interface Element extends Node, ParentNode, NonDocumentTypeChildNode, ChildNode, Slotable, InnerHTML, Animatable { +interface Element extends Node, Animatable, ChildNode, InnerHTML, NonDocumentTypeChildNode, ParentNode, Slotable { readonly assignedSlot: HTMLSlotElement | null; readonly attributes: NamedNodeMap; /** @@ -6635,7 +6635,7 @@ interface HTMLElementEventMap extends ElementEventMap, GlobalEventHandlersEventM } /** Any HTML element. Some elements directly implement this interface, while others implement it via an interface that inherits it. */ -interface HTMLElement extends Element, GlobalEventHandlers, DocumentAndElementEventHandlers, ElementContentEditable, HTMLOrSVGElement, ElementCSSInlineStyle { +interface HTMLElement extends Element, DocumentAndElementEventHandlers, ElementCSSInlineStyle, ElementContentEditable, GlobalEventHandlers, HTMLOrSVGElement { accessKey: string; readonly accessKeyLabel: string; autocapitalize: string; @@ -10817,7 +10817,7 @@ declare var NavigationPreloadManager: { }; /** The state and the identity of the user agent. It allows scripts to query it and to register themselves to carry on some activities. */ -interface Navigator extends NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorContentUtils, NavigatorCookies, NavigatorPlugins, NavigatorConcurrentHardware, NavigatorStorage, NavigatorAutomationInformation, MSFileSaver, MSNavigatorDoNotTrack, NavigatorBeacon { +interface Navigator extends MSFileSaver, MSNavigatorDoNotTrack, NavigatorAutomationInformation, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorContentUtils, NavigatorCookies, NavigatorID, NavigatorLanguage, NavigatorOnLine, NavigatorPlugins, NavigatorStorage { readonly activeVRDisplays: ReadonlyArray; readonly clipboard: Clipboard; readonly credentials: CredentialsContainer; @@ -11356,7 +11356,7 @@ declare var OffscreenCanvas: { new(width: number, height: number): OffscreenCanvas; }; -interface OffscreenCanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { +interface OffscreenCanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform { readonly canvas: OffscreenCanvas; commit(): void; } @@ -13113,7 +13113,7 @@ interface SVGElementEventMap extends ElementEventMap, GlobalEventHandlersEventMa } /** All of the SVG DOM interfaces that correspond directly to elements in the SVG language derive from the SVGElement interface. */ -interface SVGElement extends Element, GlobalEventHandlers, DocumentAndElementEventHandlers, SVGElementInstance, HTMLOrSVGElement, ElementCSSInlineStyle { +interface SVGElement extends Element, DocumentAndElementEventHandlers, ElementCSSInlineStyle, GlobalEventHandlers, HTMLOrSVGElement, SVGElementInstance { /** @deprecated */ readonly className: any; readonly ownerSVGElement: SVGSVGElement | null; @@ -14323,7 +14323,7 @@ declare var SVGPathSegMovetoRel: { }; /** Corresponds to the element. */ -interface SVGPatternElement extends SVGElement, SVGTests, SVGFitToViewBox, SVGURIReference { +interface SVGPatternElement extends SVGElement, SVGFitToViewBox, SVGTests, SVGURIReference { readonly height: SVGAnimatedLength; readonly patternContentUnits: SVGAnimatedEnumeration; readonly patternTransform: SVGAnimatedTransformList; @@ -15624,7 +15624,7 @@ interface TextDecoderCommon { readonly ignoreBOM: boolean; } -interface TextDecoderStream extends TextDecoderCommon, GenericTransformStream { +interface TextDecoderStream extends GenericTransformStream, TextDecoderCommon { } declare var TextDecoderStream: { @@ -15656,7 +15656,7 @@ interface TextEncoderCommon { readonly encoding: string; } -interface TextEncoderStream extends TextEncoderCommon, GenericTransformStream { +interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon { } declare var TextEncoderStream: { @@ -16424,7 +16424,7 @@ declare var WebAuthnAssertion: { new(): WebAuthnAssertion; }; -interface WebGL2RenderingContext extends WebGLRenderingContextBase, WebGL2RenderingContextBase, WebGL2RenderingContextOverloads { +interface WebGL2RenderingContext extends WebGL2RenderingContextBase, WebGL2RenderingContextOverloads, WebGLRenderingContextBase { } declare var WebGL2RenderingContext: { @@ -18477,7 +18477,7 @@ interface WindowEventMap extends GlobalEventHandlersEventMap, WindowEventHandler } /** A window containing a DOM document; the document property points to the DOM document loaded in that window. */ -interface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, AnimationFrameProvider, WindowOrWorkerGlobalScope, WindowEventHandlers { +interface Window extends EventTarget, AnimationFrameProvider, GlobalEventHandlers, IDBEnvironment, WindowBase64, WindowConsole, WindowEventHandlers, WindowLocalStorage, WindowOrWorkerGlobalScope, WindowSessionStorage, WindowTimers { readonly applicationCache: ApplicationCache; readonly caches: CacheStorage; readonly clientInformation: Navigator; diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index b84e14a4d..9c6830aca 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -2452,7 +2452,7 @@ declare var OffscreenCanvas: { new(width: number, height: number): OffscreenCanvas; }; -interface OffscreenCanvasRenderingContext2D extends CanvasState, CanvasTransform, CanvasCompositing, CanvasImageSmoothing, CanvasFillStrokeStyles, CanvasShadowStyles, CanvasFilters, CanvasRect, CanvasDrawPath, CanvasText, CanvasDrawImage, CanvasImageData, CanvasPathDrawingStyles, CanvasTextDrawingStyles, CanvasPath { +interface OffscreenCanvasRenderingContext2D extends CanvasCompositing, CanvasDrawImage, CanvasDrawPath, CanvasFillStrokeStyles, CanvasFilters, CanvasImageData, CanvasImageSmoothing, CanvasPath, CanvasPathDrawingStyles, CanvasRect, CanvasShadowStyles, CanvasState, CanvasText, CanvasTextDrawingStyles, CanvasTransform { readonly canvas: OffscreenCanvas; commit(): void; } @@ -3082,7 +3082,7 @@ interface TextDecoderCommon { readonly ignoreBOM: boolean; } -interface TextDecoderStream extends TextDecoderCommon, GenericTransformStream { +interface TextDecoderStream extends GenericTransformStream, TextDecoderCommon { } declare var TextDecoderStream: { @@ -3114,7 +3114,7 @@ interface TextEncoderCommon { readonly encoding: string; } -interface TextEncoderStream extends TextEncoderCommon, GenericTransformStream { +interface TextEncoderStream extends GenericTransformStream, TextEncoderCommon { } declare var TextEncoderStream: { @@ -3365,7 +3365,7 @@ interface WEBGL_lose_context { restoreContext(): void; } -interface WebGL2RenderingContext extends WebGLRenderingContextBase, WebGL2RenderingContextBase, WebGL2RenderingContextOverloads { +interface WebGL2RenderingContext extends WebGL2RenderingContextBase, WebGL2RenderingContextOverloads, WebGLRenderingContextBase { } declare var WebGL2RenderingContext: { @@ -5355,7 +5355,7 @@ interface WorkerGlobalScopeEventMap { } /** This Web Workers API interface is an interface representing the scope of any worker. Workers have no browsing context; this scope contains the information usually conveyed by Window objects — in this case event handlers, the console or the associated WorkerNavigator object. Each WorkerGlobalScope has its own event loop. */ -interface WorkerGlobalScope extends EventTarget, WorkerUtils, WindowConsole, WindowOrWorkerGlobalScope { +interface WorkerGlobalScope extends EventTarget, WindowConsole, WindowOrWorkerGlobalScope, WorkerUtils { readonly caches: CacheStorage; readonly isSecureContext: boolean; readonly location: WorkerLocation; @@ -5394,7 +5394,7 @@ declare var WorkerLocation: { }; /** A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator. */ -interface WorkerNavigator extends NavigatorID, NavigatorOnLine, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorStorage { +interface WorkerNavigator extends NavigatorBeacon, NavigatorConcurrentHardware, NavigatorID, NavigatorOnLine, NavigatorStorage { readonly permissions: Permissions; readonly serviceWorker: ServiceWorkerContainer; } diff --git a/src/emitter.ts b/src/emitter.ts index 1e7ec61af..71ee8abe9 100644 --- a/src/emitter.ts +++ b/src/emitter.ts @@ -847,7 +847,7 @@ export function emitWebIdl(webidl: Browser.WebIdl, flavor: Flavor) { printer.print(`interface ${getNameWithTypeParameter(i, processedIName)}`); - const finalExtends = distinct([i.extends || "Object"].concat(i.implements || []) + const finalExtends = distinct([i.extends || "Object"].concat((i.implements || []).sort()) .filter(i => i !== "Object") .map(processIName));