import { Session } from "@inrupt/solid-client-authn-browser" import { LiveStore, NamedNode, Statement } from "rdflib" export type AppDetails = { noun: string appPathSegment: string } export type AuthenticationContext = { containers?: Array div?: HTMLElement dom?: HTMLDocument index?: { [key: string]: Array } instances?: Array me?: NamedNode | null noun?: string preferencesFile?: NamedNode preferencesFileError?: string publicProfile?: NamedNode statusArea?: HTMLElement } export interface AuthnLogic { authSession: Session //this needs to be deprecated in the future. Is only here to allow imports like panes.UI.authn.authSession prior to moving authn from ui to logic currentUser: () => NamedNode | null checkUser: (setUserCallback?: (me: NamedNode | null) => T) => Promise saveUser: (webId: NamedNode | string | null, context?: AuthenticationContext) => NamedNode | null } export interface SolidNamespace { [key: string]: (term: string) => NamedNode } export type TypeIndexScope = { label: string, index: NamedNode, agent: NamedNode } export type ScopedApp = { instance: NamedNode, type: NamedNode, scope: TypeIndexScope } export interface NewPaneOptions { me?: NamedNode; newInstance?: NamedNode; newBase: string; } export interface CreatedPaneOptions { newInstance: NamedNode; } export interface ChatLogic { setAcl: (chatContainer: NamedNode, me: NamedNode, invitee: NamedNode) => Promise, addToPrivateTypeIndex: (chatThing, me) => void | Promise, findChat: (invitee: NamedNode) => Promise, createChatThing: (chatContainer: NamedNode, me: NamedNode) => Promise, mintNew: (newPaneOptions: NewPaneOptions) => Promise, getChat: (invitee: NamedNode, boolean) => Promise, sendInvite: (invitee: NamedNode, chatThing: NamedNode) => void } export interface Chat { me: NamedNode, chatContainer: NamedNode, exists: boolean } export interface ProfileLogic { silencedLoadPreferences: (user: NamedNode) => Promise, loadPreferences: (user: NamedNode) => Promise, loadProfile: (user: NamedNode) => Promise, loadMe: () => Promise, getPodRoot: (user: NamedNode) => NamedNode, getMainInbox: (user: NamedNode) => Promise, findStorage: (me: NamedNode) => Node | null } export interface AclLogic { findAclDocUrl: (url: NamedNode) => Promise, setACLUserPublic: (docURI: string, me: NamedNode, options: { defaultForNew?: boolean, public?: [] } ) => Promise, genACLText: (docURI: string, me: NamedNode, aclURI: string, options: { defaultForNew?: boolean, public?: [] } ) => string | undefined } export interface InboxLogic { createInboxFor: (peerWebId: string, nick: string) => Promise, getNewMessages: (user?: NamedNode) => Promise, markAsRead: (url: string, date: Date) => void } export interface TypeIndexLogic { getRegistrations: (instance, theClass) => Node[], loadTypeIndexesFor: (user: NamedNode) => Promise>, loadCommunityTypeIndexes: (user: NamedNode) => Promise, loadAllTypeIndexes: (user: NamedNode) => Promise>, getScopedAppInstances: (klass: NamedNode, user: NamedNode) => Promise, getAppInstances: (klass: NamedNode) => Promise, suggestPublicTypeIndex: (me: NamedNode) => NamedNode, suggestPrivateTypeIndex: (preferencesFile: NamedNode) => NamedNode, registerInTypeIndex: (instance: NamedNode, index: NamedNode, theClass: NamedNode) => Promise, deleteTypeIndexRegistration: (item: any) => Promise getScopedAppsFromIndex: (scope: TypeIndexScope, theClass: NamedNode | null) => Promise } export interface SolidLogic { store: LiveStore, authn: AuthnLogic, acl: AclLogic, profile: ProfileLogic, inbox: InboxLogic, typeIndex: TypeIndexLogic, chat: ChatLogic, load: (doc: NamedNode | NamedNode[] | string) => void, updatePromise: (del: Array, ins: Array) => Promise, clearStore: () => void }