@sujalchoudhari/solaris-ui
Version:
A UI framework to create HTML pages with just JavaScript.
43 lines (42 loc) • 1.03 kB
TypeScript
/**
* Script
* -----
* Script is an representation of Javascript scripts in html
* @author Ansh Sharma
*/
export default class Script {
/**
* The actual string of script
*/
script: string;
/**
* The URL of the Script.
* only used when external is selected as type of script
*/
url: string;
/**
* The Type of the script
*/
type: string;
/**
* The Parameters of the script
*/
params: {
[key: string]: string;
};
/**
* Create a new instance of Script
* @param type the type of the script either external or infile
* @param url the url of an external source script
* @param script the actual script when url is specified
* @param params the parameters of the script
*/
constructor(type: "infile" | "external", url?: string, script?: string, params?: {
[key: string]: string;
});
/**
* Get the script as a string
* @returns the script as a string
*/
toString(): string;
}