@tinycloudlabs/web-sdk-wasm 0.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/README.md +92 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +1171 -0
- package/dist/tinycloud_web_sdk_rs.d.ts +227 -0
- package/package.json +33 -0
- package/tsconfig.json +5 -0
package/README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# TinyCloud Web SDK (Rust/WASM)
|
|
2
|
+
|
|
3
|
+
<img src="https://github.com/TinyCloudLabs/web-sdk/blob/main/documentation/static/img/tinycloudheader.png?raw=true" alt="TinyCloud" width="100%" />
|
|
4
|
+
|
|
5
|
+
WebAssembly library written in Rust for the TinyCloud Web SDK.
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@tinycloudlabs/web-sdk-rs)
|
|
8
|
+
[](https://github.com/TinyCloudLabs/web-sdk/blob/main/LICENSE-MIT)
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
This package provides high-performance WebAssembly components for TinyCloud Web SDK. It uses `rollup` to encode the `.wasm` as a base64-encoded string, meaning there is no configuration needed downstream to support WebAssembly (other than a compatible browser).
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- **High Performance** - Critical operations implemented in Rust for maximum efficiency
|
|
17
|
+
- **Small Footprint** - Minimal bundle size overhead
|
|
18
|
+
- **Seamless Integration** - Works directly with the JavaScript SDK without configuration
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Using npm
|
|
24
|
+
npm install @tinycloudlabs/web-sdk-rs
|
|
25
|
+
|
|
26
|
+
# Using Yarn
|
|
27
|
+
yarn add @tinycloudlabs/web-sdk-rs
|
|
28
|
+
|
|
29
|
+
# Using Bun (recommended)
|
|
30
|
+
bun add @tinycloudlabs/web-sdk-rs
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Usage
|
|
34
|
+
|
|
35
|
+
This package is typically used internally by the main TinyCloud Web SDK, but you can also use it directly:
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { initialize } from '@tinycloudlabs/web-sdk-rs';
|
|
39
|
+
|
|
40
|
+
// Initialize the WASM module
|
|
41
|
+
await initialize();
|
|
42
|
+
|
|
43
|
+
// Use the WASM functions
|
|
44
|
+
// ...
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Building from Source
|
|
48
|
+
|
|
49
|
+
### Requirements
|
|
50
|
+
|
|
51
|
+
* [Rust](https://www.rust-lang.org/tools/install)
|
|
52
|
+
* [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/)
|
|
53
|
+
* [Bun](https://bun.sh) or [Yarn](https://yarnpkg.com/getting-started/install)
|
|
54
|
+
|
|
55
|
+
### Building
|
|
56
|
+
|
|
57
|
+
For development builds:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
bun run build-dev
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
For optimized release builds:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
bun run build-release
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Then bundle the package:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
bun run bundle
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Documentation
|
|
76
|
+
|
|
77
|
+
For complete documentation, please visit:
|
|
78
|
+
|
|
79
|
+
- [**TinyCloud SDK Documentation**](https://docs.tinycloud.xyz/)
|
|
80
|
+
|
|
81
|
+
## Contributing
|
|
82
|
+
|
|
83
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
This project is licensed under the MIT License - see the [LICENSE-MIT](https://github.com/TinyCloudLabs/web-sdk/blob/main/LICENSE-MIT) file for details.
|
|
88
|
+
|
|
89
|
+
## Related Packages
|
|
90
|
+
|
|
91
|
+
- [**@tinycloudlabs/web-sdk**](https://www.npmjs.com/package/@tinycloudlabs/web-sdk) - The main TinyCloud Web SDK package
|
|
92
|
+
- [**@tinycloudlabs/web-core**](https://www.npmjs.com/package/@tinycloudlabs/web-core) - Core utilities and types
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as lib from "./tinycloud_web_sdk_rs.js";
|
|
2
|
+
export declare const initialized: Promise<void>;
|
|
3
|
+
export declare namespace tcwSession {
|
|
4
|
+
export import TCWSessionManager = lib.TCWSessionManager;
|
|
5
|
+
export import SiweConfig = lib.SiweConfig;
|
|
6
|
+
export import ExtraFields = lib.ExtraFields;
|
|
7
|
+
}
|
|
8
|
+
export declare namespace tinycloud {
|
|
9
|
+
export import completeSessionSetup = lib.completeSessionSetup;
|
|
10
|
+
export import generateHostSIWEMessage = lib.generateHostSIWEMessage;
|
|
11
|
+
export import siweToDelegationHeaders = lib.siweToDelegationHeaders;
|
|
12
|
+
export import invoke = lib.invoke;
|
|
13
|
+
export import makeOrbitId = lib.makeOrbitId;
|
|
14
|
+
export import prepareSession = lib.prepareSession;
|
|
15
|
+
export import Session = lib.Session;
|
|
16
|
+
export import SessionConfig = lib.SessionConfig;
|
|
17
|
+
export import HostConfig = lib.HostConfig;
|
|
18
|
+
}
|