UNPKG

@looker/sdk-rtl

Version:
46 lines (45 loc) 1.64 kB
import type { IAPIMethods } from './transport'; export interface IErrorDocItem { url: string; } export declare const ErrorCodesUrl = "https://static-a.cdn.looker.app/errorcodes/"; export type ErrorCodeIndex = Record<string, IErrorDocItem>; export declare const ErrorDocNotFound = "### No documentation found for "; export declare const ErrorDocRx: RegExp; export interface IErrorDocLink { redirector: string; apiVersion: string; statusCode: string; apiPath: string; } export interface IErrorDoc { index?: ErrorCodeIndex; indexUrl: string; parse(docUrl: string): IErrorDocLink; contentUrl(urlPath: string): string; getContent(url: string): Promise<string>; content(docUrl: string): Promise<string>; specPath(path: string): string; errorKey(docUrl: string): string; load(): Promise<ErrorCodeIndex>; methodName(errorMdUrl: string): string; } export type SDKGetCallback = (sdk: IAPIMethods, url: string) => Promise<string>; export declare class ErrorDoc implements IErrorDoc { sdk: IAPIMethods; getter: SDKGetCallback; readonly cdnUrl: string; private _index?; constructor(sdk: IAPIMethods, getter?: SDKGetCallback, cdnUrl?: string); load(): Promise<ErrorCodeIndex>; get indexUrl(): string; get index(): ErrorCodeIndex | undefined; specPath(path: string): string; errorKey(docUrl: string): string; private notFound; getContent(url: string): Promise<string>; content(docUrl: string): Promise<string>; contentUrl(urlPath: string): string; methodName(errorMdUrl: string): string; parse(docUrl: string): IErrorDocLink; }