@@ -586,10 +586,10 @@ function askName (
586586
587587// ////////////////////////////////////////////////////////////////
588588
589- // A little link icon
590- //
591- / /
592- function linkIcon ( dom , subject , iconURI ?) {
589+ /**
590+ * A little link icon
591+ * /
592+ function linkIcon ( dom : HTMLDocument , subject : NamedNode , iconURI ?: string ) : HTMLElement {
593593 var anchor = dom . createElement ( 'a' )
594594 anchor . setAttribute ( 'href' , subject . uri )
595595 if ( subject . uri . startsWith ( 'http' ) ) {
@@ -605,11 +605,12 @@ function linkIcon (dom, subject, iconURI?) {
605605 return anchor
606606}
607607
608- // A TR to repreent a draggable person, etc in a list
609- //
610- // pred is unused param at the moment
611- //
612- function personTR ( dom , pred , obj , options ) {
608+ /**
609+ * A TR to repreent a draggable person, etc in a list
610+ *
611+ * pred is unused param at the moment
612+ */
613+ function personTR ( dom : HTMLDocument , pred : NamedNode , obj : NamedNode , options : any ) : HTMLTableRowElement {
613614 var tr = dom . createElement ( 'tr' )
614615 options = options || { }
615616 // tr.predObj = [pred.uri, obj.uri] moved to acl-control
@@ -642,7 +643,7 @@ function personTR (dom, pred, obj, options) {
642643 dragAndDrop . makeDraggable ( tr , obj )
643644 }
644645 }
645- tr . subject = obj
646+ ; ( tr as any ) . subject = obj
646647 return tr
647648}
648649
@@ -754,12 +755,13 @@ function attachmentList (dom: HTMLDocument, subject: NamedNode, div: HTMLElement
754755
755756// /////////////////////////////////////////////////////////////////////////////
756757
757- // Event Handler for links within solid apps.
758- //
759- // Note that native links have consraints in Firefox, they
760- // don't work with local files for instance (2011)
761- //
762- function openHrefInOutlineMode ( e ) {
758+ /**
759+ * Event Handler for links within solid apps.
760+ *
761+ * Note that native links have constraints in Firefox, they
762+ * don't work with local files for instance (2011)
763+ */
764+ function openHrefInOutlineMode ( e : Event ) {
763765 e . preventDefault ( )
764766 e . stopPropagation ( )
765767 var target = utils . getTarget ( e )
@@ -839,7 +841,7 @@ function allClassURIs (): { [uri: string]: boolean } {
839841 * @param {Store } kb The quadstore to be searched.
840842 */
841843
842- function propertyTriage ( kb ) {
844+ function propertyTriage ( kb : IndexedFormula ) : any {
843845 var possibleProperties : any = { }
844846 // if (possibleProperties === undefined) possibleProperties = {}
845847 // var kb = UI.store
@@ -848,7 +850,7 @@ function propertyTriage (kb) {
848850 var no = 0
849851 var nd = 0
850852 var nu = 0
851- var pi = kb . predicateIndex // One entry for each pred
853+ var pi = ( kb as any ) . predicateIndex // One entry for each pred
852854 for ( var p in pi ) {
853855 var object = pi [ p ] [ 0 ] . object
854856 if ( object . termType === 'Literal' ) {
@@ -879,15 +881,16 @@ function propertyTriage (kb) {
879881 * General purpose widgets
880882 */
881883
882- // A button for jumping
883- //
884- function linkButton ( dom , object ) {
884+ /**
885+ * A button for jumping
886+ */
887+ function linkButton ( dom : HTMLDocument , object : NamedNode ) : HTMLElement {
885888 var b = dom . createElement ( 'button' )
886889 b . setAttribute ( 'type' , 'button' )
887890 b . textContent = 'Goto ' + utils . label ( object )
888891 b . addEventListener ( 'click' , function ( _event ) {
889892 // b.parentNode.removeChild(b)
890- dom . outlineManager . GotoSubject ( object , true , undefined , true , undefined )
893+ ; ( dom as any ) . outlineManager . GotoSubject ( object , true , undefined , true , undefined )
891894 } , true )
892895 return b
893896}
0 commit comments