mirror of
https://github.com/janishutz/oidc-login-sdk.git
synced 2026-10-08 17:36:20 +02:00
feat: refactor imports
This commit is contained in:
1 parent
e3d1bd7a62
commit
b08532e89a
4 files changed
+33
-23
No files matched your search
@@ -0,0 +1,21 @@
|
||||
# OIDC Login SDK Browser
|
||||
To get completion for the `autherror` event, in the global types file, add the below snippet.
|
||||
|
||||
```typescript
|
||||
declare global {
|
||||
interface GlobalEventHandlersEventMap {
|
||||
'autherror': CustomEvent<void>
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
To define a global types file (i.e. a `typeRoot`), update your `tsconfig.json` file with the following:
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"typeRoots": [
|
||||
"./relative/path/to/global.d.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
+12
-4
@@ -1,6 +1,14 @@
|
||||
import {
|
||||
Config
|
||||
} from './dtype.js';
|
||||
export type AuthErrorResolution = 'resolve' | 'error';
|
||||
|
||||
export interface Config {
|
||||
'backendURL': URL;
|
||||
'defaultAuthErrorResolution': AuthErrorResolution;
|
||||
'authErrorEvent'?: string;
|
||||
'authCheckEndpoint'?: string;
|
||||
'loginEndpoint'?: string;
|
||||
'logoutEndpoint'?: string;
|
||||
'checkAutoRedirect'?: boolean;
|
||||
}
|
||||
|
||||
let configuration: Config = {
|
||||
'backendURL': new URL( '' ),
|
||||
@@ -11,7 +19,7 @@ const get = () => {
|
||||
return configuration;
|
||||
};
|
||||
|
||||
const configure = ( config: Config ) => {
|
||||
export const configure = ( config: Config ) => {
|
||||
configuration = config;
|
||||
};
|
||||
|
||||
|
||||
Vendored
-17
@@ -1,17 +0,0 @@
|
||||
export type AuthErrorResolution = 'resolve' | 'error';
|
||||
|
||||
export interface Config {
|
||||
'backendURL': URL;
|
||||
'defaultAuthErrorResolution': AuthErrorResolution;
|
||||
'authErrorEvent'?: string;
|
||||
'authCheckEndpoint'?: string;
|
||||
'loginEndpoint'?: string;
|
||||
'logoutEndpoint'?: string;
|
||||
'checkAutoRedirect'?: boolean;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface GlobalEventHandlersEventMap {
|
||||
'autherror': CustomEvent<void>
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
import config from './config.js';
|
||||
|
||||
export type * as dtype from './dtype.d.ts';
|
||||
|
||||
export const configure = config.configure;
|
||||
|
||||
export * as auth from './auth.js';
|
||||
|
||||
Reference in new issue
Block a user