54 lines
1.7 KiB
TypeScript
54 lines
1.7 KiB
TypeScript
import Immutable from "immutable";
|
|
import TemplateShortcut from "./templateShortcut";
|
|
import nunjucks from "nunjucks";
|
|
declare const TemplateBlock_base: Immutable.Record.Class;
|
|
declare class TemplateBlock extends TemplateBlock_base {
|
|
getName(): string;
|
|
getEndTag(): string;
|
|
getProcess(): Function;
|
|
getBlocks(): Immutable.List<string>;
|
|
/**
|
|
* Return shortcuts associated with this block or undefined
|
|
* @return {TemplateShortcut|undefined}
|
|
*/
|
|
getShortcuts(): TemplateShortcut;
|
|
/**
|
|
* Return name for the nunjucks extension
|
|
* @return {string}
|
|
*/
|
|
getExtensionName(): string;
|
|
/**
|
|
* Return a nunjucks extension to represents this block
|
|
* @return {Nunjucks.Extension}
|
|
*/
|
|
toNunjucksExt(mainContext: any, blocksOutput: any): nunjucks.Extension;
|
|
/**
|
|
* Apply a block to a content
|
|
* @param {Object} inner
|
|
* @param {Object} context
|
|
* @return {Promise<String>|String}
|
|
*/
|
|
applyBlock(inner: any, context: any): any;
|
|
/**
|
|
* Normalize result from a block process function
|
|
* @param {Object|String} result
|
|
* @return {Object}
|
|
*/
|
|
normalizeBlockResult(result: any): any;
|
|
/**
|
|
* Convert a block result to HTML
|
|
* @param {Object} result
|
|
* @param {Object} blocksOutput: stored post processing blocks in this object
|
|
* @return {string}
|
|
*/
|
|
blockResultToHtml(result: any, blocksOutput: any): any;
|
|
/**
|
|
* Create a template block from a function or an object
|
|
* @param {string} blockName
|
|
* @param {Object} block
|
|
* @return {TemplateBlock}
|
|
*/
|
|
static create(blockName: any, block: any): any;
|
|
}
|
|
export default TemplateBlock;
|
|
//# sourceMappingURL=templateBlock.d.ts.map
|