/** * 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 { UrlString, LitDataset, DatasetInfo, ChangeLog, unstable_Acl } from "./interfaces"; /** * Initialise a new [[LitDataset]] in memory. * * @returns An empty [[LitDataset]]. */ export declare function createLitDataset(): LitDataset; /** * Fetch a LitDataset from the given URL. Currently requires the LitDataset to be available as [Turtle](https://www.w3.org/TR/turtle/). * * @param url URL to fetch a [[LitDataset]] from. * @param options Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/docs/Web/API/WindowOrWorkerGlobalScope/fetch#parameters). * @returns Promise resolving to a [[LitDataset]] containing the data at the given Resource, or rejecting if fetching it failed. */ export declare function fetchLitDataset(url: UrlString, options?: Partial): Promise; /** * Experimental: fetch a LitDataset and its associated Access Control List. * * This is an experimental function that fetches both a Resource, the linked ACL Resource (if * available), and the ACL that applies to it if the linked ACL Resource is not available. This can * result in many HTTP requests being executed, in lieu of the Solid spec mandating servers to * provide this info in a single request. Therefore, and because this function is still * experimental, prefer [[fetchLitDataset]] instead. * * If the Resource does not advertise the ACL Resource (because the authenticated user does not have * access to it), the `acl` property in the returned value will be null. `acl.resourceAcl` will be * undefined if the Resource's linked ACL Resource could not be fetched (because it does not exist), * and `acl.fallbackAcl` will be null if the applicable Container's ACL is not accessible to the * authenticated user. * * @param url URL of the LitDataset to fetch. * @param options Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/docs/Web/API/WindowOrWorkerGlobalScope/fetch#parameters). * @returns A LitDataset and the ACLs that apply to it, if available to the authenticated user. */ export declare function unstable_fetchLitDatasetWithAcl(url: UrlString, options?: Partial): Promise; declare const defaultSaveOptions: { fetch: ((input: RequestInfo, init?: RequestInit | undefined) => Promise) & typeof globalThis.fetch; }; /** * Given a LitDataset, store it in a Solid Pod (overwriting the existing data at the given URL). * * @param url URL to save `litDataset` to. * @param litDataset The [[LitDataset]] to save. * @param options Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/docs/Web/API/WindowOrWorkerGlobalScope/fetch#parameters). * @returns A Promise resolving to a [[LitDataset]] containing the stored data, or rejecting if saving it failed. */ export declare function saveLitDatasetAt(url: UrlString, litDataset: LitDataset, options?: Partial): Promise; declare const defaultSaveInContainerOptions: { fetch: ((input: RequestInfo, init?: RequestInit | undefined) => Promise) & typeof globalThis.fetch; }; declare type SaveInContainerOptions = Partial; /** * Given a LitDataset, store it in a Solid Pod in a new Resource inside a Container. * * @param containerUrl URL of the Container in which to create a new Resource. * @param litDataset The [[LitDataset]] to save to a new Resource in the given Container. * @param options Optional parameter `options.fetch`: An alternative `fetch` function to make the HTTP request, compatible with the browser-native [fetch API](https://developer.mozilla.org/docs/Web/API/WindowOrWorkerGlobalScope/fetch#parameters). * @returns A Promise resolving to a [[LitDataset]] containing the stored data linked to the new Resource, or rejecting if saving it failed. */ export declare function saveLitDatasetInContainer(containerUrl: UrlString, litDataset: LitDataset, options?: SaveInContainerOptions): Promise; export {};