tsconfig.json [Emit]

2

tsconfig.json

목록 보기
3/8
post-thumbnail

최종 수정일 : 2021년 9월 7일

!주의 이 문서는 유익하지 않습니다(?).

목차

declaration
declarationDir
declarationMap
downlevelIteration
emitBOM
emitDeclarationOnly
importHelpers
importsNotUsedAsValues
inlineSourceMap
inlineSources
mapRoot
newLine
noEmit
noEmitHelpers
noEmitOnError
outDir
outFile
preserveConstEnums
removeComments
sourceMap
sourceRoot
stripInternal

Options

declaration

원본 링크

프로젝트 내의 모든 TypeScript나 JavaScript 파일에 대한 .d.ts파일을 생성합니다. .d.ts 파일은 모듈의 외부 API를 설명하는 타입 정의 파일입니다. .d.ts 파일 사용하면 TypeScript와 같은 도구로 intellisense와 타입이 정해지지 않은 코드의 정확한 타입을 제공할 수 있습니다.

declarationtrue로 설정되면, 아래와 같은 TypeScript 코드로 컴파일러를 실행합니다:

export let helloWorld = "hi";

아래와 같은 index.js 파일이 생성될 것입니다:

export let helloWorld = "hi";
 

helloWorld.d.ts:

export declare let helloWorld: string;
 

JavaScript 파일을 위한 .d.ts 파일을 작업할 때, emitDeclarationOnly를 사용하거나 outDir를 사용하여 JavaScript 파일이 덮어써지지 않도록 할 수 있습니다.

declarationDir

원본 링크

declaration 파일들을 내보내는 루트 경로를 설정합니다.

example
├── index.ts
├── package.json
└── tsconfig.json

아래의 tsconfig.json 를 사용하면:

{
  "compilerOptions": {
    "declaration": true,
    "declarationDir": "./types"
  }
}

index.tsd.ts 파일은 types 폴더 안에 위치합니다:

example
├── index.js
├── index.ts
├── package.json
├── tsconfig.json
└── types
    └── index.d.ts

declarationMap

원본 링크

원본 .ts파일에 매핑되는 .d.ts를 위한 source map 파일들을 생성합니다.
피쳐를 사용 할 때 vscode같은 에디터가 원본 .ts파일에 정의된 곳으로 이동할 수 있습니다.

프로젝트 레퍼런스를 사용하는 경우 이 기능을 강력하게 추천합니다.

downlevelIteration

원본 링크

Downleveling은 오래된 버전의 JavaScript를 위한 TypeScript의 transpiling 정책입니다. 이 플래그는 오래된 JavaScript 런타임에서 최신 JavaScript의 이터레이터를 좀 더 정확하게 구현하도록 지원합니다.

ECMAScript 6 에서 몇 가지 새로운 이터레이션이 추가되었습니다: for / of (for (el of arr)), 배열 스프레드 ([a, ...b]), 매개변수 스프레드 (fn(...args)), Symbol.iterator. --downlevelIteration을 사용할 경우 Symbol.iterator 구현이 되어있는 경우 ES5 환경에서 이터레이션들이 더 정확하게 사용될 수 있습니다.

예제: for / of에 주는 영향

아래 타입스크립트 코드를:

const str = "Hello!";
for (const s of str) {
  console.log(s);
}

downlevelIteration 을 비활성화 시키면, for / of 반복문이 전통적인 for 반복문으로 하향조정 됩니다:

"use strict";
var str = "Hello!";
for (var _i = 0, str_1 = str; _i < str_1.length; _i++) {
    var s = str_1[_i];
    console.log(s);
}

이렇게 되길 기대시겠지만, ECMAScript 이터레이션 프로토콜을 100% 준수하지는 않습니다. 이모지(😜), .length를 2개 갸진(또는 더 많이)문자열 같은 특정 문자열은 for-of 반복문 안에 하나만 존재해야 합니다. Jonathan New의 블로그 포스트에서 더 많은 설명을 참고하세요.

downlevelIteration을 사용하면 TypeScript는 Symbol.iterator 구현체를(native나 polyfill) 확인하는 헬퍼 함수를 사용합니다. 민약 이 구현체가 누락되었다면 인덱스 기반의 이터레이션으로 돌아갑니다.

"use strict";
var __values = (this && this.__values) || function(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var e_1, _a;
var str = "Hello!";
try {
    for (var str_1 = __values(str), str_1_1 = str_1.next(); !str_1_1.done; str_1_1 = str_1.next()) {
        var s = str_1_1.value;
        console.log(s);
    }
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
    try {
        if (str_1_1 && !str_1_1.done && (_a = str_1.return)) _a.call(str_1);
    }
    finally { if (e_1) throw e_1.error; }
}

tslib을 사용하는 importHelpers를 이용하면 인라인 JavaScript 양을 줄일 수 있습니다:

"use strict";
var __values = (this && this.__values) || function(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var e_1, _a;
var str = "Hello!";
try {
    for (var str_1 = __values(str), str_1_1 = str_1.next(); !str_1_1.done; str_1_1 = str_1.next()) {
        var s = str_1_1.value;
        console.log(s);
    }
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
    try {
        if (str_1_1 && !str_1_1.done && (_a = str_1.return)) _a.call(str_1);
    }
    finally { if (e_1) throw e_1.error; }
}

주의: Symbol.iterator를 런타임에서 사용할 수 없다면, downlevelIteration을 사용해도 완벽하게 개선되진 않습니다.

예제: 배열 스프레드에 주는 영향

이것은 배열 스프레드 입니다:

// Make a new array who elements are 1 followed by the elements of arr2
const arr = [1, ...arr2];

설명에 따르면, ES5로 하향조정은 것은 쉽습니다:

// 같지 않나요?
const arr = [1].concat(arr2);

하지만, 이것은 가끔 완전히 다르게 작동합니다. 예를 들어, 배열에 "구멍" 이 있다면 누락된 인덱스는 스프레드에서는 고유한 값을 생성하지만, concat을 사용할 떈 그렇지 않습니다:

// Make an array where the '1' element is missing
let missing = [0, , 1];
let spreaded = [...missing];
let concated = [].concat(missing);
// true
"1" in spreaded;
// false
"1" in concated;

for / of와 마찬가지로, downlevelIteration은 ES6의 동작을 더 정확히 가상화하기 위해 Symbol.iterator를 사용합니다(있으면).

emitBOM

원본 링크

타입스크립트가 output 파일을 작성할 때 BOM(Byte Order Mark)을 만들지 결정합니다.
일부 런타임 환경은 JavaScript 파일을 올바르게 해석하기 위해 BOM을 요구합니다. (다른 경우는 그것이 존재하지 않을 것을 요구합니다.)
기본값은 false로 특별히 바꿔야 할 이유가 없다면 일반적으로 기본값이 가장 좋습니다.

emitDeclarationOnly

원본 링크

.js파일을 만들지 않고 .d.ts파일만 생성합니다.

이 설정은 두 가지 경우에 유용합니다:

  • JavaScript를 생성하기 위해 TypeScript가 아닌 다른 transpiler를 사용할 때.
  • d.ts파일만을 필요로 하는 다른 사용자를 위해 TypeScript를 사용할 때.

importHelpers

원본 링크

특정 다운레벨링 작업의 경우 TypeScript는 헬퍼 코드를 이용하여 클래스의 확장, 배열 또는 객체의 spread, 비동기 처리 등을 구현합니다.
기본적으로 헬퍼는 이를 사용하는 파일에만 들어지만, 동일한 헬퍼가 여러 다른 module에서 사용되는 경우 중복이 발생할 수 있습니다.

importHelpers 플래그를 사용하면, 이 헬퍼 함수들을 tslib에서 가져옵니다.
tslib을 런타임에 import 할 수 있는지 확인해야 합니다.
이것은 module에만 영향을 미칩니다. 전역 스크립트 파일은 tslib의 import를 시도하지 않습니다.

아래 타입스크립트를 예시로 들면:

export function fn(arr: number[]) {
  const arr2 = [1, ...arr];
}

downlevelIterationimportHelpersfalse로 했을 때:

var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
export function fn(arr) {
    var arr2 = __spreadArray([1], __read(arr), false);
}

downlevelIterationimportHelperstrue로 했을 때:

import { __read, __spreadArray } from "tslib";
export function fn(arr) {
    var arr2 = __spreadArray([1], __read(arr), false);
}

함수의 구현만을 제공할 때는 noEmitHelpers를 사용할 수 있습니다.

importsNotUsedAsValues

원본 링크

이 플래그는 import의 작동 방식을 컨트롤 합니다.

3가지 옵션이 있습니다:

  • remove: type으로만 참조되는 import문을 삭제하는 기본적인 작동 방식.
  • preserve: valuetype으로 사용되지 않는 모든 import문을 보존합니다. 이로 인해 import로 인한 부수효과가 보존될 수 있습니다.
  • error: 모든 import를 보존하지만(preserve 옵션과 동일), importvaluetype으로만 사용될 때 에러가 발생합니다. 실수로 valueimport하지 않도록 보장하려면 유용하지만, 여전히 import로 인한 부수효과가 일어날 수 있습니다.

이 플래그로 JavaScript로 내보내지 않아야하는 type을 가져오는 import문을 명시적으로 생성하는 데 사용할 수 있습니다.

inlineSourceMap

원본 링크

.js.map 파일로 source map을 제공하는 대신, TypeScript는 .js파일 인에 source map을 포함시킵니다. 결과적으로 JS 파일을 크게 만들지만, 몇몇 상황에서는 편리할 수 있습니다. 예를 들어, .map 파일을 허용하지 않는 웹서버에서 JS 파일을 디버그 하고싶을 때.

sourceMap과 상호 배타적입니다.

예를 들어, 이 TypeScript를:

const helloWorld = "hi";
console.log(helloWorld);

JavaScript로 변환하면:

"use strict";
const helloWorld = "hi";
console.log(helloWorld);

inlineSourceMap을 활성화한 채로 빌드하면, 하단에 주석으로 source map을 포함한 파일이 만들어집니다.

"use strict";
const helloWorld = "hi";
console.log(helloWorld);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsTUFBTSxVQUFVLEdBQUcsSUFBSSxDQUFDO0FBQ3hCLE9BQU8sQ0FBQyxHQUFHLENBQUMsVUFBVSxDQUFDLENBQUMifQ==

inlineSources

원본 링크

TypeScript는 원본 .ts 파일의 내용을 source map에 포함시킵니다. inlineSourceMap와 같은 이유로 유용하게 쓰입니다.

Requires either sourceMap or inlineSourceMap to be set.
sourceMap 또는 inlineSourceMap을 필요로 합니다.

예를 들어, 이 TypeScript 를:

const helloWorld = "hi";
console.log(helloWorld);

기본적으로 이 JavaScript로 변환됩니다:

"use strict";
const helloWorld = "hi";
console.log(helloWorld);
 

inlineSourcesinlineSourceMap을 활성화하여 source map 파일 하단에 포함시킬 수 있습니다. 원본도 포함되었기 때문에 inlineSourceMap의 예제와 다릅니다.

"use strict";
const helloWorld = "hi";
console.log(helloWorld);
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsTUFBTSxVQUFVLEdBQUcsSUFBSSxDQUFDO0FBQ3hCLE9BQU8sQ0FBQyxHQUFHLENBQUMsVUFBVSxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCBoZWxsb1dvcmxkID0gXCJoaVwiO1xuY29uc29sZS5sb2coaGVsbG9Xb3JsZCk7Il19

mapRoot

원본 링크

디버거에게 map 파일이 생성된 위치 대신 찾아야 하는 위치를 선언합니다. 이 문자열은 source map 내에서 그대로 처리됩니다.

예를 들면 다음과 같습니다:

{
  "compilerOptions": {
    "sourceMap": true,
    "mapRoot": "https://my-website.com/debug/sourcemaps/"
  }
}

index.js의 source map 은 https://my-website.com/debug/sourcemaps/index.js.map 에서 찾아야 한다고 선언되어 있습니다.

newLine

원본 링크

파일을 내보낼 때 줄바꿈의 끝을 지정합니다 : ‘CRLF’ (docs) 또는 ‘LF’ (unix).

noEmit

원본 링크

컴파일러가 JavaScript 코드, source map, declaration를 만들지 않도록 합니다.

Babel이나 swc 같은 다른 도구가 TypeScript 파일을 JavaScript 환경 내에서 실행할 수 있는 파일로 변환하는 것을 처리할 공간을 만듭니다.

이 경우, TypeScript를 에디터 통합을 제공하는 도구 및 코드의 타입 검사기로 사용할 수 있습니다.

noEmitHelpers

원본 링크

importHelpers를 사용하여 헬퍼를 가져오는 대신 전역 범위에서 헬퍼 함수를 구현하고 헬퍼 함수 생성을 하지 않게 됩니다.

예를 들어, ES5에서 비동기 함수를 사용 하려면 헬퍼 역할을 해주는 await-like 함수와 generator-like 함수가 필요합니다:

const getAPI = async (url: string) => {
  // Get API
  return {};
};

상당히 많은 JavaScript 코드를 생성합니다:

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var getAPI = function (url) { return __awaiter(void 0, void 0, void 0, function () {
    return __generator(this, function (_a) {
        // Get API
        return [2 /*return*/, {}];
    });
}); };

이 플래그를 통해 헬퍼 함수를 전역으로 사용할 수 있습니다:

"use strict";
var getAPI = function (url) { return __awaiter(void 0, void 0, void 0, function () {
    return __generator(this, function (_a) {
        // Get API
        return [2 /*return*/, {}];
    });
}); };

noEmitOnError

원본 링크

에러가 보고된 경우, 컴파일러는 JavaScript 파일, source map, declaration을 생성하지 않습니다.

기본값은 false, 모든 오류가 해결되었는지 확인하기 전에 다른 환경에서 코드 변경 결과를 확인하려는 watch-like 환경에서 TypeScript로 작업하기가 더 쉽습니다.

outDir

원본 링크

만일 지정하면, .js (이 외에도 .d.ts, .js.map, 등.) 파일이 지정한 디렉터리로 배출됩니다. 원본 파일의 디렉터리 구조는 보존됩니다; 계산된 루트가 예상과 다를 경우 rootDir 을 보세요.

만일 지정하지 않으면, .js 파일은 .ts 파일이 생성된 곳과 동일한 디렉터리에 생성됩니다:

$ tsc
example
├── index.js
└── index.ts

다음과 같이 tsconfig.json 을 작성할 경우:

{
  "compilerOptions": {
    "outDir": "dist"
  }
}

이러한 설정으로 tsc를 실행하면 파일이 지정한 dist 폴더로 이동합니다:

$ tsc
example
├── dist
│   └── index.js
├── index.ts
└── tsconfig.json

outFile

원본 링크

만일 지정하면, 모든 전역 (비모듈) 파일이 지정된 단일 출력 파일에 연결됩니다.

만일 modulesystem 또는 amd 일 경우, 모든 모듈 파일도 모든 전역 컨텐츠 뒤에 이 파일에 연결됩니다.

참고: outFilemoduleNone 이거나, System, AMD 가 아니면 사용할 수 없습니다. 이 옵션은 bundle CommonJS 또는 ES6 모듈에 사용할 수 없습니다.

preserveConstEnums

원본 링크

생성된 코드에서 enum 선언을 지우지 않습니다. const enum에 대해 참조 대신 enum값을 내보내 런타임에서 애플리케이션의 전체 메모리를 줄일 수 있도록 합니다.

예를 들면 이 TypeScript 에선:

const enum Album {
  JimmyEatWorldFutures = 1,
  TubRingZooHypothesis = 2,
  DogFashionDiscoAdultery = 3,
}
 
const selectedAlbum = Album.JimmyEatWorldFutures;
if (selectedAlbum === Album.JimmyEatWorldFutures) {
  console.log("That is a great choice.");
}

기본적으로 enum의 변환은 해당 숫자와, JavaScript에서 enum에 대한 참조를 완전히 제거합니다.

"use strict";
const selectedAlbum = 1 /* JimmyEatWorldFutures */;
if (selectedAlbum === 1 /* JimmyEatWorldFutures */) {
    console.log("That is a great choice.");
}

reserveConstEnumstrue로 설정하면 런타임에 enum을 유지하며 숫자도 내보냅니다.

"use strict";
var Album;
(function (Album) {
    Album[Album["JimmyEatWorldFutures"] = 1] = "JimmyEatWorldFutures";
    Album[Album["TubRingZooHypothesis"] = 2] = "TubRingZooHypothesis";
    Album[Album["DogFashionDiscoAdultery"] = 3] = "DogFashionDiscoAdultery";
})(Album || (Album = {}));
const selectedAlbum = 1 /* JimmyEatWorldFutures */;
if (selectedAlbum === 1 /* JimmyEatWorldFutures */) {
    console.log("That is a great choice.");
}

본질적으로 이것은 enum이 소스코드에만 가능하고, 런타임에서 추적되지 않을 때만 사용하십시오.

removeComments

원본 링크

Strips all comments from TypeScript files when converting into JavaScript. Defaults to false.

For example, this is a TypeScript file which has a JSDoc comment:

/** The translation of 'Hello world' into Portuguese */
export const helloWorldPTBR = "Olá Mundo";

When removeComments is set to true:

export const helloWorldPTBR = "Olá Mundo";

Without setting removeComments or having it as false:

/** The translation of 'Hello world' into Portuguese */
export const helloWorldPTBR = "Olá Mundo";

This means that your comments will show up in the JavaScript code.

sourceMap

원본 링크

source map 파일을 생성합니다. 이 파일을 이용하여 내보낸 JavaScript 파일을 사용할 때 디버거 및 기타 도구가 원본 TypeScript의 코드를 표시할 수 있습니다. source map 파일은 생성된 .js파일에 대응되는 .js.map(또는 .jsx.map)으로 생성됩니다.

.js 파일에는 source map 파일이 있는 위치를 나타내는 주석이 포함됩니다. 예시:

// helloWorld.ts
export declare const helloWorld = "hi";

sourceMaptrue로 하고 컴파일하면 아래 JavaScript 파일을 생성합니다:

// helloWorld.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.helloWorld = "hi";
//# sourceMappingURL=// helloWorld.js.map

그리고 이것은 json map을 생성합니다:

// helloWorld.js.map
{
  "version": 3,
  "file": "ex.js",
  "sourceRoot": "",
  "sources": ["../ex.ts"],
  "names": [],
  "mappings": ";;AAAa,QAAA,UAAU,GAAG,IAAI,CAAA"
}

sourceRoot

원본 링크

소스의 상대 위치 대신 디버거가 TypeScript 파일을 찾을 위치를 지정합니다. 이 문자열은 경로 또는 URL을 사용할 수 있는 소스-맵 내에서 그대로 처리됩니다:

{
  "compilerOptions": {
    "sourceMap": true,
    "sourceRoot": "https://my-website.com/debug/source/"
  }
}

index.js 에 https://my-website.com/debug/source/index.ts 위치에 소스 파일이 있다고 명시해야 합니다.

stripInternal

원본 링크

@internal annotation이 있는 JSDoc comment를 declarations에 내보내지 않습니다. 이것은 컴파일러 내부 옵션입니다. 컴파일러는 유효성 검사를 하지 않으므로 사용 시 위험성을 알고 있어야 합니다. d.ts파일 내에서 추가적으로 주석을 다루는 도구를 찾고있다면, api-extractor를 참고하세요.

/**
 * 일주일 내에 사용 가능한 일 수
 * @internal
 */
export const daysInAWeek = 7;
 
/** 일주일에 얼마나 버는지 계산합니다 */
export function weeklySalary(dayRate: number) {
  return daysInAWeek * dayRate;
}

false 로 했을 때 (default):

/**
 * 일주일 내에 사용 가능한 일 수
 * @internal
 */
export declare const daysInAWeek = 7;
/** 일주일에 얼마나 버는지 계산합니다 */
export declare function weeklySalary(dayRate: number): number;

stripInternaltrue로 하면 d.ts가 수정되어 만들어집니다.

/** 일주일에 얼마나 버는지 계산합니다 */
export declare function weeklySalary(dayRate: number): number;
 

JavaScript로 만들어지는 파일은 동일합니다.

profile
지상 최강의 개발자 쥬니니

0개의 댓글