├── project ├── build.properties └── build.sbt ├── sbt-launch-0.13.8.jar ├── sbt.sh ├── sbt.bat ├── .gitignore ├── README.md ├── LICENSE └── src └── main └── scala └── com └── scalawarrior └── scalajs └── ace └── Ace.scala /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.13 2 | -------------------------------------------------------------------------------- /project/build.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.14") 2 | -------------------------------------------------------------------------------- /sbt-launch-0.13.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scalawarrior/scalajs-ace/HEAD/sbt-launch-0.13.8.jar -------------------------------------------------------------------------------- /sbt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | java -Dsbt.log.noformat=true -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss2M -jar `dirname $0`/sbt-launch-0.13.8.jar "$@" 3 | -------------------------------------------------------------------------------- /sbt.bat: -------------------------------------------------------------------------------- 1 | set SCRIPT_DIR=%~dp0 2 | java -Dsbt.log.noformat=true -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss2M -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar "%SCRIPT_DIR%\sbt-launch-0.13.8.jar" %* 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | *.log 3 | 4 | # sbt specific 5 | dist/* 6 | target/ 7 | lib_managed/ 8 | src_managed/ 9 | project/boot/ 10 | project/plugins/project/ 11 | 12 | # Scala-IDE specific 13 | .scala_dependencies 14 | .classpath 15 | .project 16 | .cache 17 | .settings 18 | 19 | # IntelliJ specific 20 | .idea/ 21 | .idea_modules/ 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | scalajs-ace 2 | =============== 3 | 4 | Static types for the [Ace](http://ace.c9.io/) editor for [Scala.js](http://www.scala-js.org/) programs. 5 | 6 | Usage 7 | ----- 8 | 9 | Add the following to your sbt build definition: 10 | 11 | ```scala 12 | resolvers += "amateras-repo" at "http://amateras.sourceforge.jp/mvn/" 13 | 14 | libraryDependencies += "com.scalawarrior" %%% "scalajs-ace" % "0.0.4" 15 | ``` 16 | 17 | If are using webjars, you can introduce Ace by adding following dependency: 18 | 19 | ```scala 20 | libraryDependencies += "org.webjars" % "ace" % "01.08.2014" 21 | ``` 22 | 23 | then enjoy Ace in Scala.js! 24 | 25 | ```scala 26 | import com.scalawarrior.scalajs.ace._ 27 | 28 | val editor = ace.edit("editor") 29 | editor.setTheme("ace/theme/monokai") 30 | editor.getSession().setMode("ace/mode/scala") 31 | 32 | val text = editor.getValue() 33 | ``` 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2015-2-16 Scala-Warrior Team 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /src/main/scala/com/scalawarrior/scalajs/ace/Ace.scala: -------------------------------------------------------------------------------- 1 | package com.scalawarrior.scalajs 2 | 3 | import org.scalajs.dom.raw._ 4 | import scala.scalajs.js 5 | import js.| 6 | import js.annotation._ 7 | 8 | package ace { 9 | 10 | @ScalaJSDefined 11 | trait Delta extends js.Object { 12 | var action: String 13 | var range: Range 14 | var text: String 15 | var lines: js.Array[String] 16 | } 17 | 18 | @ScalaJSDefined 19 | trait EditorCommand extends js.Object { 20 | var name: String 21 | var bindKey: js.Any 22 | var exec: js.Function 23 | var readOnly: Boolean 24 | } 25 | 26 | @ScalaJSDefined 27 | trait CommandManager extends js.Object { 28 | var byName: js.Array[EditorCommand] 29 | var commands: js.Array[EditorCommand] 30 | var platform: String 31 | def addCommands(commands: js.Array[EditorCommand]): js.Dynamic 32 | def addCommand(command: EditorCommand): js.Dynamic 33 | def removeCommand(commandname: String): Unit 34 | def exec(name: String, editor: Editor, args: js.Any): js.Dynamic 35 | } 36 | 37 | @ScalaJSDefined 38 | trait Annotation extends js.Object { 39 | var row: Double 40 | var column: Double 41 | var text: String 42 | var `type`: String 43 | } 44 | 45 | @ScalaJSDefined 46 | trait TokenInfo extends js.Object { 47 | var value: String 48 | } 49 | 50 | @ScalaJSDefined 51 | trait Position extends js.Object { 52 | var row: Double 53 | var column: Double 54 | } 55 | 56 | @js.native 57 | @JSName("AceAjax.KeyBinding") 58 | class KeyBinding protected () extends js.Object { 59 | def this(editor: Editor) = this() 60 | def setDefaultHandler(kb: js.Any): js.Dynamic = js.native 61 | def setKeyboardHandler(kb: js.Any): js.Dynamic = js.native 62 | def addKeyboardHandler(kb: js.Any, pos: js.Any): js.Dynamic = js.native 63 | def removeKeyboardHandler(kb: js.Any): Boolean = js.native 64 | def getKeyboardHandler(): js.Dynamic = js.native 65 | def onCommandKey(e: js.Any, hashId: js.Any, keyCode: js.Any): js.Dynamic = js.native 66 | def onTextInput(text: js.Any): js.Dynamic = js.native 67 | } 68 | 69 | @js.native 70 | @JSName("AceAjax.KeyBinding") 71 | object KeyBinding extends js.Object { 72 | } 73 | 74 | @ScalaJSDefined 75 | trait TextMode extends js.Object { 76 | def getTokenizer(): js.Dynamic 77 | def toggleCommentLines(state: js.Any, doc: js.Any, startRow: js.Any, endRow: js.Any): js.Dynamic 78 | def getNextLineIndent(state: js.Any, line: js.Any, tab: js.Any): String 79 | def checkOutdent(state: js.Any, line: js.Any, input: js.Any): Boolean 80 | def autoOutdent(state: js.Any, doc: js.Any, row: js.Any): js.Dynamic 81 | def createWorker(session: js.Any): js.Dynamic 82 | def createModeDelegates(mapping: js.Any): js.Dynamic 83 | def transformAction(state: js.Any, action: js.Any, editor: js.Any, session: js.Any, param: js.Any): js.Dynamic 84 | } 85 | 86 | @ScalaJSDefined 87 | trait Ace extends js.Object { 88 | def require(moduleName: String): js.Dynamic 89 | def edit(el: String): Editor 90 | def createEditSession(text: Document, mode: TextMode): IEditSession 91 | } 92 | 93 | @js.native 94 | @JSName("AceAjax.Anchor") 95 | class Anchor protected () extends js.Object { 96 | def this(doc: Document, row: Double, column: Double) = this() 97 | def on(event: String, fn: js.Function1[js.Any, Any]): js.Dynamic = js.native 98 | def getPosition(): Position = js.native 99 | def getDocument(): Document = js.native 100 | def onChange(e: js.Any): js.Dynamic = js.native 101 | def setPosition(row: Double, column: Double, noClip: Boolean): js.Dynamic = js.native 102 | def detach(): js.Dynamic = js.native 103 | } 104 | 105 | @js.native 106 | @JSName("AceAjax.Anchor") 107 | object Anchor extends js.Object { 108 | } 109 | 110 | @js.native 111 | @JSName("AceAjax.BackgroundTokenizer") 112 | class BackgroundTokenizer protected () extends js.Object { 113 | def this(tokenizer: Tokenizer, editor: Editor) = this() 114 | var states: js.Array[js.Any] = js.native 115 | def setTokenizer(tokenizer: Tokenizer): js.Dynamic = js.native 116 | def setDocument(doc: Document): js.Dynamic = js.native 117 | def fireUpdateEvent(firstRow: Double, lastRow: Double): js.Dynamic = js.native 118 | def start(startRow: Double): js.Dynamic = js.native 119 | def stop(): js.Dynamic = js.native 120 | def getTokens(row: Double): js.Array[TokenInfo] = js.native 121 | def getState(row: Double): String = js.native 122 | } 123 | 124 | @js.native 125 | @JSName("AceAjax.BackgroundTokenizer") 126 | object BackgroundTokenizer extends js.Object { 127 | } 128 | 129 | @js.native 130 | @JSName("AceAjax.Document") 131 | class Document protected () extends js.Object { 132 | def this(text: String = ???) = this() 133 | def on(event: String, fn: js.Function1[js.Any, Any]): js.Dynamic = js.native 134 | def setValue(text: String): js.Dynamic = js.native 135 | def getValue(): String = js.native 136 | def createAnchor(row: Double, column: Double): js.Dynamic = js.native 137 | def getNewLineCharacter(): String = js.native 138 | def setNewLineMode(newLineMode: String): js.Dynamic = js.native 139 | def getNewLineMode(): String = js.native 140 | def isNewLine(text: String): Boolean = js.native 141 | def getLine(row: Double): String = js.native 142 | def getLines(firstRow: Double, lastRow: Double): js.Array[String] = js.native 143 | def getAllLines(): js.Array[String] = js.native 144 | def getLength(): Double = js.native 145 | def getTextRange(range: Range): String = js.native 146 | def insert(position: Position, text: String): js.Dynamic = js.native 147 | def insertLines(row: Double, lines: js.Array[String]): js.Dynamic = js.native 148 | def insertNewLine(position: Position): js.Dynamic = js.native 149 | def insertInLine(position: js.Any, text: String): js.Dynamic = js.native 150 | def remove(range: Range): js.Dynamic = js.native 151 | def removeInLine(row: Double, startColumn: Double, endColumn: Double): js.Dynamic = js.native 152 | def removeLines(firstRow: Double, lastRow: Double): js.Array[String] = js.native 153 | def removeNewLine(row: Double): js.Dynamic = js.native 154 | def replace(range: Range, text: String): js.Dynamic = js.native 155 | def applyDeltas(deltas: js.Array[Delta]): js.Dynamic = js.native 156 | def revertDeltas(deltas: js.Array[Delta]): js.Dynamic = js.native 157 | def indexToPosition(index: Double, startRow: Double): Position = js.native 158 | def positionToIndex(pos: Position, startRow: Double): Double = js.native 159 | } 160 | 161 | @js.native 162 | @JSName("AceAjax.Document") 163 | object Document extends js.Object { 164 | } 165 | 166 | @ScalaJSDefined 167 | trait IEditSession extends js.Object { 168 | var selection: Selection 169 | var bgTokenizer: BackgroundTokenizer 170 | var doc: Document 171 | def on(event: String, fn: js.Function1[js.Any, Any]): js.Dynamic 172 | def findMatchingBracket(position: Position): js.Dynamic 173 | def addFold(text: String, range: Range): js.Dynamic 174 | def getFoldAt(row: Double, column: Double): js.Dynamic 175 | def removeFold(arg: js.Any): js.Dynamic 176 | def expandFold(arg: js.Any): js.Dynamic 177 | def unfold(arg1: js.Any, arg2: Boolean): js.Dynamic 178 | def screenToDocumentColumn(row: Double, column: Double): js.Dynamic 179 | def getFoldDisplayLine(foldLine: js.Any, docRow: Double, docColumn: Double): js.Dynamic 180 | def getFoldsInRange(range: Range): js.Dynamic 181 | def highlight(text: String): js.Dynamic 182 | def setDocument(doc: Document): js.Dynamic 183 | def getDocument(): Document 184 | @JSName("$resetRowCache") 185 | def `$resetRowCache`(row: Double): js.Dynamic 186 | def setValue(text: String): js.Dynamic 187 | def setMode(mode: String): js.Dynamic 188 | def getValue(): String 189 | def getSelection(): Selection 190 | def getState(row: Double): String 191 | def getTokens(row: Double): js.Array[TokenInfo] 192 | def getTokenAt(row: Double, column: Double): TokenInfo 193 | def setUndoManager(undoManager: UndoManager): js.Dynamic 194 | def getUndoManager(): UndoManager 195 | def getTabString(): String 196 | def setUseSoftTabs(useSoftTabs: Boolean): js.Dynamic 197 | def getUseSoftTabs(): Boolean 198 | def setTabSize(tabSize: Double): js.Dynamic 199 | def getTabSize(): Double 200 | def isTabStop(position: js.Any): Boolean 201 | def setOverwrite(overwrite: Boolean): js.Dynamic 202 | def getOverwrite(): Boolean 203 | def toggleOverwrite(): js.Dynamic 204 | def addGutterDecoration(row: Double, className: String): js.Dynamic 205 | def removeGutterDecoration(row: Double, className: String): js.Dynamic 206 | def getBreakpoints(): js.Array[Double] 207 | def setBreakpoints(rows: js.Array[js.Any]): js.Dynamic 208 | def clearBreakpoints(): js.Dynamic 209 | def setBreakpoint(row: Double, className: String): js.Dynamic 210 | def clearBreakpoint(row: Double): js.Dynamic 211 | def addMarker(range: Range, clazz: String, `type`: js.Function | String, inFront: Boolean): Int 212 | def addDynamicMarker(marker: js.Any, inFront: Boolean): js.Dynamic 213 | def removeMarker(markerId: Double): js.Dynamic 214 | def getMarkers(inFront: Boolean): js.Array[js.Any] 215 | def setAnnotations(annotations: js.Array[Annotation]): js.Dynamic 216 | def getAnnotations(): js.Dynamic 217 | def clearAnnotations(): js.Dynamic 218 | @JSName("$detectNewLine") 219 | def `$detectNewLine`(text: String): js.Dynamic 220 | def getWordRange(row: Double, column: Double): Range 221 | def getAWordRange(row: Double, column: Double): js.Dynamic 222 | def setNewLineMode(newLineMode: String): js.Dynamic 223 | def getNewLineMode(): String 224 | def setUseWorker(useWorker: Boolean): js.Dynamic 225 | def getUseWorker(): Boolean 226 | def onReloadTokenizer(): js.Dynamic 227 | @JSName("$mode") 228 | def `$mode`(mode: TextMode): js.Dynamic 229 | def getMode(): TextMode 230 | def setScrollTop(scrollTop: Double): js.Dynamic 231 | def getScrollTop(): Double 232 | def setScrollLeft(scrollLeft: Double): js.Dynamic 233 | def getScrollLeft(): Double 234 | def getScreenWidth(): Double 235 | def getLine(row: Double): String 236 | def getLines(firstRow: Double, lastRow: Double): js.Array[String] 237 | def getLength(): Double 238 | def getTextRange(range: Range): String 239 | def insert(position: Position, text: String): js.Dynamic 240 | def remove(range: Range): js.Dynamic 241 | def undoChanges(deltas: js.Array[js.Any], dontSelect: Boolean): Range 242 | def redoChanges(deltas: js.Array[js.Any], dontSelect: Boolean): Range 243 | def setUndoSelect(enable: Boolean): js.Dynamic 244 | def replace(range: Range, text: String): js.Dynamic 245 | def moveText(fromRange: Range, toPosition: js.Any): Range 246 | def indentRows(startRow: Double, endRow: Double, indentString: String): js.Dynamic 247 | def outdentRows(range: Range): js.Dynamic 248 | def moveLinesUp(firstRow: Double, lastRow: Double): Double 249 | def moveLinesDown(firstRow: Double, lastRow: Double): Double 250 | def duplicateLines(firstRow: Double, lastRow: Double): Double 251 | def setUseWrapMode(useWrapMode: Boolean): js.Dynamic 252 | def getUseWrapMode(): Boolean 253 | def setWrapLimitRange(min: Double, max: Double): js.Dynamic 254 | def adjustWrapLimit(desiredLimit: Double): Boolean 255 | def getWrapLimit(): Double 256 | def getWrapLimitRange(): js.Dynamic 257 | @JSName("$getDisplayTokens") 258 | def `$getDisplayTokens`(str: String, offset: Double): js.Dynamic 259 | @JSName("$getStringScreenWidth") 260 | def `$getStringScreenWidth`(str: String, maxScreenColumn: Double, screenColumn: Double): js.Array[Double] 261 | def getRowLength(row: Double): Double 262 | def getScreenLastRowColumn(screenRow: Double): Double 263 | def getDocumentLastRowColumn(docRow: Double, docColumn: Double): Double 264 | def getDocumentLastRowColumnPosition(docRow: Double, docColumn: Double): Double 265 | def getRowSplitData(): String 266 | def getScreenTabSize(screenColumn: Double): Double 267 | def screenToDocumentPosition(screenRow: Double, screenColumn: Double): js.Dynamic 268 | def documentToScreenPosition(docRow: Double, docColumn: Double): js.Dynamic 269 | def documentToScreenColumn(row: Double, docColumn: Double): Double 270 | def documentToScreenRow(docRow: Double, docColumn: Double): js.Dynamic 271 | def getScreenLength(): Double 272 | } 273 | 274 | @js.native 275 | @JSName("AceAjax.EditSession") 276 | object EditSession extends js.Object { 277 | /* ??? ConstructorMember(FunSignature(List(),List(FunParam(Ident(text),false,Some(TypeRef(CoreType(string),List()))), FunParam(Ident(mode),true,Some(TypeRef(TypeName(TextMode),List())))),Some(TypeRef(TypeName(IEditSession),List())))) */ 278 | /* ??? ConstructorMember(FunSignature(List(),List(FunParam(Ident(content),false,Some(TypeRef(CoreType(string),List()))), FunParam(Ident(mode),true,Some(TypeRef(CoreType(string),List())))),Some(TypeRef(TypeName(IEditSession),List())))) */ 279 | /* ??? ConstructorMember(FunSignature(List(),List(FunParam(Ident(text),false,Some(TypeRef(TypeName(Array),List(TypeRef(CoreType(string),List()))))), FunParam(Ident(mode),true,Some(TypeRef(CoreType(string),List())))),Some(TypeRef(TypeName(IEditSession),List())))) */ 280 | } 281 | 282 | @js.native 283 | @JSName("AceAjax.Editor") 284 | class Editor protected () extends js.Object { 285 | def this(renderer: VirtualRenderer, session: IEditSession = ???) = this() 286 | def addEventListener(ev: String, callback: js.Function): js.Dynamic = js.native 287 | var inMultiSelectMode: Boolean = js.native 288 | def selectMoreLines(n: Double): js.Dynamic = js.native 289 | def onTextInput(text: String): js.Dynamic = js.native 290 | def onCommandKey(e: js.Any, hashId: js.Any, keyCode: js.Any): js.Dynamic = js.native 291 | var commands: CommandManager = js.native 292 | var session: IEditSession = js.native 293 | var selection: Selection = js.native 294 | var renderer: VirtualRenderer = js.native 295 | var keyBinding: KeyBinding = js.native 296 | var container: HTMLElement = js.native 297 | def onSelectionChange(e: js.Any): js.Dynamic = js.native 298 | def onChangeMode(e: js.Any = ???): js.Dynamic = js.native 299 | def execCommand(command: String, args: js.Any = ???): js.Dynamic = js.native 300 | def setKeyboardHandler(keyboardHandler: String): js.Dynamic = js.native 301 | def getKeyboardHandler(): String = js.native 302 | def setSession(session: IEditSession): js.Dynamic = js.native 303 | def getSession(): IEditSession = js.native 304 | def setValue(`val`: String, cursorPos: Double = ???): String = js.native 305 | def getValue(): String = js.native 306 | def getSelection(): Selection = js.native 307 | def resize(force: Boolean = ???): js.Dynamic = js.native 308 | def setTheme(theme: String): js.Dynamic = js.native 309 | def getTheme(): String = js.native 310 | def setStyle(style: String): js.Dynamic = js.native 311 | def unsetStyle(): js.Dynamic = js.native 312 | def setFontSize(size: String): js.Dynamic = js.native 313 | def focus(): js.Dynamic = js.native 314 | def isFocused(): js.Dynamic = js.native 315 | def blur(): js.Dynamic = js.native 316 | def onFocus(): js.Dynamic = js.native 317 | def onBlur(): js.Dynamic = js.native 318 | def onDocumentChange(e: js.Any): js.Dynamic = js.native 319 | def onCursorChange(): js.Dynamic = js.native 320 | def getCopyText(): String = js.native 321 | def onCopy(): js.Dynamic = js.native 322 | def onCut(): js.Dynamic = js.native 323 | def onPaste(text: String): js.Dynamic = js.native 324 | def insert(text: String): js.Dynamic = js.native 325 | def setAutoScrollEditorIntoView(): Unit = js.native 326 | def setOverwrite(overwrite: Boolean): js.Dynamic = js.native 327 | def getOverwrite(): Boolean = js.native 328 | def toggleOverwrite(): js.Dynamic = js.native 329 | def setScrollSpeed(speed: Double): js.Dynamic = js.native 330 | def getScrollSpeed(): Double = js.native 331 | def setDragDelay(dragDelay: Double): js.Dynamic = js.native 332 | def getDragDelay(): Double = js.native 333 | def setSelectionStyle(style: String): js.Dynamic = js.native 334 | def getSelectionStyle(): String = js.native 335 | def setHighlightActiveLine(shouldHighlight: Boolean): js.Dynamic = js.native 336 | def getHighlightActiveLine(): js.Dynamic = js.native 337 | def setHighlightSelectedWord(shouldHighlight: Boolean): js.Dynamic = js.native 338 | def getHighlightSelectedWord(): Boolean = js.native 339 | def setShowInvisibles(showInvisibles: Boolean): js.Dynamic = js.native 340 | def getShowInvisibles(): Boolean = js.native 341 | def setShowPrintMargin(showPrintMargin: Boolean): js.Dynamic = js.native 342 | def getShowPrintMargin(): Boolean = js.native 343 | def setPrintMarginColumn(showPrintMargin: Double): js.Dynamic = js.native 344 | def getPrintMarginColumn(): Double = js.native 345 | def setReadOnly(readOnly: Boolean): js.Dynamic = js.native 346 | def getReadOnly(): Boolean = js.native 347 | def setBehavioursEnabled(enabled: Boolean): js.Dynamic = js.native 348 | def getBehavioursEnabled(): Boolean = js.native 349 | def setWrapBehavioursEnabled(enabled: Boolean): js.Dynamic = js.native 350 | def getWrapBehavioursEnabled(): js.Dynamic = js.native 351 | def setShowFoldWidgets(show: Boolean): js.Dynamic = js.native 352 | def getShowFoldWidgets(): js.Dynamic = js.native 353 | def remove(dir: String): js.Dynamic = js.native 354 | def removeWordRight(): js.Dynamic = js.native 355 | def removeWordLeft(): js.Dynamic = js.native 356 | def removeToLineStart(): js.Dynamic = js.native 357 | def removeToLineEnd(): js.Dynamic = js.native 358 | def splitLine(): js.Dynamic = js.native 359 | def transposeLetters(): js.Dynamic = js.native 360 | def toLowerCase(): js.Dynamic = js.native 361 | def toUpperCase(): js.Dynamic = js.native 362 | def indent(): js.Dynamic = js.native 363 | def blockIndent(): js.Dynamic = js.native 364 | def blockOutdent(arg: String = ???): js.Dynamic = js.native 365 | def toggleCommentLines(): js.Dynamic = js.native 366 | def getNumberAt(): Double = js.native 367 | def modifyNumber(amount: Double): js.Dynamic = js.native 368 | def removeLines(): js.Dynamic = js.native 369 | def moveLinesDown(): Double = js.native 370 | def moveLinesUp(): Double = js.native 371 | def moveText(fromRange: Range, toPosition: js.Any): Range = js.native 372 | def copyLinesUp(): Double = js.native 373 | def copyLinesDown(): Double = js.native 374 | def getFirstVisibleRow(): Double = js.native 375 | def getLastVisibleRow(): Double = js.native 376 | def isRowVisible(row: Double): Boolean = js.native 377 | def isRowFullyVisible(row: Double): Boolean = js.native 378 | def selectPageDown(): js.Dynamic = js.native 379 | def selectPageUp(): js.Dynamic = js.native 380 | def gotoPageDown(): js.Dynamic = js.native 381 | def gotoPageUp(): js.Dynamic = js.native 382 | def scrollPageDown(): js.Dynamic = js.native 383 | def scrollPageUp(): js.Dynamic = js.native 384 | def scrollToRow(): js.Dynamic = js.native 385 | def scrollToLine(line: Double, center: Boolean, animate: Boolean, callback: js.Function): js.Dynamic = js.native 386 | def centerSelection(): js.Dynamic = js.native 387 | def getCursorPosition(): Position = js.native 388 | def getCursorPositionScreen(): Double = js.native 389 | def getSelectionRange(): Range = js.native 390 | def selectAll(): js.Dynamic = js.native 391 | def clearSelection(): js.Dynamic = js.native 392 | def moveCursorTo(row: Double, column: Double = ???, animate: Boolean = ???): js.Dynamic = js.native 393 | def moveCursorToPosition(position: Position): js.Dynamic = js.native 394 | def jumpToMatching(): js.Dynamic = js.native 395 | def gotoLine(lineNumber: Double, column: Double = ???, animate: Boolean = ???): js.Dynamic = js.native 396 | def navigateTo(row: Double, column: Double): js.Dynamic = js.native 397 | def navigateUp(times: Double = ???): js.Dynamic = js.native 398 | def navigateDown(times: Double = ???): js.Dynamic = js.native 399 | def navigateLeft(times: Double = ???): js.Dynamic = js.native 400 | def navigateRight(times: Double): js.Dynamic = js.native 401 | def navigateLineStart(): js.Dynamic = js.native 402 | def navigateLineEnd(): js.Dynamic = js.native 403 | def navigateFileEnd(): js.Dynamic = js.native 404 | def navigateFileStart(): js.Dynamic = js.native 405 | def navigateWordRight(): js.Dynamic = js.native 406 | def navigateWordLeft(): js.Dynamic = js.native 407 | def replace(replacement: String, options: js.Any = ???): js.Dynamic = js.native 408 | def replaceAll(replacement: String, options: js.Any = ???): js.Dynamic = js.native 409 | def getLastSearchOptions(): js.Dynamic = js.native 410 | def find(needle: String, options: js.Any = ???, animate: Boolean = ???): js.Dynamic = js.native 411 | def findNext(options: js.Any = ???, animate: Boolean = ???): js.Dynamic = js.native 412 | def findPrevious(options: js.Any = ???, animate: Boolean = ???): js.Dynamic = js.native 413 | def setOptions(options: js.Dynamic): js.Dynamic = js.native 414 | def undo(): js.Dynamic = js.native 415 | def redo(): js.Dynamic = js.native 416 | def destroy(): js.Dynamic = js.native 417 | } 418 | 419 | @js.native 420 | @JSName("AceAjax.Editor") 421 | object Editor extends js.Object { 422 | } 423 | 424 | @ScalaJSDefined 425 | trait EditorChangeEvent extends js.Object { 426 | var start: Position 427 | var end: Position 428 | var action: String 429 | var lines: js.Array[js.Any] 430 | } 431 | 432 | @js.native 433 | @JSName("AceAjax.PlaceHolder") 434 | class PlaceHolder protected () extends js.Object { 435 | def this(session: Document, length: Double, pos: Double, others: String, mainClass: String, othersClass: String) = this() 436 | def this(session: IEditSession, length: Double, pos: Position, positions: js.Array[Position]) = this() 437 | def on(event: String, fn: js.Function1[js.Any, Any]): js.Dynamic = js.native 438 | def setup(): js.Dynamic = js.native 439 | def showOtherMarkers(): js.Dynamic = js.native 440 | def hideOtherMarkers(): js.Dynamic = js.native 441 | def onUpdate(): js.Dynamic = js.native 442 | def onCursorChange(): js.Dynamic = js.native 443 | def detach(): js.Dynamic = js.native 444 | def cancel(): js.Dynamic = js.native 445 | } 446 | 447 | @js.native 448 | @JSName("AceAjax.PlaceHolder") 449 | object PlaceHolder extends js.Object { 450 | } 451 | 452 | @js.native 453 | trait IRangeList extends js.Object { 454 | var ranges: js.Array[Range] = js.native 455 | def pointIndex(pos: Position, startIndex: Double = ???): js.Dynamic = js.native 456 | def addList(ranges: js.Array[Range]): js.Dynamic = js.native 457 | def add(ranges: Range): js.Dynamic = js.native 458 | def merge(): js.Array[Range] = js.native 459 | def substractPoint(pos: Position): js.Dynamic = js.native 460 | } 461 | 462 | @js.native 463 | @JSName("AceAjax.RangeList") 464 | object RangeList extends js.Object { 465 | /* ??? ConstructorMember(FunSignature(List(),List(),Some(TypeRef(TypeName(IRangeList),List())))) */ 466 | } 467 | 468 | @js.native 469 | @JSName("AceAjax.Range") 470 | class Range protected () extends js.Object { 471 | def this(startRow: Double, startColumn: Double, endRow: Double, endColumn: Double) = this() 472 | var startRow: Double = js.native 473 | var startColumn: Double = js.native 474 | var endRow: Double = js.native 475 | var endColumn: Double = js.native 476 | var start: Position = js.native 477 | var end: Position = js.native 478 | def isEmpty(): Boolean = js.native 479 | def isEqual(range: Range): Boolean = js.native 480 | override def toString(): String = js.native 481 | def contains(row: Double, column: Double): Boolean = js.native 482 | def compareRange(range: Range): Double = js.native 483 | def comparePoint(p: Range): Double = js.native 484 | def containsRange(range: Range): Boolean = js.native 485 | def intersects(range: Range): Boolean = js.native 486 | def isEnd(row: Double, column: Double): Boolean = js.native 487 | def isStart(row: Double, column: Double): Boolean = js.native 488 | def setStart(row: Double, column: Double): js.Dynamic = js.native 489 | def setEnd(row: Double, column: Double): js.Dynamic = js.native 490 | def inside(row: Double, column: Double): Boolean = js.native 491 | def insideStart(row: Double, column: Double): Boolean = js.native 492 | def insideEnd(row: Double, column: Double): Boolean = js.native 493 | def compare(row: Double, column: Double): Double = js.native 494 | def compareStart(row: Double, column: Double): Double = js.native 495 | def compareEnd(row: Double, column: Double): Double = js.native 496 | def compareInside(row: Double, column: Double): Double = js.native 497 | def clipRows(firstRow: Double, lastRow: Double): Range = js.native 498 | def extend(row: Double, column: Double): Range = js.native 499 | def isMultiLine(): Boolean = js.native 500 | override def clone(): Range = js.native 501 | def collapseRows(): Range = js.native 502 | def toScreenRange(session: IEditSession): Range = js.native 503 | def fromPoints(start: Range, end: Range): Range = js.native 504 | } 505 | 506 | @js.native 507 | @JSName("AceAjax.Range") 508 | object Range extends js.Object { 509 | def fromPoints(pos1: Position, pos2: Position): Range = js.native 510 | } 511 | 512 | @js.native 513 | @JSName("AceAjax.RenderLoop") 514 | class RenderLoop extends js.Object { 515 | } 516 | 517 | @js.native 518 | @JSName("AceAjax.RenderLoop") 519 | object RenderLoop extends js.Object { 520 | } 521 | 522 | @js.native 523 | @JSName("AceAjax.ScrollBar") 524 | class ScrollBar protected () extends js.Object { 525 | def this(parent: HTMLElement) = this() 526 | def onScroll(e: js.Any): js.Dynamic = js.native 527 | def getWidth(): Double = js.native 528 | def setHeight(height: Double): js.Dynamic = js.native 529 | def setInnerHeight(height: Double): js.Dynamic = js.native 530 | def setScrollTop(scrollTop: Double): js.Dynamic = js.native 531 | } 532 | 533 | @js.native 534 | @JSName("AceAjax.ScrollBar") 535 | object ScrollBar extends js.Object { 536 | } 537 | 538 | @js.native 539 | @JSName("AceAjax.Search") 540 | class Search extends js.Object { 541 | def set(options: js.Any): Search = js.native 542 | def getOptions(): js.Dynamic = js.native 543 | def setOptions(An: js.Any): js.Dynamic = js.native 544 | def find(session: IEditSession): Range = js.native 545 | def findAll(session: IEditSession): js.Array[Range] = js.native 546 | def replace(input: String, replacement: String): String = js.native 547 | } 548 | 549 | @js.native 550 | @JSName("AceAjax.Search") 551 | object Search extends js.Object { 552 | } 553 | 554 | @js.native 555 | @JSName("AceAjax.Selection") 556 | class Selection protected () extends js.Object { 557 | def this(session: IEditSession) = this() 558 | def addEventListener(ev: String, callback: js.Function): js.Dynamic = js.native 559 | def moveCursorWordLeft(): js.Dynamic = js.native 560 | def moveCursorWordRight(): js.Dynamic = js.native 561 | def fromOrientedRange(range: Range): js.Dynamic = js.native 562 | def setSelectionRange(`match`: js.Any): js.Dynamic = js.native 563 | def getAllRanges(): js.Array[Range] = js.native 564 | def on(event: String, fn: js.Function1[js.Any, Any]): js.Dynamic = js.native 565 | def addRange(range: Range): js.Dynamic = js.native 566 | def isEmpty(): Boolean = js.native 567 | def isMultiLine(): Boolean = js.native 568 | def getCursor(): Position = js.native 569 | def setSelectionAnchor(row: Double, column: Double): js.Dynamic = js.native 570 | def getSelectionAnchor(): js.Dynamic = js.native 571 | def getSelectionLead(): js.Dynamic = js.native 572 | def shiftSelection(columns: Double): js.Dynamic = js.native 573 | def isBackwards(): Boolean = js.native 574 | def getRange(): Range = js.native 575 | def clearSelection(): js.Dynamic = js.native 576 | def selectAll(): js.Dynamic = js.native 577 | def setRange(range: Range, reverse: Boolean): js.Dynamic = js.native 578 | def selectTo(row: Double, column: Double): js.Dynamic = js.native 579 | def selectToPosition(pos: js.Any): js.Dynamic = js.native 580 | def selectUp(): js.Dynamic = js.native 581 | def selectDown(): js.Dynamic = js.native 582 | def selectRight(): js.Dynamic = js.native 583 | def selectLeft(): js.Dynamic = js.native 584 | def selectLineStart(): js.Dynamic = js.native 585 | def selectLineEnd(): js.Dynamic = js.native 586 | def selectFileEnd(): js.Dynamic = js.native 587 | def selectFileStart(): js.Dynamic = js.native 588 | def selectWordRight(): js.Dynamic = js.native 589 | def selectWordLeft(): js.Dynamic = js.native 590 | def getWordRange(): js.Dynamic = js.native 591 | def selectWord(): js.Dynamic = js.native 592 | def selectAWord(): js.Dynamic = js.native 593 | def selectLine(): js.Dynamic = js.native 594 | def moveCursorUp(): js.Dynamic = js.native 595 | def moveCursorDown(): js.Dynamic = js.native 596 | def moveCursorLeft(): js.Dynamic = js.native 597 | def moveCursorRight(): js.Dynamic = js.native 598 | def moveCursorLineStart(): js.Dynamic = js.native 599 | def moveCursorLineEnd(): js.Dynamic = js.native 600 | def moveCursorFileEnd(): js.Dynamic = js.native 601 | def moveCursorFileStart(): js.Dynamic = js.native 602 | def moveCursorLongWordRight(): js.Dynamic = js.native 603 | def moveCursorLongWordLeft(): js.Dynamic = js.native 604 | def moveCursorBy(rows: Double, chars: Double): js.Dynamic = js.native 605 | def moveCursorToPosition(position: js.Any): js.Dynamic = js.native 606 | def moveCursorTo(row: Double, column: Double, keepDesiredColumn: Boolean = ???): js.Dynamic = js.native 607 | def moveCursorToScreen(row: Double, column: Double, keepDesiredColumn: Boolean): js.Dynamic = js.native 608 | } 609 | 610 | @js.native 611 | @JSName("AceAjax.Selection") 612 | object Selection extends js.Object { 613 | } 614 | 615 | @js.native 616 | @JSName("AceAjax.Split") 617 | class Split extends js.Object { 618 | def getSplits(): Double = js.native 619 | def getEditor(idx: Double): js.Dynamic = js.native 620 | def getCurrentEditor(): Editor = js.native 621 | def focus(): js.Dynamic = js.native 622 | def blur(): js.Dynamic = js.native 623 | def setTheme(theme: String): js.Dynamic = js.native 624 | def setKeyboardHandler(keybinding: String): js.Dynamic = js.native 625 | def forEach(callback: js.Function, scope: String): js.Dynamic = js.native 626 | def setFontSize(size: Double): js.Dynamic = js.native 627 | def setSession(session: IEditSession, idx: Double): js.Dynamic = js.native 628 | def getOrientation(): Double = js.native 629 | def setOrientation(orientation: Double): js.Dynamic = js.native 630 | def resize(): js.Dynamic = js.native 631 | } 632 | 633 | @js.native 634 | @JSName("AceAjax.Split") 635 | object Split extends js.Object { 636 | } 637 | 638 | @js.native 639 | @JSName("AceAjax.TokenIterator") 640 | class TokenIterator protected () extends js.Object { 641 | def this(session: IEditSession, initialRow: Double, initialColumn: Double) = this() 642 | def stepBackward(): js.Array[String] = js.native 643 | def stepForward(): String = js.native 644 | def getCurrentToken(): TokenInfo = js.native 645 | def getCurrentTokenRow(): Double = js.native 646 | def getCurrentTokenColumn(): Double = js.native 647 | } 648 | 649 | @js.native 650 | @JSName("AceAjax.TokenIterator") 651 | object TokenIterator extends js.Object { 652 | } 653 | 654 | @js.native 655 | @JSName("AceAjax.Tokenizer") 656 | class Tokenizer protected () extends js.Object { 657 | def this(rules: js.Any, flag: String) = this() 658 | def getLineTokens(): js.Dynamic = js.native 659 | } 660 | 661 | @js.native 662 | @JSName("AceAjax.Tokenizer") 663 | object Tokenizer extends js.Object { 664 | } 665 | 666 | @js.native 667 | @JSName("AceAjax.UndoManager") 668 | class UndoManager extends js.Object { 669 | def execute(options: js.Any): js.Dynamic = js.native 670 | def undo(dontSelect: Boolean = ???): Range = js.native 671 | def redo(dontSelect: Boolean): js.Dynamic = js.native 672 | def reset(): js.Dynamic = js.native 673 | def hasUndo(): Boolean = js.native 674 | def hasRedo(): Boolean = js.native 675 | } 676 | 677 | @js.native 678 | @JSName("AceAjax.UndoManager") 679 | object UndoManager extends js.Object { 680 | } 681 | 682 | @js.native 683 | @JSName("AceAjax.VirtualRenderer") 684 | class VirtualRenderer protected () extends js.Object { 685 | def this(container: HTMLElement, theme: String = ???) = this() 686 | var scroller: js.Any = js.native 687 | var characterWidth: Double = js.native 688 | var lineHeight: Double = js.native 689 | def screenToTextCoordinates(left: Double, top: Double): js.Dynamic = js.native 690 | def setSession(session: IEditSession): js.Dynamic = js.native 691 | def updateLines(firstRow: Double, lastRow: Double): js.Dynamic = js.native 692 | def updateText(): js.Dynamic = js.native 693 | def updateFull(force: Boolean): js.Dynamic = js.native 694 | def updateFontSize(): js.Dynamic = js.native 695 | def onResize(force: Boolean, gutterWidth: Double, width: Double, height: Double): js.Dynamic = js.native 696 | def adjustWrapLimit(): js.Dynamic = js.native 697 | def setAnimatedScroll(shouldAnimate: Boolean): js.Dynamic = js.native 698 | def getAnimatedScroll(): Boolean = js.native 699 | def setShowInvisibles(showInvisibles: Boolean): js.Dynamic = js.native 700 | def getShowInvisibles(): Boolean = js.native 701 | def setShowPrintMargin(showPrintMargin: Boolean): js.Dynamic = js.native 702 | def getShowPrintMargin(): Boolean = js.native 703 | def setPrintMarginColumn(showPrintMargin: Boolean): js.Dynamic = js.native 704 | def getPrintMarginColumn(): Boolean = js.native 705 | def getShowGutter(): Boolean = js.native 706 | def setShowGutter(show: Boolean): js.Dynamic = js.native 707 | def getContainerElement(): HTMLElement = js.native 708 | def getMouseEventTarget(): HTMLElement = js.native 709 | def getTextAreaContainer(): HTMLElement = js.native 710 | def getFirstVisibleRow(): Double = js.native 711 | def getFirstFullyVisibleRow(): Double = js.native 712 | def getLastFullyVisibleRow(): Double = js.native 713 | def getLastVisibleRow(): Double = js.native 714 | def setPadding(padding: Double): js.Dynamic = js.native 715 | def getHScrollBarAlwaysVisible(): Boolean = js.native 716 | def setHScrollBarAlwaysVisible(alwaysVisible: Boolean): js.Dynamic = js.native 717 | def updateFrontMarkers(): js.Dynamic = js.native 718 | def updateBackMarkers(): js.Dynamic = js.native 719 | def addGutterDecoration(): js.Dynamic = js.native 720 | def removeGutterDecoration(): js.Dynamic = js.native 721 | def updateBreakpoints(): js.Dynamic = js.native 722 | def setAnnotations(annotations: js.Array[js.Any]): js.Dynamic = js.native 723 | def updateCursor(): js.Dynamic = js.native 724 | def hideCursor(): js.Dynamic = js.native 725 | def showCursor(): js.Dynamic = js.native 726 | def scrollCursorIntoView(): js.Dynamic = js.native 727 | def getScrollTop(): Double = js.native 728 | def getScrollLeft(): Double = js.native 729 | def getScrollTopRow(): Double = js.native 730 | def getScrollBottomRow(): Double = js.native 731 | def scrollToRow(row: Double): js.Dynamic = js.native 732 | def scrollToLine(line: Double, center: Boolean, animate: Boolean, callback: js.Function): js.Dynamic = js.native 733 | def scrollToY(scrollTop: Double): Double = js.native 734 | def scrollToX(scrollLeft: Double): Double = js.native 735 | def scrollBy(deltaX: Double, deltaY: Double): js.Dynamic = js.native 736 | def isScrollableBy(deltaX: Double, deltaY: Double): Boolean = js.native 737 | def textToScreenCoordinates(row: Double, column: Double): js.Dynamic = js.native 738 | def visualizeFocus(): js.Dynamic = js.native 739 | def visualizeBlur(): js.Dynamic = js.native 740 | def showComposition(position: Double): js.Dynamic = js.native 741 | def setCompositionText(text: String): js.Dynamic = js.native 742 | def hideComposition(): js.Dynamic = js.native 743 | def setTheme(theme: String): js.Dynamic = js.native 744 | def getTheme(): String = js.native 745 | def setStyle(style: String): js.Dynamic = js.native 746 | def unsetStyle(style: String): js.Dynamic = js.native 747 | def destroy(): js.Dynamic = js.native 748 | } 749 | 750 | @js.native 751 | @JSName("AceAjax.VirtualRenderer") 752 | object VirtualRenderer extends js.Object 753 | 754 | } 755 | 756 | // Extending js.GlobalScope requires us, since ScalaJS 0.6.5, to 757 | // annotate the object with @js.native. Sadly, package objects 758 | // cannot be annotated, and we thus need to explicitly assign 759 | // a value to `ace`. 760 | // 761 | // More information at https://github.com/scala-js/scala-js/issues/1892 762 | package object ace { 763 | import js.Dynamic.global 764 | 765 | lazy val ace: Ace = global.ace.asInstanceOf[Ace] 766 | } 767 | 768 | --------------------------------------------------------------------------------