If you are writing JavaScript/TypeScript code for MediaWiki, make sure all relevant ResourceLoader modules are loaded, then use OO.ui
globally.
utils.d.ts contains a list of known icon and indicator names. To use them, you must ensure the corresponding modules have been loaded. Please refer to the OOUI documentation or the code comments for more details.
- Methods and classes marked as private and protected are not included in the definition because interfaces can only define public constraints.
- Some OOUI classes are designed in violation of Liskov substitution principle, which is forbidden in TypeScript. To address this issue we use some hacks, but they also result in additional issues, for instance:
Known problematic classes:
// Error: Type 'NumberInputWidget' is not assignable to type 'TextInputWidget'... let widget: OO.ui.TextInputWidget = new OO.ui.NumberInputWidget(); // Use type assertion as a fix let widget: OO.ui.TextInputWidget = new OO.ui.NumberInputWidget() as unknown as OO.ui.TextInputWidget;
OO.ui.mixin.GroupElement
(Changes method signatures ofOO.EmitterList
)OO.ui.CheckboxInputWidget
(Inconsistency inchange
event)OO.ui.NumberInputWidget
(Changes method signatures ofOO.ui.TextInputWidget
)OO.ui.OutlineControlsWidget
(Inconsistency inmove
andremove
event)OO.ui.SelectFileInputWidget
(Inconsistency inchange
event, changes method signatures ofOO.ui.InputWidget
)OO.ui.SelectWidget
(Inconsistency inmove
andremove
event)
This project uses JSDoc documentations from OOUI which is licensed under the MIT License.
Copyright 2011-2022 OOUI Team and other contributors.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.