Skip to content

Commit

Permalink
Export a few more referenced types
Browse files Browse the repository at this point in the history
  • Loading branch information
pimterry committed Aug 18, 2021
1 parent 3e2fd1b commit e41516c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
18 changes: 16 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export type {
MockttpOptions,
MockttpClientOptions,
StandaloneServerOptions,
MockttpStandalone,
PortRange
};

Expand All @@ -32,8 +33,21 @@ export type { WebSocketRuleBuilder } from "./rules/websockets/websocket-rule-bui
// Old pre-WebSocket names, exported for backward compat:
export { requestHandlers as handlers, RequestRuleData as MockRuleData };

// Export TLS utilities:
export { generateCACertificate, generateSPKIFingerprint } from './util/tls';
// Export TLS utility methods:
export {
generateCACertificate,
generateSPKIFingerprint
} from './util/tls';

// Export various referenced utility types:
export type {
CAOptions,
PEM,
HttpsOptions,
HttpsPathOptions
} from './util/tls';
export type { CachedDns } from './util/dns';
export type { MaybePromise } from './util/type-utils';

// Export the core API:

Expand Down
6 changes: 3 additions & 3 deletions src/mockttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { RequestRuleBuilder } from "./rules/requests/request-rule-builder";
import { WebSocketRuleBuilder } from "./rules/websockets/websocket-rule-builder";

import {
ProxyConfig,
ProxyEnvConfig,
MockedEndpoint,
Method,
CompletedRequest,
Expand Down Expand Up @@ -100,7 +100,7 @@ export interface Mockttp {
* process.env = Object.assign(process.env, mockServer.proxyEnv)
* ```
*/
proxyEnv: ProxyConfig;
proxyEnv: ProxyEnvConfig;

/**
* Get a builder for a mock rule that will match any requests on any path.
Expand Down Expand Up @@ -550,7 +550,7 @@ export abstract class AbstractMockttp {
options.ignoreWebsocketHostCertificateErrors || [];
}

get proxyEnv(): ProxyConfig {
get proxyEnv(): ProxyEnvConfig {
return {
HTTP_PROXY: this.url,
HTTPS_PROXY: this.url
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export interface Explainable {
explain(): string;
}

export interface ProxyConfig {
export interface ProxyEnvConfig {
HTTP_PROXY: string;
HTTPS_PROXY: string;
}
Expand Down

0 comments on commit e41516c

Please sign in to comment.