fix: Simlify types, convert interfaces into types
This commit is contained in:
parent
c59cc1e144
commit
ec7dbeb0ae
@ -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));
|
||||
|
@ -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');
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
@ -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({
|
||||
|
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user