/** * 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 { Literal, NamedNode } from "rdf-js"; import { Thing, Url, UrlString, ThingPersisted, ThingLocal } from "../interfaces"; /** * Create a new Thing with all values removed for the given Predicate. * * The original `thing` is not modified; this function returns a cloned Thing with updated values. * * @param thing [[Thing]] to remove values from. * @param predicate Predicate for which to remove all values from the Thing. * @returns A new Thing equal to the input Thing with all values removed for the given Predicate. */ export declare function removeAll(thing: T, predicate: Url | UrlString): T extends ThingLocal ? ThingLocal : ThingPersisted; /** * Create a new Thing with the given URL removed for the given Predicate. * * The original `thing` is not modified; this function returns a cloned Thing with updated values. * * @param thing Thing to remove a URL value from. * @param predicate Predicate for which to remove the given URL value. * @param value URL to remove from `thing` for the given `predicate`. * @returns A new Thing equal to the input Thing with the given value removed for the given Predicate. */ export declare const removeUrl: RemoveOfType; /** @hidden Alias of [[removeUrl]] for those who prefer IRI terminology. */ export declare const removeIri: RemoveOfType & { url: string; } & { url: string; }) | (import("rdf-js").DatasetCore & { name: string; } & { url: string; })>; /** * Create a new Thing with the given boolean removed for the given Predicate. * * The original `thing` is not modified; this function returns a cloned Thing with updated values. * * @param thing Thing to remove a boolean value from. * @param predicate Predicate for which to remove the given boolean value. * @param value Boolean to remove from `thing` for the given `predicate`. * @returns A new Thing equal to the input Thing with the given value removed for the given Predicate. */ export declare const removeBoolean: RemoveOfType; /** * Create a new Thing with the given datetime removed for the given Predicate. * * The original `thing` is not modified; this function returns a cloned Thing with updated values. * * @param thing Thing to remove a datetime value from. * @param predicate Predicate for which to remove the given datetime value. * @param value Datetime to remove from `thing` for the given `predicate`. * @returns A new Thing equal to the input Thing with the given value removed for the given Predicate. */ export declare const removeDatetime: RemoveOfType; /** * Create a new Thing with the given decimal removed for the given Predicate. * * The original `thing` is not modified; this function returns a cloned Thing with updated values. * * @param thing Thing to remove a decimal value from. * @param predicate Predicate for which to remove the given decimal value. * @param value Decimal to remove from `thing` for the given `predicate`. * @returns A new Thing equal to the input Thing with the given value removed for the given Predicate. */ export declare const removeDecimal: RemoveOfType; /** * Create a new Thing with the given integer removed for the given Predicate. * * The original `thing` is not modified; this function returns a cloned Thing with updated values. * * @param thing Thing to remove an integer value from. * @param predicate Predicate for which to remove the given integer value. * @param value Integer to remove from `thing` for the given `predicate`. * @returns A new Thing equal to the input Thing with the given value removed for the given Predicate. */ export declare const removeInteger: RemoveOfType; /** * Create a new Thing with the given localised string removed for the given Predicate. * * The original `thing` is not modified; this function returns a cloned Thing with updated values. * * @param thing Thing to remove a localised string value from. * @param predicate Predicate for which to remove the given localised string value. * @param value String to remove from `thing` for the given `predicate`. * @param locale Locale of the string to remove. * @returns A new Thing equal to the input Thing with the given value removed for the given Predicate. */ export declare function removeStringInLocale(thing: T, predicate: Url | UrlString, value: string, locale: string): T extends ThingLocal ? ThingLocal : ThingPersisted; /** * Create a new Thing with the given unlocalised string removed for the given Predicate. * * The original `thing` is not modified; this function returns a cloned Thing with updated values. * * @param thing Thing to remove an unlocalised string value from. * @param predicate Predicate for which to remove the given string value. * @param value String to remove from `thing` for the given `predicate`. * @returns A new Thing equal to the input Thing with the given value removed for the given Predicate. */ export declare const removeStringUnlocalized: RemoveOfType; /** * @ignore This should not be needed due to the other remove*() functions. If you do find yourself needing it, please file a feature request for your use case. * @param thing Thing to remove a NamedNode value from. * @param predicate Predicate for which to remove the given NamedNode value. * @param value NamedNode to remove from `thing` for the given `predicate`. * @returns A new Thing equal to the input Thing with the given value removed for the given Predicate. */ export declare function removeNamedNode(thing: T, predicate: Url | UrlString, value: NamedNode): T extends ThingLocal ? ThingLocal : ThingPersisted; /** * @ignore This should not be needed due to the other remove*() functions. If you do find yourself needing it, please file a feature request for your use case. * @param thing Thing to remove a Literal value from. * @param predicate Predicate for which to remove the given Literal value. * @param value Literal to remove from `thing` for the given `predicate`. * @returns A new Thing equal to the input Thing with the given value removed for the given Predicate. */ export declare function removeLiteral(thing: T, predicate: Url | UrlString, value: Literal): T extends ThingLocal ? ThingLocal : ThingPersisted; /** * @param thing Thing to remove a value from. * @param predicate Predicate for which to remove the given value. * @param value Value to remove from `thing` for the given `predicate`. * @returns A new Thing equal to the input Thing with the given value removed for the given Predicate. */ declare type RemoveOfType = (thing: T, predicate: Url | UrlString, value: Type) => T extends ThingLocal ? ThingLocal : ThingPersisted; export {};