Check if there are any pending nextFrame callbacks
function anyPendingFrames(): boolean;
Declares a CSS style string to be added to the <head>
block
This function is intended to be used as a template literal tag
function css(strings: string[], values: string[]): void;
strings
The CSS to be added
values
The interpolated string values
Fetches a JSON asset.
In the browser, issues a fetch request for an asset On the server, uses fs.readFile to load a local file asset.
The asset path must be absolute (start with a '/') and is resolved relative to the project root.
function fetchJsonAsset(path: string): Promise<object>;
path
The path of the asset to fetchFetches a text asset.
In the browser, issues a fetch request for an asset On the server, uses fs.readFile to load a local file asset.
The asset path must be absolute (start with a '/') and is resolved relative to the project root.
function fetchTextAsset(path: string): Promise<string>;
path
The path of the asset to fetchEncodes a string to make it safe for use in HTML.
function htmlEncode(str: string): string;
str
The string to encodeInterface to a notify service instance.
type INotify =
{
(sourceObject: any, ...args: any[]): void;
addEventListener: (sourceObject: any, handler: any) => void;
removeEventListener: (sourceObject: any, handler: any) => void;
}
Fires a notification.
(sourceObject: any, ...args: any[]): void;
sourceObject
The event source object or value
args
Optional arguments to pass to the event handlers
Adds an event listener to the notify service.
addEventListener: (sourceObject: any, handler: any) => void;
sourceObject
The event source object or value
handler
The event handler
Removes previously registered event listener from the notify service.
removeEventListener: (sourceObject: any, handler: any) => void;
sourceObject
The event source object or value
handler
The event handler
Invokes a callback on the next update cycle.
function nextFrame(callback: () => void, order?: number): void;
callback
The callback to be invoked.
order
The priority of the callback in related to others (lowest first, default 0).
Default Notify Instance
let notify: INotify;
Creates a new notify service instance.
Usuauly notify instances don't need to be created and the default notify instance can be used directly.
function Notify(): INotify;
Invokes a callback after all other nextFrame callbacks have been invoked, or immediately if there are no pending nextFrame callbacks.
function postNextFrame(callback: () => void): void;
callback
The callback to invokeConverts a URL pattern string to a regular expression string.
function urlPattern(pattern: string): string;
pattern
The URL pattern to be converted to a regular expression