trm-tb-plugin
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -10,2 +10,5 @@ import React, { Dispatch, SetStateAction, ReactNode } from 'react'; | ||
}; | ||
type ClientResponse<T> = T & { | ||
error?: string; | ||
}; | ||
type BaseColumnType = 'String' | 'Date' | 'UInt64' | 'Float64'; | ||
@@ -17,5 +20,2 @@ type ColumnType = BaseColumnType | `Nullable(${BaseColumnType})`; | ||
}; | ||
type ClientResponse<T> = T & { | ||
error?: string; | ||
}; | ||
type Statistics = { | ||
@@ -26,6 +26,2 @@ elapsed: number; | ||
}; | ||
declare class QueryError extends Error { | ||
status: number; | ||
constructor(message: string, status: number); | ||
} | ||
type QueryPipe<T> = { | ||
@@ -37,3 +33,8 @@ meta: Meta<T>[]; | ||
}; | ||
type PipeParams<T> = Record<keyof T, string>; | ||
type QueryStatus = 'idle' | 'loading' | 'updating' | 'error' | 'success'; | ||
declare class QueryError extends Error { | ||
status: number; | ||
constructor(message: string, status: number); | ||
} | ||
type QueryResponse<T> = SWRResponse<T> & { | ||
@@ -47,3 +48,3 @@ warning: QueryError | null; | ||
declare function useFetchPipe<PipeParams>(name: string, queryParams?: Partial<PipeParams>, config?: TbConfig, responseType?: ResponseType): QueryResponse<PipeParams[]>; | ||
declare function useFetchPipe<PipeParams, QueryParams = object>(name: string, queryParams?: Partial<QueryParams>, config?: TbConfig, responseType?: ResponseType): QueryResponse<PipeParams[]>; | ||
@@ -56,2 +57,2 @@ declare const TbConfigContext: React.Context<TbConfig>; | ||
export { BaseColumnType, ClientResponse, ColumnType, Meta, QueryError, QueryPipe, QueryResponse, QueryStatus, ResponseType, Statistics, TbConfig, TbConfigContext, TbConfigProvider, TbConfigProviderProps, client, useFetchPipe }; | ||
export { BaseColumnType, ClientResponse, ColumnType, Meta, PipeParams, QueryError, QueryPipe, QueryResponse, QueryStatus, ResponseType, Statistics, TbConfig, TbConfigContext, TbConfigProvider, TbConfigProviderProps, client, useFetchPipe }; |
@@ -9,2 +9,5 @@ import type { Dispatch, SetStateAction } from 'react'; | ||
}; | ||
export type ClientResponse<T> = T & { | ||
error?: string; | ||
}; | ||
export type BaseColumnType = 'String' | 'Date' | 'UInt64' | 'Float64'; | ||
@@ -16,5 +19,2 @@ export type ColumnType = BaseColumnType | `Nullable(${BaseColumnType})`; | ||
}; | ||
export type ClientResponse<T> = T & { | ||
error?: string; | ||
}; | ||
export type Statistics = { | ||
@@ -25,6 +25,2 @@ elapsed: number; | ||
}; | ||
export declare class QueryError extends Error { | ||
status: number; | ||
constructor(message: string, status: number); | ||
} | ||
export type QueryPipe<T> = { | ||
@@ -36,3 +32,8 @@ meta: Meta<T>[]; | ||
}; | ||
export type PipeParams<T> = Record<keyof T, string>; | ||
export type QueryStatus = 'idle' | 'loading' | 'updating' | 'error' | 'success'; | ||
export declare class QueryError extends Error { | ||
status: number; | ||
constructor(message: string, status: number); | ||
} | ||
export type QueryResponse<T> = SWRResponse<T> & { | ||
@@ -39,0 +40,0 @@ warning: QueryError | null; |
import { TbConfig, ResponseType } from './types'; | ||
export default function useFetchPipe<PipeParams>(name: string, queryParams?: Partial<PipeParams>, config?: TbConfig, responseType?: ResponseType): import("./types").QueryResponse<PipeParams[]>; | ||
export default function useFetchPipe<PipeParams, QueryParams = object>(name: string, queryParams?: Partial<QueryParams>, config?: TbConfig, responseType?: ResponseType): import("./types").QueryResponse<PipeParams[]>; |
{ | ||
"name": "trm-tb-plugin", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "Plugin to fetch data from Tinybird.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.cjs", |
13890
131