@turbowarp/types-tw
Preparing search index...
scratch-storage
ScratchStorage
Class ScratchStorage
Hierarchy (
View Summary
)
ScratchStorage
GUIScratchStorage
Index
Constructors
constructor
Properties
_
helpers
Accessors
Asset
Asset
Type
Data
Format
Methods
add
Helper
add
Web
Source
add
Web
Store
cache
create
Asset
get
load
store
Constructors
constructor
new
ScratchStorage
()
:
ScratchStorage
Returns
ScratchStorage
Properties
_
helpers
_helpers
:
Helper
[]
Accessors
Asset
get
Asset
()
:
typeof
Asset
Returns
typeof
Asset
Asset
Type
get
AssetType
()
:
typeof
ScratchStorage
.
AssetType
Returns
typeof
ScratchStorage
.
AssetType
Data
Format
get
DataFormat
()
:
typeof
DataFormat
Returns
typeof
DataFormat
Methods
add
Helper
addHelper
(
helper
:
Helper
,
priority
?:
number
)
:
void
Parameters
helper
:
Helper
Optional
priority
:
number
Returns
void
add
Web
Source
addWebSource
(
types
:
ScratchStorage
.
AssetType
[]
,
getFunction
:
UrlFunction
)
:
void
Parameters
types
:
ScratchStorage
.
AssetType
[]
getFunction
:
UrlFunction
Returns
void
Deprecated
Use addWebStore instead.
add
Web
Store
addWebStore
(
types
:
ScratchStorage
.
AssetType
[]
,
getFunction
:
UrlFunction
,
createFunction
?:
UrlFunction
,
updateFunction
?:
UrlFunction
,
)
:
void
Parameters
types
:
ScratchStorage
.
AssetType
[]
getFunction
:
UrlFunction
Optional
createFunction
:
UrlFunction
Optional
updateFunction
:
UrlFunction
Returns
void
cache
cache
(
assetType
:
ScratchStorage
.
AssetType
,
dataFormat
:
DataFormat
,
data
:
Uint8Array
,
assetId
:
string
,
)
:
string
Parameters
assetType
:
ScratchStorage
.
AssetType
dataFormat
:
DataFormat
data
:
Uint8Array
assetId
:
string
Returns
string
create
Asset
createAsset
(
assetType
:
ScratchStorage
.
AssetType
,
dataFormat
:
DataFormat
,
data
:
Uint8Array
,
assetId
:
null
,
generateId
:
true
,
)
:
Asset
Parameters
assetType
:
ScratchStorage
.
AssetType
dataFormat
:
DataFormat
data
:
Uint8Array
assetId
:
null
generateId
:
true
Returns
Asset
createAsset
(
assetType
:
ScratchStorage
.
AssetType
,
dataFormat
:
DataFormat
,
data
:
Uint8Array
,
assetId
:
string
,
generateId
?:
boolean
,
)
:
Asset
Parameters
assetType
:
ScratchStorage
.
AssetType
dataFormat
:
DataFormat
data
:
Uint8Array
assetId
:
string
Optional
generateId
:
boolean
Returns
Asset
get
get
(
assetId
:
string
)
:
Asset
|
null
Synchronously get a cached asset.
Parameters
assetId
:
string
Returns
Asset
|
null
load
load
(
assetType
:
ScratchStorage
.
AssetType
,
assetId
:
string
,
dataFormat
:
DataFormat
,
)
:
Promise
<
Asset
|
null
>
Parameters
assetType
:
ScratchStorage
.
AssetType
assetId
:
string
dataFormat
:
DataFormat
Returns
Promise
<
Asset
|
null
>
store
store
(
assetType
:
Asset
,
dataFormat
:
DataFormat
,
data
:
Uint8Array
,
assetId
:
string
,
)
:
Promise
<
unknown
>
Parameters
assetType
:
Asset
dataFormat
:
DataFormat
data
:
Uint8Array
assetId
:
string
Returns
Promise
<
unknown
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
_
helpers
Accessors
Asset
Asset
Type
Data
Format
Methods
add
Helper
add
Web
Source
add
Web
Store
cache
create
Asset
get
load
store
@turbowarp/types-tw
Loading...
Deprecated
Use addWebStore instead.