IO
Defined in: util/io.ts:9
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new IO():
IO
Returns
Section titled “Returns”IO
Properties
Section titled “Properties”_callback
Section titled “_callback”
static_callback:object={}
Defined in: util/io.ts:147
_proxyCallback
Section titled “_proxyCallback”
static_proxyCallback:object={}
Defined in: util/io.ts:149
_remoteCallback
Section titled “_remoteCallback”
static_remoteCallback:object={}
Defined in: util/io.ts:148
Methods
Section titled “Methods”_finalCallback()
Section titled “_finalCallback()”
static_finalCallback(message):Promise<unknown>
Defined in: util/io.ts:195
Parameters
Section titled “Parameters”message
Section titled “message”string
Returns
Section titled “Returns”Promise<unknown>
getFileContent()
Section titled “getFileContent()”
staticgetFileContent(path):Promise<string>
Defined in: util/io.ts:24
param: (path: string)
return: Promise<string>Returns a base-64 encoded string of the target file’s contents. UTF-8 encoded files may be decoded through:
IO.getFileContent('C:\\text.txt').then(function(base64Content) { var actualContent = decodeURIComponent(escape(window.atob(base64Content));});Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<string>
getVideoDuration()
Section titled “getVideoDuration()”
staticgetVideoDuration(file):Promise<unknown>
Defined in: util/io.ts:159
param: (file: string)
return: Promise
Returns the duration of a video file on the local system, specified in units of 10^-7 seconds.
Parameters
Section titled “Parameters”any
Returns
Section titled “Returns”Promise<unknown>
getWebContent()
Section titled “getWebContent()”
staticgetWebContent(url):Promise<string>
Defined in: util/io.ts:46
param: (url: string)
return: Promise<string>Returns a base-64 encoded string of the target endpoint’s contents. Redirects are resolved, and this bypasses access-control-allow-origin.
UTF-8 encoded content may be decoded through:
IO.getWebContent('http://example.com').then(function(base64Content) { var actualContent = decodeURIComponent(escape(window.atob(base64Content));});Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<string>
openFileDialog()
Section titled “openFileDialog()”
staticopenFileDialog(optionBag?,filter?):Promise<string[]>
Defined in: util/io.ts:93
param: ([options] [, filter]) – see below
return: Promise<string[]>Opens a file dialog for the user to select a file (or multiple files). Resolves with an array of strings, each of which contains the full path and filename of a selected file. Rejects when the dialog is canceled.
The first (optional) argument is a JSON object that can be used to indicate that certain flags should be true. These are documented as follows:
allowMultiSelect: allows users to select multiple files.fileMustExist: prevents users from typing a name of a nonexistent fileforceShowHidden: lets the dialog show files marked as System or Hidden (but not both)
The second argument (also optional) is a JSON object used to specify the filter for items to be displayed. It takes two members:
name: the description of the filter (for example: Image Files)extensions: an array of file extensions (for example:['jpg','bmp']);
Parameters
Section titled “Parameters”optionBag?
Section titled “optionBag?”allowMultiSelect?
Section titled “allowMultiSelect?”boolean
fileMustExist?
Section titled “fileMustExist?”boolean
forceShowHidden?
Section titled “forceShowHidden?”boolean
filter?
Section titled “filter?”extensions
Section titled “extensions”string[]
boolean
Returns
Section titled “Returns”Promise<string[]>
openUrl()
Section titled “openUrl()”
staticopenUrl(url):Promise<string>
Defined in: util/io.ts:60
param: (url: string)
Opens a URL in the user’s default browser. URL must specify HTTP or HTTPS.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<string>