Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F1262862
image.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
797 B
Referenced Files
None
Subscribers
None
image.ts
View Options
import
_locreq
from
"locreq"
;
import
{
JDDContext
}
from
".."
;
import
{
File
as
FileArgument
}
from
"./file"
;
const
locreq
=
_locreq
(
__dirname
);
let
example_image_promises
:
Record
<
string
,
Promise
<
string
>
|
null
>
=
{
"image1.jpg"
:
null
,
"image3.jpg"
:
null
,
"image4.jpg"
:
null
,
"image5.jpg"
:
null
,
};
export
class
Image
extends
FileArgument
{
getTypeName
()
{
return
"image"
;
}
async
getExampleValue
(
context
:
JDDContext
)
{
const
keys
=
Object
.
keys
(
example_image_promises
);
const
key
=
keys
[
Math
.
floor
(
Math
.
random
()
*
keys
.
length
)];
if
(
!
example_image_promises
[
key
])
{
example_image_promises
[
key
]
=
context
.
encode_file
(
{
type
:
"path"
,
path
:
locreq
.
resolve
(
`resources/
${
key
}
`
),
},
true
);
}
return
example_image_promises
[
key
]
as
Promise
<
string
>
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Fri, Jan 24, 15:16 (17 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
601381
Default Alt Text
image.ts (797 B)
Attached To
Mode
rJDD jdd
Attached
Detach File
Event Timeline
Log In to Comment