Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ToPHPCompiler

Hierarchy

  • ToPHPCompiler

Implements

  • Compiler

Index

Constructors

constructor

Properties

Private phpTranspiler

phpTranspiler: PHPTranspiler

Private project

project: SanProject

Private tsRoot

tsRoot: string

Methods

compileToSource

  • compileToSource(sourceFile: SanSourceFile, options: CompileOptions): string

Private emitComponent

Private emitRenderer

Private normalizeCompilerOptions

  • normalizeCompilerOptions(compilerOptions: CompilerOptions): CompilerOptions
  • 归一化 tsconfig 里的 compilerOptions 比如,把相对路径的 baseUrl 改绝对,否则传递下去工作路径的信息就丢失了。

    Parameters

    • compilerOptions: CompilerOptions

    Returns CompilerOptions

Static emitHelpers

  • emitHelpers(__namedParameters?: { emitHeader: boolean; namespace: string }): string
  • 产出一份 runtime 代码 配合 compileToSource importHelpers 参数来避免每份组件都包含一份 helpers

    Parameters

    • Default value __namedParameters: { emitHeader: boolean; namespace: string } = {}
      • emitHeader: boolean

        是否输出 <?php

      • namespace: string

        产出 helper 的命名空间,默认值是 "san\runtime"

    Returns string

Static fromSanProject

Generated using TypeDoc