mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
fix(package): no implicit any
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { cache } from '../cache';
|
||||
|
||||
const activeEvents: Record<string, (...args) => void> = {};
|
||||
const activeEvents: Record<string, (...args: any[]) => void> = {};
|
||||
|
||||
onNet(`__ox_cb_${cache.resource}`, (key: string, ...args: any) => {
|
||||
const resolve = activeEvents[key];
|
||||
@@ -41,8 +41,8 @@ export function triggerServerCallback<T = unknown>(
|
||||
});
|
||||
}
|
||||
|
||||
export function onServerCallback(eventName: string, cb: (...args) => any) {
|
||||
onNet(`__ox_cb_${eventName}`, async (resource: string, key: string, ...args) => {
|
||||
export function onServerCallback(eventName: string, cb: (...args: any[]) => any) {
|
||||
onNet(`__ox_cb_${eventName}`, async (resource: string, key: string, ...args: any[]) => {
|
||||
let response: any;
|
||||
|
||||
try {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cache } from '../cache';
|
||||
|
||||
const activeEvents: Record<string, (...args) => void> = {};
|
||||
const activeEvents: Record<string, (...args: any[]) => void> = {};
|
||||
|
||||
onNet(`__ox_cb_${cache.resource}`, (key: string, ...args: any) => {
|
||||
const resolve = activeEvents[key];
|
||||
@@ -25,8 +25,8 @@ export function triggerClientCallback<T = unknown>(
|
||||
});
|
||||
}
|
||||
|
||||
export function onClientCallback(eventName: string, cb: (playerId: number, ...args) => any) {
|
||||
onNet(`__ox_cb_${eventName}`, async (resource: string, key: string, ...args) => {
|
||||
export function onClientCallback(eventName: string, cb: (playerId: number, ...args: any[]) => any) {
|
||||
onNet(`__ox_cb_${eventName}`, async (resource: string, key: string, ...args: any[]) => {
|
||||
const src = source;
|
||||
let response: any;
|
||||
|
||||
|
||||
2
package/shared/resource/cache/index.ts
vendored
2
package/shared/resource/cache/index.ts
vendored
@@ -3,7 +3,7 @@ export const cache: Record<string, any> = new Proxy(
|
||||
resource: GetCurrentResourceName(),
|
||||
},
|
||||
{
|
||||
get(target, key: string) {
|
||||
get(target: any, key: string) {
|
||||
const result = key ? target[key] : target;
|
||||
if (result !== undefined) return result;
|
||||
|
||||
|
||||
@@ -9,14 +9,12 @@
|
||||
"target": "ESNext",
|
||||
"allowJs": false,
|
||||
"lib": ["ESNext"],
|
||||
"noEmitOnError": false,
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"moduleResolution": "node",
|
||||
"experimentalDecorators": true,
|
||||
"noImplicitAny": false,
|
||||
"noEmit": false
|
||||
"noImplicitAny": true
|
||||
},
|
||||
"include": ["client", "server", "shared"],
|
||||
"exclude": ["**/node_modules"]
|
||||
|
||||
Reference in New Issue
Block a user