Skip to content

Commit

Permalink
fix module exports
Browse files Browse the repository at this point in the history
  • Loading branch information
0xch4z committed Aug 9, 2019
1 parent 11aa7dc commit 07013ae
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
35 changes: 17 additions & 18 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { AxiosInstance } from 'axios';

export interface AppOptions {
declare interface AppOptions {
readonly slug: string;
}

export interface Client {
declare interface Client {
app(options: AppOptions): App;
}

export interface App {
declare interface App {
readonly app: { slug: string };

/**
Expand All @@ -20,23 +20,23 @@ export interface App {
triggerBuild(buildParams?: BuildOptions): Promise<Build>;
}

export interface AbortOptions {
declare interface AbortOptions {
readonly reason?: string;
readonly withSuccess?: boolean;
readonly skipNotifications?: boolean;
}

export interface FollowOptions {
declare interface FollowOptions {
readonly heartbeat?: number;
readonly interval?: number;
}

export interface AbortResponse {
declare interface AbortResponse {
readonly status?: string;
readonly message?: string;
}

export interface BuildDescription {
declare interface BuildDescription {
readonly abort_reason: string;
readonly branch: string;
readonly build_number: number;
Expand All @@ -62,10 +62,8 @@ export interface BuildDescription {
readonly triggered_workflow: string;
}

export interface Build {
abort(
options?: Pick<AbortOptions, Exclude<AbortOptions, 'reason'>>
): Promise<void>;
declare interface Build {
abort(options?: Omit<AbortOptions, 'reason'>): Promise<void>;
abort(options?: AbortOptions): Promise<AbortResponse>;

describe(): Promise<BuildDescription>;
Expand All @@ -75,19 +73,19 @@ export interface Build {
isFinished(): Promise<Boolean>;
}

export interface CommitPathsFilter {
declare interface CommitPathsFilter {
readonly added?: string[];
readonly modified?: string[];
readonly removed?: string[];
}

export type BuildTargetStrategy =
declare type BuildTargetStrategy =
| { branch: string }
| { commitHash: string }
| { workflow: string }
| { tag: string };

export interface BaseBuildOptions {
declare interface BaseBuildOptions {
readonly branch?: string;
readonly commitHash?: string;
readonly commitMessage?: string;
Expand All @@ -106,11 +104,12 @@ export interface BaseBuildOptions {
readonly target?: string;
}

export type BuildOptions = BaseBuildOptions & BuildTargetStrategy;
declare type BuildOptions = BaseBuildOptions & BuildTargetStrategy;

export interface ClientConfiguration {
declare interface ClientConfiguration {
readonly token: string;
}

export const createClient: (config: ClientConfiguration) => Client;
export default createClient;
declare function createClient(config: ClientConfiguration): Client;

export = createClient;
2 changes: 0 additions & 2 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ const createClient = ({ token }) => {
};

module.exports = createClient;
module.exports.createClient = createClient;
module.exports.default = createClient;

0 comments on commit 07013ae

Please sign in to comment.