DefinitelyTyped/types/mkcert/index.d.ts
Sachin A 4da4730d44 mkcert npm package typings (#33819)
* mkcert package typings

* Fixed linting errors

* Fixed tests
2019-03-12 14:12:54 -07:00

34 lines
991 B
TypeScript

// Type definitions for mkcert 1.2
// Project: https://github.com/Subash/mkcert/
// Definitions by: Sachin Arunkumar <https://github.com/asachin96>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Type which represent's generated certificate
export interface Certificate {
cert: string;
key: string;
}
// Type which represent's CA certificate generation input parameters
export interface CACertificateInfo {
organization: string;
countryCode: string;
state: string;
locality: string;
validityDays: number;
}
// Type which represent's certificate generation input parameters
export interface CertificateInfo {
domains: string[];
validityDays: number;
caKey: string;
caCert: string;
}
// Api to create a Certificate Authority
export function createCA(caCerticateInfo: CACertificateInfo): Promise<Certificate>;
// Api to create a Certificate
export function createCert(certicateInfo: CertificateInfo): Promise<Certificate>;