@mdfriday/foundry
Version:
The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.
59 lines (58 loc) • 1.82 kB
TypeScript
import { Path as IPath, PathType } from '../type';
import { PathComponentsImpl } from '../vo/pathcomponents';
export declare class Path implements IPath {
private readonly components;
private _unnormalized?;
private shouldTrimLeadingSlash;
constructor(components: PathComponentsImpl);
component(): string;
path(): string;
name(): string;
originalNameNoExt(): string;
nameNoExt(): string;
nameNoLang(): string;
dir(): string;
ext(): string;
lang(): string;
section(): string;
sections(): string[];
container(): string;
containerDir(): string;
base(): string;
baseNoLeadingSlash(): string;
baseNameNoIdentifier(): string;
nameNoIdentifier(): string;
pathNoLang(): string;
pathNoIdentifier(): string;
pathRel(owner: IPath): string;
baseRel(owner: IPath): string;
trimLeadingSlash(): IPath;
identifier(index: number): string;
identifiers(): string[];
bundleType(): PathType;
isContent(): boolean;
isBundle(): boolean;
isBranchBundle(): boolean;
isLeafBundle(): boolean;
isHTML(): boolean;
disabled(): boolean;
forBundleType(type: PathType): IPath;
unnormalized(): IPath;
private setShouldTrimLeadingSlash;
private norm;
private isContentPage;
private baseInternal;
private identifierAsString;
private identifierIndex;
private escapeRegExp;
toString(): string;
equals(other: IPath): boolean;
hashCode(): string;
}
export declare class PathUtils {
static fromString(component: string, path: string): Path;
static hasExtension(path: IPath, extension: string): boolean;
static isUnder(child: IPath, parent: IPath): boolean;
static relativeTo(from: IPath, to: IPath): string;
static compare(a: IPath, b: IPath): number;
}