feat: refactor imports

This commit is contained in:
janishutz committed 2026-09-21 17:09:42 +02:00
1 parent e3d1bd7a62
commit b08532e89a
4 files changed
+33 -23

No files matched your search

+21
View File
@@ -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
View File
@@ -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;
};
-17
View File
@@ -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>
}
}
-2
View File
@@ -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';