@glimmer/compiler

  • Version 0.56.2
  • Published
  • 2.02 MB
  • 5 dependencies
  • MIT license

Install

npm i @glimmer/compiler
yarn add @glimmer/compiler
pnpm add @glimmer/compiler

Overview

Overview not available.

Index

Variables

variable defaultId

const defaultId: TemplateIdFn;

    variable NEWLINE

    const NEWLINE: string;

      Functions

      function buildStatement

      buildStatement: (
      normalized: NormalizedStatement,
      symbols?: Symbols
      ) => WireFormat.Statement[];

        function buildStatements

        buildStatements: (
        statements: BuilderStatement[],
        symbols: Symbols
        ) => WireFormat.Statement[];

          function c

          c: (arr: TemplateStringsArray, ...interpolated: unknown[]) => BuilderComment;

            function locationToOffset

            locationToOffset: (source: string, line: number, column: number) => any;

              function offsetToLocation

              offsetToLocation: (source: string, offset: number) => any;

                function precompile

                precompile: (string: string, options?: PrecompileOptions) => any;

                  function s

                  s: (
                  arr: TemplateStringsArray,
                  ...interpolated: unknown[]
                  ) => [Builder.Literal, string];

                    function unicode

                    unicode: (charCode: string) => string;

                      Classes

                      class ProgramSymbols

                      class ProgramSymbols implements Symbols {}

                        property top

                        top: ProgramSymbols;

                          method arg

                          arg: (name: string) => number;

                            method block

                            block: (name: string) => number;

                              method child

                              child: (locals: string[]) => LocalSymbols;

                                method freeVar

                                freeVar: (name: string) => number;

                                  method hasLocal

                                  hasLocal: (_name: string) => false;

                                    method local

                                    local: (name: string) => never;

                                      method symbol

                                      symbol: (name: string) => number;

                                        method this

                                        this: () => number;

                                          method toSymbols

                                          toSymbols: () => string[];

                                            method toUpvars

                                            toUpvars: () => string[];

                                              class TemplateCompiler

                                              class TemplateCompiler implements Processor<InputOps> {}

                                                constructor

                                                constructor(source: string);

                                                  method attribute

                                                  attribute: (
                                                  [action]: [AST.AttrNode],
                                                  isComponent: boolean,
                                                  elementNode: any
                                                  ) => void;

                                                    method block

                                                    block: ([action]: [AST.BlockStatement]) => void;

                                                      method BooleanLiteral

                                                      BooleanLiteral: (action: any) => void;

                                                        method closeElement

                                                        closeElement: ([action]: [AST.ElementNode]) => void;

                                                          method comment

                                                          comment: ([action]: [AST.CommentStatement]) => void;

                                                            method compile

                                                            static compile: (ast: any, source: string, options?: CompileOptions) => Template;

                                                              method cursor

                                                              cursor: () => string;

                                                                method debugger

                                                                debugger: (_name: string, action: any) => void;

                                                                  method endBlock

                                                                  endBlock: () => void;

                                                                    method endProgram

                                                                    endProgram: () => void;

                                                                      method hasBlock

                                                                      hasBlock: (name: string, action: any) => void;

                                                                        method hasBlockParams

                                                                        hasBlockParams: (name: string, action: any) => void;

                                                                          method helperCall

                                                                          helperCall: (call: any, node: any) => void;

                                                                            method keyword

                                                                            keyword: (action: any) => void;

                                                                              method location

                                                                              location: (node: any) => SourceLocation | null;

                                                                                method meta

                                                                                meta: (node: any) => (string | (string | number[] | null)[])[];

                                                                                  method modifier

                                                                                  modifier: ([action]: [AST.ElementModifierStatement]) => void;

                                                                                    method mustache

                                                                                    mustache: ([mustache]: [AST.MustacheStatement]) => void;

                                                                                      method mustacheCall

                                                                                      mustacheCall: (call: any) => void;

                                                                                        method NullLiteral

                                                                                        NullLiteral: (action: any) => void;

                                                                                          method NumberLiteral

                                                                                          NumberLiteral: (action: any) => void;

                                                                                            method opcode

                                                                                            opcode: <O extends Ops<AllocateSymbolsOps>>(opcode: O, action?: any) => void;

                                                                                              method openElement

                                                                                              openElement: ([action]: [AST.ElementNode]) => void;

                                                                                                method partial

                                                                                                partial: (_params: AST.Expression[], action: any) => void;

                                                                                                  method PathExpression

                                                                                                  PathExpression: (expr: any) => void;

                                                                                                    method prepareAttributeValue

                                                                                                    prepareAttributeValue: (value: any) => value is any;

                                                                                                      method prepareConcatParts

                                                                                                      prepareConcatParts: (parts: any) => void;

                                                                                                        method prepareHash

                                                                                                        prepareHash: (
                                                                                                        hash: any,
                                                                                                        context: 'helper' | 'modifier' | 'block' | 'in-element'
                                                                                                        ) => void;

                                                                                                          method prepareHelper

                                                                                                          prepareHelper: (
                                                                                                          expr: any,
                                                                                                          context: 'helper' | 'modifier' | 'block' | 'in-element'
                                                                                                          ) => void;

                                                                                                            method prepareParams

                                                                                                            prepareParams: (params: AST.Expression[]) => void;

                                                                                                              method process

                                                                                                              process: (
                                                                                                              actions: Action[]
                                                                                                              ) => {
                                                                                                              opcodes: readonly Ops<AllocateSymbolsOps>[];
                                                                                                              locations: readonly Option<SourceLocation>[];
                                                                                                              };

                                                                                                                method startBlock

                                                                                                                startBlock: ([program]: [AST.Block]) => void;

                                                                                                                  method startProgram

                                                                                                                  startProgram: ([program]: [AST.Template]) => void;

                                                                                                                    method StringLiteral

                                                                                                                    StringLiteral: (action: any) => void;

                                                                                                                      method SubExpression

                                                                                                                      SubExpression: (expr: any) => void;

                                                                                                                        method text

                                                                                                                        text: ([action]: [AST.TextNode]) => void;

                                                                                                                          method UndefinedLiteral

                                                                                                                          UndefinedLiteral: (action: any) => void;

                                                                                                                            method yield

                                                                                                                            yield: (to: string, action: any) => void;

                                                                                                                              class TemplateVisitor

                                                                                                                              class TemplateVisitor {}

                                                                                                                                property actions

                                                                                                                                actions: Action.Action[];

                                                                                                                                  method anyBlock

                                                                                                                                  anyBlock: (program: AST.Block | AST.Template) => void;

                                                                                                                                    method AttrNode

                                                                                                                                    AttrNode: (attr: any) => void;

                                                                                                                                      method Block

                                                                                                                                      Block: (program: any) => void;

                                                                                                                                        method BlockStatement

                                                                                                                                        BlockStatement: (node: any) => void;

                                                                                                                                          method CommentStatement

                                                                                                                                          CommentStatement: (text: any) => void;

                                                                                                                                            method ElementNode

                                                                                                                                            ElementNode: (element: any) => void;

                                                                                                                                              method MustacheCommentStatement

                                                                                                                                              MustacheCommentStatement: () => void;

                                                                                                                                                method MustacheStatement

                                                                                                                                                MustacheStatement: (mustache: any) => void;

                                                                                                                                                  method PartialStatement

                                                                                                                                                  PartialStatement: (node: any) => void;

                                                                                                                                                    method Template

                                                                                                                                                    Template: (program: any) => void;

                                                                                                                                                      method TextNode

                                                                                                                                                      TextNode: (text: any) => void;

                                                                                                                                                        method visit

                                                                                                                                                        visit: <S extends any>(node: S) => void;

                                                                                                                                                          class WireFormatDebugger

                                                                                                                                                          class WireFormatDebugger {}

                                                                                                                                                            constructor

                                                                                                                                                            constructor(program: any, _parameters?: number[]);

                                                                                                                                                              method format

                                                                                                                                                              format: () => unknown;

                                                                                                                                                                method formatOpcode

                                                                                                                                                                formatOpcode: (opcode: any) => unknown;

                                                                                                                                                                  Interfaces

                                                                                                                                                                  interface PrecompileOptions

                                                                                                                                                                  interface PrecompileOptions extends CompileOptions, PreprocessOptions {}

                                                                                                                                                                    property id

                                                                                                                                                                    id?: TemplateIdFn;

                                                                                                                                                                      Enums

                                                                                                                                                                      enum Builder

                                                                                                                                                                      const enum Builder {
                                                                                                                                                                      Literal = 0,
                                                                                                                                                                      Comment = 1,
                                                                                                                                                                      Append = 2,
                                                                                                                                                                      Modifier = 3,
                                                                                                                                                                      DynamicComponent = 4,
                                                                                                                                                                      Get = 5,
                                                                                                                                                                      Concat = 6,
                                                                                                                                                                      HasBlock = 7,
                                                                                                                                                                      HasBlockParams = 8,
                                                                                                                                                                      }

                                                                                                                                                                        member Append

                                                                                                                                                                        Append = 2

                                                                                                                                                                          member Comment

                                                                                                                                                                          Comment = 1

                                                                                                                                                                            member Concat

                                                                                                                                                                            Concat = 6

                                                                                                                                                                              member DynamicComponent

                                                                                                                                                                              DynamicComponent = 4

                                                                                                                                                                                member Get

                                                                                                                                                                                Get = 5

                                                                                                                                                                                  member HasBlock

                                                                                                                                                                                  HasBlock = 7

                                                                                                                                                                                    member HasBlockParams

                                                                                                                                                                                    HasBlockParams = 8

                                                                                                                                                                                      member Literal

                                                                                                                                                                                      Literal = 0

                                                                                                                                                                                        member Modifier

                                                                                                                                                                                        Modifier = 3

                                                                                                                                                                                          Type Aliases

                                                                                                                                                                                          type BuilderStatement

                                                                                                                                                                                          type BuilderStatement =
                                                                                                                                                                                          | VerboseStatement
                                                                                                                                                                                          | SugaryArrayStatement
                                                                                                                                                                                          | TupleBuilderExpression
                                                                                                                                                                                          | string;

                                                                                                                                                                                            Package Files (8)

                                                                                                                                                                                            Dependencies (5)

                                                                                                                                                                                            Dev Dependencies (1)

                                                                                                                                                                                            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/@glimmer/compiler.

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