import { FromStringOptions } from "./FromStringOptions"; import { AnyKeysOf, Grammar, TermsDefinition } from "./Grammar"; /** * Object used to define a microgrammar */ export interface MicrogrammarDefinition { /** * Phrase defining how the terms should appear, including * literals, if specified. * A phrase is of form "method ${name}(): ${returnType}". */ phrase?: string; /** * Definitions of the productions in this grammar */ terms?: TermsDefinition; /** * Configure special characters in fromString. * Defaults to: * { * ellipsis: "...", * componentPrefix: "$", // so terms are designated like ${name} * } */ options?: FromStringOptions; } /** * Create a microgrammar return matches with properties according * to the given interface. * @param definition full definition, including a phrase string, or terms definition * @return {Grammar} */ export declare function microgrammar(definition: MicrogrammarDefinition | TermsDefinition): Grammar; /** * Create a microgrammar with return matches implementing an inferred interface * taking properties of type "any" from definitions. * Use microgrammar for stronger typing. * @return {Grammar} */ export declare function simpleMicrogrammar(definition: MicrogrammarDefinition | TermsDefinition): Grammar>;