DenchHTTPURL
간략한 설명
프로토콜을 포함한 URL 문자열만 허용하는 템플릿 리터럴 유니온 타입입니다.
타입 정의
type DenchHTTPURL =
| `http://${string}`
| `https://${string}`
| `file://${string}`
| `ftp://${string}`
| `ws://${string}`
| `wss://${string}`;
DenchHTTPURL에는 제너릭이 없습니다.
프로퍼티
DenchHTTPURL은 객체 타입이 아닌 문자열 유니온 타입이므로 프로퍼티가 없습니다.
| Property | Type | Required | Description |
|---|---|---|---|
| 해당 없음 | - | - | 허용된 프로토콜로 시작하는 문자열 자체가 값입니다. |
사용처
dench(baseURL: DenchHTTPURL)의baseURL매개변수에 사용됩니다.DenchInterface.baseURL프로퍼티 타입에 사용됩니다.
import type { DenchHTTPURL } from 'dench-fetch';
const productionURL: DenchHTTPURL = 'https://api.example.com';
const localURL: DenchHTTPURL = 'http://localhost:3000';