mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #31512 from runebaas/microservice-utilities
[microservice-utilities] Fix typing issue on the PlatformClient constructor
This commit is contained in:
+2
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for microservice-utilities 0.1
|
||||
// Type definitions for microservice-utilities 0.2
|
||||
// Project: https://github.com/Cimpress-MCP/microservice-utilities.js
|
||||
// Definitions by: Daan Boerlage <https://github.com/runebaas>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -41,7 +41,7 @@ export interface PlatformClientResponse {
|
||||
}
|
||||
|
||||
export class PlatformClient {
|
||||
constructor(logFunction: (msg: any) => void, tokenResolverFunction?: Promise<() => string>, configuration?: PlatformClientConfiguration)
|
||||
constructor(logFunction: (msg: any) => void, tokenResolverFunction?: () => Promise<string>, configuration?: PlatformClientConfiguration)
|
||||
get(url: string, headers?: { [s: string]: string; }, type?: string): Promise<PlatformClientResponse>;
|
||||
post(url: string, data: object, headers?: { [s: string]: string; }): Promise<PlatformClientResponse>;
|
||||
put(url: string, data: object, headers?: { [s: string]: string; }): Promise<PlatformClientResponse>;
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Authorizer, PlatformClient, RequestLogger, ServiceTokenProvider } from
|
||||
const authorizer = new Authorizer((msg: any) => msg, { jwkKeyListUrl: 'aaa' });
|
||||
const authorizerPolicy = authorizer.getPolicy({ test: true });
|
||||
|
||||
const platformClient = new PlatformClient((msg: any) => msg);
|
||||
const platformClient = new PlatformClient((msg: any) => msg, (): Promise<string> => Promise.resolve('secretToken'));
|
||||
const result = await platformClient.get('https://www.typescriptlang.org/');
|
||||
const data = result.data as string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user