@@ -2,7 +2,16 @@ import { authn, icons, ns, pad, widgets } from 'solid-ui'
22// @ts -ignore
33// @@ TODO: serialize is not part rdflib type definitions
44// Might be fixed in https://github.com/linkeddata/rdflib.js/issues/341
5- import { graph , log , NamedNode , Namespace , sym , serialize } from 'rdflib'
5+ import {
6+ graph ,
7+ log ,
8+ NamedNode ,
9+ Namespace ,
10+ sym ,
11+ serialize ,
12+ UpdateManager ,
13+ Fetcher
14+ } from 'rdflib'
615import { PaneDefinition } from 'pane-registry'
716/* pad Pane
817 **
@@ -29,7 +38,7 @@ const paneDef: PaneDefinition = {
2938
3039 mintNew : function ( context , newPaneOptions : any ) {
3140 const store = context . session . store
32- var updater = store . updater
41+ const updater = store . updater as UpdateManager
3342 if ( newPaneOptions . me && ! newPaneOptions . me . uri ) {
3443 throw new Error ( 'notepad mintNew: Invalid userid' )
3544 }
@@ -272,7 +281,7 @@ const paneDef: PaneDefinition = {
272281
273282 var toBeCopied = [ { local : 'index.html' , contentType : 'text/html' } ]
274283
275- let newInstance = store . sym ( newPadDoc . uri + '#thisPad' )
284+ const newInstance = store . sym ( newPadDoc . uri + '#thisPad' )
276285
277286 // log.debug("\n Ready to put " + kb.statementsMatching(undefined, undefined, undefined, there)); //@@
278287
@@ -287,21 +296,19 @@ const paneDef: PaneDefinition = {
287296 console . log ( 'Copying ' + base + item . local + ' to ' + newURI )
288297
289298 var setThatACL = function ( ) {
290- setACL ( newURI , false , function ( ok : boolean , message : string ) {
291- if ( ! ok ) {
292- complainIfBad (
293- ok ,
294- 'FAILED to set ACL ' + newURI + ' : ' + message
295- )
296- console . log ( 'FAILED to set ACL ' + newURI + ' : ' + message )
297- } else {
298- agenda . shift ( ) ! ( ) // beware too much nesting
299- }
300- } )
301- }
302-
303- // @@ TODO Remove casting of fetcher
304- ; ( store . fetcher as any )
299+ setACL ( newURI , false , function ( ok : boolean , message : string ) {
300+ if ( ! ok ) {
301+ complainIfBad (
302+ ok ,
303+ 'FAILED to set ACL ' + newURI + ' : ' + message
304+ )
305+ console . log ( 'FAILED to set ACL ' + newURI + ' : ' + message )
306+ } else {
307+ agenda . shift ( ) ! ( ) // beware too much nesting
308+ }
309+ } )
310+ }
311+ ; ( store as any ) . fetcher // @@ TODO Remove casting
305312 . webCopy (
306313 base + item . local ,
307314 newBase + item . local ,
@@ -489,8 +496,9 @@ const paneDef: PaneDefinition = {
489496 // Body of Pane
490497 var appPathSegment = 'app-pad.timbl.com' // how to allocate this string and connect to
491498
492- var fetcher = store . fetcher
493- var updater = store . updater
499+ // @@ TODO Remove castings
500+ const fetcher = ( store as any ) . fetcher as Fetcher
501+ const updater = ( store as any ) . updater as UpdateManager
494502 var me : any
495503
496504 var PAD = Namespace ( 'http://www.w3.org/ns/pim/pad#' )
0 commit comments