@linkdesk/contracts 0.1.13 → 0.1.14
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 +14 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
# @linkdesk/contracts
|
|
2
2
|
|
|
3
|
-
LinkDesk
|
|
3
|
+
The LinkDesk plugin contract types — the complete type definitions for `window.linkdesk.*`.
|
|
4
4
|
|
|
5
|
-
>
|
|
5
|
+
> This package is generated automatically by the LinkDesk shell's **contract generator** (`scripts/generate-contract.mjs`) from `src/core/api/linkdesk-api.ts`, and is the **single** source of truth for types. Third-party plugin authors use it to get API types that are perfectly in sync with the shell — drift means a compile error.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm install -D @linkdesk/contracts
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Usage
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
The package contains types only (`linkdesk.d.ts`, with the `types` entry pointing straight at it) and has zero runtime. Once installed:
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
18
|
import type { LinkDeskAPI } from "@linkdesk/contracts";
|
|
19
19
|
|
|
20
|
-
// window.linkdesk
|
|
21
|
-
window.linkdesk.configuration.get("editor.fontSize"); //
|
|
20
|
+
// window.linkdesk is typed automatically (the built-in global Window interface is declared); no extra global.d.ts needed
|
|
21
|
+
window.linkdesk.configuration.get("editor.fontSize"); // IntelliSense + type checking
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
24
|
+
- **Types only**: no `getLinkDesk`/`linkdesk` value exports — at runtime you go through `window.linkdesk` (injected by the preload).
|
|
25
|
+
- **Self-contained**: no `@src/core` dependency whatsoever; drop a single d.ts into your project for the complete types.
|
|
26
|
+
- **Independent version axis (decoupled on 2026-09-06)**: the package version no longer follows the shell — a shell upgrade is not a contract upgrade (app upgrades are a user-facing axis and unrelated to this package). A new version is published only when the `window.linkdesk.*` API surface changes and authors need the new types. **The content is still byte-for-byte in sync with the shell source** (compared by the generator; drift turns `contracts:check` red) — the types always describe the current shell, only the version number is not tied to it. Run `npm update @linkdesk/contracts` after a version bump to pick up the new types.
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Two tracks alongside the repository artifact
|
|
29
29
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
30
|
+
- **Recommended**: `npm i -D @linkdesk/contracts` (the real publication chain; types follow the version)
|
|
31
|
+
- **Alternative**: copy `contracts/linkdesk.d.ts` from the LinkDesk repository (a fallback when there is no npm environment)
|
|
32
32
|
|
|
33
|
-
##
|
|
33
|
+
## License
|
|
34
34
|
|
|
35
35
|
MIT
|