@@ -8,23 +8,36 @@ package org.scalajs.dom
88
99import scala .scalajs .js
1010
11- /** A MediaQueryList object maintains a list of media queries on a document, and handles sending notifications to
12- * listeners when the media queries on the document change .
11+ /** A MediaQueryList object stores information on a media query applied to a document, with support for both immediate
12+ * and event-driven matching against the state of the document.
1313 */
1414@ js.native
15- trait MediaQueryList extends js. Object {
15+ trait MediaQueryList extends EventTarget {
1616
17- /** true if the document currently matches the media query list; otherwise false. Read only . */
17+ /** A boolean value that returns true if the document currently matches the media query list, or false if not . */
1818 def matches : Boolean = js.native
1919
20- /** The serialized media query list */
21- var media : String = js.native
20+ /** A string representing a serialized media query. */
21+ def media : String = js.native
2222
23- /** Adds a new listener to the media query list. If the specified listener is already in the list, this method has no
24- * effect.
23+ /** Adds to the MediaQueryList a callback which is invoked whenever the media query status—whether or not the document
24+ * matches the media queries in the list—changes.
25+ *
26+ * This method exists primarily for backward compatibility; if possible, you should instead use addEventListener() to
27+ * watch for the change event.
28+ * @deprecated
2529 */
30+ @ deprecated(" Use addEventListener() instead" , " 2.4.0" )
2631 def addListener (listener : MediaQueryListListener ): Unit = js.native
2732
28- /** Removes a listener from the media query list. Does nothing if the specified listener isn't already in the list. */
33+ /** Removes the specified listener callback from the callbacks to be invoked when the MediaQueryList changes media
34+ * query status, which happens any time the document switches between matching and not matching the media queries
35+ * listed in the MediaQueryList.
36+ *
37+ * This method has been kept for backward compatibility; if possible, you should generally use removeEventListener()
38+ * to remove change notification callbacks (which should have previously been added using addEventListener()).
39+ * @deprecated
40+ */
41+ @ deprecated(" Use removeEventListener() instead" , " 2.4.0" )
2942 def removeListener (listener : MediaQueryListListener ): Unit = js.native
3043}
0 commit comments