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';
|
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) => {
|
onNet(`__ox_cb_${cache.resource}`, (key: string, ...args: any) => {
|
||||||
const resolve = activeEvents[key];
|
const resolve = activeEvents[key];
|
||||||
@@ -41,8 +41,8 @@ export function triggerServerCallback<T = unknown>(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function onServerCallback(eventName: string, cb: (...args) => any) {
|
export function onServerCallback(eventName: string, cb: (...args: any[]) => any) {
|
||||||
onNet(`__ox_cb_${eventName}`, async (resource: string, key: string, ...args) => {
|
onNet(`__ox_cb_${eventName}`, async (resource: string, key: string, ...args: any[]) => {
|
||||||
let response: any;
|
let response: any;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { cache } from '../cache';
|
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) => {
|
onNet(`__ox_cb_${cache.resource}`, (key: string, ...args: any) => {
|
||||||
const resolve = activeEvents[key];
|
const resolve = activeEvents[key];
|
||||||
@@ -25,8 +25,8 @@ export function triggerClientCallback<T = unknown>(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function onClientCallback(eventName: string, cb: (playerId: number, ...args) => any) {
|
export function onClientCallback(eventName: string, cb: (playerId: number, ...args: any[]) => any) {
|
||||||
onNet(`__ox_cb_${eventName}`, async (resource: string, key: string, ...args) => {
|
onNet(`__ox_cb_${eventName}`, async (resource: string, key: string, ...args: any[]) => {
|
||||||
const src = source;
|
const src = source;
|
||||||
let response: any;
|
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(),
|
resource: GetCurrentResourceName(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
get(target, key: string) {
|
get(target: any, key: string) {
|
||||||
const result = key ? target[key] : target;
|
const result = key ? target[key] : target;
|
||||||
if (result !== undefined) return result;
|
if (result !== undefined) return result;
|
||||||
|
|
||||||
|
|||||||
@@ -9,14 +9,12 @@
|
|||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
"allowJs": false,
|
"allowJs": false,
|
||||||
"lib": ["ESNext"],
|
"lib": ["ESNext"],
|
||||||
"noEmitOnError": false,
|
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": true
|
||||||
"noEmit": false
|
|
||||||
},
|
},
|
||||||
"include": ["client", "server", "shared"],
|
"include": ["client", "server", "shared"],
|
||||||
"exclude": ["**/node_modules"]
|
"exclude": ["**/node_modules"]
|
||||||
|
|||||||
Reference in New Issue
Block a user