diff --git a/src/content/docs/ko/reference/adapter-reference.mdx b/src/content/docs/ko/reference/adapter-reference.mdx index acc4e8c687033..57a9132eb7fc8 100644 --- a/src/content/docs/ko/reference/adapter-reference.mdx +++ b/src/content/docs/ko/reference/adapter-reference.mdx @@ -254,7 +254,7 @@ export default function createIntegration() {
-**타입:** `(manifest: SSRManifest, options: any) => Record(manifest: SSRManifest, options: any) => Record\
-**타입:** `(manifest: SSRManifest, options: any) => Record(manifest: SSRManifest, options: any) => Record\
-**타입:** `(renderer:` [`AstroRenderer`](https://github.com/withastro/astro/blob/fdd607c5755034edf262e7b275732519328a33b2/packages/astro/src/%40types/astro.ts#L872-L883) `) => void;`
+**타입:** (renderer: AstroRenderer) => void;
**예:** [`svelte`](https://github.com/withastro/astro/blob/main/packages/integrations/svelte/src/index.ts), [`react`](https://github.com/withastro/astro/blob/main/packages/integrations/react/src/index.ts), [`preact`](https://github.com/withastro/astro/blob/main/packages/integrations/preact/src/index.ts), [`vue`](https://github.com/withastro/astro/blob/main/packages/integrations/vue/src/index.ts), [`solid`](https://github.com/withastro/astro/blob/main/packages/integrations/solid/src/index.ts)
-**타입:** `(directive:` [`ClientDirectiveConfig`](https://github.com/withastro/astro/blob/00327c213f74627ac9ca1dec774efa5bf71e9375/packages/astro/src/%40types/astro.ts#L1872-L1875) `) => void;`
+**타입:** (directive: ClientDirectiveConfig) => void;
-**타입:** `(middleware:` [`AstroIntegrationMiddleware`](https://github.com/withastro/astro/blob/852ac0f75dfca1b2602e9cdbfa0447d9998e2449/packages/astro/src/%40types/astro.ts#L2124-L2127) `) => void;`
+**타입:** (middleware: AstroIntegrationMiddleware) => void;
-**타입:** [`RouteOptions`](https://github.com/withastro/astro/blob/3b10b97a4fecd1dfd959b160a07b5b8427fe40a7/packages/astro/src/types/public/integrations.ts#L14-L27) +**타입:** `{ readonly component: string; prerender?: boolean; }`
라우트를 식별하는 `component` 속성과 생성된 라우트를 구성할 수 있도록 하는 다음 추가 값(`prerender`)을 가진 객체입니다. @@ -811,7 +811,7 @@ export default { `astro dev` 실행 중 통합 기능이 콘텐츠 레이어 업데이트를 트리거하는 함수입니다. 예를 들어, 개발 중 웹훅 엔드포인트를 등록하거나, 변경 사항을 수신하기 위해 CMS에 소켓을 열 때 사용할 수 있습니다. -기본적으로 `refreshContent`는 모든 컬렉션을 새로 고칩니다. 선택적으로 로더 이름 배열인 `loaders` 속성을 전달할 수 있습니다. 제공된 경우 해당 로더를 사용하는 컬렉션만 새로 고쳐집니다. 예를 들어, CMS 통합 기능은 이 속성을 사용하여 자체 컬렉션만 새로 고칠 수 있습니다. +기본적으로 `refreshContent()`는 모든 컬렉션을 새로 고칩니다. 선택적으로 로더 이름 배열인 `loaders` 속성을 전달할 수 있습니다. 제공된 경우 해당 로더를 사용하는 컬렉션만 새로 고쳐집니다. 예를 들어, CMS 통합 기능은 이 속성을 사용하여 자체 컬렉션만 새로 고칠 수 있습니다. 로더에 `context` 객체를 전달할 수도 있습니다. 이는 웹훅 본문이나 웹소켓의 이벤트와 같은 임의의 데이터를 전달하는 데 사용할 수 있습니다. @@ -874,10 +874,10 @@ export default {-**타입:** [`AddressInfo`](https://microsoft.github.io/PowerBI-JavaScript/interfaces/_node_modules__types_node_net_d_._net_.addressinfo.html) +**타입:** `AddressInfo`
-[Node.js Net 모듈](https://nodejs.org/api/net.html)에서 제공하는 주소, 패밀리 및 포트 번호입니다. +[Node.js Net 모듈의 `server.address()` 메서드](https://nodejs.org/api/net.html#serveraddress)에서 제공하는 주소, 패밀리, 포트 번호입니다. ### `astro:server:done` @@ -956,10 +956,10 @@ export default {
-**타입:** Map\
+**타입:** `Map
+
+**타입:** `string`
+
+ +**타입:** `string` +
+ +소스 컴포넌트 URL을 지정합니다. + +###### `route` + ++ +**타입:** [`RouteData`](#routedata) +
+ +페이지 라우트에 대한 정보를 설명합니다. + +###### `moduleSpecifier` + ++ +**타입:** `string` +
+ +모듈의 파일 경로로 해석될 수 있는 문자열을 정의합니다. + +###### `styles` + +
+
+**타입:** `Array<{ depth: number; order: number; sheet: { type: 'inline'; content: string } | { type: 'external'; src: string } }>`
+
@@ -1053,7 +1104,7 @@ export default {
-**타입:** [`SerializedSSRManifest`](https://github.com/withastro/astro/blob/3b10b97a4fecd1dfd959b160a07b5b8427fe40a7/packages/astro/src/core/app/types.ts#L91-L109) +**타입:** [`SerializedSSRManifest`](#직렬화된-ssr-매니페스트-속성)
SSR 매니페스트에 액세스하여 커스텀 빌드를 생성할 수 있습니다. @@ -1072,6 +1123,77 @@ export default { } ``` +##### 직렬화된 SSR 매니페스트 속성 + +[`astro:build:ssr` 훅](#astrobuildssr)을 통해 접근할 수 있는 [`SSRManifest`](#ssrmanifest)의 직렬화된 버전입니다. 이는 `SSRManifest`와 동일한 정보를 포함하며, 일부 속성은 직렬화 가능한 형식으로 변환됩니다. + +###### `routes` + ++ +**타입:** `SerializedRouteInfo[]` +
+ +직렬화된 라우트 정보 목록을 정의합니다. 각 라우트는 [`SSRManifest.routes`](#routes-1)와 동일한 속성을 포함하며, `routeData`는 JSON으로 직렬화 가능한 형식으로 변환됩니다. + +###### `assets` + ++ +**타입:** `string[]` +
+ +직렬화된 자산 파일 경로 목록을 정의합니다. + +###### `componentMetadata` + +
+
+**타입:** [string, SSRComponentMetadata][]
+
+ +**타입:** `[string, string][]` +
+ +각 항목이 튜플인 키-값 쌍의 배열을 정의합니다. 첫 번째 요소는 스크립트 식별자이고 두 번째 요소는 스크립트 콘텐츠입니다. + +###### `clientDirectives` + +
+
+**타입:** `[string, string][]`
+
+
+**타입:** `[string, string][]`
+
+
+**타입:** `string`
+
@@ -1147,7 +1269,9 @@ export default { **타입:** [`URL`](https://developer.mozilla.org/ko/docs/Web/API/URL)
-빌드 출력 디렉터리의 URL 경로입니다. 유효한 절대 경로 문자열이 필요한 경우 Node의 내장 [`fileURLToPath`](https://nodejs.org/api/url.html#urlfileurltopathurl-options) 유틸리티를 사용해야 합니다. +빌드 출력 디렉터리에 대한 URL 경로입니다. + +다음 예시는 Node.js의 내장 [`fileURLToPath()`](https://nodejs.org/api/url.html#urlfileurltopathurl-options) 유틸리티를 사용하여 통합에서 제공하는 파일의 유효한 절대 경로 문자열을 계산합니다. ```js import { fileURLToPath } from 'node:url'; @@ -1188,7 +1312,9 @@ export default { **타입:** [`URL`](https://developer.mozilla.org/ko/docs/Web/API/URL) -빌드 출력 디렉터리의 URL 경로입니다. 유효한 절대 경로 문자열이 필요한 경우 Node의 내장 [`fileURLToPath`](https://nodejs.org/api/url.html#urlfileurltopathurl-options) 유틸리티를 사용해야 합니다. +빌드 출력 디렉터리에 대한 URL 경로입니다. + +다음 예시는 Node.js의 내장 [`fileURLToPath()`](https://nodejs.org/api/url.html#urlfileurltopathurl-options) 유틸리티를 사용하여 파일에 쓰기 전, 통합에서 제공하는 파일의 유효한 절대 경로 문자열을 계산합니다. ```js import { writeFile } from 'node:fs/promises'; @@ -1243,7 +1369,7 @@ export default function myIntegration() { **타입:** `{ pathname: string }[]` -생성된 모든 페이지 목록입니다. 하나의 속성을 가진 객체입니다. +생성된 모든 페이지의 목록입니다. 각 항목은 하나의 속성을 가진 객체입니다. - `pathname` - 페이지의 최종 경로. @@ -1270,12 +1396,21 @@ Astro는 향후 내장 훅을 위해 `astro:` 접두사를 예약합니다. 사 ```ts import type { AstroIntegrationLogger, + AstroIntegrationMiddleware, + AstroMiddlewareInstance, + AstroRenderer, + ClientDirectiveConfig, HookParameters, IntegrationResolvedRoute, RedirectConfig, RouteData, RoutePart, RouteType, + SSRComponentMetadata, + SSRLoadedRenderer, + SSRLoadedRendererValue, + SSRManifest, + SSRManifestCSP, ValidRedirectStatus, // 다음 타입은 더 이상 사용되지 않습니다. IntegrationRouteData, @@ -1344,9 +1479,110 @@ export function formatIntegration(): AstroIntegration { [astro-format/build] Build finished. ``` +### `AstroIntegrationMiddleware` + ++ +**타입:** `{ order: "pre" | "post"; entrypoint: string | URL; }` +
+ +[통합에 의해 추가된 미들웨어](#addmiddleware-옵션)를 설명합니다. + +#### `order` + ++ +**타입:** `"pre" | "post"` +
+ +미들웨어가 다른 미들웨어보다 먼저(`pre`) 실행되어야 할지 아니면 이후(`post`)에 실행되어야 할지를 지정합니다. + +#### `entrypoint` + ++ +**타입:** `string | URL` +
+ +미들웨어의 가져오기 경로를 정의합니다. + +### `AstroMiddlewareInstance` + +
+
+**타입:** \{ onRequest?: MiddlewareHandler; \}
+
+ +**타입:** `{ name: string; clientEntrypoint?: string | URL; serverEntrypoint: string | URL; }` +
+ +[통합에 의해 추가된 컴포넌트 프레임워크 렌더러](#addrenderer-옵션)를 설명합니다. + +#### `name` + ++ +**타입:** `string` +
+ +컴포넌트 프레임워크 렌더러의 이름입니다. + +#### `clientEntrypoint` + ++ +**타입:** `string | URL` +
+ +컴포넌트가 사용될 때마다 클라이언트에서 실행되는 렌더러의 가져오기 경로를 정의합니다. + +#### `serverEntrypoint` + ++ +**타입:** `string | URL` +
+ +컴포넌트가 사용될 때마다 서버 측 요청 또는 정적 빌드 중에 실행되는 렌더러의 가져오기 경로를 정의합니다. + +### `ClientDirectiveConfig` + ++ +**타입:** `{ name: string; entrypoint: string | URL; }` +
+ +[통합에 의해 추가된 사용자 정의 클라이언트 지시어](#addclientdirective-옵션)를 설명합니다. + +#### `name` + ++ +**타입:** `string` +
+ +지시어에 의해 트리거되는 이벤트의 사용자 정의 이름입니다. + +#### `entrypoint` + ++ +**타입:** `string | URL` +
+ +지시어가 사용될 때마다 실행되는 코드의 가져오기 경로를 정의합니다. + ### `HookParameters` -`HookParameters` 유틸리티 타입에 훅 이름을 전달하여 훅 인자의 타입을 가져올 수 있습니다. 다음 예제에서 함수의 `options` 인자는 `astro:config:setup` 훅의 매개변수와 일치하도록 타입이 지정됩니다. +`HookParameters` 유틸리티 타입에 훅의 이름을 전달하여 훅 인자의 타입을 가져올 수 있습니다. + +다음 예시에서 함수의 `options` 인자는 [`astro:config:setup` 훅](#astroconfigsetup)의 매개변수와 일치하도록 타입이 지정되었습니다. ```ts /HookParameters(?:<.+>)?/ import type { HookParameters } from 'astro'; @@ -1436,7 +1672,7 @@ interface IntegrationResolvedRoute extends Pick< ### `RouteData` -라우트에 대한 정보를 설명합니다. 여기에는 다음 속성이 포함됩니다. +라우트에 대한 정보를 설명합니다. #### `route` @@ -1609,7 +1845,7 @@ generate({ id: 'presentation' }) // `/blog/presentation`을 출력합니다. **타입:** `{ content: string; dynamic: boolean; spread: boolean; }` -라우트 세그먼트를 설명합니다. 여기에는 다음과 같은 속성들이 포함됩니다. +라우트 세그먼트를 설명합니다. #### `content` @@ -1656,6 +1892,659 @@ generate({ id: 'presentation' }) // `/blog/presentation`을 출력합니다. * `redirect`: 파일 시스템에 존재하는 다른 라우트를 가리키는 라우트입니다. * `fallback`: 파일 시스템에는 존재하지 않으며, 보통 미들웨어 등 다른 방식으로 처리해야 하는 라우트입니다. +### `SSRComponentMetadata` + ++ +**타입:** `{ propagation: PropagationHint; containsHead: boolean; }` +
+ +서버에서 렌더링된 컴포넌트의 빌드 메타데이터를 설명합니다. + +#### `propagation` + ++ +**타입:** `'none' | 'self' | 'in-tree'` +
+ +이 컴포넌트에서 head 콘텐츠를 렌더링하는 방법에 대한 설명이며, Astro 런타임이 다음 컴포넌트를 기다려야 하는지 여부를 포함합니다. +- `none`: 컴포넌트가 head 콘텐츠를 전파하지 않습니다. +- `self`: 컴포넌트가 head 콘텐츠를 추가합니다. +- `in-tree`: 이 컴포넌트의 의존성 트리에 있는 다른 컴포넌트가 head 콘텐츠를 추가합니다. + +#### `containsHead` + ++ +**타입:** `boolean` +
+ +컴포넌트가 head 콘텐츠를 포함하는지 여부를 결정합니다. + +### `SSRLoadedRenderer` + ++ +**타입:** `{ name: string; clientEntrypoint?: string | URL; ssr: SSRLoadedRendererValue; }` +
+ +서버에서 사용할 수 있는 렌더러를 설명합니다. 이는 [`AstroRenderer`](#astrorenderer)의 하위 집합이며 다음과 같은 추가 속성을 포함합니다. + +#### `ssr` + ++ +**타입:** [`SSRLoadedRendererValue`](#ssrloadedrenderervalue) +
+ +이 프레임워크를 위해 서버에서 사용하는 함수 및 설정을 정의합니다. + +### `SSRLoadedRendererValue` + +특정 UI 프레임워크의 컴포넌트를 서버에서 렌더링하는 데 필요한 함수와 설정을 포함합니다. + +#### `name` + ++ +**타입:** `string` +
+ +렌더러의 이름 식별자를 지정합니다. + +#### `check()` + +
+
+**타입:** `AsyncRendererComponentFn
+
+**타입:** `AsyncRendererComponentFn<{ html: string; attrs?: Record
+
+**타입:** `boolean`
+
+
+**타입:** `() => string`
+
+
+**타입:** `string`
+
+ +**타입:** `string` +
+ +요청 시 렌더링에 사용되는 [서버 어댑터](/ko/guides/on-demand-rendering/#서버-어댑터)의 이름을 정의합니다. + +#### `routes` + ++ +**타입:** `RouteInfo[]` +
+ +이 프로젝트에서 사용 가능한 라우트에 대한 정보 목록입니다. 각 항목은 다음 속성들을 포함합니다. + +##### `routeData` + ++ +**타입:** [`RouteData`](#routedata) +
+ +라우트에 대해 알려진 정보를 설명하는 객체입니다. + +##### `file` + ++ +**타입:** `string` +
+ +빌드된 라우트 진입점의 파일 경로를 지정합니다. + +##### `links` + ++ +**타입:** `string[]` +
+ +이 라우트에 필요한 [HTML `link` 요소](https://developer.mozilla.org/ko/docs/Web/HTML/Reference/Elements/link) 목록을 정의합니다. + +##### `scripts` + ++ +**타입:** `Array<{ children: string; stage: string } | { type: 'inline' | 'external'; value: string }>` +
+ +이 라우트와 관련된 스크립트 목록을 정의합니다. 여기에는 `children` 및 `stage` 속성을 가진 통합 삽입 스크립트와 `type` 및 `value` 속성을 가진 호이스팅된 스크립트가 모두 포함됩니다. + +##### `styles` + +
+
+**타입:** `Array<{ type: "inline"; content: string; } | { type: "external"; src: string; }>`
+
+ +**타입:** `string` +
+ +[설정된 `site`](/ko/reference/configuration-reference/#site)를 지정합니다. + +#### `base` + ++ +**타입:** `string` +
+ +배포할 [설정된 `base` 경로](/ko/reference/configuration-reference/#base)를 지정합니다. + +#### `userAssetsBase` + +
+
+**타입:** `string | undefined`
+
+
+**타입:** [`AstroConfig['trailingSlash']`](/ko/reference/configuration-reference/#trailingslash)
+
+
+**타입:** [`NonNullable
+
+
+**타입:** `boolean`
+
+
+**타입:** `string | ({ fallback: string; } & Record
+
+
+**타입:** SSRLoadedRenderer[]
+
+
+**타입:** `Map
+
+
+**타입:** `Record
+
+**타입:** `Map
+
+
+**타입:** `Set
+
+**타입:** Map\
+
+
+**타입:** `{ page: ImportComponentInstance; onRequest?: MiddlewareHandler; renderers: SSRLoadedRenderer[]; }`
+
+
+**타입:** `() => Promise
+
+**타입:** [`MiddlewareHandler`](/ko/reference/modules/astro-middleware/#middlewarehandler)
+
+
+**타입:** SSRLoadedRenderer[]
+
+
+**타입:** Map\
+
+
+**타입:** `Map
+
+
+**타입:** `Map
+
+
+**타입:** `Promise
+
+
+**타입:** `SSRManifestI18n | undefined`
+
+ +**타입:** `"manual" | "pathname-prefix-always" | "pathname-prefix-other-locales" | "pathname-prefix-always-no-redirect" | "domains-prefix-always" | "domains-prefix-other-locales" | "domains-prefix-always-no-redirect"` +
+ +설정된 [i18n 라우팅 전략](/ko/reference/configuration-reference/#i18nrouting)을 정의합니다. 이는 URL에서 로케일이 처리되는 방식과 리디렉션 발생 여부를 결정합니다. + +##### `locales` + ++ +**타입:** `Locales` +
+ +[프로젝트에 설정된 지원되는 로케일](/ko/reference/configuration-reference/#i18nlocales) 목록을 지정합니다. + +##### `defaultLocale` + ++ +**타입:** `string` +
+ +[프로젝트에 설정된 기본 로케일](/ko/reference/configuration-reference/#i18ndefaultlocale)을 결정합니다. + +##### `fallback` + +
+
+**타입:** `Record
+ +**타입:** `"redirect" | "rewrite"` +
+ +[프로젝트에 설정된 대체 전략](/ko/reference/configuration-reference/#i18nroutingfallbacktype)을 결정합니다. + +##### `domainLookupTable` + +
+
+**타입:** `Record
+
+**타입:** () => Promise\<AstroMiddlewareInstance\> | AstroMiddlewareInstance
+
+
+**타입:** () => Promise\<\{ server: Record\
+
+
+**타입:** `boolean`
+
+
+**타입:** Partial\<RemotePattern\>[]
+
+
+**타입:** SessionConfig\
+
+
+**타입:** `string | URL`
+
+
+**타입:** `string | URL`
+
+
+**타입:** `string | URL`
+
+
+**타입:** `string | URL`
+
+
+**타입:** `string | URL`
+
+
+**타입:** `string | URL`
+
+
+**타입:** SSRManifestCSP | undefined
+
+
+**타입:** `Record
+
+
+
+ +**타입:** `'adapter' | 'meta' | 'header' | undefined` +
+ +CSP 지시어를 `meta` 요소로 삽입할지, 응답 `header`로 삽입할지, [응답 헤더 설정을 지원하는 어댑터](/ko/reference/adapter-reference/#experimentalstaticheaders)를 통해 삽입할지 여부를 지정합니다. + +#### `algorithm` + ++ +**타입:** `'SHA-256' | 'SHA-384' | 'SHA-512'` +
+ +[설정된 해시 함수](/ko/reference/experimental-flags/csp/#algorithm)를 지정합니다. + +#### `scriptHashes` + ++ +**타입:** `string[]` +
+ +프로젝트 스크립트용으로 생성된 해시 목록과 외부 스크립트용으로 [사용자가 제공한 해시](/ko/reference/experimental-flags/csp/#hashes) 목록을 지정합니다. + +#### `scriptResources` + ++ +**타입:** `string[]` +
+ +[설정된 스크립트 리소스](/ko/reference/experimental-flags/csp/#resources)와 [삽입된 스크립트 리소스](/ko/reference/experimental-flags/csp/#cspinsertscriptresource)를 결합한 유효한 소스 목록을 지정합니다. + +#### `isStrictDynamic` + ++ +**타입:** `boolean` +
+ +[설정에서 동적 스크립트 삽입 지원이 활성화되었는지 여부](/ko/reference/experimental-flags/csp/#strictdynamic)를 결정합니다. + +#### `styleHashes` + ++ +**타입:** `string[]` +
+ +프로젝트 스타일용으로 생성된 해시 목록과 외부 스타일용으로 [사용자가 제공한 해시](/ko/reference/experimental-flags/csp/#hashes) 목록을 지정합니다. + +#### `styleResources` + ++ +**타입:** `string[]` +
+ +[설정된 스타일 리소스](/ko/reference/experimental-flags/csp/#resources)와 [삽입된 스타일 리소스](/ko/reference/experimental-flags/csp/#cspinsertstyleresource)를 결합한 유효한 소스 목록을 지정합니다. + +#### `directives` + ++ +**타입:** `CspDirective[]` +
+ +특정 콘텐츠 유형에 대해 [설정된 유효한 소스 목록](/ko/reference/experimental-flags/csp/#directives)을 지정합니다. + ### `ValidRedirectStatus`