UNPKG

@jsvfs/core

Version:

The JavaScript Virtual File System - an extensible engine for file operations.

17 lines (16 loc) 994 B
import { Item, RealItem, Root } from './Item'; export declare const SEPARATOR = "/"; /** Normalize a path to match expectations. */ export declare function normalize(path: string): string; /** Destructure a path to an array. */ export declare function destructure(path: string): string[]; /** Perform a POSIX join on one or more strings. */ export declare function join(...paths: string[]): string; /** Get the base name of the given path. */ export declare function basename(path: string): string; /** Get an item in the file system tree. Optionally return links at a path instead of link contents. */ export declare function getItemAtPath(root: Root, path: string): RealItem; export declare function getItemAtPath(root: Root, path: string, resolveLinks: false): Item; export declare function getItemAtPath(root: Root, path: string, resolveLinks: true): RealItem; /** Set an item in the file system tree. */ export declare function setItemAtPath(root: Root, item: Item): void;