From cf91fc96fa334b2df9f9f8d5c6146c886760008a Mon Sep 17 00:00:00 2001 From: German Attanasio Date: Thu, 30 Nov 2017 19:54:00 -0500 Subject: [PATCH] :memo: Export .d.ts and .js.map source maps --- .gitignore | 4 +++- lib/base_service.ts | 8 ++++---- lib/helper.ts | 6 +++--- tsconfig.json | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index ae8952c223..5b57826f4e 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,6 @@ tone-analyzer/*.js visual-recognition/*.js text-to-speech/*.js speech-to-text/*.js -.nyc_output \ No newline at end of file +.nyc_output +**/*.d.ts +**/*.js.map \ No newline at end of file diff --git a/lib/base_service.ts b/lib/base_service.ts index 6b635532fd..becf9e1124 100644 --- a/lib/base_service.ts +++ b/lib/base_service.ts @@ -23,12 +23,12 @@ import bufferFrom = require('buffer-from'); import { stripTrailingSlash } from './helper'; // custom interfaces -interface HeaderOptions { +export interface HeaderOptions { 'X-Watson-Learning-Opt-Out'?: boolean; [key: string]: any; } -interface UserOptions { +export interface UserOptions { url?: string; version_date?: string; username?: string; @@ -40,14 +40,14 @@ interface UserOptions { token?: string; } -interface BaseServiceOptions extends UserOptions { +export interface BaseServiceOptions extends UserOptions { headers: HeaderOptions; url: string; jar?: request.CookieJar; qs: any; } -interface Credentials { +export interface Credentials { username: string; password: string; api_key: string; diff --git a/lib/helper.ts b/lib/helper.ts index ef49c65da0..aa03965716 100644 --- a/lib/helper.ts +++ b/lib/helper.ts @@ -27,17 +27,17 @@ export interface FileObject { } // internal interfaces -interface FileOptions { +export interface FileOptions { filename?: string; contentType?: string; } -interface FileParamAttributes { +export interface FileParamAttributes { data: ReadableStream | Buffer | FileObject; contentType: string; } -interface FileStream extends ReadableStream { +export interface FileStream extends ReadableStream { path: string | Buffer; } diff --git a/tsconfig.json b/tsconfig.json index bcc9cae2ed..3f404199f6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,8 +11,8 @@ // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "sourceMap": true, /* Generates corresponding '.map' file. */ + "declaration": true, /* Generates corresponding '.d.ts' file. */ + "sourceMap": true, /* Generates corresponding '.map' file. */ // "outFile": "./", /* Concatenate and emit output to single file. */ // "outDir": "./", /* Redirect output structure to the directory. */ // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */