fix: Swap TS Expect errors with proper type handling in app.d.ts
This commit is contained in:
parent
f54eb55f91
commit
22b3f0a72a
9
src/app.d.ts
vendored
9
src/app.d.ts
vendored
@ -1,9 +1,16 @@
|
|||||||
// See https://svelte.dev/docs/kit/types#app.d.ts
|
// See https://svelte.dev/docs/kit/types#app.d.ts
|
||||||
// for information about these interfaces
|
// for information about these interfaces
|
||||||
|
|
||||||
|
import { Server as SocketIOServer } from 'socket.io';
|
||||||
|
import type { HttpServer } from 'vite';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
namespace App {
|
namespace App {
|
||||||
// interface Error {}
|
// interface Error {}
|
||||||
// interface Locals {}
|
interface Locals {
|
||||||
|
io: SocketIOServer | undefined;
|
||||||
|
httpServer: HttpServer | null;
|
||||||
|
}
|
||||||
// interface PageData {}
|
// interface PageData {}
|
||||||
// interface PageState {}
|
// interface PageState {}
|
||||||
// interface Platform {}
|
// interface Platform {}
|
||||||
|
@ -10,9 +10,7 @@ let io: SocketIOServer | undefined;
|
|||||||
export const handle = (async ({ event, resolve }) => {
|
export const handle = (async ({ event, resolve }) => {
|
||||||
// Initialize WebSocket server if not building
|
// Initialize WebSocket server if not building
|
||||||
if (!building) {
|
if (!building) {
|
||||||
// @ts-expect-error hides incorrect error
|
|
||||||
startupSocketIOServer(event.locals.httpServer);
|
startupSocketIOServer(event.locals.httpServer);
|
||||||
// @ts-expect-error hides incorrect error
|
|
||||||
event.locals.io = io;
|
event.locals.io = io;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user