@titanpl/native 1.0.0 → 1.4.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 +11 -0
- package/index.d.ts +41 -0
- package/package.json +12 -4
package/README.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# @titanpl/native
|
|
2
|
+
|
|
3
|
+
The native utility extension module for Titan Planet.
|
|
4
|
+
|
|
5
|
+
## What it works (What it does)
|
|
6
|
+
It acts as the low-level communication bridge offering type definitions and utility wrappers out-of-the-box. Rather than being dependent on heavy JavaScript libraries, this package bridges Node-style features gracefully to the Titan runtime environment.
|
|
7
|
+
|
|
8
|
+
## How it works
|
|
9
|
+
You can import tools and primitives from this package into your server-side actions alongside `@titanpl/core` when you want direct low-level interaction or need access to platform operations that interact directly with the C/Rust engine.
|
|
10
|
+
|
|
11
|
+
**Important Note:** Currently, Titan Planet and its entire package ecosystem are only for Windows. The Linux version is in development (dev only) for the new architecture and will be launched later.
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface Request {
|
|
2
|
+
method: string;
|
|
3
|
+
path: string;
|
|
4
|
+
headers: Record<string, string>;
|
|
5
|
+
params: Record<string, any>;
|
|
6
|
+
query: Record<string, any>;
|
|
7
|
+
body: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface FileSystem {
|
|
11
|
+
readFile(path: string, options?: any, callback?: (err: any, data: string) => void): string;
|
|
12
|
+
writeFile(path: string, data: string): void;
|
|
13
|
+
exists(path: string): boolean;
|
|
14
|
+
readdir(path: string): string[];
|
|
15
|
+
mkdir(path: string): void;
|
|
16
|
+
stat(path: string): any;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const fs: FileSystem;
|
|
20
|
+
export function log(message: any): void;
|
|
21
|
+
export function defineAction<T = any>(handler: (req: Request) => T | Promise<T>): (req: Request) => T | Promise<T>;
|
|
22
|
+
export function fetch(url: string, options?: any): any;
|
|
23
|
+
export function drift<T>(op: any): T;
|
|
24
|
+
|
|
25
|
+
// Add more as needed based on native/index.js
|
|
26
|
+
export const db: any;
|
|
27
|
+
export const path: any;
|
|
28
|
+
export const jwt: any;
|
|
29
|
+
export const password: any;
|
|
30
|
+
export const crypto: any;
|
|
31
|
+
export const buffer: any;
|
|
32
|
+
export const ls: any;
|
|
33
|
+
export const session: any;
|
|
34
|
+
export const cookies: any;
|
|
35
|
+
export const os: any;
|
|
36
|
+
export const net: any;
|
|
37
|
+
export const proc: any;
|
|
38
|
+
export const time: any;
|
|
39
|
+
export const url: any;
|
|
40
|
+
export const response: any;
|
|
41
|
+
export const valid: any;
|
package/package.json
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@titanpl/native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Titan native utilities package",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"titan",
|
|
8
|
+
"titanpl",
|
|
9
|
+
"t8n",
|
|
10
|
+
"native",
|
|
11
|
+
"utilities",
|
|
12
|
+
"ezetgalaxy"
|
|
13
|
+
],
|
|
6
14
|
"main": "index.js",
|
|
7
15
|
"types": "./t.native.d.ts",
|
|
8
16
|
"exports": {
|
|
@@ -12,7 +20,7 @@
|
|
|
12
20
|
}
|
|
13
21
|
},
|
|
14
22
|
"dependencies": {
|
|
15
|
-
"@titanpl/core": "
|
|
16
|
-
"@titanpl/node": "
|
|
23
|
+
"@titanpl/core": "1.4.0",
|
|
24
|
+
"@titanpl/node": "1.4.0"
|
|
17
25
|
}
|
|
18
|
-
}
|
|
26
|
+
}
|