lenix 1.7.12 → 1.7.15

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/client/index.ts CHANGED
@@ -13,3 +13,4 @@ export * from './nearest.ts'
13
13
  export * from './pool.ts'
14
14
  export * from './timer.ts'
15
15
  export * from './client.ts'
16
+ export * from '../shared/api'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lenix",
3
- "version": "1.7.12",
3
+ "version": "1.7.15",
4
4
  "description": "Typed FiveM utilities for client, server, shared, and NUI scripts",
5
5
  "author": "Lenix",
6
6
  "license": "MIT",
package/server/index.ts CHANGED
@@ -4,4 +4,5 @@
4
4
  * FiveM server-side helpers.
5
5
  */
6
6
 
7
- export * from './server'
7
+ export * from './server'
8
+ export * from '../shared/api'
package/shared/api.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  import { asserts } from "@lenix/lenix"
2
- import type { Fn } from "./types"
3
2
 
4
3
  interface Api {
5
4
  [resource: number]: never
6
5
  [resource: string]: {
7
6
  [method: number]: never
8
- [method: string]: <T extends Fn<unknown, any[]>>(...args: Parameters<T>) => ReturnType<T>
7
+ [method: string]: <Return, Args extends unknown[] = []>(...args: Args) => Return
9
8
  }
10
9
  }
11
10
 
@@ -31,4 +30,4 @@ export const api: Api = new Proxy(globalThis.exports, {
31
30
  },
32
31
  })
33
32
  },
34
- }) as unknown as Api
33
+ }) as unknown as Api
package/shared/index.ts CHANGED
@@ -4,6 +4,6 @@
4
4
  * Shared helpers that can be used from both client and server contexts.
5
5
  */
6
6
 
7
- export * from './api.ts'
8
7
  export * from './types.ts'
9
8
  export * from './repeat.ts'
9
+ export * from './pallete.ts'
@@ -0,0 +1,12 @@
1
+ const colorCodes = {
2
+ red: '1',
3
+ green: '2',
4
+ yellow: '3',
5
+ blue: '4',
6
+ cyan: '5',
7
+ pink: '6',
8
+ wine: '8',
9
+ navy: '9',
10
+ } as const
11
+
12
+ export const forma = (color: keyof typeof colorCodes, text: string) => `^${colorCodes[color]}${text}^7` as const
package/shared/types.ts CHANGED
@@ -33,5 +33,3 @@ export interface _InternalRequests {
33
33
  cursor: boolean
34
34
  }>
35
35
  }
36
-
37
- export type Fn<Return, Args extends unknown[] = []> = (...args: Args) => Return