Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions types/atlassian-connect-js/atlassian-connect-js-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ AP.confluence.syncPropertyFromServer('propertyKey', property => console.log(prop
AP.context.getToken(token => console.log(token)); // $ExpectType void
AP.context.getContext(context => console.log(context)); // $ExpectType void

AP.context.getToken(); // $ExpectType Promise<string>
AP.context.getContext(); // $ExpectType Promise<any>

AP.cookie.save('name', 'value', 10); // $ExpectType void
AP.cookie.read('name', value => console.log(value)); // $ExpectType void
AP.cookie.erase('name'); // $ExpectType void
Expand Down
2 changes: 2 additions & 0 deletions types/atlassian-connect-js/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,14 @@ declare namespace AP {
* @param callback the callback that handles the response
*/
function getToken(callback: (token: string) => void): void;
function getToken(): Promise<string>;

/**
* Retrieves the current user context containing details such as space key, issue id, etc.
* @param callback the callback that handles the response
*/
function getContext(callback: (context: any) => void): void;
function getContext(): Promise<any>;
}

/**
Expand Down