From d78f090d430e7f351e33d55ac05db8e2c103d130 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Sun, 15 Sep 2024 13:39:23 +0200 Subject: [PATCH] docs: update JSDoc to use more link syntax --- docs/functions/generateKeyPair.md | 6 +++--- docs/type-aliases/JWSAlgorithm.md | 8 ++++---- patches/typedoc-plugin-mdn-links+3.2.12.patch | 14 ++++++++++++++ src/index.ts | 10 +++++----- 4 files changed, 26 insertions(+), 12 deletions(-) create mode 100644 patches/typedoc-plugin-mdn-links+3.2.12.patch diff --git a/docs/functions/generateKeyPair.md b/docs/functions/generateKeyPair.md index 4b656bcc..ee898e93 100644 --- a/docs/functions/generateKeyPair.md +++ b/docs/functions/generateKeyPair.md @@ -6,9 +6,9 @@ Support from the community to continue maintaining and improving this module is *** -▸ **generateKeyPair**(`alg`, `options`?): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`CryptoKeyPair`\> +▸ **generateKeyPair**(`alg`, `options`?): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`CryptoKeyPair`](https://developer.mozilla.org/docs/Web/API/CryptoKeyPair)\> -Generates a CryptoKeyPair for a given JWS `alg` Algorithm identifier. +Generates a [CryptoKeyPair](https://developer.mozilla.org/docs/Web/API/CryptoKeyPair) for a given JWS `alg` Algorithm identifier. ## Parameters @@ -19,4 +19,4 @@ Generates a CryptoKeyPair for a given JWS `alg` Algorithm identifier. ## Returns -[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`CryptoKeyPair`\> +[`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`CryptoKeyPair`](https://developer.mozilla.org/docs/Web/API/CryptoKeyPair)\> diff --git a/docs/type-aliases/JWSAlgorithm.md b/docs/type-aliases/JWSAlgorithm.md index a91c8396..6b7db0e6 100644 --- a/docs/type-aliases/JWSAlgorithm.md +++ b/docs/type-aliases/JWSAlgorithm.md @@ -12,7 +12,7 @@ Supported JWS `alg` Algorithm identifiers. ## Examples -CryptoKey algorithm for the `PS256`, `PS384`, or `PS512` JWS Algorithm Identifiers +[CryptoKey.algorithm](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) for the `PS256`, `PS384`, or `PS512` JWS Algorithm Identifiers ```ts interface PS256 extends RsaHashedKeyAlgorithm { @@ -31,7 +31,7 @@ interface PS512 extends RsaHashedKeyAlgorithm { } ``` -CryptoKey algorithm for the `ES256`, `ES384`, or `ES512` JWS Algorithm Identifiers +[CryptoKey.algorithm](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) for the `ES256`, `ES384`, or `ES512` JWS Algorithm Identifiers ```ts interface ES256 extends EcKeyAlgorithm { @@ -50,7 +50,7 @@ interface ES512 extends EcKeyAlgorithm { } ``` -CryptoKey algorithm for the `RS256`, `RS384`, or `RS512` JWS Algorithm Identifiers +[CryptoKey.algorithm](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) for the `RS256`, `RS384`, or `RS512` JWS Algorithm Identifiers ```ts interface RS256 extends RsaHashedKeyAlgorithm { @@ -69,7 +69,7 @@ interface RS512 extends RsaHashedKeyAlgorithm { } ``` -CryptoKey algorithm for the `EdDSA` JWS Algorithm Identifier (Experimental) +[CryptoKey.algorithm](https://developer.mozilla.org/docs/Web/API/CryptoKey/algorithm) for the `EdDSA` JWS Algorithm Identifier (Experimental) Runtime support for this algorithm is limited, it depends on the [Secure Curves in the Web Cryptography API](https://wicg.github.io/webcrypto-secure-curves/) proposal which is yet to be diff --git a/patches/typedoc-plugin-mdn-links+3.2.12.patch b/patches/typedoc-plugin-mdn-links+3.2.12.patch new file mode 100644 index 00000000..f48dd9c0 --- /dev/null +++ b/patches/typedoc-plugin-mdn-links+3.2.12.patch @@ -0,0 +1,14 @@ +diff --git a/node_modules/typedoc-plugin-mdn-links/data/web-api.json b/node_modules/typedoc-plugin-mdn-links/data/web-api.json +index 3e76956..5751271 100644 +--- a/node_modules/typedoc-plugin-mdn-links/data/web-api.json ++++ b/node_modules/typedoc-plugin-mdn-links/data/web-api.json +@@ -1645,6 +1645,9 @@ + "usages": "https://developer.mozilla.org/docs/Web/API/CryptoKey/usages" + } + }, ++ "CryptoKeyPair": { ++ "url": "https://developer.mozilla.org/docs/Web/API/CryptoKeyPair" ++ }, + "CustomElementRegistry": { + "url": "https://developer.mozilla.org/docs/Web/API/CustomElementRegistry", + "inst": { diff --git a/src/index.ts b/src/index.ts index 1bf34ae1..b4c2fa0d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -90,7 +90,7 @@ export type ClientAuthenticationMethod = * * @example * - * CryptoKey algorithm for the `PS256`, `PS384`, or `PS512` JWS Algorithm Identifiers + * {@link !CryptoKey.algorithm} for the `PS256`, `PS384`, or `PS512` JWS Algorithm Identifiers * * ```ts * interface PS256 extends RsaHashedKeyAlgorithm { @@ -111,7 +111,7 @@ export type ClientAuthenticationMethod = * * @example * - * CryptoKey algorithm for the `ES256`, `ES384`, or `ES512` JWS Algorithm Identifiers + * {@link !CryptoKey.algorithm} for the `ES256`, `ES384`, or `ES512` JWS Algorithm Identifiers * * ```ts * interface ES256 extends EcKeyAlgorithm { @@ -132,7 +132,7 @@ export type ClientAuthenticationMethod = * * @example * - * CryptoKey algorithm for the `RS256`, `RS384`, or `RS512` JWS Algorithm Identifiers + * {@link !CryptoKey.algorithm} for the `RS256`, `RS384`, or `RS512` JWS Algorithm Identifiers * * ```ts * interface RS256 extends RsaHashedKeyAlgorithm { @@ -153,7 +153,7 @@ export type ClientAuthenticationMethod = * * @example * - * CryptoKey algorithm for the `EdDSA` JWS Algorithm Identifier (Experimental) + * {@link !CryptoKey.algorithm} for the `EdDSA` JWS Algorithm Identifier (Experimental) * * Runtime support for this algorithm is limited, it depends on the [Secure Curves in the Web * Cryptography API](https://wicg.github.io/webcrypto-secure-curves/) proposal which is yet to be @@ -4376,7 +4376,7 @@ export interface GenerateKeyPairOptions { } /** - * Generates a CryptoKeyPair for a given JWS `alg` Algorithm identifier. + * Generates a {@link !CryptoKeyPair} for a given JWS `alg` Algorithm identifier. * * @param alg Supported JWS `alg` Algorithm identifier. *