refactor: rename root to tag, remove not supported typescript features

This commit is contained in:
Artemy Egorov 2024-08-03 12:56:51 +03:00
parent 44ae5868b4
commit dc12c44895
12 changed files with 14 additions and 236 deletions

View file

@ -4,12 +4,12 @@
Daletl is data representation of serialized/deserialized [DaletPack](./daletpack.md).
### Root
### Page
Daletl root is array of tags. For convenience, we will use the typescript notation.
Daletl page is array of tags. For convenience, we will use the typescript notation.
```typescript
type Root = Tag[];
type Page = Tag[];
```
### Tag
@ -17,17 +17,20 @@ type Root = Tag[];
All tags specification is in [Tags](./tags.md).
```typescript
interface Tag {
export type Body = string | Tag[] | null;
export type Argument = string | number | null;
export interface Tag {
id: number;
body: string | Tag[] | null;
argument: string | number | null;
body: Body;
argument: Argument;
}
```
### Example
```typescript
const root: Root = [
const page: Page = [
{
id: 1,
body: "I am Heading with level 1",

View file

@ -6,7 +6,7 @@ All apps that supports Dalet must use this format when transmitting data between
All data must be compressed with [zstd](https://datatracker.ietf.org/doc/html/rfc8878).
Root data format is array of tags (see [daletl specification](./daletl.md)), each element reads sequentially. Type definition for root is not needed.
Page data format is array of tags (see [daletl specification](./daletl.md)), each element reads sequentially. Type definition for page is not needed.
Mime type: `application/dalet-pack`