Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22393486
image-value.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
858 B
Referenced Files
None
Subscribers
None
image-value.ts
View Options
import
type
{
PathFilePointer
}
from
"@sealcode/file-manager"
;
import
type
{
FieldValue
}
from
"./field-value.js"
;
type
RestPreference
=
"relative"
|
"absolute"
;
export
class
ImageValue
implements
FieldValue
{
constructor
(
private
readonly
file
:
PathFilePointer
,
private
readonly
base_url
:
string
,
private
readonly
restPreference
:
RestPreference
)
{}
toFile
()
:
PathFilePointer
{
return
this
.
file
;
}
async
toPath
()
:
Promise
<
string
>
{
return
this
.
file
.
getPath
();
}
async
getPath
()
:
Promise
<
string
>
{
return
this
.
toPath
();
}
toUrl
(
with_host
:
boolean
=
true
)
:
string
{
return
`
${
with_host
?
this
.
base_url
:
""
}${
this
.
file
.
getURL
()
}
`
;
}
toString
()
:
string
{
return
this
.
toUrl
(
true
);
}
getRestAPIValue
()
:
string
|
PathFilePointer
{
return
this
.
restPreference
===
"absolute"
?
this
.
toUrl
(
true
)
:
this
.
toUrl
(
false
);
}
}
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, Nov 27, 16:05 (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1213041
Default Alt Text
image-value.ts (858 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline