docs: 修改错误文档

This commit is contained in:
ningmengchongshui 2024-06-09 11:57:45 +08:00
parent 01223c6d59
commit 6d8c923bf5
5 changed files with 79 additions and 9 deletions

67
DEV.md
View File

@ -1,6 +1,6 @@
# 开发者需知 # 开发者需知
该版本将支持TS、TSX环境提供Miao-Yunzai完全的类型声明及其开发文档。 未来将支持TS、TSX环境提供Miao-Yunzai完全的类型声明及其开发文档。
- 提交 - 提交
@ -17,6 +17,57 @@
*/ */
``` ```
- 注释风格
```ts
/**
* 返回false
* @param T 任意字符串
* @returns false
*/
function getTest(T:string){
return false
}
```
- 命名风格
```ts
// 获得test值
function getTest(T:string){
}
// 设置
function setTest(T:string){
}
// 删除
function delTest(T:string){
}
// 获取某数据依据为id
function getDataById(T:string){
}
// 系统常量
const ENV_TEST = 'dev'
// 局域常量
const MyName = 'yunzai'
// 可修改变量
let values = ''
// 禁止使用 var values = ''
// 声明数组
const Arr = []
// 不推荐 new
// 声明对象
const Obj = {}
// 不推荐new
```
## 关于lib目录 ## 关于lib目录
lib目录将在未来逐渐放弃在版本发布后开发者需要有意识的对此变化做出调整. lib目录将在未来逐渐放弃在版本发布后开发者需要有意识的对此变化做出调整.
@ -31,14 +82,22 @@ lib目录将在未来逐渐放弃在版本发布后开发者需要有意
--lib / tools / web.js / test.js / log.js / ksr.js --lib / tools / web.js / test.js / log.js / ksr.js
// 计划废弃 // 计划废弃
--renderers --renderers
// 其他内容逐步优化。。。
``` ```
## 新版目录 ## 新版目录
- 核心源码 - 核心源码
src/core src/core
- 配置管理
src/config
- 数据管理 - 数据管理
src/db src/db
@ -51,7 +110,7 @@ src/mys
src/utils src/utils
## 开发示例 ## 开发示例
- 图片组件 - 图片组件
@ -81,7 +140,7 @@ import { join } from 'path'
// puppeteer // puppeteer
import { Puppeteer } from './puppeteer.ts' import { Puppeteer } from './puppeteer.ts'
// component // component
import HelloComponent from '../component/hello.tsx' import HelloComponent from './hello.tsx'
// //
class Component { class Component {
puppeteer: typeof Puppeteer.prototype puppeteer: typeof Puppeteer.prototype
@ -121,4 +180,4 @@ class Component {
) )
} }
} }
``` ```

View File

@ -73,14 +73,16 @@ sudo ln -s libstdc++.so.6.0.29 libstdc++.so.6
node >= 20.0.0 node >= 20.0.0
```ts - 启动
ts-node alemon.config.ts
```sh
npm run latest:app
``` ```
更改为 - 重新登录
```ts ```sh
node --no-warnings=ExperimentalWarning --loader ts-node/esm alemon.config.ts npm run latest:app login
``` ```
## 致谢 ## 致谢

View File

@ -14,6 +14,8 @@
"ts:app": "ts-node src/main.ts", "ts:app": "ts-node src/main.ts",
"ts:login": "ts-node src/main.ts login", "ts:login": "ts-node src/main.ts login",
"ts:build": "rollup --config rollup.config.js", "ts:build": "rollup --config rollup.config.js",
"latest:app": "node --no-warnings=ExperimentalWarning --loader ts-node/esm src/main.ts",
"latest:login": "node --no-warnings=ExperimentalWarning --loader ts-node/esm src/main.ts login",
"format": "prettier --write .", "format": "prettier --write .",
"prepare": "husky" "prepare": "husky"
}, },

View File

@ -16,6 +16,10 @@ import ListenerLoader from './lib/listener/loader.js'
* *
*/ */
import { Client } from 'icqq' import { Client } from 'icqq'
/**
*
*/
export class Yunzai extends Client { export class Yunzai extends Client {
/** /**
* *

View File

@ -8,6 +8,9 @@ const games = [
{ key: 'sr', name: '星穹铁道' } { key: 'sr', name: '星穹铁道' }
] ]
/** /**
* *
*/ */