mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-12 20:02:28 +08:00
refactor(server): various type errors
This commit is contained in:
parent
6414dd71ab
commit
de83029c3a
@ -6,7 +6,7 @@ import etapiTokenService from "../services/etapi_tokens.js";
|
|||||||
import config from "../services/config.js";
|
import config from "../services/config.js";
|
||||||
import type { NextFunction, Request, RequestHandler, Response, Router } from "express";
|
import type { NextFunction, Request, RequestHandler, Response, Router } from "express";
|
||||||
import type { ValidatorMap } from "./etapi-interface.js";
|
import type { ValidatorMap } from "./etapi-interface.js";
|
||||||
import type { ApiRequestHandler } from "../routes/routes.js";
|
import type { ApiRequestHandler } from "../routes/route_api.js";
|
||||||
const GENERIC_CODE = "GENERIC";
|
const GENERIC_CODE = "GENERIC";
|
||||||
|
|
||||||
type HttpMethod = "all" | "get" | "post" | "put" | "delete" | "patch" | "options" | "head";
|
type HttpMethod = "all" | "get" | "post" | "put" | "delete" | "patch" | "options" | "head";
|
||||||
|
@ -50,7 +50,7 @@ function init(app: Express.Application) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return app._router.handle(req, res, () => {});
|
return (app as any)._router.handle(req, res, () => {});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ async function getClient(opts: ClientOpts): Promise<Client> {
|
|||||||
// it's not clear how to explicitly configure proxy (as opposed to system proxy),
|
// it's not clear how to explicitly configure proxy (as opposed to system proxy),
|
||||||
// so in that case, we always use node's modules
|
// so in that case, we always use node's modules
|
||||||
if (isElectron && !opts.proxy) {
|
if (isElectron && !opts.proxy) {
|
||||||
return (await import("electron")).net as Client;
|
return (await import("electron")).net as unknown as Client;
|
||||||
} else {
|
} else {
|
||||||
const { protocol } = url.parse(opts.url);
|
const { protocol } = url.parse(opts.url);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user