Skip to content

Commit 44336ea

Browse files
committed
Fixing some type errors
1 parent 30ba1da commit 44336ea

5 files changed

Lines changed: 49 additions & 33 deletions

File tree

src/dashboard/dashboardPane.source.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ function buildPage (
4343
}
4444

4545
function buildDashboard (container: HTMLElement, context: DataBrowserContext) {
46-
const outliner = context.getOutliner(context.dom)
46+
// @@ TODO get a proper type
47+
const outliner: any = context.getOutliner(context.dom)
4748
outliner
4849
.getDashboard()
4950
.then((dashboard: HTMLElement) => container.appendChild(dashboard))

src/internal/internalPane.source.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ const pane: PaneDefinition = {
113113
// @@ TODO Remove casing of store.fetcher
114114
var promise = isFolder
115115
? deleteRecursive(store, subject)
116-
: (store.fetcher as any).webOperation('DELETE', subject.uri)
116+
: (store as any).fetcher.webOperation('DELETE', subject.uri) // @@ TODO remove casting
117117
promise
118118
.then(() => {
119119
var str = 'Deleted: ' + subject
@@ -140,7 +140,8 @@ const pane: PaneDefinition = {
140140
refreshCell.appendChild(refreshButton)
141141
refreshButton.addEventListener('click', () => {
142142
// @@ TODO Remove casting of store.fetcher
143-
;(store.fetcher as any).refresh(subject, function (
143+
;(store as any).fetcher.refresh(subject, function (
144+
// @@ TODO Remove casting
144145
ok: boolean,
145146
errm: string
146147
) {
@@ -164,7 +165,7 @@ const pane: PaneDefinition = {
164165
subject,
165166
sym('http://www.w3.org/2007/ont/link#uri'),
166167
subject.uri,
167-
store.fetcher.appNode
168+
(store as any).fetcher.appNode // @@ TODO Remove casting
168169
)
169170
)
170171
if (subject.uri.indexOf('#') >= 0) {
@@ -174,15 +175,15 @@ const pane: PaneDefinition = {
174175
subject,
175176
sym('http://www.w3.org/2007/ont/link#documentURI'),
176177
subject.uri.split('#')[0],
177-
store.fetcher.appNode
178+
(store as any).fetcher.appNode // @@ TODO Remove casting
178179
)
179180
)
180181
plist.push(
181182
st(
182183
subject,
183184
sym('http://www.w3.org/2007/ont/link#document'),
184185
sym(subject.uri.split('#')[0]),
185-
store.fetcher.appNode
186+
(store as any).fetcher.appNode // @@ TODO Remove casting
186187
)
187188
)
188189
} else {
@@ -199,12 +200,13 @@ const pane: PaneDefinition = {
199200
subject,
200201
sym('http://www.w3.org/ns/rww#editable'),
201202
(literal as any)(ed),
202-
store.fetcher.appNode
203+
(store as any).fetcher.appNode // @@ TODO remove casting
203204
)
204205
)
205206
}
206207
}
207-
var outliner = context.getOutliner(dom)
208+
// @@ TODO get a proper type
209+
const outliner: any = context.getOutliner(dom)
208210
outliner.appendPropertyTRs(div, plist, false, filter)
209211
plist = store.statementsMatching(undefined, undefined, subject)
210212
outliner.appendPropertyTRs(div, plist, true, filter)

src/pad/padPane.source.ts

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -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'
615
import { 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#')

src/profile/profilePane.source.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,16 @@ const thisPane: PaneDefinition = {
6161
) {
6262
if (!subject) throw new Error('subject missing')
6363
const profile = subject.doc()
64-
let otherProfiles = store.each(subject, ns.rdfs('seeAlso'), null, profile)
64+
const otherProfiles = store.each(
65+
subject,
66+
ns.rdfs('seeAlso'),
67+
null,
68+
profile
69+
)
6570
if (otherProfiles.length > 0) {
6671
try {
67-
// @@ TODO Remove casting of store.fetcher.load
68-
await (store.fetcher.load as any)(otherProfiles)
72+
// @@ TODO Remove casting of store and store.fetcher.load
73+
await ((store as any).fetcher.load as any)(otherProfiles)
6974
} catch (err) {
7075
container.appendChild(widgets.errorMessageBlock(err))
7176
}

src/versionInfo.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export default {
2-
buildTime: '2019-11-21T14:13:06Z',
3-
commit: '8601dd767b2705e7ece30b299ab5aea0a10dc81e',
2+
buildTime: '2019-11-24T12:58:17Z',
3+
commit: '30ba1daec3519100d272620ed385a542111b4644',
44
npmInfo: {
55
'solid-panes': '2.0.4',
66
npm: '6.10.0',

0 commit comments

Comments
 (0)