fix: Simlify types, convert interfaces into types

This commit is contained in:
April Hall 2025-03-01 01:47:14 -05:00
parent c59cc1e144
commit ec7dbeb0ae
6 changed files with 14 additions and 19 deletions

View File

@ -1,10 +1,10 @@
import cassandra from 'cassandra-driver';
import 'dotenv/config';
interface Messages {
type Messages = {
messages: cassandra.types.Row[] | null;
error: Error | null;
}
};
function createDelay(ms: number) {
return new Promise((res) => setTimeout(res, ms));

View File

@ -1,9 +1,9 @@
import Database from 'better-sqlite3';
interface Profile {
type Profile = {
username: string;
image: string;
}
};
class AuthDb {
private client = new Database('./src/lib/server/db/users.db');

View File

@ -3,13 +3,13 @@ import * as Minio from 'minio';
import { Readable } from 'stream';
import { v4 } from 'uuid';
interface ClientParams {
type ClientParams = {
endPoint: string;
port: number;
accessKey: string;
secretKey: string;
useSSL: boolean;
}
};
class MinioClient {
private client: Minio.Client;

View File

@ -1,16 +1,11 @@
export interface TypeMessage {
export type TypeMessage = {
message: string;
imageSrc: string;
user: string;
uid: string;
timestamp: Date;
}
};
export interface TypeFullMessage {
export type TypeFullMessage = TypeMessage & {
channel: string;
message: string;
imageSrc: string;
user: string;
uid: string;
timestamp: Date;
}
};

View File

@ -6,10 +6,10 @@ import { redirect } from '@sveltejs/kit';
import { superValidate } from 'sveltekit-superforms';
import { zod } from 'sveltekit-superforms/adapters';
interface Profile {
type Profile = {
username: string;
image: string;
}
};
export async function load({ request }) {
const session = await auth.api.getSession({

View File

@ -4,11 +4,11 @@ import type { TypeMessage } from '$lib/types';
import { error, redirect } from '@sveltejs/kit';
import { auth } from '$lib/server/db/auth';
interface ChannelLoad {
type ChannelLoad = {
messages: TypeMessage[];
currentUserID: string;
currentUserName: string;
}
};
export async function load({ params, request }): Promise<ChannelLoad> {
const session = await auth.api.getSession({