3.1.6 • Published 6 months ago

@types/idyll-compiler v3.1.6

Weekly downloads
3
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/idyll-compiler

Summary

This package contains type definitions for idyll-compiler (https://github.com/idyll-lang/idyll/tree/master/packages/idyll-compiler).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/idyll-compiler.

index.d.ts

// Type definitions for idyll-compiler 3.1
// Project: https://github.com/idyll-lang/idyll/tree/master/packages/idyll-compiler, https://github.com/idyll-lang/idyll
// Definitions by: Thanh Ngo <https://github.com/iocat>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8

declare namespace compiler {
    type PropType = "variable" | "value" | "expression";
    type PropData = string | number | boolean;
    type PropKey = string;
    type PropValue = [PropType, PropData];
    type Property = [PropKey, PropValue];
    type __RecursiveNode<T> = [string, Property[], T[]];
    interface TreeNode extends __RecursiveNode<Node> {}
    type Node = TreeNode | string;
    type AST = Node[];

    type PostProcessor =
        | ((ast: AST) => AST)
        | ((ast: AST, callback: (err: any, value: AST) => void) => void);

    interface Options {
        spellcheck?: boolean | undefined;

        smartquotes?: boolean | undefined;

        /**
         * If false and there is no postprocessors, compiler returns the AST synchronously
         * Otherwise, a promise is returned
         *
         */
        async?: boolean | undefined;

        /**
         * compiler plugins
         * If provided, compiler always compiles asynchronously
         */
        postProcessors?: PostProcessor[] | undefined;
    }
}

/**
 * Compiles the given idyllMarkup and returns an AST either synchronously
 * or asynchronously.
 *
 * If postProcessors are provided or options.async is set to true:
 *      compiler returns a promise
 * Otherwise, compile returns the AST synchronously
 *
 */
declare function compiler(
    input: string,
    options?: compiler.Options,
    callback?: () => void
): Promise<compiler.AST> | compiler.AST;

export = compiler;

Additional Details

  • Last updated: Thu, 08 Jul 2021 14:23:06 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Thanh Ngo.

3.1.6

6 months ago

3.1.5

7 months ago

3.1.4

8 months ago

3.1.3

3 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

6 years ago