@mdfriday/foundry
Version:
The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.
76 lines • 2.12 kB
TypeScript
import { Page, Position } from '../type';
import { Scratch } from '../../../../pkg/maps/scratch';
/**
* ShortcodeWithPage is the "." context in a shortcode template.
*/
export declare class ShortcodeWithPage {
private _params;
private _inner;
private _page;
private _parent;
private _name;
private _isNamedParams;
private _ordinal;
private _indentation;
private _innerDeindent;
private _posOffset;
private _pos;
private _scratch;
constructor(params: any, inner: string, page: Page, parent: ShortcodeWithPage | null, name: string, isNamedParams: boolean, ordinal: number, indentation?: string, posOffset?: number);
/**
* Get shortcode parameters
*/
get params(): any;
get Params(): any;
get IsNamedParams(): boolean;
/**
* Get inner content
*/
get inner(): string;
get Inner(): string;
/**
* Get parent page
*/
get page(): Page;
get Page(): Page;
/**
* Get parent shortcode if any
*/
get parent(): ShortcodeWithPage | null;
get Parent(): ShortcodeWithPage | null;
/**
* Get shortcode name
*/
get name(): string;
/**
* Check if using named parameters
*/
get isNamedParams(): boolean;
/**
* Get ordinal position
*/
get ordinal(): number;
get Ordinal(): number;
/**
* Returns the (potentially de-indented) inner content of the shortcode
*/
innerDeindent(): string;
get InnerDeindent(): string;
/**
* Position returns this shortcode's detailed position.
* Note that this information may be expensive to calculate,
* so only use this in error situations.
*/
position(): Promise<Position>;
/**
* Scratch returns a scratch-pad scoped for this shortcode.
* This can be used as a temporary storage for variables, counters etc.
*/
scratch(): Scratch;
/**
* Get is a convenience method to look up shortcode parameters by its key
*/
get(key: string | number): any;
Get(key: string | number): any;
}
//# sourceMappingURL=shortcode.d.ts.map