@@ -80,7 +80,7 @@ export default class DecorationManagement {
8080 *
8181 * @return {Array<Decoration> } all the decorations in this `Minimap`
8282 */
83- getDecorations ( ) {
83+ getDecorations ( ) : Array < Decoration > {
8484 return [ ...this . decorationsById . values ( ) ]
8585 }
8686
@@ -96,7 +96,7 @@ export default class DecorationManagement {
9696 * - decoration: the decoration object that was created
9797 * @return {Disposable } a disposable to stop listening to the event
9898 */
99- onDidAddDecoration ( callback ) {
99+ onDidAddDecoration ( callback : ( event : Object ) = > void ) : Disposable {
100100 return this . emitter . on ( "did-add-decoration" , callback )
101101 }
102102
@@ -112,7 +112,7 @@ export default class DecorationManagement {
112112 * - decoration: the decoration object that was created
113113 * @return {Disposable } a disposable to stop listening to the event
114114 */
115- onDidRemoveDecoration ( callback ) {
115+ onDidRemoveDecoration ( callback : ( event : Object ) = > void ) : Disposable {
116116 return this . emitter . on ( "did-remove-decoration" , callback )
117117 }
118118
@@ -131,7 +131,7 @@ export default class DecorationManagement {
131131 * - decoration: the decoration object that was created
132132 * @return {Disposable } a disposable to stop listening to the event
133133 */
134- onDidChangeDecoration ( callback ) {
134+ onDidChangeDecoration ( callback : ( event : Object ) = > void ) : Disposable {
135135 return this . emitter . on ( "did-change-decoration" , callback )
136136 }
137137
@@ -150,7 +150,7 @@ export default class DecorationManagement {
150150 * - decoration: the decoration object that was created
151151 * @return {Disposable } a disposable to stop listening to the event
152152 */
153- onDidChangeDecorationRange ( callback ) {
153+ onDidChangeDecorationRange ( callback : ( event : Object ) = > void ) : Disposable {
154154 return this . emitter . on ( "did-change-decoration-range" , callback )
155155 }
156156
@@ -164,7 +164,7 @@ export default class DecorationManagement {
164164 * triggered
165165 * @return {Disposable } a disposable to stop listening to the event
166166 */
167- onDidUpdateDecoration ( callback ) {
167+ onDidUpdateDecoration ( callback : ( decoration : Decoration ) = > void ) : Disposable {
168168 return this . emitter . on ( "did-update-decoration" , callback )
169169 }
170170
@@ -174,7 +174,7 @@ export default class DecorationManagement {
174174 * @param {number } id the decoration id
175175 * @return {Decoration } the decoration with the given id
176176 */
177- decorationForId ( id ) {
177+ decorationForId ( id : number ) : Decoration {
178178 return this . decorationsById . get ( id )
179179 }
180180
@@ -186,7 +186,7 @@ export default class DecorationManagement {
186186 * @return {Record<string, Decoration> } the decorations that intersect the passed-in
187187 * range
188188 */
189- decorationsForScreenRowRange ( startScreenRow , endScreenRow ) {
189+ decorationsForScreenRowRange ( startScreenRow : number , endScreenRow : number ) : Record < string , Decoration > {
190190 const decorationsByMarkerId = { }
191191 const markers = this . findMarkers ( {
192192 intersectsScreenRowRange : [ startScreenRow , endScreenRow ] ,
@@ -231,7 +231,7 @@ export default class DecorationManagement {
231231 * highlight-outine decorations at a given
232232 * row
233233 */
234- decorationsByTypeThenRows ( ) {
234+ decorationsByTypeThenRows ( ) : { } {
235235 if ( this . decorationsByTypeThenRowsCache != null ) {
236236 return this . decorationsByTypeThenRowsCache
237237 }
@@ -328,7 +328,10 @@ export default class DecorationManagement {
328328 * @emits {did-add-decoration} when the decoration is created successfully
329329 * @emits {did-change} when the decoration is created successfully
330330 */
331- decorateMarker ( marker , decorationParams ) {
331+ decorateMarker (
332+ marker : Marker ,
333+ decorationParams : { class : string , color : string , plugin : string , render : function , scope : string , type : string }
334+ ) : Decoration {
332335 if ( this . destroyed || this . minimap . destroyed || marker == null ) {
333336 return
334337 }
@@ -452,7 +455,7 @@ export default class DecorationManagement {
452455 * @param {Decoration } decoration the decoration for which emitting an event
453456 * @access private
454457 */
455- emitDecorationChanges ( type , decoration ) {
458+ emitDecorationChanges ( type : string , decoration : Decoration ) {
456459 if ( this . destroyed || this . minimap . editorDestroyed ( ) ) {
457460 return
458461 }
@@ -476,7 +479,7 @@ export default class DecorationManagement {
476479 * change object
477480 * @access private
478481 */
479- emitRangeChanges ( type , range , screenDelta ) {
482+ emitRangeChanges ( type : string , range : { } , screenDelta : number ) {
480483 const startScreenRow = range . start . row
481484 const endScreenRow = range . end . row
482485 const lastRenderedScreenRow = this . minimap . getLastVisibleScreenRow ( )
@@ -503,7 +506,7 @@ export default class DecorationManagement {
503506 * @emits {did-change} when the decoration is removed
504507 * @emits {did-remove-decoration} when the decoration is removed
505508 */
506- removeDecoration ( decoration ) {
509+ removeDecoration ( decoration : Decoration ) {
507510 if ( decoration == null ) {
508511 return
509512 }
@@ -555,7 +558,7 @@ export default class DecorationManagement {
555558 * @emits {did-change} when a decoration have been removed
556559 * @emits {did-remove-decoration} when a decoration have been removed
557560 */
558- removeAllDecorationsForMarker ( marker ) {
561+ removeAllDecorationsForMarker ( marker : Marker ) {
559562 if ( marker == null ) {
560563 return
561564 }
@@ -586,7 +589,7 @@ export default class DecorationManagement {
586589 * @param {Marker } marker the marker for which removing decorations
587590 * @access private
588591 */
589- removedAllMarkerDecorations ( marker ) {
592+ removedAllMarkerDecorations ( marker : Marker ) {
590593 if ( marker == null ) {
591594 return
592595 }
@@ -666,7 +669,7 @@ function getOriginatorPackageName() {
666669 * @return {Array<Object> } the array of diff ranges
667670 * @access private
668671 */
669- function computeRangesDiffs ( oldStart , oldEnd , newStart , newEnd ) {
672+ function computeRangesDiffs ( oldStart : number , oldEnd : number , newStart : number , newEnd : number ) : Array < { } > {
670673 const diffs = [ ]
671674
672675 if ( oldStart . isLessThan ( newStart ) ) {
0 commit comments