docs: update api reports
Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
+5
@@ -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,
|
||||
}: {
|
||||
|
||||
@@ -25,3 +25,4 @@
|
||||
|
||||
export * from './components';
|
||||
export * from './hooks';
|
||||
export * from './types';
|
||||
|
||||
@@ -14,4 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @public
|
||||
* Defines a minimal inteface for auth apis.
|
||||
*/
|
||||
export type AuthApi = { getCookie(): Promise<{ expiresAt: string }> };
|
||||
|
||||
Reference in New Issue
Block a user