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

Added .d.ts for sessionless-node #77

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions src/javascript/node/sessionless.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

export declare const AsyncFunction: (func: () => {}) => void;

export declare const generateKeys: (getKey: () => {}, saveKey: () => {}) => Promise<{privateKey: string, publicKey: string}>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be getKeys, and saveKeys

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So here, and for the return of generateKeys above, you should define a Keys type that has privateKey: string, and publicKey: string


// did not know
export declare let getKeysFromDisk: () => void;
export declare const getKeys: () => void;

export declare const sign: (message: string) => Promise<string>;
export declare const verifySignature: (sig: {r: string, s:string}, message: string, pubKey: string) => boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sig is just a string

export declare const generateUUID: () => string ;
export declare const associate: (primarySignature: {r: string, s:string}, primaryMessage: string, primaryPublicKey: string, secondarySignature: {r: string, s:string}, secondaryMessage: string, secondaryPublicKey: string) => boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the signatures here are strings