UNPKG

@podlite/schema

Version:

AST tools for Podlite markup language

83 lines (82 loc) 2.58 kB
import { ErrorObject } from 'ajv'; import { PodNode } from './types'; export { PodliteDocument } from './types'; export { AstTree } from './types'; export * from './types'; export * from './blocks-helpers'; export * from './query-helpers'; export * from './ast-helpers'; export * from './helpers/handlers'; export { makeInterator } from './ast-inerator'; export { makeTransformer, isNamedBlock, isSemanticBlock } from './helpers/makeTransformer'; export { toAny } from './exportAny'; export { makeAttrs } from './helpers/config'; export { pluginCleanLocation } from './plugin-clean-location'; export { toAnyRules } from './helpers/plugins'; export { podlitePluggable, Podlite, PodliteExport, cleanIds, frozenIds } from './pluggableParser'; export declare function toAst(): {}; export declare type SchemaValidationError = ErrorObject<string, Record<string, any>>; export declare function getTextContentFromNode(node: PodNode): string; export declare function validatePodliteAst(data: unknown): SchemaValidationError[]; export declare function validateAstTree(data: unknown): SchemaValidationError[]; export declare function validateAst(data: unknown, Name?: string): SchemaValidationError[]; export declare function isValidateError(result: SchemaValidationError[], src: any): any; export interface Test { ters: string; } export interface nBlock { type: 'block'; name: 'pod'; content: AST; margin: string; } export interface nCode { type: 'code'; content: []; name: string; margin: string; config: []; text: string; } export interface nText { type: 'text'; content: []; name: string; margin: string; config: []; value: string; } export interface nPara { type: 'para'; content: []; name: string; margin: string; config: []; } export interface nVerbatim { type: 'verbatim'; value: string; margin: string; text: string; } export declare type Node = nBlock | nCode | nText | nPara | nVerbatim; export declare type AST = Array<Node>; export declare type ParserPlugin = (opt: { skipChain: number; podMode: number; }) => (param: AST) => AST; declare function makeTree(): { (): void; use: (plugin: ParserPlugin) => any; parse: (src: string, opt?: { skipChain: number; podMode: number; }) => AST; }; export { makeTree as toTree }; declare const parse: Function; export { parse as parse }; export { default as toHtml } from './exportHtml'; export { default as Writer } from './writer'; declare const VERSION: any; export { VERSION as version };