Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #177 from amarzavery/types
Browse files Browse the repository at this point in the history
acquireUserCode returns UserCodeInfo in the callback, hence it needs to have a different callback type
  • Loading branch information
lovemaths authored Nov 6, 2017
2 parents dc55bd1 + b779f9e commit c565b8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions lib/adal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ export interface ErrorResponse {
*/
export type AcquireTokenCallback = (error: Error, response: TokenResponse | ErrorResponse) => void;

/**
* This is the callback that is passed to all acquireUserCode method below.
* @callback AcquireTokenCallback
* @param {Error} [error] If the request fails this parameter will contain an Error object.
* @param {UserCodeInfo} [response] On a succesful request returns a {@link UserCodeInfo}.
*/
export type AcquireUserCodeCallback = (error: Error, response: UserCodeInfo) => void;

/**
* This is an interface that can be implemented to provide custom token cache persistence.
* @public
Expand Down Expand Up @@ -325,9 +333,9 @@ export class AuthenticationContext {
* @param {string} resource A URI that identifies the resource for which the device_code and user_code is valid for.
* @param {string} clientId The OAuth client id of the calling application.
* @param {string} language The language code specifying how the message should be localized to.
* @param {AcquireTokenCallback} callback The callback function.
* @param {AcquireUserCodeCallback} callback The callback function.
*/
public acquireUserCode(resource: string, clientId: string, language: string, callback: AcquireTokenCallback): void;
public acquireUserCode(resource: string, clientId: string, language: string, callback: AcquireUserCodeCallback): void;

/**
* Gets a new access token using via a certificate credential.
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c565b8b

Please sign in to comment.