import type Func from './ast/function'; import type Node from './ast/node'; import type Var from './ast/variable'; import type Tag from './tag'; export type { Node, Tag }; export declare type Function = Func; export declare type Variable = Var; export type MaybePromise = T | Promise; export interface AstType { readonly $$mdtype: 'Function' | 'Node' | 'Variable'; resolve(config: Config): any; } export type AttributeValue = { type: string; name: string; value: any; }; export type Config = Readonly>; export type ConfigType = Partial<{ nodes: Partial>>; tags: Record; variables: Record; functions: Record; partials: Record; validation?: { parents?: Node[]; validateFunctions?: boolean; environment?: string; }; }>; export type ConfigFunction = { returns?: ValidationType | ValidationType[]; parameters?: Record; transform?(parameters: Record, config: Config): any; validate?(fn: Func, config: Config): ValidationError[]; }; export interface CustomAttributeTypeInterface { transform?(value: any, config: Config): Scalar; validate?(value: any, config: Config, name: string): ValidationError[]; } export interface CustomAttributeType { new (): CustomAttributeTypeInterface; readonly prototype: CustomAttributeTypeInterface; } export type Location = { file?: string; start: LocationEdge; end: LocationEdge; }; export type LocationEdge = { line: number; character?: number; }; export type NodeType = 'blockquote' | 'code' | 'comment' | 'document' | 'em' | 'error' | 'fence' | 'hardbreak' | 'heading' | 'hr' | 'image' | 'inline' | 'item' | 'link' | 'list' | 'node' | 'paragraph' | 's' | 'softbreak' | 'strong' | 'table' | 'tag' | 'tbody' | 'td' | 'text' | 'th' | 'thead' | 'tr'; export type Primitive = null | boolean | number | string; export type RenderableTreeNode = Tag | Scalar; export type RenderableTreeNodes = RenderableTreeNode | RenderableTreeNode[]; export type Scalar = Primitive | Scalar[] | { [key: string]: Scalar; }; export type Schema = { render?: R; children?: string[]; attributes?: Record; slots?: Record; selfClosing?: boolean; inline?: boolean; transform?(node: Node, config: C): MaybePromise; validate?(node: Node, config: C): MaybePromise; description?: string; }; export type SchemaAttribute = { type?: ValidationType | ValidationType[]; render?: boolean | string; default?: any; required?: boolean; matches?: SchemaMatches | ((config: Config) => SchemaMatches); validate?(value: any, config: Config, name: string): ValidationError[]; errorLevel?: ValidationError['level']; description?: string; }; export type SchemaMatches = RegExp | string[] | null; export type SchemaSlot = { render?: boolean | string; required?: boolean; }; export interface Transformer { findSchema(node: Node, config: Config): Schema | undefined; node(node: Node, config: Config): MaybePromise; attributes(node: Node, config: Config): Record; children(node: Node, config: Config): RenderableTreeNode[]; } export type ValidationError = { id: string; level: 'debug' | 'info' | 'warning' | 'error' | 'critical'; message: string; location?: Location; }; export type ValidateError = { type: string; lines: number[]; location?: Location; error: ValidationError; }; export type ValidationType = CustomAttributeType | typeof String | typeof Number | typeof Boolean | typeof Object | typeof Array | 'String' | 'Number' | 'Boolean' | 'Object' | 'Array'; export type Value = AstType | Scalar; export type ParserArgs = { file?: string; slots?: boolean; location?: boolean; conditionalTags?: string[]; }; //# sourceMappingURL=types.d.ts.map