/** * Copyright 2020 Inrupt Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal in * the Software without restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the * Software, and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ import { DatasetCore, NamedNode } from "rdf-js"; /** * Alias to indicate where we expect to be given a URL represented as an RDF/JS NamedNode. */ export declare type Url = NamedNode; /** @hidden Alias of Url for those who prefer to use IRI terminology. */ export declare type Iri = Url; /** * Alias to indicate where we expect to be given a URL. */ export declare type UrlString = string; /** @hidden Alias of UrlString for those who prefer to use IRI terminology. */ export declare type IriString = UrlString; /** * Alias to indicate where we expect to be given a WebId. */ export declare type WebId = UrlString; /** * A LitDataset represents all Quads from a single Resource. */ export declare type LitDataset = DatasetCore; /** * A Thing represents all Quads with a given Subject URL and a given Named * Graph, from a single Resource. */ export declare type Thing = DatasetCore & ({ url: UrlString; } | { name: string; }); /** * A [[Thing]] for which we know what the full Subject URL is. */ export declare type ThingPersisted = Thing & { url: UrlString; }; /** * A [[Thing]] whose full Subject URL will be determined when it is persisted. */ export declare type ThingLocal = Thing & { name: string; }; /** * A [[LitDataset]] containing Access Control rules for another LitDataset. * * Please note that the Web Access Control specification is not yet finalised, and hence, this * function is still experimental and can change in a non-major release. */ export declare type unstable_AclDataset = LitDataset & DatasetInfo & { accessTo: UrlString; }; /** * @hidden Developers shouldn't need to directly access ACL rules. Instead, we provide our own functions that verify what access someone has. */ export declare type unstable_AclRule = Thing; /** * An object with the boolean properties `read`, `append`, `write` and `control`, representing the * respective Access Modes defined by the Web Access Control specification. * * Since that specification is not finalised yet, this interface is still experimental. */ export declare type unstable_AccessModes = { read: boolean; append: true; write: true; control: boolean; } | { read: boolean; append: boolean; write: false; control: boolean; }; declare type unstable_WacAllow = { user: unstable_AccessModes; public: unstable_AccessModes; }; /** * [[LitDataset]]s fetched by lit-pod include this metadata describing its relation to a Pod Resource. */ export declare type DatasetInfo = { datasetInfo: { fetchedFrom: UrlString; /** * The URL reported by the server as possibly containing an ACL file. Note that this file might * not necessarily exist, in which case the ACL of the nearest Container with an ACL applies. * * @ignore We anticipate the Solid spec to change how the ACL gets accessed, which would result * in this API changing as well. */ unstable_aclUrl?: UrlString; /** * Access permissions for the current user and the general public for this resource. * * @ignore There is no consensus yet about how this functionality will be incorporated in the * final spec, so the final implementation might influence this API in the future. * @see https://github.com/solid/solid-spec/blob/cb1373a369398d561b909009bd0e5a8c3fec953b/api-rest.md#wac-allow-headers * @see https://github.com/solid/specification/issues/171 */ unstable_permissions?: unstable_WacAllow; }; }; /** * @hidden Developers should use [[unstable_getResourceAcl]] and [[unstable_getFallbackAcl]] to access these. */ export declare type unstable_Acl = { acl: { resourceAcl?: unstable_AclDataset; fallbackAcl: unstable_AclDataset | null; }; }; /** * Verify whether a given LitDataset includes metadata about where it was retrieved from. * * @param dataset A [[LitDataset]] that may have metadata attached about the Resource it was retrieved from. * @returns True if `dataset` includes metadata about the Resource it was retrieved from, false if not. */ export declare function hasDatasetInfo(dataset: T): dataset is T & DatasetInfo; /** * A RequestInit restriction where the method is set by the library */ export declare type unstable_UploadRequestInit = Omit; export {};