Skip to content

Commit

Permalink
feat: add more type defs
Browse files Browse the repository at this point in the history
  • Loading branch information
sosweetham committed May 22, 2024
1 parent fb3fc54 commit ca66c25
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@cardboard-ink/cardboard-js",
"version": "1.0.5",
"version": "1.0.6",
"exports": "./src/index.ts"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cardboard.js",
"version": "1.0.5",
"version": "1.0.6",
"description": "JS/TS Wrapper for the CardBoard API",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
34 changes: 34 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,24 @@ export interface UserStatus {
customReaction?: CustomReaction
}

/**
* @typedef {Object} Content
* @property {string} object
* @property {Document} document
* Slate helper object for easy navigation
*/
export interface Content {
object: string
document: Document
}

/**
* @typedef {Object} Document
* @property {Data} data
* @property {Node[]} nodes
* @property {string} object
* Slate helper object for easy navigation
*/
export interface Document {
data: Data
nodes: Node[]
Expand All @@ -180,6 +193,14 @@ export interface Document {

export interface Data {}

/**
* @typedef {Object} Node
* @property {Data2} data
* @property {string} type
* @property {Node2[]} nodes
* @property {string} object
* Slate helper object for easy navigation
*/
export interface Node {
data: Data2
type: string
Expand All @@ -189,11 +210,24 @@ export interface Node {

export interface Data2 {}

/**
* @typedef {Object} Node2
* @property {Lefe[]} leaves
* @property {string} object
* Slate helper object for easy navigation
*/
export interface Node2 {
leaves: Lefe[]
object: string
}

/**
* @typedef {Object} Lefe
* @property {string} text
* @property {any[]} marks
* @property {string} object
* Slate helper object for easy navigation
*/
export interface Lefe {
text: string
marks: any[]
Expand Down

0 comments on commit ca66c25

Please sign in to comment.