style: lint .d.ts files

This commit is contained in:
Filip Skokan 2020-11-15 12:40:47 +01:00
parent b02902ef88
commit e6e789c8dd
17 changed files with 65 additions and 56 deletions

2
.gitignore vendored
View file

@ -1,6 +1,6 @@
# crypto runtime copies
src/runtime/*.ts
+src/runtime/*.d.ts
!src/runtime/*.d.ts
# cjs clone of the test suite
test/cjs

View file

@ -1,3 +1,3 @@
import type { AesGcmKwUnwrapFunction, AesGcmKwWrapFunction } from './interfaces.d';
export declare const wrap: AesGcmKwWrapFunction;
export declare const unwrap: AesGcmKwUnwrapFunction;
import type { AesGcmKwUnwrapFunction, AesGcmKwWrapFunction } from './interfaces.d'
export declare const wrap: AesGcmKwWrapFunction
export declare const unwrap: AesGcmKwUnwrapFunction

View file

@ -1,3 +1,3 @@
import type { AesKwUnwrapFunction, AesKwWrapFunction } from './interfaces.d';
export declare const wrap: AesKwWrapFunction;
export declare const unwrap: AesKwUnwrapFunction;
import type { AesKwUnwrapFunction, AesKwWrapFunction } from './interfaces.d'
export declare const wrap: AesKwWrapFunction
export declare const unwrap: AesKwUnwrapFunction

View file

@ -1,3 +1,3 @@
import type { Base64UrlDecode, Base64UrlEncode } from './interfaces.d';
export declare const encode: Base64UrlEncode;
export declare const decode: Base64UrlDecode;
import type { Base64UrlDecode, Base64UrlEncode } from './interfaces.d'
export declare const encode: Base64UrlEncode
export declare const decode: Base64UrlDecode

View file

@ -1,3 +1,3 @@
import type { DecryptFunction } from './interfaces.d';
declare const decrypt: DecryptFunction;
export default decrypt;
import type { DecryptFunction } from './interfaces.d'
declare const decrypt: DecryptFunction
export default decrypt

View file

@ -1,3 +1,3 @@
import type { AsyncOrSync } from '../types.i.d'
declare const _default: (digest: string, data: Uint8Array) => AsyncOrSync<Uint8Array>;
export default _default;
declare const _default: (digest: string, data: Uint8Array) => AsyncOrSync<Uint8Array>
export default _default

View file

@ -1,6 +1,12 @@
import type { EcdhAllowedFunction, EcdhESDeriveKeyFunction, EphemeralKeyToPublicJwkFunction, GenerateEpkFunction, PublicJwkToEphemeralKeyFunction } from './interfaces.d';
export declare const deriveKey: EcdhESDeriveKeyFunction;
export declare const ephemeralKeyToPublicJWK: EphemeralKeyToPublicJwkFunction;
export declare const generateEpk: GenerateEpkFunction;
export declare const publicJwkToEphemeralKey: PublicJwkToEphemeralKeyFunction;
export declare const ecdhAllowed: EcdhAllowedFunction;
import type {
EcdhAllowedFunction,
EcdhESDeriveKeyFunction,
EphemeralKeyToPublicJwkFunction,
GenerateEpkFunction,
PublicJwkToEphemeralKeyFunction,
} from './interfaces.d'
export declare const deriveKey: EcdhESDeriveKeyFunction
export declare const ephemeralKeyToPublicJWK: EphemeralKeyToPublicJwkFunction
export declare const generateEpk: GenerateEpkFunction
export declare const publicJwkToEphemeralKey: PublicJwkToEphemeralKeyFunction
export declare const ecdhAllowed: EcdhAllowedFunction

View file

@ -1,3 +1,3 @@
import type { EncryptFunction } from './interfaces.d';
declare const encrypt: EncryptFunction;
export default encrypt;
import type { EncryptFunction } from './interfaces.d'
declare const encrypt: EncryptFunction
export default encrypt

View file

@ -1,2 +1,2 @@
declare const _default: (url: URL, timeout: number) => Promise<any>;
export default _default;
declare const _default: (url: URL, timeout: number) => Promise<any>
export default _default

View file

@ -1,11 +1,14 @@
import type { KeyObject } from 'crypto';
import type { KeyLike } from '../types.d';
export declare function generateSecret(alg: string): Promise<KeyLike>;
import type { KeyObject } from 'crypto'
import type { KeyLike } from '../types.d'
export declare function generateSecret(alg: string): Promise<KeyLike>
interface Options {
crv?: string;
crv?: string
}
export declare function generateKeyPair(alg: string, options?: Options): Promise<{
privateKey: CryptoKey | KeyObject,
publicKey: CryptoKey | KeyObject
}>;
export {};
export declare function generateKeyPair(
alg: string,
options?: Options,
): Promise<{
privateKey: CryptoKey | KeyObject
publicKey: CryptoKey | KeyObject
}>
export {}

View file

@ -1,3 +1,3 @@
import type { KeyLike, JWK } from '../types.d';
declare const _default: (jwk: JWK) => Promise<KeyLike>;
export default _default;
import type { KeyLike, JWK } from '../types.d'
declare const _default: (jwk: JWK) => Promise<KeyLike>
export default _default

View file

@ -1,3 +1,3 @@
import type { Pbes2KWDecryptFunction, Pbes2KWEncryptFunction } from './interfaces.d';
export declare const encrypt: Pbes2KWEncryptFunction;
export declare const decrypt: Pbes2KWDecryptFunction;
import type { Pbes2KWDecryptFunction, Pbes2KWEncryptFunction } from './interfaces.d'
export declare const encrypt: Pbes2KWEncryptFunction
export declare const decrypt: Pbes2KWDecryptFunction

View file

@ -1,3 +1,3 @@
import type { GetRandomValuesFunction } from './interfaces.d';
declare const random: GetRandomValuesFunction;
export default random;
import type { GetRandomValuesFunction } from './interfaces.d'
declare const random: GetRandomValuesFunction
export default random

View file

@ -1,3 +1,3 @@
import type { RsaEsDecryptFunction, RsaEsEncryptFunction } from './interfaces.d';
export declare const encrypt: RsaEsEncryptFunction;
export declare const decrypt: RsaEsDecryptFunction;
import type { RsaEsDecryptFunction, RsaEsEncryptFunction } from './interfaces.d'
export declare const encrypt: RsaEsEncryptFunction
export declare const decrypt: RsaEsDecryptFunction

View file

@ -1,3 +1,3 @@
import type { SignFunction } from './interfaces.d';
declare const sign: SignFunction;
export default sign;
import type { SignFunction } from './interfaces.d'
declare const sign: SignFunction
export default sign

View file

@ -1,3 +1,3 @@
import type { VerifyFunction } from './interfaces.d';
declare const verify: VerifyFunction;
export default verify;
import type { VerifyFunction } from './interfaces.d'
declare const verify: VerifyFunction
export default verify

View file

@ -1,3 +1,3 @@
import type { InflateFunction, DeflateFunction } from '../types.d';
export declare const inflate: InflateFunction;
export declare const deflate: DeflateFunction;
import type { InflateFunction, DeflateFunction } from '../types.d'
export declare const inflate: InflateFunction
export declare const deflate: DeflateFunction