Tipos & Erros

Organiza os limites de tipo do contrato de requisição HTTP e do objeto de erro padrão.


OpenApiPathsLike

ts
export type OpenApiPathsLike = object;

A restrição em tempo de compilação é ampla. objetoA inferência de tipo real éPaths[path][method].parametersdo elemento alvo e requestBody.content["application/json"]especificada quando há uma propriedade do tipo OpenAPI.

ServiceArguments<Paths, TPath, TMethod, R>

NameTypeDefaultDescrição

url

obrigatório

TPath

-

Paths key.

method

obrigatório

TMethod

-

Paths[TPath] method key.

pathVariable

parameters.path | Record

-

path parameters가 있으면 해당 타입, 없으면 일반 Record fallback.

queryString

parameters.query | Record

-

query parameters가 있으면 해당 타입, 없으면 일반 Record fallback.

body

requestBody application/json | unknown

-

JSON request body schema가 있으면 해당 타입.

resultInterceptor

(response: Response) => Promise<R>

-

직접 response parser.

headers

Readonly<Record<string, string>>

-

요청별 headers.

CacheForService&lt;CacheName&gt;

NameTypeDefaultDescrição

cacheTime

obrigatório

number

-

CSR shareReplay windowTime 또는 SSR revalidate 기준 milliseconds.

cacheSize

number

-

CSR shareReplay bufferSize. SSR에서는 사용하지 않습니다.

cacheName

obrigatório

CacheName

-

cache key prefix와 Next.js cache tag.

HttpResponseError&lt;Args&gt;

ts
client.callApi<Response>({
  url: "/profile/me",
  method: "get",
}).subscribe({
  error: (error) => {
    if (isHttpResponseError(error)) {
      console.log(error.status);
      console.log(error.response);
      console.log(error.args);
      console.log(error.data);
    }
  },
});

response

원본 Fetch Response.

args

실패한 ServiceArguments.

data

JSON 또는 text로 파싱한 에러 body.

status

response.status getter.

message

body.message → defaultErrorMessage → 기본 HTTP ERROR 문자열 순서로 결정됩니다.

Comportamento de compatibilidade de erro

© 2026 Byeolnaerim. Todos os direitos reservados.IntroduçãoPolítica de Privacidade