Skip to content

Commit

Permalink
Export types of missing MDS classes and functions (#137)
Browse files Browse the repository at this point in the history
* Add missing mds classes and functions

* Update deno-lock.json

Reverse deno-lock changes

---------

Co-authored-by: Or Gaizer <or.gaizer@transmitsecurity.com>
Co-authored-by: James Cullum (Pseudonym) <JamesCullum@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 17, 2023
1 parent 9da9eb9 commit b31e86e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions types/main.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
/// <reference types="node" />

import {JWTPayload} from "jose/dist/types/types";

declare module "fido2-lib" {

class MdsEntry{
constructor(mdsEntry: Object, tocEntry: Object)
}

class MdsCollection{
constructor(collectionName: string);
addToc(tocStr: string, rootCert: string, crls: string[] | ArrayBuffer[]): Promise<JWTPayload>
getToc(): Promise<JWTPayload | null>
addEntry(entryStr: string): void
validate() : Promise<void>
findEntry(id: string | ArrayBuffer): MdsEntry | null
}
class Fido2Lib {
constructor(opts?: Fido2LibOptions);

Expand All @@ -18,6 +33,11 @@ declare module "fido2-lib" {
res: AssertionResult,
expected: ExpectedAssertionResult
): Promise<Fido2AssertionResult>;

static createMdsCollection(collectionName: string): MdsCollection
static addMdsCollection(mdsCollection: MdsCollection) : Promise<void>
static clearMdsCollections() : void
static findMdsEntry(id: string): MdsEntry[]
}

interface Fido2LibOptions {
Expand Down Expand Up @@ -143,4 +163,6 @@ declare module "fido2-lib" {
request: AttestationResult;
audit: Audit;
}


}

0 comments on commit b31e86e

Please sign in to comment.