Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export types of missing MDS classes and functions #137

Merged
merged 2 commits into from
Sep 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}


}
Loading