Namespace: util

util

Methods Show Inherited

staticutil.getRelativePath(basePath, path){string}

Name Type Description
basePath string
path string
Returns:
Type Description
string

staticutil.convertUint8ArrayToString(array, isUTF8){string}

Name Type Default Description
array Uint8Array | Array.<number>
isUTF8 boolean false optional
Returns:
Type Description
string

staticutil.getExtension(url){string}

Name Type Description
url string
Returns:
Type Description
string

staticutil.each(obj, fn)

Name Type Description
obj object
fn function

staticutil.getIndexFromSortedArray(array, value, compareFn){Array.<number>}

Name Type Description
array Array.<any>
value any
compareFn function
Returns:
Type Description
Array.<number>

staticutil.insertToSortedArray(array, item, compareFn)

Name Type Description
array Array.<any>
item any
compareFn function

staticutil.padLeft(str, len, char){string}

Name Type Description
str string
len number
char string
Returns:
Type Description
string

staticutil.getTypedArrayGLType(array){GLenum}

Name Type Description
array TypedArray
Returns:
Type Description
GLenum

staticutil.getTypedArrayClass(type){any}

Name Type Description
type GLenum
Returns:
Type Description
any

staticutil.copyArrayData(destArr, srcArr, destIdx, srcIdx, count)

Name Type Description
destArr Array.<any>
srcArr Array.<any>
destIdx number
srcIdx number
count number

staticutil.isStrOrNumber(d){boolean}

Name Type Description
d any
Returns:
Type Description
boolean

staticutil.isBlobUrl(url){boolean}

Name Type Description
url string
Returns:
Type Description
boolean

staticutil.revokeBlobUrl(blobUrl)

Name Type Description
blobUrl string

staticutil.getBlobUrl(mimeType, data){string}

Name Type Description
mimeType string
data ArrayBuffer | TypedArray
Returns:
Type Description
string

staticutil.isArrayLike(obj){boolean}

Name Type Description
obj any
Returns:
Type Description
boolean

staticutil.getElementRect(elem){any}

Name Type Description
elem Element
Returns:
Type Description
any

staticutil.serialRun(data, fn){Promise.<any>}

Name Type Description
data any
fn function
Returns:
Type Description
Promise.<any>

staticutil.hasOwnProperty(obj, name){boolean}

Name Type Description
obj any
name string
Returns:
Type Description
boolean

staticutil.isWebGL2(gl){boolean}

是否是 WebGL2

Name Type Description
gl any
Returns:
Type Description
boolean