Skip to content

Commit 23febd1

Browse files
SeokHyeonChindvlprshbumkeyy
authored
JSDoc Reference 나머지 전체 번역 #120 (#187)
* JSDoc Reference 나머지 전체 번역 #120 * Update pages/jsdoc-reference.md 넵 제안 바로 변경하겠습니다. Co-authored-by: Seohee Park <[email protected]> * Update pages/jsdoc-reference.md 넵 제안 바로 변경하겠습니다 Co-authored-by: Seohee Park <[email protected]> * Update pages/jsdoc-reference.md 넵 감사합니다! 수정하도록 하겠습니다. Co-authored-by: Kibeom Kwon <[email protected]> * Update pages/jsdoc-reference.md 넵 감사합니다! 수정하도록 하겠습니다. Co-authored-by: Kibeom Kwon <[email protected]> * Update jsdoc-reference.md * Update jsdoc-reference.md Co-authored-by: Seohee Park <[email protected]> Co-authored-by: Kibeom Kwon <[email protected]>
1 parent 2cddad7 commit 23febd1

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

Diff for: pages/jsdoc-reference.md

+35-35
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var win;
4343
/** @type {PromiseLike<string>} */
4444
var promisedString;
4545

46-
// You can specify an HTML Element with DOM properties
46+
// DOM 프로퍼티를 사용하여 HTML 요소를 지정할 수 있습니다
4747
/** @type {HTMLElement} */
4848
var myElement = document.querySelector(selector);
4949
element.dataset.myData = "";
@@ -439,27 +439,27 @@ var result = C(1);
439439

440440
> Note: 오류 메시지는 [a JSConfig](/docs/handbook/tsconfig-json.html)[`checkJs`](/tsconfig#checkJs)가 활성화된 상태에서만 JS 코드 베이스에 나타납니다.
441441
442-
With `@constructor`, `this` is checked inside the constructor function `C`, so you will get suggestions for the `initialize` method and an error if you pass it a number. Your editor may also show warnings if you call `C` instead of constructing it.
442+
`@constructor`를 사용하면 생성자 함수 `C`안에 `this`가 있는지 검사하므로, `initialize` 메서드에 대한 제안사항을 받으며 만약 인자로 숫자를 넘긴다면 오류가 발생합니다. 또한 `C`를 생성하지 않고 호출만 한다면 에디터에서 경고를 표시할 수 있습니다.
443443

444-
Unfortunately, this means that constructor functions that are also callable cannot use `@constructor`.
444+
유감스럽게도, 이는 호출가능한 생성자 함수는 `@constructor`를 사용하지 못함을 의미합니다.
445445

446446
## `@this`
447447

448-
The compiler can usually figure out the type of `this` when it has some context to work with. When it doesn't, you can explicitly specify the type of `this` with `@this`:
448+
컴파일러는 코드가 동작할 컨텍스트가 있다면 보통 `this`의 타입을 파악할 수 있습니다. 그렇지 않은 경우, `@this`를 사용하여 명확하게 `this`의 타입을 지정할 수 있습니다:
449449

450450
```js
451451
/**
452452
* @this {HTMLElement}
453453
* @param {*} e
454454
*/
455455
function callbackForLater(e) {
456-
this.clientHeight = parseInt(e); // should be fine!
456+
this.clientHeight = parseInt(e); // 잘 작동해야 합니다!
457457
}
458458
```
459459

460460
## `@extends`
461461

462-
When Javascript classes extend a generic base class, there is nowhere to specify what the type parameter should be. The `@extends` tag provides a place for that type parameter:
462+
Javascript 클래스를 제네릭 기반 클래스로부터 상속(extend)하면, 매개변수가 어떤 타입이 되어야 하는지 지정할 곳이 없습니다. `@extends` 태그는 이러한 타입 매개변수를 위한 위치를 제공합니다:
463463

464464
```js
465465
/**
@@ -471,11 +471,11 @@ class SortableSet extends Set {
471471
}
472472
```
473473

474-
Note that `@extends` only works with classes. Currently, there is no way for a constructor function extend a class.
474+
`@extends`는 클래스에서만 작동합니다. 현재까지, 생성자 함수가 클래스를 상속할 수 있는 방법은 없습니다.
475475

476476
## `@enum`
477477

478-
The `@enum` tag allows you to create an object literal whose members are all of a specified type. Unlike most object literals in Javascript, it does not allow other members.
478+
`@enum` 태그는 멤버가 모두 지정된 객체 리터럴을 만들 수 있게 도와줍니다. Javascript 대부분의 객체 리터럴과 달리, 이 태그는 다른 멤버를 허용하지 않습니다.
479479

480480
```js
481481
/** @enum {number} */
@@ -488,7 +488,7 @@ const JSDocState = {
488488
JSDocState.SawAsterisk;
489489
```
490490

491-
Note that `@enum` is quite different from, and much simpler than, TypeScript's `enum`. However, unlike TypeScript's enums, `@enum` can have any type:
491+
`@enum`은 TypeScript의 `enum`과 상당히 다르고, 더 간단합니다. 하지만 TypeScript의 열거형(enum)과 달리, `@enum`은 어떠한 타입도 가질 수 있습니다:
492492

493493
```js
494494
/** @enum {function(number): number} */
@@ -501,65 +501,65 @@ const MathFuncs = {
501501
MathFuncs.add1;
502502
```
503503

504-
## More examples
504+
## 추가 예제 (More examples)
505505

506506
```js
507507
class Foo {}
508508
// ---cut---
509509
var someObj = {
510510
/**
511-
* @param {string} param1 - Docs on property assignments work
511+
* @param {string} param1 - 프로퍼티 할당 문서를 참조하세요
512512
*/
513513
x: function (param1) {},
514514
};
515515

516516
/**
517-
* As do docs on variable assignments
517+
* 변수 할당 문서를 참조하세요
518518
* @return {Window}
519519
*/
520520
let someFunc = function () {};
521521

522522
/**
523-
* And class methods
524-
* @param {string} greeting The greeting to use
523+
* 클래스 메서드
524+
* @param {string} greeting 사용할 인사말
525525
*/
526526
Foo.prototype.sayHi = (greeting) => console.log("Hi!");
527527

528528
/**
529-
* And arrow functions expressions
530-
* @param {number} x - A multiplier
529+
* 화살표 함수 표현식
530+
* @param {number} x - 곱하는 수
531531
*/
532532
let myArrow = (x) => x * x;
533533

534534
/**
535-
* Which means it works for stateless function components in JSX too
535+
* JSX의 무상태 함수형 컴포넌트(SFC)에도 작동합니다
536536
* @param {{a: string, b: number}} test - Some param
537537
*/
538538
var sfc = (test) => <div>{test.a.charAt(0)}</div>;
539539

540540
/**
541-
* A parameter can be a class constructor, using Closure syntax.
541+
* 매개변수는 클로저 구문을 사용하면 클래스 생성자로 사용할 수 있습니다.
542542
*
543543
* @param {{new(...args: any[]): object}} C - The class to register
544544
*/
545545
function registerClass(C) {}
546546

547547
/**
548-
* @param {...string} p1 - A 'rest' arg (array) of strings. (treated as 'any')
548+
* @param {...string} p1 - '나머지' 문자열 인수들의 배열 ('any' 타입으로 취급됨)
549549
*/
550550
function fn10(p1) {}
551551

552552
/**
553-
* @param {...string} p1 - A 'rest' arg (array) of strings. (treated as 'any')
553+
* @param {...string} p1 - '나머지' 문자열 인수들의 배열 ('any' 타입으로 취급됨)
554554
*/
555555
function fn9(p1) {
556556
return p1.join();
557557
}
558558
```
559559

560-
## Patterns that are known NOT to be supported
560+
## 지원하지 않는다고 알려진 패턴 (Patterns that are known NOT to be supported)
561561

562-
Referring to objects in the value space as types doesn't work unless the object also creates a type, like a constructor function.
562+
Value space 안의 객체를 타입으로 태그하는 것은 객체가 마치 생성자 함수처럼 타입을 생성하지 않는 이상 작동하지 않습니다.
563563

564564
```js
565565
function aNormalFunction() {}
@@ -568,27 +568,27 @@ function aNormalFunction() {}
568568
*/
569569
var wrong;
570570
/**
571-
* Use 'typeof' instead:
571+
* 'typeof'를 대신 사용하세요:
572572
* @type {typeof aNormalFunction}
573573
*/
574574
var right;
575575
```
576576

577-
Postfix equals on a property type in an object literal type doesn't specify an optional property:
577+
접미사(Postfix)는 선택적(Optional) 프로퍼티를 구체화하지 않는 객체 리터럴 타입의 프로퍼티 타입과 같습니다:
578578

579579
```js
580580
/**
581581
* @type {{ a: string, b: number= }}
582582
*/
583583
var wrong;
584584
/**
585-
* Use postfix question on the property name instead:
585+
* 프로퍼티 이름 대신 물음표 접미사를 사용하세요:
586586
* @type {{ a: string, b?: number }}
587587
*/
588588
var right;
589589
```
590590

591-
Nullable types only have meaning if `strictNullChecks` is on:
591+
`strictNullCheck`가 활성화 중인 경우에만 널러블(Nullable) 타입이 의미가 있습니다.
592592

593593
```js
594594
/**
@@ -599,7 +599,7 @@ Nullable types only have meaning if `strictNullChecks` is on:
599599
var nullable;
600600
```
601601

602-
You can also use a union type:
602+
유니언 타입을 사용해도 됩니다:
603603

604604
```js
605605
/**
@@ -610,25 +610,25 @@ You can also use a union type:
610610
var unionNullable;
611611
```
612612

613-
Non-nullable types have no meaning and are treated just as their original type:
613+
널러블 타입이 아닌 경우에는 아무 의미가 없으며 원래 타입으로 취급합니다:
614614

615615
```js
616616
/**
617617
* @type {!number}
618-
* Just has type number
618+
* 타입 number를 가집니다
619619
*/
620620
var normal;
621621
```
622622

623-
Unlike JSDoc's type system, TypeScript only allows you to mark types as containing null or not.
624-
There is no explicit non-nullability -- if strictNullChecks is on, then `number` is not nullable.
625-
If it is off, then `number` is nullable.
623+
JSDoc의 타입 체계와 달리, TypeScript는 타입이 오직 null을 포함하거나 하지 않는다 표시할 수 있습니다.
624+
널러블은 명확하게 구분되지 않습니다 -- 만약 strictNullChecks가 활성화 중이라면, `number`는 널러블하지 않습니다.
625+
반대의 경우, `number`는 널러블합니다.
626626

627-
### Unsupported tags
627+
### 지원하지 않는 태그 (Unsupported tags)
628628

629-
TypeScript ignores any unsupported JSDoc tags.
629+
TypeScript는 지원하지 않는 JSDoc 태그를 무시합니다.
630630

631-
The following tags have open issues to support them:
631+
태그 지원을 위한 오픈 이슈가 아래에 있습니다:
632632

633633
* `@const` ([issue #19672](https://github.com/Microsoft/TypeScript/issues/19672))
634634
* `@inheritdoc` ([issue #23215](https://github.com/Microsoft/TypeScript/issues/23215))

0 commit comments

Comments
 (0)