Skip to content

Commit

Permalink
docs: add various exported symbol descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Feb 23, 2025
1 parent e1350ef commit 74f02c8
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/types/interfaces/CompactDecryptResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva).

Compact JWE decryption result

## Properties

### plaintext
Expand Down
2 changes: 2 additions & 0 deletions docs/types/interfaces/CompactVerifyResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva).

Compact JWS verification result

## Properties

### payload
Expand Down
2 changes: 2 additions & 0 deletions docs/types/interfaces/FlattenedDecryptResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva).

Flattened JWE JSON Serialization Syntax decryption result

## Properties

### plaintext
Expand Down
2 changes: 2 additions & 0 deletions docs/types/interfaces/FlattenedVerifyResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva).

Flattened JWS JSON Serialization Syntax verification result

## Properties

### payload
Expand Down
2 changes: 2 additions & 0 deletions docs/types/interfaces/GeneralDecryptResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva).

Flattened JWE JSON Serialization Syntax decryption result

## Properties

### plaintext
Expand Down
2 changes: 2 additions & 0 deletions docs/types/interfaces/GeneralVerifyResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva).

Flattened JWS JSON Serialization Syntax verification result

## Properties

### payload
Expand Down
2 changes: 2 additions & 0 deletions docs/types/interfaces/JoseHeaderParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva).

Header Parameters common to JWE and JWS

## Properties

### cty?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by [becoming a sponsor](https://github.com/sponsors/panva).

**ProtectedHeaderParameters**: [`JWSHeaderParameters`](../../../types/interfaces/JWSHeaderParameters.md) & [`JWEHeaderParameters`](../../../types/interfaces/JWEHeaderParameters.md)

JWE and JWS Header Parameters
7 changes: 7 additions & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ export interface GeneralJWS {
signatures: Omit<FlattenedJWSInput, 'payload'>[]
}

/** Header Parameters common to JWE and JWS */
export interface JoseHeaderParameters {
/** "kid" (Key ID) Header Parameter */
kid?: string
Expand Down Expand Up @@ -584,6 +585,7 @@ export interface JWTPayload {
[propName: string]: unknown
}

/** Flattened JWE JSON Serialization Syntax decryption result */
export interface FlattenedDecryptResult {
/** JWE AAD. */
additionalAuthenticatedData?: Uint8Array
Expand All @@ -601,8 +603,10 @@ export interface FlattenedDecryptResult {
unprotectedHeader?: JWEHeaderParameters
}

/** Flattened JWE JSON Serialization Syntax decryption result */
export interface GeneralDecryptResult extends FlattenedDecryptResult {}

/** Compact JWE decryption result */
export interface CompactDecryptResult {
/** Plaintext. */
plaintext: Uint8Array
Expand All @@ -611,6 +615,7 @@ export interface CompactDecryptResult {
protectedHeader: CompactJWEHeaderParameters
}

/** Flattened JWS JSON Serialization Syntax verification result */
export interface FlattenedVerifyResult {
/** JWS Payload. */
payload: Uint8Array
Expand All @@ -622,8 +627,10 @@ export interface FlattenedVerifyResult {
unprotectedHeader?: JWSHeaderParameters
}

/** Flattened JWS JSON Serialization Syntax verification result */
export interface GeneralVerifyResult extends FlattenedVerifyResult {}

/** Compact JWS verification result */
export interface CompactVerifyResult {
/** JWS Payload. */
payload: Uint8Array
Expand Down
1 change: 1 addition & 0 deletions src/util/decode_protected_header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { decoder } from '../lib/buffer_utils.js'
import isObject from '../lib/is_object.js'
import type * as types from '../types.d.ts'

/** JWE and JWS Header Parameters */
export type ProtectedHeaderParameters = types.JWSHeaderParameters & types.JWEHeaderParameters

/**
Expand Down

0 comments on commit 74f02c8

Please sign in to comment.