/** * VisualFormat * * @namespace VisualFormat */ declare class VisualFormat { /** * Parses a single line of vfl into an array of constraint definitions. * * When the visual-format could not be succesfully parsed an exception is thrown containing * additional info about the parse error and column position. * * @param {String} visualFormat Visual format string (cannot contain line-endings!). * @param {Object} [options] Configuration options. * @param {Boolean} [options.extended] When set to true uses the extended syntax (default: false). * @param {String} [options.outFormat] Output format (`constraints` or `raw`) (default: `constraints`). * @param {Number} [options.lineIndex] Line-index used when auto generating equal-spacing constraints. * @return {Array} Array of constraint definitions. */ static parseLine(visualFormat: any, options: any): any[]; /** * Parses one or more visual format strings into an array of constraint definitions. * * When the visual-format could not be succesfully parsed an exception is thrown containing * additional info about the parse error and column position. * * @param {String|Array} visualFormat One or more visual format strings. * @param {Object} [options] Configuration options. * @param {Boolean} [options.extended] When set to true uses the extended syntax (default: false). * @param {Boolean} [options.strict] When set to false trims any leading/trailing spaces and ignores empty lines (default: true). * @param {String} [options.lineSeparator] String that defines the end of a line (default `\n`). * @param {String} [options.outFormat] Output format (`constraints` or `raw`) (default: `constraints`). * @return {Array} Array of constraint definitions. */ static parse(visualFormat: any, options: any): any[]; /** * Parses meta information from the comments in the VFL. * * Additional meta information can be specified in the comments * for previewing and rendering purposes. For instance, the view-port * aspect-ratio, sub-view widths and colors, can be specified. The * following example renders three colored circles in the visual-format editor: * * ```vfl * //viewport aspect-ratio:3/1 max-height:300 * //colors red:#FF0000 green:#00FF00 blue:#0000FF * //shapes red:circle green:circle blue:circle * H:|-[row:[red(green,blue)]-[green]-[blue]]-| * V:|[row]| * ``` * * Supported categories and properties: * * |Category|Property|Example| * |--------|--------|-------| * |`viewport`|`aspect-ratio:{width}/{height}`|`//viewport aspect-ratio:16/9`| * ||`width:[{number}/intrinsic]`|`//viewport width:10`| * ||`height:[{number}/intrinsic]`|`//viewport height:intrinsic`| * ||`min-width:{number}`| * ||`max-width:{number}`| * ||`min-height:{number}`| * ||`max-height:{number}`| * |`spacing`|`[{number}/array]`|`//spacing:8` or `//spacing:[10, 20, 5]`| * |`widths`|`{view-name}:[{number}/intrinsic]`|`//widths subview1:100`| * |`heights`|`{view-name}:[{number}/intrinsic]`|`//heights subview1:intrinsic`| * |`colors`|`{view-name}:{color}`|`//colors redview:#FF0000 blueview:#00FF00`| * |`shapes`|`{view-name}:[circle/square]`|`//shapes avatar:circle`| * * @param {String|Array} visualFormat One or more visual format strings. * @param {Object} [options] Configuration options. * @param {String} [options.lineSeparator] String that defines the end of a line (default `\n`). * @param {String} [options.prefix] When specified, also processes the categories using that prefix (e.g. "-dev-viewport max-height:10"). * @return {Object} meta-info */ static parseMetaInfo(visualFormat: any, options?: any): { viewport?: Record; widths?: Record; heights?: Record; spacing?: any; }; } export default VisualFormat; //# sourceMappingURL=VisualFormat.d.ts.map