import { BehaviorSubject } from "rxjs"; import { PodOsSession, SessionInfo } from "./authentication"; import { FileFetcher, SolidFile } from "./files"; import { AttachmentGateway } from "./attachments"; import { WebIdProfile } from "./profile"; import { LabelIndex } from "./search"; import { Store } from "./Store"; import { Term } from "./terms"; import { Thing } from "./thing"; import { UriService } from "./uri/UriService"; import { OfflineCache, OnlineStatus } from "./offline-cache"; import { IndexedFormula } from "rdflib"; import { ResultAsync } from "neverthrow"; import { HttpProblem, NetworkProblem } from "./problems"; import { OpenWithApp } from "./open-with"; export * from "./authentication"; export * from "./files"; export * from "./thing"; export * from "./rdf-document"; export * from "./ldp-container"; export * from "./attachments"; export * from "./picture"; export * from "./profile"; export * from "./search"; export * from "./offline-cache"; export * from "./terms"; export * from "./Store"; export * from "./uri"; export * from "./problems"; export * from "./type-index"; export * from "./open-with"; export interface PodOsConfiguration { offlineCache?: OfflineCache; onlineStatus?: OnlineStatus; session?: PodOsSession; internalStore?: IndexedFormula; } export declare class PodOS { private readonly session; readonly store: Store; readonly uriService: UriService; private readonly fileFetcher; private readonly searchGateway; private readonly fileGateway; private readonly attachmentGateway; private readonly pictureGateway; private readonly offlineCache; private readonly profileGateway; constructor({ session, offlineCache, onlineStatus, internalStore, }?: PodOsConfiguration); private flagAuthorizationMetaDataOnSessionChange; fetch(uri: string): Promise; fetchAll(uris: string[]): Promise[]>; /** * @deprecated Use {@link FileFetcher.fetchFile} via {@link PodOS.files} instead * @param {string} url - URL identifying the file * @returns {Promise} An object representing the fetched file */ fetchFile(url: string): Promise; /** * Provides access to file operations such as fetching and updating files in the pod * @returns {FileFetcher} An instance of FileFetcher that handles file operations */ files(): FileFetcher; /** * Adds a new value to the property of the given thing * @param thing * @param property * @param value */ addPropertyValue(thing: Thing, property: string, value: string): Promise; /** * Updates the value of the given property of the given thing to the new value * @param thing * @param property * @param oldValue * @param newValue */ editPropertyValue(thing: Thing, property: string, oldValue: string, newValue: string): Promise; /** * Adds a new relation (link) from the thing to the given uri using the property * @param thing * @param property * @param uri */ addRelation(thing: Thing, property: string, value: string): Promise; listKnownTerms(): Term[]; addNewThing(uri: string, name: string, type?: string): Promise; proposeUriForNewThing(referenceUri: string, name: string): string; /** * returns a behavior subject that can be used to observe changes in the session state */ observeSession(): BehaviorSubject; /** * Fetch the WebId profile and preferences file for the given WebID * @param webId */ fetchProfile(webId: string): Promise; /** * Build the search index on demand. * * While logged in, the index is built from the logged-in user's label indexes * and cached, so repeated calls return the same instance. * * While logged out, a fresh empty index is returned that is not cached. */ buildSearchIndex(): Promise; logout(): Promise; login(oidcIssuer?: string): Promise; /** * Dynamically loads a module by its name and returns an instance of the module * @param moduleName */ loadModule(moduleName: string): Promise; /** * Adds a label of the given thing to the label index, so that it can be found after the search index has been rebuilt * @param thing - The thing to index * @param labelIndex - The index to update */ addToLabelIndex(thing: Thing, labelIndex: LabelIndex): Promise; /** * Creates a new label index document at a default location and links it to the user's profile or preferences document * * @param profile - The profile for that to create the index * @returns the newly created label index */ createDefaultLabelIndex(profile: WebIdProfile): Promise; /** * Uploads a picture file and associates it with a thing. * The container is automatically derived from the thing's URI. * * @param thing - The thing to add the picture to * @param pictureFile - The picture file to upload * @returns Result with the picture URL or error */ uploadAndAddPicture(thing: Thing, pictureFile: File): ResultAsync<{ url: string; }, HttpProblem | NetworkProblem>; /** * Provides access to attachment operations such as uploading and linking attachments to things * @since 0.24.0 * @returns {AttachmentGateway} An instance of AttachmentGateway that handles attachment operations */ attachments(): AttachmentGateway; /** * Propose matching apps to open a thing * @param thing - The thing to open * @returns An array of apps that can open the thing. The array is empty if no apps are found. */ proposeAppsFor(thing: Thing): OpenWithApp[]; }