fix: tsc errors

This commit is contained in:
b1ek 2024-05-11 21:58:25 +10:00
parent c06e655819
commit 6d68a704a3
Signed by: blek
GPG Key ID: 14546221E3595D0C
8 changed files with 13 additions and 9 deletions

View File

@ -1,4 +1,4 @@
import crypto from 'node:crypto';
import * as crypto from 'node:crypto';
export type Client = {
name: string;

View File

@ -1,8 +1,9 @@
import { Client, checkKey } from './client.js';
import fsp from 'node:fs/promises';
import * as fsp from 'node:fs/promises';
import Ajv from 'ajv';
import { existsSync } from 'node:fs';
// @ts-expect-error: esnext moment
const ajv = new Ajv();
const config_validate = ajv.compile({

View File

@ -1,5 +1,5 @@
import { type FastifyPluginAsync } from 'fastify';
import fsp from 'node:fs/promises';
import * as fsp from 'node:fs/promises';
import { Config, config } from '../config.js';
import { InvalidAuthorization } from '../errors.js';

View File

@ -1,5 +1,5 @@
import { FastifyPluginAsync } from 'fastify';
import fsp from 'node:fs/promises';
import * as fsp from 'node:fs/promises';
import { Config, config } from '../config.js';
import { InvalidAuthorization, NotFoundError } from '../errors.js';

View File

@ -1,6 +1,6 @@
import { type FastifyPluginAsync } from 'fastify';
import fsp from 'node:fs/promises';
import path from 'node:path';
import * as fsp from 'node:fs/promises';
import * as path from 'node:path';
import { Stats } from 'node:fs';
import { Config, config } from '../config.js';

View File

@ -14,6 +14,7 @@ type UploadPayload = {
data: string; // base64-encoded
name: string;
};
// @ts-expect-error: esnext moment
const ajv = new Ajv();
const upload_schema = {
type: 'object',

View File

@ -1,7 +1,7 @@
import { config } from './config.js';
import path from 'path';
import fsp from 'node:fs/promises';
import * as path from 'path';
import * as fsp from 'node:fs/promises';
import { NoKeyClient } from './client.js';
function getClient(clientName: string): NoKeyClient | undefined {

View File

@ -1,5 +1,7 @@
{
"compilerOptions": {
"lib": ["ES2023"]
"lib": ["ES2023"],
"module": "NodeNext",
"moduleResolution": "NodeNext"
}
}