@foxpage/foxpage-core
Version:
foxpage core
58 lines (57 loc) • 1.39 kB
TypeScript
import { Messages } from '@foxpage/foxpage-shared';
import { Context, Page, PageParser, StructureNode } from '@foxpage/foxpage-types';
/**
* page parser impl
*
* @export
* @class PageParserImpl
* @implements {PageParser}
*/
export declare class PageParserImpl implements PageParser {
page: Page;
/**
* template containers
*
* @type {Map<string, StructureNode>}
*/
templateSchemasMap: Map<string, StructureNode>;
/**
* block containers
*
* @type {Map<string, StructureNode>}
*/
blockSchemasMap: Map<string, StructureNode>;
messages: Messages;
constructor(page: Page);
/**
* pre parse for prepare template containers eg.
*
*/
preParse(ctx: Context): void;
/**
* do parse
*
* @param {Context} ctx
*/
parse(ctx: Context): {
parsed: Page;
messages: string[];
};
/**
* get template container by templateId
*
* @param {string} templateId
* @return {StructureNode|undefined}
*/
getTemplateSchemas(templateId: string): StructureNode | undefined;
/**
* get block container by blockId
*
* @param {string} blockId
* @return {StructureNode|undefined}
*/
getBlockSchemas(blockId: string): StructureNode | undefined;
private pageParser;
private getTplRefers;
private isTemplateTpl;
}