Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7188037
text.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
631 B
Referenced Files
None
Subscribers
None
text.ts
View Options
import
{
predicates
,
ShapeToType
}
from
"@sealcode/ts-predicates"
;
import
{
Primitive
}
from
"./primitive"
;
export
const
TextShape
=
{
type
:
predicates
.
const
(
<
const
>
"text"
),
content
:
predicates
.
string
,
id
:
predicates
.
maybe
(
predicates
.
string
),
};
export
type
TextJSON
=
ShapeToType
<
typeof
TextShape
>
;
export
class
TextPrimitive
extends
Primitive
{
public
content
:
string
;
public
id
:
string
|
null
=
null
;
constructor
(
json
:
Record
<
string
,
unknown
>
)
{
super
();
this
.
content
=
json
[
"content"
]
as
string
;
this
.
id
=
json
[
"id"
]
as
string
|
null
;
}
to_html
()
:
string
{
return
/* HTML */
`<p>
${
this
.
content
}
</p>`
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Jul 8, 07:50 (21 h, 2 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
783815
Default Alt Text
text.ts (631 B)
Attached To
Mode
rJDD jdd
Attached
Detach File
Event Timeline
Log In to Comment