remove intermediate type for headers

Signed-off-by: Abhinav Rastogi <abhinav.rastogi@harness.io>
This commit is contained in:
Abhinav Rastogi
2022-12-12 17:56:41 +05:30
parent fae040888a
commit b5c65ca6e9
3 changed files with 4 additions and 10 deletions
+1 -2
View File
@@ -807,7 +807,7 @@ export const ProxiedSignInPage: (
// @public
export type ProxiedSignInPageProps = SignInPageProps & {
provider: string;
headers?: RefreshHeaders;
headers?: HeadersInit | (() => HeadersInit) | (() => Promise<HeadersInit>);
};
// Warning: (ae-missing-release-tag) "Ranker" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -1533,5 +1533,4 @@ export type WarningPanelClassKey =
// src/components/TabbedLayout/RoutedTabs.d.ts:9:5 - (ae-forgotten-export) The symbol "SubRoute" needs to be exported by the entry point index.d.ts
// src/components/Table/Table.d.ts:20:5 - (ae-forgotten-export) The symbol "SelectedFilters" needs to be exported by the entry point index.d.ts
// src/layout/ErrorBoundary/ErrorBoundary.d.ts:8:5 - (ae-forgotten-export) The symbol "SlackChannel" needs to be exported by the entry point index.d.ts
// src/layout/ProxiedSignInPage/ProxiedSignInPage.d.ts:19:5 - (ae-forgotten-export) The symbol "RefreshHeaders" needs to be exported by the entry point index.d.ts
```
@@ -48,15 +48,10 @@ export function tokenToExpiry(jwtToken: string | undefined): Date {
return new Date(payload.exp * 1000 - DEFAULTS.tokenExpiryMarginMillis);
}
export type RefreshHeaders =
| HeadersInit
| (() => HeadersInit)
| (() => Promise<HeadersInit>);
type ProxiedSignInIdentityOptions = {
provider: string;
discoveryApi: typeof discoveryApiRef.T;
headers?: RefreshHeaders;
headers?: HeadersInit | (() => HeadersInit) | (() => Promise<HeadersInit>);
};
type State =
@@ -23,7 +23,7 @@ import React from 'react';
import { useAsync, useMountEffect } from '@react-hookz/web';
import { ErrorPanel } from '../../components/ErrorPanel';
import { Progress } from '../../components/Progress';
import { ProxiedSignInIdentity, RefreshHeaders } from './ProxiedSignInIdentity';
import { ProxiedSignInIdentity } from './ProxiedSignInIdentity';
/**
* Props for {@link ProxiedSignInPage}.
@@ -41,7 +41,7 @@ export type ProxiedSignInPageProps = SignInPageProps & {
* Optional headers which are passed along with the request to the
* underlying provider
*/
headers?: RefreshHeaders;
headers?: HeadersInit | (() => HeadersInit) | (() => Promise<HeadersInit>);
};
/**