Skip to content

Commit e7ec50d

Browse files
i18n(ko-KR): update astro-actions.mdx (#12752)
Co-authored-by: Yan <[email protected]>
1 parent fa10d9d commit e7ec50d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/content/docs/ko/reference/modules/astro-actions.mdx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@ import type {
443443
ActionAPIContext,
444444
ActionClient,
445445
ActionErrorCode,
446+
ActionInputSchema,
446447
ActionReturnType,
447448
SafeResult,
448449
} from 'astro:actions';
@@ -546,6 +547,32 @@ button?.addEventListener('click', async () => {
546547

547548
[IANA에서 정의한](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml) 표준 HTTP 상태 코드의 유니언 타입으로, 사람이 읽을 수 있는 버전의 대문자 문자열이며, 언더스코어로 구분합니다. (예: `BAD_REQUEST` 또는 `PAYLOAD_TOO_LARGE`)
548549

550+
### `ActionInputSchema`
551+
552+
<p>
553+
554+
**타입:** `ZodType`
555+
<Since v="5.16.0" />
556+
</p>
557+
558+
Zod 스키마를 기반으로 액션 입력의 TypeScript 타입을 추론하는 유틸리티 타입입니다. 이는 자체 타입 정의에서 액션의 [`input` 유효성 검사기 타입](#input-유효성-검사기)을 객체로 참조할 때 유용할 수 있습니다.
559+
560+
[`input` 유효성 검사기](#input-유효성-검사기)가 생략되면 `never`를 반환합니다.
561+
562+
다음은 이름이 `contact`인 액션에서 `ActionInputSchema`를 사용하는 예시입니다.
563+
* 액션 입력에 대한 Zod 스키마 타입을 검색합니다.
564+
* 액션 유효성 검사기의 예상 입력 타입을 검색합니다.
565+
566+
```astro title="src/components/Form.astro" {5}
567+
---
568+
import { actions, ActionInputSchema } from 'astro:actions';
569+
import { z } from 'astro/zod';
570+
571+
type ContactSchema = ActionInputSchema<typeof actions.contact>;
572+
type ContactInput = z.input<ContactSchema>;
573+
---
574+
```
575+
549576
### `ActionReturnType`
550577

551578
<p>

0 commit comments

Comments
 (0)