Home Reference Source Test
import Component from 'web-cell-cli/source/Component.js'
public class | source

Component

Component packer

Test:

Static Method Summary

Static Public Methods
public static
public static
public static

packJS(path: String): String

public static

async parseCSS(source: string, type: string, base: string): Element

public static

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

entry: *

public

name: *

public

path: *

Method Summary

Public Methods
public
public

async toJS(): string

Protected Methods
protected

async assetOf(file: String): String

Static Public Methods

public static findStyle(fragment: DocumentFragment): Element[] source

Params:

NameTypeAttributeDescription
fragment DocumentFragment

Return:

Element[]

Test:

public static identifierOf(tagName: string): string source

Params:

NameTypeAttributeDescription
tagName string

Return:

string

Test:

public static packJS(path: String): String source

Params:

NameTypeAttributeDescription
path String

Full name of a JS file

Return:

String

Packed JS source code

Test:

public static async parseCSS(source: string, type: string, base: string): Element source

Params:

NameTypeAttributeDescription
source string

File path or Style source code

type string
  • nullable: true

MIME type

base string
  • optional

Path of the file which @import located in

Return:

Element (nullable: true)

Style element

Test:

public static async parseHTML(path: string): DocumentFragment source

Params:

NameTypeAttributeDescription
path string

Test:

Public Constructors

public constructor(path: string) source

Params:

NameTypeAttributeDescription
path string

Component directory

Public Members

public entry: * source

public name: * source

public path: * source

Public Methods

public async toHTML(): DocumentFragment source

Return:

DocumentFragment

HTML version bundle of this component

Test:

public async toJS(): string source

Return:

string

JS version bundle of this component

Test:

Protected Methods

protected async assetOf(file: String): String source

Params:

NameTypeAttributeDescription
file String

File path

Return:

String

Legal ECMAScript source code