Skip to main content

HotStaq

hotstaq / Modules / HotStaq

Class: HotStaq

The main class that handles all HTML preprocessing, then outputs the results.

Implements​

Table of contents​

Constructors​

Properties​

Methods​

Constructors​

constructor​

• new HotStaq(copy?)

Parameters​

NameType
copyIHotStaq

Defined in​

HotStaq.ts:440

Properties​

api​

• api: HotAPI

The api that's used to communicate with.

Implementation of​

IHotStaq.api

Defined in​

HotStaq.ts:394


apiContent​

• apiContent: string

The api content to use when about to load HotStaq.

Defined in​

HotStaq.ts:418


components​

• components: Object

The components that can be constructed.

Index signature​

â–ª [name: string]: HotComponent

Implementation of​

IHotStaq.components

Defined in​

HotStaq.ts:406


files​

• files: Object

The files that can be stored for later use.

Index signature​

â–ª [name: string]: HotFile

Implementation of​

IHotStaq.files

Defined in​

HotStaq.ts:410


hotSite​

• hotSite: HotSite

The loaded hotsite.

Implementation of​

IHotStaq.hotSite

Defined in​

HotStaq.ts:414


logger​

• logger: HotLog

The logger.

Defined in​

HotStaq.ts:430


mode​

• mode: DeveloperMode

Indicates what type of execution this is.

Implementation of​

IHotStaq.mode

Defined in​

HotStaq.ts:390


pageContent​

• pageContent: string

The page content to use when about to load HotStaq.

Defined in​

HotStaq.ts:426


pages​

• pages: Object

The pages that can be constructed.

Index signature​

â–ª [name: string]: HotPage

Implementation of​

IHotStaq.pages

Defined in​

HotStaq.ts:402


publicSecrets​

• publicSecrets: any

The secrets that can be exposed publicly.

Defined in​

HotStaq.ts:434


testerAPI​

• testerAPI: HotAPI

The tester api that's used to communicate with.

Implementation of​

IHotStaq.testerAPI

Defined in​

HotStaq.ts:398


testerApiContent​

• testerApiContent: string

The tester api content to use when about to load HotStaq.

Defined in​

HotStaq.ts:422


testers​

• testers: Object

The secrets that can be exposed publicly.

Index signature​

â–ª [name: string]: HotTester

Defined in​

HotStaq.ts:438


isReadyForTesting​

â–ª Static isReadyForTesting: boolean = false

Indicates if this is ready for testing.

Defined in​

HotStaq.ts:382


isWeb​

â–ª Static isWeb: boolean = false

Indicates if this is a web build.

Defined in​

HotStaq.ts:378


onReadyForTesting​

â–ª Static onReadyForTesting: () => Promise<void> = null

Type declaration​

â–¸ (): Promise<void>

Executes this event when this page is ready for testing.

Returns​

Promise<void>

Defined in​

HotStaq.ts:386

Methods​

addComponent​

â–¸ addComponent(component): void

Add and register a component.

Parameters​

NameType
componentHotComponent

Returns​

void

Defined in​

HotStaq.ts:676


addFile​

â–¸ addFile(file): void

Add a file.

Parameters​

NameType
fileHotFile

Returns​

void

Defined in​

HotStaq.ts:649


addPage​

â–¸ addPage(page): void

Add a page.

Parameters​

NameType
pageHotPage

Returns​

void

Defined in​

HotStaq.ts:633


addTester​

â–¸ addTester(tester): void

Add a tester for use later.

Parameters​

NameType
testerHotTester

Returns​

void

Defined in​

HotStaq.ts:1451


createExpressRoutes​

â–¸ createExpressRoutes(expressApp, jsSrcPath?): void

Create the Express routes from the given pages. Be sure to load the pages first before doing this. This method is meant to be used for customized Express applications. If you wish to use the loaded routes from this HotStaq object with HotHTTPServer, be sure to use the loadHotSite method in HotHTTPServer.

Parameters​

NameTypeDefault value
expressAppanyundefined
jsSrcPathstring"./js/HotStaq.js"

Returns​

void

Defined in​

HotStaq.ts:1434


executeAllAPITests​

â–¸ executeAllAPITests(testerName): Promise<void>

Execute all api tests from the HotSite testing api object.

Parameters​

NameTypeDescription
testerNamestringThe tester to use to execute tests.

Returns​

Promise<void>

Defined in​

HotStaq.ts:1580


executeAllWebTests​

â–¸ executeAllWebTests(testerName): Promise<void>

Execute all web tests from the HotSite testing web object.

Parameters​

NameTypeDescription
testerNamestringThe tester to use to execute tests.

Returns​

Promise<void>

Defined in​

HotStaq.ts:1559


executeTests​

â–¸ executeTests(testerName, mapName): Promise<void>

Execute tests.

Parameters​

NameTypeDescription
testerNamestringThe tester to use to execute tests.
mapNamestringThe map or maps to use to navigate through tests.

Returns​

Promise<void>

Defined in​

HotStaq.ts:1544


generateContent​

â–¸ generateContent(routeKey, name?, url?, jsSrcPath?, passArgs?, args?): string

Generate the content to send to a client.

Parameters​

NameTypeDefault value
routeKeystringundefined
namestring""
urlstring"./"
jsSrcPathstring"./js/HotStaq.js"
passArgsbooleantrue
argsanynull

Returns​

string

Defined in​

HotStaq.ts:1149


getAPITestingMaps​

â–¸ getAPITestingMaps(): string[]

Get the list of maps for testing from the HotSite.

Returns​

string[]

Defined in​

HotStaq.ts:1479


getComponent​

â–¸ getComponent(name): HotComponent

Get a component to process.

Parameters​

NameType
namestring

Returns​

HotComponent

Defined in​

HotStaq.ts:746


getFile​

â–¸ getFile(name): HotFile

Get a file.

Parameters​

NameType
namestring

Returns​

HotFile

Defined in​

HotStaq.ts:665


getPage​

â–¸ getPage(pageName): HotPage

Get a page to process.

Parameters​

NameType
pageNamestring

Returns​

HotPage

Defined in​

HotStaq.ts:641


getRouteFromName​

â–¸ getRouteFromName(name): HotSiteRoute

Get a route from a route's name.

Parameters​

NameType
namestring

Returns​

HotSiteRoute

Defined in​

HotStaq.ts:1527


getRouteKeyFromName​

â–¸ getRouteKeyFromName(name): string

Get a route's key from a route's name.

Parameters​

NameType
namestring

Returns​

string

Defined in​

HotStaq.ts:1499


getWebTestingMaps​

â–¸ getWebTestingMaps(): string[]

Get the list of maps for testing from the HotSite.

Returns​

string[]

Defined in​

HotStaq.ts:1459


loadHotFiles​

â–¸ loadHotFiles(files, forceContentLoading?): Promise<void>

Load an array of files. If a file already has content, it will not be reloaded unless forceContentLoading is set to true.

Parameters​

NameTypeDefault value
filesObjectundefined
forceContentLoadingbooleanfalse

Returns​

Promise<void>

Defined in​

HotStaq.ts:1098


loadHotSite​

â–¸ loadHotSite(path): Promise<void>

Load from a HotSite.json file. Be sure to load and attach any testers before loading a HotSite.

Parameters​

NameType
pathstring

Returns​

Promise<void>

Defined in​

HotStaq.ts:862


process​

â–¸ process(pageName, args?): Promise<string>

Process a page and get the result.

Parameters​

NameTypeDefault value
pageNamestringundefined
argsanynull

Returns​

Promise<string>

Defined in​

HotStaq.ts:1599


registerComponent​

â–¸ registerComponent(component): void

Register a component for use as a HTML tag.

Parameters​

NameType
componentHotComponent

Returns​

void

Defined in​

HotStaq.ts:685


addHtml​

â–¸ Static addHtml(parent, html): HTMLElement | HTMLElement[]

Add a new HTML element(s) to the current document.

Parameters​

NameType
parentstring | HTMLElement
htmlstring | HTMLElement

Returns​

HTMLElement | HTMLElement[]

Defined in​

HotStaq.ts:754


checkHotSiteName​

â–¸ Static checkHotSiteName(hotsiteName, throwException?): boolean

Check if a HotSite's name is valid.

Parameters​

NameTypeDefault value
hotsiteNamestringundefined
throwExceptionbooleanfalse

Returns​

boolean

Defined in​

HotStaq.ts:791


displayContent​

â–¸ Static displayContent(content, name, processor?): Promise<HotStaq>

Process and replace the current HTML page with the hott script. This is meant for web browser use only.

Parameters​

NameTypeDefault value
contentstringundefined
namestringundefined
processorHotStaqnull

Returns​

Promise<HotStaq>

Defined in​

HotStaq.ts:1864


displayUrl​

â–¸ Static displayUrl(url, name?, processor?, args?): Promise<HotStaq>

Process and replace the current HTML page with the hott script from the given url. This is meant for web browser use only.

Parameters​

NameTypeDefault value
urlstring | HotStartOptionsundefined
namestringnull
processorHotStaqnull
argsanynull

Returns​

Promise<HotStaq>

Defined in​

HotStaq.ts:1714


getParam​

â–¸ Static getParam(name, objWithParam, required?, throwException?): any

Check if a required parameter exists inside an object. If it exists, return the value.

Parameters​

NameTypeDefault value
namestringundefined
objWithParamanyundefined
requiredbooleantrue
throwExceptionbooleantrue

Returns​

any

Defined in​

HotStaq.ts:568


getParamDefault​

â–¸ Static getParamDefault(name, objWithParam, defaultValue): any

Check if a required parameter exists inside an object. If it exists, return the value. If it does not exist, return a default value instead.

Parameters​

NameType
namestring
objWithParamany
defaultValueany

Returns​

any

Defined in​

HotStaq.ts:600


getValueFromHotSiteObj​

â–¸ Static getValueFromHotSiteObj(hotsite, params): any

Get a value from a HotSite object.

Parameters​

NameType
hotsiteHotSite
paramsstring[]

Returns​

any

Returns the value from the hotsite object. Returns null if it doesn't exist.

Defined in​

HotStaq.ts:827


onReady​

â–¸ Static onReady(readyFunc): void

When the window has finished loading, execute the function. This is meant for web browser use only.

Parameters​

NameType
readyFunc() => void

Returns​

void

Defined in​

HotStaq.ts:1676


parseBoolean​

â–¸ Static parseBoolean(value): boolean

Parse a boolean value.

Parameters​

NameType
valuestring

Returns​

boolean

Defined in​

HotStaq.ts:531


processContent​

â–¸ Static processContent(processor, content, name, args?): Promise<string>

Process content and get the result.

Parameters​

NameTypeDefault value
processorHotStaqundefined
contentstringundefined
namestringundefined
argsanynull

Returns​

Promise<string>

Defined in​

HotStaq.ts:1654


processLocalFile​

â–¸ Static processLocalFile(localFilepath, name?, args?): Promise<string>

Process a local file and get the result.

Parameters​

NameTypeDefault value
localFilepathstringundefined
namestringlocalFilepath
argsanynull

Returns​

Promise<string>

Defined in​

HotStaq.ts:1610


processUrl​

â–¸ Static processUrl(options): Promise<string>

Process a url and get the result.

Parameters​

NameType
optionsHotStartOptions

Returns​

Promise<string>

Defined in​

HotStaq.ts:1631


replaceKey​

â–¸ Static replaceKey(content, key, value): string

In the supplied content, replace a key in a ${KEY} with a value.

Parameters​

NameType
contentstring
keystring
valuestring

Returns​

string

The content with the correct values.

Defined in​

HotStaq.ts:815


useOutput​

â–¸ Static useOutput(output): void

Replace the current HTML page with the output. This is meant for web browser use only.

Parameters​

NameType
outputstring

Returns​

void

Defined in​

HotStaq.ts:1688


wait​

â–¸ Static wait(numMilliseconds): Promise<void>

Wait for a number of milliseconds.

Parameters​

NameType
numMillisecondsnumber

Returns​

Promise<void>

Defined in​

HotStaq.ts:619


waitForTesters​

â–¸ Static waitForTesters(): Promise<void>

Wait for testers to load.

fixme This does not wait for ALL testers to finish loading. Only the first one.

Returns​

Promise<void>

Defined in​

HotStaq.ts:1701