docs: update api reports

Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
Camila Belo
2024-03-13 12:36:23 +01:00
parent 756ddb637f
commit a7db1e651d
5 changed files with 70 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
## API Report File for "@backstage/plugin-auth-react"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { ApiRef } from '@backstage/core-plugin-api';
import { AsyncState } from '@react-hookz/web';
import { default as React_2 } from 'react';
import { ReactNode } from 'react';
import { UseAsyncActions } from '@react-hookz/web';
// @public
export type AuthApi = {
getCookie(): Promise<{
expiresAt: string;
}>;
};
// @public
export function CookieAuthRefreshProvider<T extends AuthApi>({
apiRef,
children,
}: {
apiRef: ApiRef<T>;
children: ReactNode;
}):
| string
| number
| boolean
| Iterable<React_2.ReactNode>
| React_2.JSX.Element
| null
| undefined;
// @public
export function useCookieAuthRefresh<T extends AuthApi>({
apiRef,
}: {
apiRef: ApiRef<T>;
}): {
state: AsyncState<
| {
expiresAt: string;
}
| undefined
>;
actions: UseAsyncActions<
{
expiresAt: string;
},
[]
>;
};
```
@@ -21,6 +21,11 @@ import { Button } from '@material-ui/core';
import { useCookieAuthRefresh } from '../../hooks';
import { AuthApi } from '../../types';
/**
* @public
* A provider that will refresh the cookie when it is about to expire.
* It receives an `apiRef` and `children` as props, and expects that apiRef extends the `AuthApi` interface.
*/
export function CookieAuthRefreshProvider<T extends AuthApi>({
apiRef,
children,
@@ -26,6 +26,12 @@ type CookieAuthRefreshMessage = MessageEvent<{
};
}>;
/**
* @public
* It receives an `apiRef` as options, and expects that apiRef extends the `AuthApi` interface.
* @remarks
* This hook expects a `BroadcastChannel` to be available in the global scope.
*/
export function useCookieAuthRefresh<T extends AuthApi>({
apiRef,
}: {
+1
View File
@@ -25,3 +25,4 @@
export * from './components';
export * from './hooks';
export * from './types';
+4
View File
@@ -14,4 +14,8 @@
* limitations under the License.
*/
/**
* @public
* Defines a minimal inteface for auth apis.
*/
export type AuthApi = { getCookie(): Promise<{ expiresAt: string }> };