Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ScriptHandler

Index

Constructors

constructor

  • new ScriptHandler(code?: string, options?: Object): ScriptHandler

Properties

ast

ast: File

code

code: string

dirty

dirty: boolean = false

state

state: {}

Type declaration

  • [name: string]: string | number | Array<string>

Methods

default

export

  • export(specifier?: string | {}): this

from

  • from(source: string): this

froms

generate

  • generate(): string

import

  • import(specifier: string | {}): this
  • 引入

    example

    $js.import('*').from('./u-button.vue'); $js.import('UButton').from('./u-button.vue'); $js.import({ default: 'UButton', UButton2: '', UButton3: 'UButton3' }).from('./u-button.vue');

    Parameters

    • specifier: string | {}

      指示符

    Returns this

imports

merge

mergeArray

  • mergeArray(thisArray: ArrayExpression, thatArray: ArrayExpression): {}

mergeFunction

  • mergeFunction(thisFunction: ObjectMethod | FunctionExpression | ArrowFunctionExpression, thatFunction: ObjectMethod | FunctionExpression | ArrowFunctionExpression): {}
  • 没有管 params 不相同的情况

    Parameters

    • thisFunction: ObjectMethod | FunctionExpression | ArrowFunctionExpression
    • thatFunction: ObjectMethod | FunctionExpression | ArrowFunctionExpression

    Returns {}

    • [key: string]: {}
      • [old: string]: string

mergeObject

  • mergeObject(thisObject: ObjectExpression, thatObject: ObjectExpression): {}

mergeVueObject

  • mergeVueObject(thisObject: ObjectExpression, thatObject: ObjectExpression): {}

parse

  • parse(code: string): File

resetState

  • resetState(): void

variables

Generated using TypeDoc