@mdfriday/foundry
Version:
The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.
54 lines (53 loc) • 2.43 kB
TypeScript
import { PathComponents, PathPositions, LowHigh, PathType } from '../type';
export declare class PathComponentsImpl implements PathComponents {
readonly original: string;
readonly normalized: string;
readonly positions: PathPositions;
readonly identifiers: LowHigh[];
readonly bundleType: PathType;
readonly disabled: boolean;
readonly component?: string | undefined;
constructor(original: string, normalized: string, positions: PathPositions, identifiers: LowHigh[], bundleType: PathType, disabled?: boolean, component?: string | undefined);
withBundleType(bundleType: PathType): PathComponents;
withDisabled(disabled: boolean): PathComponents;
hasIdentifiers(): boolean;
firstIdentifier(): LowHigh | null;
lastIdentifier(): LowHigh | null;
getIdentifier(index: number): LowHigh | null;
isContentComponent(component: string): boolean;
clone(): PathComponents;
toString(): string;
}
export declare class PathPositionsImpl implements PathPositions {
containerLow: number;
containerHigh: number;
sectionHigh: number;
identifierLanguage: number;
constructor(containerLow?: number, containerHigh?: number, sectionHigh?: number, identifierLanguage?: number);
reset(): void;
hasContainer(): boolean;
hasSection(): boolean;
hasLanguageIdentifier(): boolean;
clone(): PathPositions;
}
export declare class LowHighImpl implements LowHigh {
readonly low: number;
readonly high: number;
constructor(low: number, high: number);
length(): number;
isEmpty(): boolean;
contains(position: number): boolean;
substring(str: string): string;
toString(): string;
}
export declare class PathComponentsFactory {
static createEmpty(original?: string, bundleType?: PathType): PathComponents;
static create(original: string, normalized?: string, bundleType?: PathType): PathComponents;
static createFull(original: string, normalized: string, positions: PathPositions, identifiers: LowHigh[], bundleType: PathType, disabled?: boolean): PathComponents;
}
export declare class PathComponentsUtils {
static extractString(str: string, range: LowHigh): string;
static extractStrings(str: string, ranges: LowHigh[]): string[];
static findIdentifierIndex(identifiers: LowHigh[], position: number): number;
static merge(base: PathComponents, override: Partial<PathComponents>): PathComponents;
}