當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript kfetch.kfetch函數代碼示例

本文整理匯總了TypeScript中ui/kfetch.kfetch函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript kfetch函數的具體用法?TypeScript kfetch怎麽用?TypeScript kfetch使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了kfetch函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: requestRepositorySearch

function requestRepositorySearch(q: string) {
  return kfetch({
    pathname: `/api/code/search/repo`,
    method: 'get',
    query: { q },
  });
}
開發者ID:elastic,項目名稱:kibana,代碼行數:7,代碼來源:search.ts

示例2: requestImportRepo

function requestImportRepo(uri: string) {
  return kfetch({
    pathname: '/api/code/repo',
    method: 'post',
    body: JSON.stringify({ url: uri }),
  });
}
開發者ID:elastic,項目名稱:kibana,代碼行數:7,代碼來源:repository.ts

示例3: putProjectConfig

function putProjectConfig(repoUri: string, config: RepositoryConfig) {
  return kfetch({
    pathname: `/api/code/repo/config/${repoUri}`,
    method: 'PUT',
    body: JSON.stringify(config),
  });
}
開發者ID:elastic,項目名稱:kibana,代碼行數:7,代碼來源:project_config.ts

示例4: fetchOptionsWithDebug

export async function callApi<T = void>(
  fetchOptions: KFetchOptions,
  options?: KFetchKibanaOptions
): Promise<T> {
  const combinedFetchOptions = fetchOptionsWithDebug(fetchOptions);
  return await kfetch(combinedFetchOptions, options);
}
開發者ID:liuyepiaoxiang,項目名稱:kibana,代碼行數:7,代碼來源:callApi.ts

示例5: requestRepoInitCmd

function requestRepoInitCmd(repoUri: string) {
  return kfetch({
    pathname: `/api/code/workspace/${repoUri}/master`,
    query: { force: true },
    method: 'post',
  });
}
開發者ID:elastic,項目名稱:kibana,代碼行數:7,代碼來源:repository.ts

示例6: requestFindReferences

function requestFindReferences(params: TextDocumentPositionParams) {
  return kfetch({
    pathname: `/api/code/lsp/findReferences`,
    method: 'POST',
    body: JSON.stringify(params),
  });
}
開發者ID:elastic,項目名稱:kibana,代碼行數:7,代碼來源:editor.ts

示例7: fetchOptionsWithDebug

export async function callApi<T = void>(
  fetchOptions: KFetchOptions,
  { camelcase = true, prependBasePath = true } = {}
): Promise<T> {
  const combinedFetchOptions = fetchOptionsWithDebug(fetchOptions);
  const res = await kfetch(combinedFetchOptions, { prependBasePath });
  return camelcase ? camelizeKeys(res) : res;
}
開發者ID:gingerwizard,項目名稱:kibana,代碼行數:8,代碼來源:callApi.ts

示例8: handleQname

 async function handleQname(qname: string) {
   const res: any = await kfetch({ pathname: `/api/code/lsp/symbol/${qname}` });
   if (res.symbols) {
     return res.symbols.map((s: DetailSymbolInformation) =>
       handleLocation(s.symbolInformation.location)
     );
   }
   return [];
 }
開發者ID:elastic,項目名稱:kibana,代碼行數:9,代碼來源:definition_provider.ts

示例9: findSymbolByQname

 public static async findSymbolByQname(qname: string) {
   try {
     const response = await kfetch({
       pathname: `/api/code/lsp/symbol/${qname}`,
       method: 'GET',
     });
     return response as SymbolSearchResult;
   } catch (e) {
     const error = e.body;
     throw new ResponseError<any>(error.code, error.message, error.data);
   }
 }
開發者ID:elastic,項目名稱:kibana,代碼行數:12,代碼來源:editor_service.ts

示例10: changePassword

 public static async changePassword(username: string, password: string, currentPassword: string) {
   const data: Record<string, string> = {
     newPassword: password,
   };
   if (currentPassword) {
     data.password = currentPassword;
   }
   await kfetch({
     pathname: `${usersUrl}/${encodeURIComponent(username)}/password`,
     method: 'POST',
     body: JSON.stringify(data),
   });
 }
開發者ID:spalger,項目名稱:kibana,代碼行數:13,代碼來源:api.ts


注:本文中的ui/kfetch.kfetch函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。