refactor: move types into single file

This commit is contained in:
Artemy 2023-08-14 13:05:34 +03:00
parent 25dbad0f3b
commit 7fad4874ce
2 changed files with 16 additions and 14 deletions

View File

@ -3,8 +3,9 @@ import { ConfigService } from "./config/config.service";
import NodeCache from "node-cache";
import { readability } from "./handlers/readability";
import minify from "./handlers/main";
import Fastify, { FastifyRequest } from "fastify";
import Fastify from "fastify";
import middie from "@fastify/middie";
import { Cached, EngineRequest, GetRequest } from "./schema/requests.types";
class App {
config: IConfigService;
cache: NodeCache;
@ -74,18 +75,5 @@ class App {
}
}
type GetRequest = FastifyRequest<{
Querystring: { url: string; type?: string };
}>;
type EngineRequest = FastifyRequest<{
Querystring: { url: string };
}>;
type Cached = {
content: string;
contentType: string;
};
const app = new App();
app.init();

View File

@ -0,0 +1,14 @@
import { FastifyRequest } from "fastify";
export type GetRequest = FastifyRequest<{
Querystring: { url: string; type?: string };
}>;
export type EngineRequest = FastifyRequest<{
Querystring: { url: string };
}>;
export type Cached = {
content: string;
contentType: string;
};