Namespace: codemelted_runtime

codemelted_runtime

Members

(static, readonly) browserName :string

Gets the name of the browser your page is running.
Type:
  • string
Source:

(static, readonly) eol :string

Gets the newline character specific to the operating system.
Type:
  • string
Source:

(static, readonly) hostname :string

Gets the hostname your page is running
Type:
  • string
Source:

(static, readonly) href :string

Gets the href of where your page is loaded.
Type:
  • string
Source:

(static, readonly) isDeno :boolean

Determines if the runtime is Deno.
Type:
  • boolean
Source:

(static, readonly) isDesktop :boolean

Identifies if you are on desktop or not.
Type:
  • boolean
Source:

(static, readonly) isMobile :boolean

Identifies if you are on mobile or not.
Type:
  • boolean
Source:

(static, readonly) isPWA :boolean

Determines if the running page is an installed Progressive Web App.
Type:
  • boolean
Source:

(static, readonly) isWeb :boolean

Determines if the runtime is Web Browser.
Type:
  • boolean
Source:

(static, readonly) osName :string

Gets the name of the operating system your page is running.
Type:
  • string
Source:

Methods

(static) addEventListener(params) → {void}

Adds an event listener either to the global object or to the specified event target.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Attributes Description
type string A case-sensitive string representing the event type to listen for.
listener EventListener Callback function to handle the event fired with optional receipt of an event object.
obj EventTarget <optional>
The optional EventTarget to attach the event vs. globalThis event listener.
Source:
Returns:
Type
void

(static) copyToClipboard(params) → {Promise.<void>}

Copies data to the system clipboard. Only available on the Web Browser runtime.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
data string The data to copy to the clipboard.
Source:
Throws:
If attempted on the Deno runtime.
Type
SyntaxError
Returns:
Of the copy action.
Type
Promise.<void>

(static) environment(params) → (nullable) {string}

Parses the environment for the given specified key.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
key string The items to search for.
Source:
Returns:
The value associated with the key or null if not found.
Type
string

(static) open(params) → {Promise.<(Window|null)>}

Loads a specified resource into a new or existing browsing context (that is, a tab, a window, or an iframe) under a specified name. These are based on the different scheme supported protocol items.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Attributes Default Description
scheme string Either "file:", "http://", "https://", "mailto:", "tel:", or "sms:".
popupWindow boolean <optional>
false true to open a new popup browser window. false to utilize the _target for browser behavior.
mailtoParams CMailToParams <optional>
Object to assist in the mailto: scheme URL construction.
url string <optional>
The url to utilize with the scheme.
target string <optional>
"_blank" The target to utilize when opening the scheme. Only valid when not utilizing popupWindow.
width number <optional>
The width to open the window with.
height number <optional>
The height to open the window with.
Source:
Returns:
The result of the transaction.
Type
Promise.<(Window|null)>

(static) print() → {void}

Will open a print dialog when running in a Web Browser.
Source:
Throws:
if you attempt to call this in Deno runtime.
Type
SyntaxError
Returns:
Type
void

(static) removeEventListener(params) → {void}

Removes an event listener either to the global object or to the specified event target.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Attributes Description
type string A case-sensitive string representing the event type to listen for.
listener EventListener Callback function to handle the event fired with optional receipt of an event object.
obj EventTarget <optional>
The optional EventTarget to attach the event vs. globalThis event listener.
Source:
Returns:
Type
void

(static) share(params) → {Promise.<CShareResult>}

Provides the ability to share items via the share services. You specify options via the shareData object parameters. Only available on the web browser runtime.
Parameters:
Name Type Description
params object The named parameters.
Properties
Name Type Description
shareData object The object specifying the data to share.
Source:
Returns:
The result of the call.
Type
Promise.<CShareResult>

(static) tryDeno() → {Deno}

Determines if we are running in a Deno Runtime or not.
Source:
Throws:
If not running in a Deno Runtime.
Type
SyntaxError
Returns:
namespace reference.
Type
Deno

(static) tryWeb() → {Window}

Determines if we are running in a Web Browser environment or not.
Source:
Throws:
If not running in a browser environment.
Type
SyntaxError
Returns:
Reference to the browser window.
Type
Window