diff --git a/index.d.ts b/index.d.ts index 5c1f9a3..7c95874 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,15 +1,15 @@ -export default class Hubkit { +export default class Hubkit { static defaults: Options & {stats: Stats}; static Stats: StatsClass; static readonly RETRY: unique symbol; static readonly DONT_RETRY: unique symbol; - constructor(options?: Options); - defaultOptions: Options; - request(path: string, options?: Options): Promise; + constructor(options?: Options & TParams); + defaultOptions: Options & TParams; + request(path: string, options?: Options & Parameters): Promise; graph(query: string, options?: Options & {variables?: Record}): Promise; - interpolate(string: string, options?: Record); - scope(options: Options); + interpolate(string: string, options?: Parameters); + scope(options: Options & Tsource): Hubkit; } interface Options { @@ -42,8 +42,6 @@ interface Options { clientId?: string; clientSecret?: string; - [key: string]: any; - onSend?(cause: 'initial' | 'retry' | 'page'): number; // returns timeout onError?(error: Error & { status?: number, @@ -60,6 +58,10 @@ interface Options { undefined | typeof Hubkit.RETRY | typeof Hubkit.DONT_RETRY | any; } +interface Parameters { + [key: string]: any; +} + interface StatsClass { new(): Stats; }