lincd
Version:
LINCD is a JavaScript library for building user interfaces with linked data (also known as 'structured data', or RDF)
27 lines (26 loc) • 1.26 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import { IFileStore } from '../interfaces/IFileStore.js';
import type { Readable } from 'stream';
export declare abstract class LinkedFileStorage {
private static defaultStore;
private static url;
static get accessURL(): string;
static setDefaultAccessURL(accessURL: string): string;
static getDefaultStore(): IFileStore;
static setDefaultStore(store: IFileStore): void;
static deleteFile(filePath: string): Promise<void>;
static fileExists(filePath: string): Promise<boolean>;
static getFile(filePath: string): Promise<Buffer>;
static listFiles(prefix?: string): Promise<string[]>;
static saveFile(filePath: string, fileContent: string | Uint8Array | Buffer | Readable, mimeType?: string, preventDuplicates?: boolean): Promise<string>;
}
/**
* Get the full path of an asset based on the way LinkedFileStorage is configured
* Returns accessURL + directory (/public by default) + path
* @param path asset path
* @param directory asset directory (optional, default is /public)
* @returns asset url. e.g. https://cdn.example.com/public/image.png
*/
export declare function asset(path: string, directory?: string): string;