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
@@ -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 }> };