@d-matrix/utils 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -3
- package/readme.md +27 -4
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d-matrix/utils",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "A dozen of utils for Front-End Development",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc"
|
|
@@ -24,6 +24,10 @@
|
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://github.com/mrdulin/dm-utils#readme",
|
|
26
26
|
"peerDependencies": {
|
|
27
|
+
"@types/react": "^16.8.0",
|
|
28
|
+
"@types/react-dom": "^16.9.0",
|
|
29
|
+
"react": "^16.8.0 || ^17.0.0",
|
|
30
|
+
"react-dom": "^16.9.0",
|
|
27
31
|
"typescript": "~4.3.2"
|
|
28
32
|
}
|
|
29
|
-
}
|
|
33
|
+
}
|
package/readme.md
CHANGED
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
# dm-utils
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A dozen of utils for Front-End Development
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[
|
|
5
|
+
## API
|
|
6
|
+
|
|
7
|
+
- [clipboard](#clipboard)
|
|
8
|
+
- [react](#react)
|
|
9
|
+
|
|
10
|
+
### clipboard
|
|
11
|
+
|
|
12
|
+
`clipboard.writeImage(element: HTMLImageElement): void`
|
|
13
|
+
|
|
14
|
+
复制图片到剪贴板。
|
|
15
|
+
|
|
16
|
+
### react
|
|
17
|
+
|
|
18
|
+
`render<P>(element: ReactElement<P>): Promise<string>`
|
|
19
|
+
|
|
20
|
+
渲染`React`组件,返回HTML字符串。
|
|
21
|
+
|
|
22
|
+
`cleanup(): void`
|
|
23
|
+
|
|
24
|
+
清理函数,需要在调用`render()`函数后调用。
|
|
25
|
+
|
|
26
|
+
## 注意事项
|
|
27
|
+
|
|
28
|
+
- [Before Publishing: Make Sure Your Package Installs and Works](https://docs.npmjs.com/cli/v10/using-npm/developers/#before-publishing-make-sure-your-package-installs-and-works)
|
|
29
|
+
- [npm-link](https://docs.npmjs.com/cli/v9/commands/npm-link)
|
|
30
|
+
- [Creating and publishing scoped public packages](https://docs.npmjs.com/creating-and-publishing-scoped-public-packages)
|