Utils
Constructors
new Utils()
new Utils():
Utils
Returns
Methods
download()
static
download(filename
,content
,contentType
?):void
Downloads the specified content locally
Parameters
Parameter | Type |
---|---|
filename | string |
content | BlobPart |
contentType ? | string |
Returns
void
Source
firstOrNull()
static
firstOrNull<T
>(iterable
):null
|T
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type | Description |
---|---|---|
iterable | Iterable <T > |
Returns
null
| T
Source
identity()
static
identity(length
):Uint32Array
Returns an 'identity' array where the element in idx-th position is equals to idx.
Parameters
Parameter | Type |
---|---|
length | number |
Returns
Uint32Array
Source
isEmpty()
static
isEmpty(s
?):boolean
Parameters
Parameter | Type |
---|---|
s ? | string |
Returns
boolean
Source
loadJsCss()
static
loadJsCss(files
):Promise
<null
>
Loads the specified common libraries, if they were not loaded already.
Use it in plugins when a big JS dependency is used infrequently,
such as exporting to Excel, or showing a 3d structure.
Example: loadJsCss(['common/exceljs.min.js', 'common/exceljs.min.css'])
Parameters
Parameter | Type |
---|---|
files | string [] |
Returns
Promise
<null
>
Source
nullIfEmpty()
static
nullIfEmpty(s
?):undefined
|null
|string
Parameters
Parameter | Type |
---|---|
s ? | string |
Returns
undefined
| null
| string
Source
openFile()
static
openFile(options
):void
Shows "Open File" dialog, and lets you process the result.
Parameters
Parameter | Type |
---|---|
options | object |
options.accept | string |
options.open | (file ) => void |
Returns
void
Source
openFileBytes()
static
openFileBytes(options
):void
Shows "Open File" dialog, and lets you process the result.
Parameters
Parameter | Type |
---|---|
options | object |
options.accept | string |
options.open | (bytes ) => void |
Returns
void
Source
replaceAll()
static
replaceAll(string
,search
,replace
):string
Parameters
Parameter | Type |
---|---|
string | string |
search | string |
replace | string |
Returns
string
Source
streamToObservable()
static
streamToObservable<T
>(dartStream
):Observable
<T
>
Type parameters
Type parameter | Value |
---|---|
T | any |
Parameters
Parameter | Type |
---|---|
dartStream | any |
Returns
Observable
<T
>