mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
23 lines
739 B
TypeScript
23 lines
739 B
TypeScript
import { RepresentationMetadata } from '../ldp/http/RepresentationMetadata';
|
|
|
|
/**
|
|
* Supports mapping a file to an URL and back.
|
|
*/
|
|
export interface ResourceMapper {
|
|
/**
|
|
* Maps the given file to an URL.
|
|
* @param file - The input file.
|
|
*
|
|
* @returns A promise resolving to the corresponding URL and metadata of the representation.
|
|
*/
|
|
mapFilePathToUrl: (file: File) => Promise<{ url: URL; metadata: RepresentationMetadata }>;
|
|
/**
|
|
* Maps the given URL and metadata to a file.
|
|
* @param url - The input URL.
|
|
* @param metadata - The representation metadata.
|
|
*
|
|
* @returns A promise resolving to the corresponding file.
|
|
*/
|
|
mapUrlToFilePath: (url: URL, metadata: RepresentationMetadata) => Promise<File>;
|
|
}
|