custardkit-ts 0.2.1 → 0.2.2
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 +11 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript implementation of [CustardKit](https://github.com/azooKey/CustardKit)
|
|
4
4
|
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Type Safety**: Fully typed with TypeScript, ensuring autocomplete and compile-time error checking.
|
|
8
|
+
- **Runtime Validation**: Validates inputs at runtime to prevent invalid keyboard configurations.
|
|
9
|
+
- **Direct Serialization**: Classes support direct JSON serialization via `JSON.stringify()`.
|
|
10
|
+
|
|
5
11
|
## Installation
|
|
6
12
|
|
|
7
13
|
```bash
|
|
@@ -11,22 +17,11 @@ npm add custardkit-ts
|
|
|
11
17
|
## Usage
|
|
12
18
|
|
|
13
19
|
```typescript
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
InputStyle,
|
|
20
|
-
Interface,
|
|
21
|
-
KeyColor,
|
|
22
|
-
KeyData,
|
|
23
|
-
KeyDesign,
|
|
24
|
-
KeyStyle,
|
|
25
|
-
Label,
|
|
26
|
-
Language,
|
|
27
|
-
Layout,
|
|
28
|
-
Metadata,
|
|
29
|
-
} from "custardkit-ts";
|
|
20
|
+
import { Custard, Interface, Metadata } from "custardkit-ts/Custard";
|
|
21
|
+
import { CustomKey, KeyDesign } from "custardkit-ts/Keys";
|
|
22
|
+
import { Action } from "custardkit-ts/Actions";
|
|
23
|
+
import { Layout, KeyData, GridFitSpecifier } from "custardkit-ts/Layout";
|
|
24
|
+
import { InputStyle, KeyStyle, Language } from "custardkit-ts";
|
|
30
25
|
|
|
31
26
|
// Create a simple key using factory methods
|
|
32
27
|
const key = new CustomKey({
|
|
@@ -62,18 +57,6 @@ const custard = new Custard({
|
|
|
62
57
|
await custard.write("my_keyboard.json");
|
|
63
58
|
```
|
|
64
59
|
|
|
65
|
-
## Subpath Imports
|
|
66
|
-
|
|
67
|
-
For direct class access:
|
|
68
|
-
|
|
69
|
-
```typescript
|
|
70
|
-
import { InputAction, DeleteAction } from "custardkit-ts/Actions";
|
|
71
|
-
import { TextLabel } from "custardkit-ts/Labels";
|
|
72
|
-
import { CustomKey, KeyDesign } from "custardkit-ts/Keys";
|
|
73
|
-
import { GridFitLayout } from "custardkit-ts/Layout";
|
|
74
|
-
import { Custard, Metadata, Interface } from "custardkit-ts/Custard";
|
|
75
|
-
```
|
|
76
|
-
|
|
77
60
|
## License
|
|
78
61
|
|
|
79
62
|
MIT
|