@types/acorn

  • Version 4.0.6
  • Published
  • 9.88 kB
  • 1 dependency
  • MIT license

Install

npm i @types/acorn
yarn add @types/acorn
pnpm add @types/acorn

Overview

TypeScript definitions for Acorn

Index

Variables

variable defaultOptions

const defaultOptions: Options;

    variable lineBreak

    const lineBreak: RegExp;

      variable lineBreakG

      const lineBreakG: RegExp;

        variable LooseParser

        let LooseParser: ILooseParserClass;

          variable parse

          const parse: IParse;

            variable parse_dammit

            let parse_dammit: IParse;

              variable plugins

              const plugins: PluginsObject;

                variable pluginsLoose

                let pluginsLoose: PluginsObject;

                  variable tokContexts

                  const tokContexts: {
                  b_stat: TokContext;
                  b_expr: TokContext;
                  b_tmpl: TokContext;
                  p_stat: TokContext;
                  p_expr: TokContext;
                  q_tmpl: TokContext;
                  f_expr: TokContext;
                  };

                    variable tokTypes

                    const tokTypes: {
                    num: TokenType;
                    regexp: TokenType;
                    string: TokenType;
                    name: TokenType;
                    eof: TokenType;
                    bracketL: TokenType;
                    bracketR: TokenType;
                    braceL: TokenType;
                    braceR: TokenType;
                    parenL: TokenType;
                    parenR: TokenType;
                    comma: TokenType;
                    semi: TokenType;
                    colon: TokenType;
                    dot: TokenType;
                    question: TokenType;
                    arrow: TokenType;
                    template: TokenType;
                    ellipsis: TokenType;
                    backQuote: TokenType;
                    dollarBraceL: TokenType;
                    eq: TokenType;
                    assign: TokenType;
                    incDec: TokenType;
                    prefix: TokenType;
                    logicalOR: TokenType;
                    logicalAND: TokenType;
                    bitwiseOR: TokenType;
                    bitwiseXOR: TokenType;
                    bitwiseAND: TokenType;
                    equality: TokenType;
                    relational: TokenType;
                    bitShift: TokenType;
                    plusMin: TokenType;
                    modulo: TokenType;
                    star: TokenType;
                    slash: TokenType;
                    starstar: TokenType;
                    _break: TokenType;
                    _case: TokenType;
                    _catch: TokenType;
                    _continue: TokenType;
                    _debugger: TokenType;
                    _default: TokenType;
                    _do: TokenType;
                    _else: TokenType;
                    _finally: TokenType;
                    _for: TokenType;
                    _function: TokenType;
                    _if: TokenType;
                    _return: TokenType;
                    _switch: TokenType;
                    _throw: TokenType;
                    _try: TokenType;
                    _var: TokenType;
                    _const: TokenType;
                    _while: TokenType;
                    _with: TokenType;
                    _new: TokenType;
                    _this: TokenType;
                    _super: TokenType;
                    _class: TokenType;
                    _extends: TokenType;
                    _export: TokenType;
                    _import: TokenType;
                    _null: TokenType;
                    _true: TokenType;
                    _false: TokenType;
                    _in: TokenType;
                    _instanceof: TokenType;
                    _typeof: TokenType;
                    _void: TokenType;
                    _delete: TokenType;
                    };

                      variable version

                      const version: string;

                        Functions

                        function addLooseExports

                        addLooseExports: (
                        parse: IParse,
                        parser: ILooseParserClass,
                        plugins: PluginsObject
                        ) => void;

                          function getLineInfo

                          getLineInfo: (input: string, offset: number) => any;

                            function isIdentifierChar

                            isIdentifierChar: (code: number, astral?: boolean) => boolean;

                              function isIdentifierStart

                              isIdentifierStart: (code: number, astral?: boolean) => boolean;

                                function isNewLine

                                isNewLine: (code: number) => boolean;

                                  function parseExpressionAt

                                  parseExpressionAt: (input: string, pos?: number, options?: Options) => any;

                                    function tokenizer

                                    tokenizer: (input: string, options: Options) => ITokenizer;

                                      Classes

                                      class Node

                                      class Node {}

                                        constructor

                                        constructor(parser: Parser, pos: number, loc: number);

                                          property end

                                          end: number;

                                            property loc

                                            loc?: any;

                                              property range

                                              range?: [number, number];

                                                property sourceFile

                                                sourceFile?: string;

                                                  property start

                                                  start: number;

                                                    property type

                                                    type: string;

                                                      class Parser

                                                      class Parser {}

                                                        constructor

                                                        constructor(options: Options, input: string, startPos?: number);

                                                          method parse

                                                          parse: () => any;

                                                            class Position

                                                            class Position implements ESTree.Position {}

                                                              constructor

                                                              constructor(line: number, col: number);

                                                                property column

                                                                column: number;

                                                                  property line

                                                                  line: number;

                                                                    method offset

                                                                    offset: (n: number) => Position;

                                                                      class SourceLocation

                                                                      class SourceLocation implements ESTree.SourceLocation {}

                                                                        constructor

                                                                        constructor(p: Parser, start: Position, end: Position);

                                                                          property end

                                                                          end: Position;

                                                                            property source

                                                                            source?: string;

                                                                              property start

                                                                              start: Position;

                                                                                class TokContext

                                                                                class TokContext {}

                                                                                  constructor

                                                                                  constructor(
                                                                                  token: string,
                                                                                  isExpr: boolean,
                                                                                  preserveSpace: boolean,
                                                                                  override: (p: Parser) => void
                                                                                  );

                                                                                    class Token

                                                                                    class Token {}

                                                                                      constructor

                                                                                      constructor(p: Parser);

                                                                                        class TokenType

                                                                                        class TokenType {}

                                                                                          constructor

                                                                                          constructor(label: string, conf?: TokeTypeConfig);

                                                                                            property beforeExpr

                                                                                            beforeExpr: boolean;

                                                                                              property binop

                                                                                              binop: number;

                                                                                                property isAssign

                                                                                                isAssign: boolean;

                                                                                                  property isLoop

                                                                                                  isLoop: boolean;

                                                                                                    property keyword

                                                                                                    keyword: string;

                                                                                                      property label

                                                                                                      label: string;

                                                                                                        property postfix

                                                                                                        postfix: boolean;

                                                                                                          property prefix

                                                                                                          prefix: boolean;

                                                                                                            property startsExpr

                                                                                                            startsExpr: boolean;

                                                                                                              property updateContext

                                                                                                              updateContext: (prevType: TokenType) => void;

                                                                                                                Interfaces

                                                                                                                interface AbstractToken

                                                                                                                interface AbstractToken {}

                                                                                                                  property end

                                                                                                                  end: number;

                                                                                                                    property loc

                                                                                                                    loc?: SourceLocation | undefined;

                                                                                                                      property range

                                                                                                                      range?: [number, number] | undefined;

                                                                                                                        property start

                                                                                                                        start: number;

                                                                                                                          interface Comment

                                                                                                                          interface Comment extends AbstractToken {}

                                                                                                                            property type

                                                                                                                            type: string;

                                                                                                                              property value

                                                                                                                              value: string;

                                                                                                                                interface ILooseParser

                                                                                                                                interface ILooseParser {}

                                                                                                                                  interface ITokenizer

                                                                                                                                  interface ITokenizer {}

                                                                                                                                    method [Symbol.iterator]

                                                                                                                                    [Symbol.iterator]: () => Iterator<Token, any, undefined>;

                                                                                                                                      method getToken

                                                                                                                                      getToken: () => Token;

                                                                                                                                        interface Options

                                                                                                                                        interface Options {}

                                                                                                                                          property allowHashBang

                                                                                                                                          allowHashBang?: boolean | undefined;

                                                                                                                                            property allowImportExportEverywhere

                                                                                                                                            allowImportExportEverywhere?: boolean | undefined;

                                                                                                                                              property allowReserved

                                                                                                                                              allowReserved?: boolean | undefined;

                                                                                                                                                property allowReturnOutsideFunction

                                                                                                                                                allowReturnOutsideFunction?: boolean | undefined;

                                                                                                                                                  property directSourceFile

                                                                                                                                                  directSourceFile?: string | undefined;

                                                                                                                                                    property ecmaVersion

                                                                                                                                                    ecmaVersion?: 3 | 5 | 6 | 7 | 8 | 2015 | 2016 | 2017 | undefined;

                                                                                                                                                      property locations

                                                                                                                                                      locations?: boolean | undefined;

                                                                                                                                                        property onComment

                                                                                                                                                        onComment?:
                                                                                                                                                        | ((
                                                                                                                                                        isBlock: boolean,
                                                                                                                                                        text: string,
                                                                                                                                                        start: number,
                                                                                                                                                        end: number,
                                                                                                                                                        startLoc?: ESTree.Position,
                                                                                                                                                        endLoc?: ESTree.Position
                                                                                                                                                        ) => void)
                                                                                                                                                        | Comment[]
                                                                                                                                                        | undefined;

                                                                                                                                                          property onInsertedSemicolon

                                                                                                                                                          onInsertedSemicolon?:
                                                                                                                                                          | ((lastTokEnd: number, lastTokEndLoc?: ESTree.Position) => void)
                                                                                                                                                          | undefined;

                                                                                                                                                            property onToken

                                                                                                                                                            onToken?: ((token: Token) => any) | Token[] | undefined;

                                                                                                                                                              property onTrailingComma

                                                                                                                                                              onTrailingComma?:
                                                                                                                                                              | ((lastTokEnd: number, lastTokEndLoc?: ESTree.Position) => void)
                                                                                                                                                              | undefined;

                                                                                                                                                                property plugins

                                                                                                                                                                plugins?: PlainObject | undefined;

                                                                                                                                                                  property preserveParens

                                                                                                                                                                  preserveParens?: boolean | undefined;

                                                                                                                                                                    property program

                                                                                                                                                                    program?: ESTree.Program | undefined;

                                                                                                                                                                      property ranges

                                                                                                                                                                      ranges?: boolean | undefined;

                                                                                                                                                                        property sourceFile

                                                                                                                                                                        sourceFile?: string | undefined;

                                                                                                                                                                          property sourceType

                                                                                                                                                                          sourceType?: 'script' | 'module' | undefined;

                                                                                                                                                                            interface PlainObject

                                                                                                                                                                            interface PlainObject {}

                                                                                                                                                                              index signature

                                                                                                                                                                              [name: string]: any;

                                                                                                                                                                                interface PluginsObject

                                                                                                                                                                                interface PluginsObject {}

                                                                                                                                                                                  index signature

                                                                                                                                                                                  [name: string]: (p: Parser, config: any) => void;

                                                                                                                                                                                    interface Token

                                                                                                                                                                                    interface Token extends AbstractToken {}

                                                                                                                                                                                      property type

                                                                                                                                                                                      type: TokenType;

                                                                                                                                                                                        property value

                                                                                                                                                                                        value: any;

                                                                                                                                                                                          interface TokeTypeConfig

                                                                                                                                                                                          interface TokeTypeConfig {}

                                                                                                                                                                                            property beforeExpr

                                                                                                                                                                                            beforeExpr?: boolean | undefined;

                                                                                                                                                                                              property binop

                                                                                                                                                                                              binop?: number | undefined;

                                                                                                                                                                                                property isAssign

                                                                                                                                                                                                isAssign?: boolean | undefined;

                                                                                                                                                                                                  property isLoop

                                                                                                                                                                                                  isLoop?: boolean | undefined;

                                                                                                                                                                                                    property keyword

                                                                                                                                                                                                    keyword: string;

                                                                                                                                                                                                      property postfix

                                                                                                                                                                                                      postfix?: boolean | undefined;

                                                                                                                                                                                                        property prefix

                                                                                                                                                                                                        prefix?: boolean | undefined;

                                                                                                                                                                                                          property startsExpr

                                                                                                                                                                                                          startsExpr?: boolean | undefined;

                                                                                                                                                                                                            Type Aliases

                                                                                                                                                                                                            type ILooseParserClass

                                                                                                                                                                                                            type ILooseParserClass = new (input: string, options?: Options) => ILooseParser;

                                                                                                                                                                                                              type IParse

                                                                                                                                                                                                              type IParse = (input: string, options?: Options) => ESTree.Program;

                                                                                                                                                                                                                Package Files (1)

                                                                                                                                                                                                                Dependencies (1)

                                                                                                                                                                                                                Dev Dependencies (0)

                                                                                                                                                                                                                No dev dependencies.

                                                                                                                                                                                                                Peer Dependencies (0)

                                                                                                                                                                                                                No peer dependencies.

                                                                                                                                                                                                                Badge

                                                                                                                                                                                                                To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/acorn.

                                                                                                                                                                                                                • Markdown
                                                                                                                                                                                                                  [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/acorn)
                                                                                                                                                                                                                • HTML
                                                                                                                                                                                                                  <a href="https://www.jsdocs.io/package/@types/acorn"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>