style: fix linter and add types

This commit is contained in:
Juan D. Jara
2021-09-27 02:35:10 +02:00
parent eea389879f
commit 54868fd486
4 changed files with 11 additions and 12 deletions

View File

@@ -1,4 +1,5 @@
import { randomBytes } from 'crypto';
import MailMessage from 'nodemailer/lib/mailer/mail-message';
import * as openpgp from 'openpgp';
import { Transform, TransformCallback } from 'stream';
@@ -25,7 +26,7 @@ class PGPEncryptor extends Transform {
// just save the whole message
_transform = (
chunk: any,
chunk: Uint8Array,
_encoding: BufferEncoding,
callback: TransformCallback
): void => {
@@ -166,17 +167,16 @@ class PGPEncryptor extends Transform {
}
export const openpgpEncrypt = (options: EncryptorOptions) => {
return function (mail: any, callback: () => unknown): void {
return function (mail: MailMessage, callback: () => unknown): void {
if (!options.encryptionKeys.length) {
setImmediate(callback);
}
mail.message.transform(
() =>
new PGPEncryptor({
signingKey: options.signingKey,
password: options.password,
encryptionKeys: options.encryptionKeys,
})
new PGPEncryptor({
signingKey: options.signingKey,
password: options.password,
encryptionKeys: options.encryptionKeys,
})
);
setImmediate(callback);
};

View File

@@ -40,7 +40,7 @@ class AsyncLock {
public dispatch = async (
key: string | number,
callback: () => Promise<void>
) => {
): Promise<void> => {
const skey = String(key);
await this.acquire(skey);
try {

View File

@@ -3,7 +3,7 @@ import { useState } from 'react';
import AnimateHeight from 'react-animate-height';
export interface AccordionProps {
children: (args: AccordionChildProps) => React.ReactElement<any, any> | null;
children: (args: AccordionChildProps) => React.ReactElement | null;
/** If true, only one accordion item can be open at any time */
single?: boolean;
/** If true, at least one accordion item will always be open */
@@ -13,7 +13,7 @@ export interface AccordionProps {
export interface AccordionChildProps {
openIndexes: number[];
handleClick(index: number): void;
AccordionContent: any;
AccordionContent: typeof AccordionContent;
}
export const AccordionContent: React.FC<{ isOpen: boolean }> = ({

View File

@@ -1,4 +1,3 @@
/* eslint-disable no-async-promise-executor */
import axios, { AxiosError, AxiosResponse } from 'axios';
interface JellyfinAuthenticationResult {