MCPcopy Create free account
hub / github.com/PatoSala/react-native-blocks / Block

Class Block

packages/core/src/interfaces/Block.interface.ts:5–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3type UUIDv4 = string;
4
5class Block {
6 id?: string;
7 type: string;
8 properties: {
9 title: string;
10 };
11 format?: {
12
13 };
14 content?: string[] | [];
15 parent: string;
16
17 constructor({
18 type,
19 properties,
20 content = [],
21 parent,
22 } : Block) {
23 this.id = Crypto.randomUUID();;
24 this.type = type;
25 this.properties = properties;
26 this.content = content;
27 this.parent = parent;
28 }
29}
30
31const createBlock = (block: Block) => {
32 return new Block(block);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected