@cocos/pink-types 0.0.0-bootstrap.0 → 0.0.12-beta.1
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/README.md +42 -6
- package/package.json +3 -4
- package/pink.d.ts +1509 -0
- package/pink.vscode.d.ts +13 -0
package/README.md
CHANGED
|
@@ -1,12 +1,48 @@
|
|
|
1
1
|
# @cocos/pink-types
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Public TypeScript type definitions for the PinK extension API (the `pink` module, public tier only).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
面向外部插件开发者:仅包含 public 层类型,internal / proposed 层级不随本包发布。
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @cocos/pink-types
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Prerequisite
|
|
14
|
+
|
|
15
|
+
`pink.d.ts` references the `vscode` module types — your extension project must install `@types/vscode` (standard for any VS Code extension project):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install --save-dev @types/vscode
|
|
9
19
|
```
|
|
10
20
|
|
|
11
|
-
|
|
12
|
-
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Add the package to your `tsconfig.json` types, then import the `pink` module:
|
|
24
|
+
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"compilerOptions": {
|
|
28
|
+
"types": ["@cocos/pink-types"]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
import * as pink from 'pink';
|
|
35
|
+
|
|
36
|
+
const assets = await pink.assets.queryAssetInfos();
|
|
37
|
+
const info = await pink.engine.getInfo();
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`pink.vscode.d.ts` (PinK-specific augmentations to the VS Code API) is included and referenced automatically via `pink.d.ts`.
|
|
41
|
+
|
|
42
|
+
## What's not in this package
|
|
43
|
+
|
|
44
|
+
- **Internal API** (`pink.internal.d.ts`) — for built-in / trusted extensions only.
|
|
45
|
+
- **Proposed API** (`pink.proposed.*.d.ts`) — experimental, opt-in per extension.
|
|
46
|
+
- **`pink-api-schema.json`** — full API schema consumed by the PinK API Lab.
|
|
47
|
+
|
|
48
|
+
These ship with `@pink/types` (same version, published together) and are not meant for external consumption.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocos/pink-types",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12-beta.1",
|
|
4
4
|
"description": "Public TypeScript type definitions for the PinK extension API (the `pink` module, public tier only).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"types": "pink.d.ts",
|
|
@@ -11,11 +11,10 @@
|
|
|
11
11
|
],
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"registry": "https://registry.npmjs.org/",
|
|
14
|
-
"access": "public"
|
|
15
|
-
"tag": "bootstrap"
|
|
14
|
+
"access": "public"
|
|
16
15
|
},
|
|
17
16
|
"repository": {
|
|
18
17
|
"type": "git",
|
|
19
18
|
"url": "https://github.com/SUD-GLOBAL/PinK"
|
|
20
19
|
}
|
|
21
|
-
}
|
|
20
|
+
}
|