-
Notifications
You must be signed in to change notification settings - Fork 78
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
refactor(ssl): replace openssl dependency with node-forge #29
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
/// <reference types="node-forge" /> | ||
declare module "command-exists"; | ||
declare module "eol"; | ||
declare module "sudo-prompt"; | ||
declare module "password-prompt"; | ||
declare module "application-config-path" { | ||
export = (appName: string) => string; | ||
} | ||
|
||
/** | ||
* The @types/node-forge package is missing these definitions. | ||
*/ | ||
declare module "node-forge" { | ||
namespace random { | ||
function getBytes(numBytes: int, callback: (err: Error, bytes: Bytes) => any): Bytes; | ||
} | ||
namespace pki { | ||
interface CertificateAuthorityStore { | ||
addCertificate: (cert: Certificate) => void; | ||
} | ||
function createCertificationRequest(): Certificate; | ||
function createCaStore(): CertificateAuthorityStore; | ||
function verifyCertificateChain(caStore: CertificateAuthorityStore, certs: Certificate[]): void; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest filing a PR with the DefinitelyTyped repo to land these types for everyone to use! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's a good idea! I haven't opened that PR yet--would you strongly prefer to wait until DefinitelyTyped approves, merges and releases such a PR before merging this? |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not super familiar with this syntax, but I was under the impression it was no longer necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was the way I got TypeScript to refer to DefinitelyTyped node-forge types in this file. If I used an
import
declaration, then TypeScript stopped regarding the file as a definition file and would error on compilation.