@moser-inc/moser-labs-custom-elements 1.2.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,44 +1,38 @@
|
|
|
1
1
|
import { default as default_2 } from 'keycloak-js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Call this function to
|
|
5
|
-
*
|
|
4
|
+
* Call this function to register all provided custom elements at once passing
|
|
5
|
+
* the Keycloak instance to them.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
9
9
|
* import Keycloak from 'keycloak-js';
|
|
10
|
-
* import {
|
|
10
|
+
* import { registerCustomElements } from '@moser-inc/moser-labs-custom-elements';
|
|
11
11
|
*
|
|
12
12
|
* const keycloak = new Keycloak('/keycloak.json');
|
|
13
13
|
*
|
|
14
14
|
* keycloak.init({ onLoad: 'login-required' }).then((isAuthenticated) => {
|
|
15
15
|
* if (!isAuthenticated) return;
|
|
16
16
|
*
|
|
17
|
-
*
|
|
18
|
-
* registerCustomElements();
|
|
17
|
+
* registerCustomElements({ keycloak, apiUri: 'https://www.moserlabs.app' });
|
|
19
18
|
* });
|
|
20
19
|
* ```
|
|
21
|
-
*/
|
|
22
|
-
export declare function authenticateCustomElements(keycloak: default_2): void;
|
|
23
|
-
|
|
24
|
-
export declare const LabsAppSwitcher: any;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Call this function to register all provided custom elements at once.
|
|
28
20
|
*
|
|
29
|
-
*
|
|
30
|
-
* ```ts
|
|
31
|
-
* import { registerCustomElements } from '@moser-inc/moser-labs-custom-elements';
|
|
32
|
-
* registerCustomElements();
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* Then use elements in your HTML or framework of choice.
|
|
21
|
+
* Use the custom elements anywhere in your application.
|
|
36
22
|
*
|
|
37
23
|
* @example
|
|
38
24
|
* ```html
|
|
39
25
|
* <labs-app-switcher></labs-app-switcher>
|
|
26
|
+
* <labs-account></labs-account>
|
|
40
27
|
* ```
|
|
41
28
|
*/
|
|
42
|
-
export declare function registerCustomElements(): void;
|
|
29
|
+
export declare function registerCustomElements(options: RegisterCustomElementsOptions): void;
|
|
30
|
+
|
|
31
|
+
export declare interface RegisterCustomElementsOptions {
|
|
32
|
+
/** Keycloak instance to provide to custom elements. */
|
|
33
|
+
keycloak: default_2;
|
|
34
|
+
/** Base URI to access the Moser Labs API. */
|
|
35
|
+
apiUri?: string;
|
|
36
|
+
}
|
|
43
37
|
|
|
44
38
|
export { }
|