fix(package): no implicit any

This commit is contained in:
Luke
2023-09-16 10:37:14 +02:00
parent abfacee33c
commit 61e3ba9904
4 changed files with 8 additions and 10 deletions

View File

@@ -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 {

View File

@@ -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;

View File

@@ -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;

View File

@@ -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"]