Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7112494
single-file-subject.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
single-file-subject.ts
View Options
import
App
from
"../../app/app"
;
import
*
as
Errors
from
"../../response/errors"
;
import
{
NoActionSubject
,
LeafSubject
}
from
"../subject"
;
import
Context
from
"../../context"
;
import
{
ShowActionName
}
from
"../../action"
;
import
{
File
}
from
"../../main"
;
export
default
class
FileHash
extends
NoActionSubject
{
file_id
:
string
;
constructor
(
app
:
App
,
file_id
:
string
)
{
super
(
app
);
this
.
file_id
=
file_id
;
}
getName
()
{
return
"FileHash"
;
}
async
getChildSubject
(
path_element
:
string
)
{
return
new
SingleFileSubject
(
this
.
app
,
this
.
file_id
,
path_element
);
}
}
class
SingleFileSubject
extends
LeafSubject
{
file_id
:
string
;
file_name
:
string
;
constructor
(
app
:
App
,
file_id
:
string
,
file_name
:
string
)
{
super
(
app
);
this
.
file_id
=
file_id
;
this
.
file_name
=
file_name
;
}
getName
()
{
return
"SingleFile"
;
}
async
performAction
(
_
:
Context
,
action_name
:
ShowActionName
,
__
?:
any
)
{
if
(
action_name
!==
"show"
)
{
throw
new
Errors
.
DeveloperError
(
`Unknown action for '
${
this
.
name
}
' subject: '
${
action_name
}
'`
);
}
return
await
File
.
fromID
(
this
.
app
,
this
.
file_id
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Thu, Jul 3, 18:22 (5 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
799699
Default Alt Text
single-file-subject.ts (1 KB)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment