Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F8922001
settable-by.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
945 B
Referenced Files
None
Subscribers
None
settable-by.ts
View Options
import
Field
,
{
ExtractFieldDecoded
,
ExtractFieldInput
,
ExtractFieldStorage
,
HybridField
,
}
from
"../../../chip-types/field.js"
;
import
type
{
Context
}
from
"../../../main.js"
;
import
type
Policy
from
"../../../chip-types/policy.js"
;
export
default
class
SettableBy
<
T
extends
Field
<
any
,
any
>>
extends
HybridField
<
ExtractFieldInput
<
T
>
,
ExtractFieldDecoded
<
T
>
,
ExtractFieldStorage
<
T
>
,
ExtractFieldInput
<
T
>
,
ExtractFieldDecoded
<
T
>
,
ExtractFieldStorage
<
T
>
,
T
>
{
typeName
=
"settable-by"
;
policy
:
Policy
;
constructor
(
base_field
:
T
,
policy
:
Policy
)
{
super
(
base_field
);
this
.
policy
=
policy
;
}
async
isProperValue
(
context
:
Context
,
input
:
Parameters
<
T
[
"encode"
]
>
[
1
],
old_value
:
Parameters
<
T
[
"encode"
]
>
[
2
]
)
{
const
result
=
await
this
.
policy
.
check
(
context
);
if
(
result
&&
!
result
.
allowed
)
{
return
Field
.
invalid
(
result
.
reason
);
}
return
this
.
virtual_field
.
checkValue
(
context
,
input
,
old_value
,
null
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Sat, Sep 20, 14:09 (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
931191
Default Alt Text
settable-by.ts (945 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment