@turbowarp/types
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
get
Default
Asset
Id
load
set
Default
Asset
Id
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
get
Default
Asset
Id
getDefaultAssetId
(
type
:
ScratchStorage
.
AssetType
)
:
string
|
undefined
Parameters
type
:
ScratchStorage
.
AssetType
Returns
string
|
undefined
load
load
(
assetType
:
ScratchStorage
.
AssetType
,
assetId
:
string
,
dataFormat
:
DataFormat
,
)
:
Promise
<
Asset
|
null
>
Parameters
assetType
:
ScratchStorage
.
AssetType
assetId
:
string
dataFormat
:
DataFormat
Returns
Promise
<
Asset
|
null
>
set
Default
Asset
Id
setDefaultAssetId
(
type
:
ScratchStorage
.
AssetType
,
id
:
string
)
:
void
Parameters
type
:
ScratchStorage
.
AssetType
id
:
string
Returns
void
store
store
(
assetType
:
ScratchStorage
.
AssetType
,
dataFormat
:
DataFormat
,
data
:
Uint8Array
,
assetId
:
string
,
)
:
Promise
<
unknown
>
Parameters
assetType
:
ScratchStorage
.
AssetType
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
get
Default
Asset
Id
load
set
Default
Asset
Id
store
@turbowarp/types
Loading...
Deprecated
Use addWebStore instead.