UNPKG

@craftercms/studio-ui

Version:

Services, components, models & utils to build CrafterCMS authoring extensions.

49 lines (47 loc) 2.81 kB
/* * Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import { AjaxError, AjaxResponse, AjaxConfig } from 'rxjs/ajax'; import { Observable, ObservableInput } from 'rxjs'; import StandardAction from '../models/StandardAction'; type Headers = Record<string, any>; export declare const CONTENT_TYPE_JSON: { 'Content-Type': string; }; export declare const OMIT_GLOBAL_HEADERS: unique symbol; export declare function setGlobalHeaders(props: object): void; export declare function removeGlobalHeaders(...headersToDelete: string[]): void; export declare function getGlobalHeaders(): Record<string, string>; export declare function get<T = any>(url: string, headers?: Headers): Observable<AjaxResponse<T>>; export declare function getText<T = any>(url: string, headers?: Headers): Observable<AjaxResponse<T>>; export declare function getBinary<T = Blob>( url: string, headers?: Headers, responseType?: XMLHttpRequestResponseType ): Observable<AjaxResponse<T>>; export declare function post<T = any>(url: string, body?: any, headers?: Headers): Observable<AjaxResponse<T>>; export declare function postJSON<T = any>(url: string, body: any, headers?: Headers): Observable<AjaxResponse<T>>; export declare function patch<T = any>(url: string, body: any, headers?: Headers): Observable<AjaxResponse<T>>; export declare function patchJSON<T = any>(url: string, body: any, headers?: Headers): Observable<AjaxResponse<T>>; export declare function put<T = any>(url: string, body: any, headers?: Headers): Observable<AjaxResponse<T>>; export declare function del<T = any>(url: string, headers?: Headers): Observable<AjaxResponse<T>>; declare function ajaxWithCrafterHeaders<T = any>(url: string): Observable<AjaxResponse<T>>; declare function ajaxWithCrafterHeaders<T = any>(request: AjaxConfig): Observable<AjaxResponse<T>>; export { ajaxWithCrafterHeaders as ajax }; export declare const catchAjaxError: ( fetchFailedCreator: any, ...moreActionCreators: Array<(error: Partial<AjaxError>) => StandardAction> ) => import('rxjs').OperatorFunction<unknown, any>; export declare const errorSelectorApi1: <T, O extends ObservableInput<any>>(err: any, caught: Observable<T>) => O;