From e3f1df672bc42f58acf352429eab3e04d52b025e Mon Sep 17 00:00:00 2001 From: Masato Urai Date: Mon, 15 Feb 2021 00:19:40 +0900 Subject: [PATCH 1/2] copy original files --- .../options/disableReferencedProjectLoad.md | 8 ++ .../tsconfig/ja/options/jsxFragmentFactory.md | 69 ++++++++++++++ docs/tsconfig/ja/options/jsxImportSource.md | 95 +++++++++++++++++++ .../ja/options/noUncheckedIndexedAccess.md | 53 +++++++++++ docs/tsconfig/ja/options/watchDirectory.md | 10 ++ docs/tsconfig/ja/options/watchFile.md | 12 +++ docs/tsconfig/ja/sections/compilerOptions.md | 3 + docs/tsconfig/ja/sections/top_level.md | 3 + docs/tsconfig/ja/sections/watchOptions.md | 0 9 files changed, 253 insertions(+) create mode 100644 docs/tsconfig/ja/options/disableReferencedProjectLoad.md create mode 100644 docs/tsconfig/ja/options/jsxFragmentFactory.md create mode 100644 docs/tsconfig/ja/options/jsxImportSource.md create mode 100644 docs/tsconfig/ja/options/noUncheckedIndexedAccess.md create mode 100644 docs/tsconfig/ja/options/watchDirectory.md create mode 100644 docs/tsconfig/ja/options/watchFile.md create mode 100644 docs/tsconfig/ja/sections/compilerOptions.md create mode 100644 docs/tsconfig/ja/sections/top_level.md create mode 100644 docs/tsconfig/ja/sections/watchOptions.md diff --git a/docs/tsconfig/ja/options/disableReferencedProjectLoad.md b/docs/tsconfig/ja/options/disableReferencedProjectLoad.md new file mode 100644 index 00000000..6ba05e74 --- /dev/null +++ b/docs/tsconfig/ja/options/disableReferencedProjectLoad.md @@ -0,0 +1,8 @@ +--- +display: "disableReferencedProjectLoad" +oneline: "Reduce the number of projects loaded automatically by TypeScript." +--- + +In multi-project TypeScript programs, TypeScript will load all of the available projects into memory in order to provide accurate results for editor responses which require a full knowledge graph like 'Find All References'. + +If your project is large, you can use the flag `disableReferencedProjectLoad` to disable the automatic loading of all projects. Instead, projects are loaded dynamically as you open files through your editor. diff --git a/docs/tsconfig/ja/options/jsxFragmentFactory.md b/docs/tsconfig/ja/options/jsxFragmentFactory.md new file mode 100644 index 00000000..a944dd1b --- /dev/null +++ b/docs/tsconfig/ja/options/jsxFragmentFactory.md @@ -0,0 +1,69 @@ +--- +display: "jsxFragmentFactory" +oneline: "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'." +--- + +Specify the JSX fragment factory function to use when targeting react JSX emit with `jsxFactory` compiler option is specified, e.g. `Fragment`. + +For example with this TSConfig: + +```json tsconfig +{ + "compilerOptions": { + "target": "esnext", + "module": "commonjs", + "jsx": "react", + "jsxFactory": "h", + "jsxFragmentFactory": "Fragment" + } +} +``` + +This TSX file: + +```tsx +import { h, Fragment } from "preact"; + +const HelloWorld = () => ( + <> +
Hello
+ +); +``` + +Would look like: + +```tsx twoslash +// @showEmit +// @showEmittedFile: index.js +// @jsxFactory: h +// @jsxFragmentFactory: Fragment +// @noErrors +// @target: esnext +// @module: commonjs + +import { h, Fragment } from "preact"; + +const HelloWorld = () => ( + <> +
Hello
+ +); +``` + +This option can be used on a per-file basis too similar to [Babel's `/* @jsxFrag h */` directive](https://babeljs.io/docs/en/babel-plugin-transform-react-jsx#fragments). + +For example: + +```tsx twoslash +/** @jsx h */ +/** @jsxFrag Fragment */ + +import { h, Fragment } from "preact"; + +const HelloWorld = () => ( + <> +
Hello
+ +); +``` diff --git a/docs/tsconfig/ja/options/jsxImportSource.md b/docs/tsconfig/ja/options/jsxImportSource.md new file mode 100644 index 00000000..2f25c2b4 --- /dev/null +++ b/docs/tsconfig/ja/options/jsxImportSource.md @@ -0,0 +1,95 @@ +--- +display: "jsxImportSource" +oneline: "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.`" +--- + +Declares the module specifier to be used for importing the `jsx` and `jsxs` factory functions when using [`jsx`](#jsx) as `"react-jsx"` or `"react-jsxdev"` which were introduced in TypeScript 4.1. + +With [React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) the library supports a new form of JSX transformation via a separate import. + +For example with this code: + +```tsx +import React from "react"; + +function App() { + return

Hello World

; +} +``` + +Using this TSConfig: + +```json tsconfig +{ + "compilerOptions": { + "target": "esnext", + "module": "commonjs", + "jsx": "react-jsx" + } +} +``` + +The emitted JavaScript from TypeScript is: + +```tsx twoslash +// @showEmit +// @noErrors +// @jsx: react-jsx +// @module: commonjs +// @target: esnext +declare module JSX { + interface Element {} + interface IntrinsicElements { + [s: string]: any; + } +} +import React from "react"; + +function App() { + return

Hello World

; +} +``` + +For example if you wanted to use `"jsxImportSource": "preact"`, you need a tsconfig like: + +```json tsconfig +{ + "compilerOptions": { + "target": "esnext", + "module": "commonjs", + "jsx": "react-jsx", + "jsxImportSource": "preact", + "types": ["preact"] + } +} +``` + +Which generates code like: + +```tsx twoslash +// @showEmit +// @jsxImportSource: preact +// @types: preact +// @jsx: react-jsx +// @target: esnext +// @module: commonjs +// @noErrors + +export function App() { + return

Hello World

; +} +``` + +Alternatively, you can use a per-file pragma to set this option, for example: + +```tsx +/** @jsxImportSource preact */ + +export function App() { + return

Hello World

; +} +``` + +Would add `preact/jsx-runtime` as an import for the `_jsx` factory. + +_Note:_ In order for this to work like you would expect, your `tsx` file must include an `export` or `import` so that it is considered a module. diff --git a/docs/tsconfig/ja/options/noUncheckedIndexedAccess.md b/docs/tsconfig/ja/options/noUncheckedIndexedAccess.md new file mode 100644 index 00000000..ebfb065d --- /dev/null +++ b/docs/tsconfig/ja/options/noUncheckedIndexedAccess.md @@ -0,0 +1,53 @@ +--- +display: "noUncheckedIndexedAccess" +oneline: "Add `undefined` to a type when accessed using an index." +--- + +TypeScript has a way to describe objects which have unknown keys but known values on an object, via index signatures. + +```ts twoslash +interface EnvironmentVars { + NAME: string; + OS: string; + + // Unknown properties are covered by this index signature. + [propName: string]: string; +} + +declare const env: EnvironmentVars; + +// Declared as existing +const sysName = env.NAME; +const os = env.OS; +// ^? + +// Not declared, but because of the index +// signature, then it is considered a string +const nodeEnv = env.NODE_ENV; +// ^? +``` + +Turning on `noUncheckedIndexedAccess` will add `undefined` to any un-declared field in the type. + +```ts twoslash +interface EnvironmentVars { + NAME: string; + OS: string; + + // Unknown properties are covered by this index signature. + [propName: string]: string; +} +// @noUncheckedIndexedAccess +// ---cut--- +declare const env: EnvironmentVars; + +// Declared as existing +const sysName = env.NAME; +const os = env.OS; +// ^? + +// Not declared, but because of the index +// signature, then it is considered a string +const nodeEnv = env.NODE_ENV; +// ^? +``` diff --git a/docs/tsconfig/ja/options/watchDirectory.md b/docs/tsconfig/ja/options/watchDirectory.md new file mode 100644 index 00000000..1870131d --- /dev/null +++ b/docs/tsconfig/ja/options/watchDirectory.md @@ -0,0 +1,10 @@ +--- +display: "watchDirectory" +oneline: "Specify how directories are watched on systems that lack recursive file-watching functionality." +--- + +The strategy for how entire directory trees are watched under systems that lack recursive file-watching functionality. + +- `fixedPollingInterval`: Check every directory for changes several times a second at a fixed interval. +- `dynamicPriorityPolling`: Use a dynamic queue where less-frequently modified directories will be checked less often. +- `useFsEvents` (the default): Attempt to use the operating system/file system's native events for directory changes. diff --git a/docs/tsconfig/ja/options/watchFile.md b/docs/tsconfig/ja/options/watchFile.md new file mode 100644 index 00000000..2ac25d6e --- /dev/null +++ b/docs/tsconfig/ja/options/watchFile.md @@ -0,0 +1,12 @@ +--- +display: "watchFile" +oneline: "Specify how the TypeScript watch mode works." +--- + +The strategy for how individual files are watched. + +- `fixedPollingInterval`: Check every file for changes several times a second at a fixed interval. +- `priorityPollingInterval`: Check every file for changes several times a second, but use heuristics to check certain types of files less frequently than others. +- `dynamicPriorityPolling`: Use a dynamic queue where less-frequently modified files will be checked less often. +- `useFsEvents` (the default): Attempt to use the operating system/file system's native events for file changes. +- `useFsEventsOnParentDirectory`: Attempt to use the operating system/file system's native events to listen for changes on a file's parent directory diff --git a/docs/tsconfig/ja/sections/compilerOptions.md b/docs/tsconfig/ja/sections/compilerOptions.md new file mode 100644 index 00000000..f569802a --- /dev/null +++ b/docs/tsconfig/ja/sections/compilerOptions.md @@ -0,0 +1,3 @@ +### Compiler Options + +These options make up the bulk of TypeScript's configuration and it covers how the language should work. diff --git a/docs/tsconfig/ja/sections/top_level.md b/docs/tsconfig/ja/sections/top_level.md new file mode 100644 index 00000000..5a366023 --- /dev/null +++ b/docs/tsconfig/ja/sections/top_level.md @@ -0,0 +1,3 @@ +### Root Fields + +Starting up are the root options in the TSConfig - these options relate to how your TypeScript or JavaScript project is set up. diff --git a/docs/tsconfig/ja/sections/watchOptions.md b/docs/tsconfig/ja/sections/watchOptions.md new file mode 100644 index 00000000..e69de29b From 23d482618846ffc21ffb1c7ea9813a7ecf918524 Mon Sep 17 00:00:00 2001 From: Masato Urai Date: Mon, 15 Feb 2021 00:39:50 +0900 Subject: [PATCH 2/2] translate files into ja --- .../options/disableReferencedProjectLoad.md | 4 ++-- .../tsconfig/ja/options/jsxFragmentFactory.md | 12 +++++------ docs/tsconfig/ja/options/jsxImportSource.md | 20 +++++++++---------- .../ja/options/noUncheckedIndexedAccess.md | 20 +++++++++---------- docs/tsconfig/ja/options/watchDirectory.md | 8 ++++---- docs/tsconfig/ja/options/watchFile.md | 12 +++++------ docs/tsconfig/ja/sections/compilerOptions.md | 4 ++-- docs/tsconfig/ja/sections/top_level.md | 4 ++-- 8 files changed, 42 insertions(+), 42 deletions(-) diff --git a/docs/tsconfig/ja/options/disableReferencedProjectLoad.md b/docs/tsconfig/ja/options/disableReferencedProjectLoad.md index 6ba05e74..29b4467f 100644 --- a/docs/tsconfig/ja/options/disableReferencedProjectLoad.md +++ b/docs/tsconfig/ja/options/disableReferencedProjectLoad.md @@ -3,6 +3,6 @@ display: "disableReferencedProjectLoad" oneline: "Reduce the number of projects loaded automatically by TypeScript." --- -In multi-project TypeScript programs, TypeScript will load all of the available projects into memory in order to provide accurate results for editor responses which require a full knowledge graph like 'Find All References'. +複数プロジェクトのTypeScriptプログラムでは、TypeScriptは利用可能なすべてのプロジェクトをメモリに読み込みます。これにより、「すべての参照元を検索」のような完全なナレッジグラフを必要とするエディタのレスポンスに対して正確な結果を提供することができます。 -If your project is large, you can use the flag `disableReferencedProjectLoad` to disable the automatic loading of all projects. Instead, projects are loaded dynamically as you open files through your editor. +プロジェクトが大規模な場合は、`disableReferencedProjectLoad`フラグを使用してすべてのプロジェクトの自動読み込みを無効にすることができます。代わりに、エディタでファイルを開いたときに動的にプロジェクトが読み込まれます。 diff --git a/docs/tsconfig/ja/options/jsxFragmentFactory.md b/docs/tsconfig/ja/options/jsxFragmentFactory.md index a944dd1b..3a8a221a 100644 --- a/docs/tsconfig/ja/options/jsxFragmentFactory.md +++ b/docs/tsconfig/ja/options/jsxFragmentFactory.md @@ -3,9 +3,9 @@ display: "jsxFragmentFactory" oneline: "Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'." --- -Specify the JSX fragment factory function to use when targeting react JSX emit with `jsxFactory` compiler option is specified, e.g. `Fragment`. +コンパイラオプションに`jsxFactory`が指定されており、React JSXのコンパイルを目的とする場合に使用されるJSXフラグメントファクトリ関数(例: `Fragment`)を指定します。 -For example with this TSConfig: +例えば、次のTSConfigでは: ```json tsconfig { @@ -19,7 +19,7 @@ For example with this TSConfig: } ``` -This TSX file: +このTSXファイルは: ```tsx import { h, Fragment } from "preact"; @@ -31,7 +31,7 @@ const HelloWorld = () => ( ); ``` -Would look like: +次のようになります: ```tsx twoslash // @showEmit @@ -51,9 +51,9 @@ const HelloWorld = () => ( ); ``` -This option can be used on a per-file basis too similar to [Babel's `/* @jsxFrag h */` directive](https://babeljs.io/docs/en/babel-plugin-transform-react-jsx#fragments). +このオプションは[Babelの`/* @jsxFrag h */`ディレクティブ](https://babeljs.io/docs/en/babel-plugin-transform-react-jsx#fragments)とよく似ており、ファイル単位で使用できます。 -For example: +例: ```tsx twoslash /** @jsx h */ diff --git a/docs/tsconfig/ja/options/jsxImportSource.md b/docs/tsconfig/ja/options/jsxImportSource.md index 2f25c2b4..ee5c26c5 100644 --- a/docs/tsconfig/ja/options/jsxImportSource.md +++ b/docs/tsconfig/ja/options/jsxImportSource.md @@ -3,11 +3,11 @@ display: "jsxImportSource" oneline: "Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.`" --- -Declares the module specifier to be used for importing the `jsx` and `jsxs` factory functions when using [`jsx`](#jsx) as `"react-jsx"` or `"react-jsxdev"` which were introduced in TypeScript 4.1. +TypeScript 4.1で導入された`"react-jsx"`や`"react-jsxdev"`を[`jsx`](#jsx)に指定する際に`jsx`と`jsxs`のファクトリ関数をインポートするモジュール指定子を宣言します。 -With [React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) the library supports a new form of JSX transformation via a separate import. +[React 17](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html)では、それぞれのインポートによる新しいJSXの変換がサポートされています。 -For example with this code: +例えば、このコードで: ```tsx import React from "react"; @@ -17,7 +17,7 @@ function App() { } ``` -Using this TSConfig: +次のようなTSConfigの場合: ```json tsconfig { @@ -29,7 +29,7 @@ Using this TSConfig: } ``` -The emitted JavaScript from TypeScript is: +TypeScriptからコンパイルされるJavaScriptは次のようになります: ```tsx twoslash // @showEmit @@ -50,7 +50,7 @@ function App() { } ``` -For example if you wanted to use `"jsxImportSource": "preact"`, you need a tsconfig like: +`"jsxImportSource": "preact"`を使用する場合、tsconfigは次のようになり: ```json tsconfig { @@ -64,7 +64,7 @@ For example if you wanted to use `"jsxImportSource": "preact"`, you need a tscon } ``` -Which generates code like: +以下のようなコードが生成されます: ```tsx twoslash // @showEmit @@ -80,7 +80,7 @@ export function App() { } ``` -Alternatively, you can use a per-file pragma to set this option, for example: +あるいは、ファイル単位のディレクティブを使ってこのオプションを設定することもできます。例えば: ```tsx /** @jsxImportSource preact */ @@ -90,6 +90,6 @@ export function App() { } ``` -Would add `preact/jsx-runtime` as an import for the `_jsx` factory. +これにより、`_jsx`ファクトリをインポートする`preact/jsx-runtime`が追加されます。 -_Note:_ In order for this to work like you would expect, your `tsx` file must include an `export` or `import` so that it is considered a module. +_注意:_ このオプションを期待通りに動作させるには、`tsx`ファイルに`export`または`import`を含める必要があります。これにより、ファイルはモジュールとみなされます。 diff --git a/docs/tsconfig/ja/options/noUncheckedIndexedAccess.md b/docs/tsconfig/ja/options/noUncheckedIndexedAccess.md index ebfb065d..d5071dd5 100644 --- a/docs/tsconfig/ja/options/noUncheckedIndexedAccess.md +++ b/docs/tsconfig/ja/options/noUncheckedIndexedAccess.md @@ -3,51 +3,51 @@ display: "noUncheckedIndexedAccess" oneline: "Add `undefined` to a type when accessed using an index." --- -TypeScript has a way to describe objects which have unknown keys but known values on an object, via index signatures. +TypeScriptには、オブジェクトにおいて未知のキーを持ちながらも値が既知であるプロパティをインデックスシグネチャで記述する方法があります。 ```ts twoslash interface EnvironmentVars { NAME: string; OS: string; - // Unknown properties are covered by this index signature. + // 未知のプロパティは、次のようなインデックスシグネチャで扱うことができます。 [propName: string]: string; } declare const env: EnvironmentVars; -// Declared as existing +// 既存のプロパティとして宣言されています const sysName = env.NAME; const os = env.OS; // ^? -// Not declared, but because of the index -// signature, then it is considered a string +// 宣言されていませんが、インデックス +// シグネチャのおかげで、stringとして扱われます const nodeEnv = env.NODE_ENV; // ^? ``` -Turning on `noUncheckedIndexedAccess` will add `undefined` to any un-declared field in the type. +`noUncheckedIndexedAccess`をオンにすると、型の未定義のフィールドに`undefined`が追加されます。 ```ts twoslash interface EnvironmentVars { NAME: string; OS: string; - // Unknown properties are covered by this index signature. + // 未知のプロパティは、次のようなインデックスシグネチャで扱うことができます。 [propName: string]: string; } // @noUncheckedIndexedAccess // ---cut--- declare const env: EnvironmentVars; -// Declared as existing +// 既存のプロパティとして宣言されています const sysName = env.NAME; const os = env.OS; // ^? -// Not declared, but because of the index -// signature, then it is considered a string +// 宣言されていませんが、インデックス +// シグネチャのおかげで、stringとして扱われます const nodeEnv = env.NODE_ENV; // ^? ``` diff --git a/docs/tsconfig/ja/options/watchDirectory.md b/docs/tsconfig/ja/options/watchDirectory.md index 1870131d..8ab7dbaf 100644 --- a/docs/tsconfig/ja/options/watchDirectory.md +++ b/docs/tsconfig/ja/options/watchDirectory.md @@ -3,8 +3,8 @@ display: "watchDirectory" oneline: "Specify how directories are watched on systems that lack recursive file-watching functionality." --- -The strategy for how entire directory trees are watched under systems that lack recursive file-watching functionality. +再帰的なファイル監視機能を持たないシステムで、ディレクトリツリー全体を監視する方法を指定します。 -- `fixedPollingInterval`: Check every directory for changes several times a second at a fixed interval. -- `dynamicPriorityPolling`: Use a dynamic queue where less-frequently modified directories will be checked less often. -- `useFsEvents` (the default): Attempt to use the operating system/file system's native events for directory changes. +- `fixedPollingInterval`: すべてのディレクトリの変更を一定間隔で毎秒数回チェックします。 +- `dynamicPriorityPolling`: 変更頻度の低いディレクトリがチェックされる頻度が低くなるような動的なキューを使用します。 +- `useFsEvents` (デフォルト): ディレクトリの変更に対するオペレーティングシステム/ファイルシステムのネイティブイベントの使用を試みます。 diff --git a/docs/tsconfig/ja/options/watchFile.md b/docs/tsconfig/ja/options/watchFile.md index 2ac25d6e..8220dede 100644 --- a/docs/tsconfig/ja/options/watchFile.md +++ b/docs/tsconfig/ja/options/watchFile.md @@ -3,10 +3,10 @@ display: "watchFile" oneline: "Specify how the TypeScript watch mode works." --- -The strategy for how individual files are watched. +個々のファイルを監視する方法を指定します。 -- `fixedPollingInterval`: Check every file for changes several times a second at a fixed interval. -- `priorityPollingInterval`: Check every file for changes several times a second, but use heuristics to check certain types of files less frequently than others. -- `dynamicPriorityPolling`: Use a dynamic queue where less-frequently modified files will be checked less often. -- `useFsEvents` (the default): Attempt to use the operating system/file system's native events for file changes. -- `useFsEventsOnParentDirectory`: Attempt to use the operating system/file system's native events to listen for changes on a file's parent directory +- `fixedPollingInterval`: すべてのファイルの変更を一定間隔で毎秒数回チェックします。 +- `priorityPollingInterval`: すべてのファイルの変更を毎秒数回チェックしますが、ヒューリスティックスを使用して他のファイルよりも少ない頻度で特定のタイプのファイルをチェックします。 +- `dynamicPriorityPolling`: 変更頻度の低いファイルがチェックされる頻度が低くなるような動的なキューを使用します。 +- `useFsEvents` (デフォルト): オペレーティングシステム/ファイルシステムのネイティブイベントの使用をファイルの変更に試みます。 +- `useFsEventsOnParentDirectory`: ファイルの親ディレクトリの変更を監視するためにオペレーティングシステム/ファイルシステムのネイティブイベントを使用を試みます。 diff --git a/docs/tsconfig/ja/sections/compilerOptions.md b/docs/tsconfig/ja/sections/compilerOptions.md index f569802a..4425e45f 100644 --- a/docs/tsconfig/ja/sections/compilerOptions.md +++ b/docs/tsconfig/ja/sections/compilerOptions.md @@ -1,3 +1,3 @@ -### Compiler Options +### コンパイラオプション -These options make up the bulk of TypeScript's configuration and it covers how the language should work. +これらのオプションはTypeScriptの設定の大部分を占めており、TypeScriptがどのように動作すべきかを扱います。 diff --git a/docs/tsconfig/ja/sections/top_level.md b/docs/tsconfig/ja/sections/top_level.md index 5a366023..e239f6dc 100644 --- a/docs/tsconfig/ja/sections/top_level.md +++ b/docs/tsconfig/ja/sections/top_level.md @@ -1,3 +1,3 @@ -### Root Fields +### ルートフィールド -Starting up are the root options in the TSConfig - these options relate to how your TypeScript or JavaScript project is set up. +まずは、TSConfigのルートオプションです - これらのオプションはTypeScriptやJavaScriptプロジェクトの設定方法に関連したものです。