feat: init sdk pkg

This commit is contained in:
0xzion
2023-10-28 23:07:57 +08:00
parent 0c06ed7b72
commit 21cbed9b90
5 changed files with 59 additions and 0 deletions

24
packages/sdk/package.json Normal file
View File

@@ -0,0 +1,24 @@
{
"name": "@penx/sdk",
"version": "0.0.0",
"main": "./src/index.ts",
"types": "./src/index.ts",
"scripts": {
"lint": "eslint \"**/*.ts*\""
},
"devDependencies": {
"@types/react": "^18.2.22",
"@types/react-dom": "^18.2.7",
"eslint": "^8.42.0",
"eslint-config-custom": "workspace:*",
"react": "^18.2.0",
"tsconfig": "workspace:*",
"typescript": "^5.1.3"
},
"dependencies": {
"@penx/local-db": "workspace:*",
"@penx/types": "workspace:*",
"@penx/constants": "workspace:*",
"@penx/model": "workspace:*"
}
}

View File

@@ -0,0 +1,13 @@
import { Inbox } from './inbox'
interface Options {
spaceId: string
}
export class Client {
inbox: Inbox
constructor(options: Options) {
this.inbox = new Inbox(this)
}
}

13
packages/sdk/src/inbox.ts Normal file
View File

@@ -0,0 +1,13 @@
import type { Client } from './client'
export class Inbox {
constructor(client: Client) {}
addMarkdown(text: string) {
//
}
addTextNode(text: string) {
//
}
}

View File

@@ -0,0 +1 @@
export * from './client'

View File

@@ -0,0 +1,8 @@
{
"extends": "tsconfig/react-library.json",
"compilerOptions": {
"lib": ["ESNext", "DOM"]
},
"include": ["."],
"exclude": ["dist", "build", "node_modules"]
}