Page MenuHomeSealhub

text.ts
No OneTemporary

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

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)

Event Timeline