mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2026-09-26 20:41:45 +00:00
chore: upgrade to typescript 7 with tsconfig strictest
This commit is contained in:
@@ -8,14 +8,15 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@msgpack/msgpack": "^3.1.3",
|
||||
"@noble/ciphers": "^2.2.0",
|
||||
"@noble/hashes": "^2.2.0",
|
||||
"@noble/ciphers": "^2.4.0",
|
||||
"@noble/hashes": "^2.4.0",
|
||||
"lz4js": "^0.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tsconfig/strictest": "catalog:",
|
||||
"@types/lz4js": "^0.2.2",
|
||||
"typescript": "^5.9.3",
|
||||
"vitest": "^4.1.7"
|
||||
"typescript": "catalog:",
|
||||
"vitest": "^4.1.11"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "vitest run",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { encode, decode } from "@msgpack/msgpack";
|
||||
|
||||
import type { ServerNote } from "./types.js";
|
||||
import type { ServerNote, Status } from "./types.js";
|
||||
|
||||
let server = "";
|
||||
|
||||
@@ -51,7 +51,7 @@ export async function get(id: string): Promise<ServerNote | null> {
|
||||
return { meta, data: d instanceof Uint8Array ? d : new Uint8Array(d) } satisfies ServerNote;
|
||||
}
|
||||
|
||||
export async function status(): Promise<Record<string, unknown>> {
|
||||
export async function status(): Promise<Status> {
|
||||
const res = await fetch(api("status"));
|
||||
if (!res.ok) throw new Error("status failed");
|
||||
return res.json();
|
||||
|
||||
@@ -18,4 +18,21 @@ export type FileDTO = {
|
||||
mime: string;
|
||||
size: number;
|
||||
data: Uint8Array;
|
||||
};
|
||||
|
||||
export type Status = {
|
||||
version: string;
|
||||
max_size: number;
|
||||
max_views: number;
|
||||
max_expiration: number;
|
||||
allow_advanced: boolean;
|
||||
allow_files: boolean;
|
||||
imprint_url: string;
|
||||
imprint_html: string;
|
||||
theme_image: string;
|
||||
theme_text: string;
|
||||
theme_page_title: string;
|
||||
theme_favicon: string;
|
||||
theme_new_note_notice: boolean;
|
||||
theme_home_link: boolean;
|
||||
};
|
||||
@@ -1,10 +1,9 @@
|
||||
{
|
||||
"extends": "@tsconfig/strictest/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true
|
||||
"noEmit": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user