codenotch-react 1.0.0 → 1.0.2
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.
- package/index.d.ts +5 -1
- package/index.js +25 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -30,4 +30,8 @@ export interface ICodenotchAppProps {
|
|
|
30
30
|
baseUrl?: string;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export type CodenotchApp<T> = React.FC<(ICodenotchAppProps & T)>;
|
|
33
|
+
export type CodenotchApp<T> = React.FC<(ICodenotchAppProps & T)>;
|
|
34
|
+
|
|
35
|
+
export abstract class CodenotchAppComponent extends React.Component<ICodenotchAppProps> {
|
|
36
|
+
|
|
37
|
+
}
|
package/index.js
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
|
+
const React = require('react');
|
|
2
|
+
|
|
1
3
|
const CODENOTCH_ENV = {
|
|
2
4
|
|
|
3
5
|
};
|
|
4
6
|
|
|
7
|
+
class CodenotchAppComponent extends React.Component {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
super(props);
|
|
10
|
+
// Initialiser l'environnement Codenotch avec les props
|
|
11
|
+
if (props.clusterUrl) {
|
|
12
|
+
CODENOTCH_ENV.clusterUrl = props.clusterUrl;
|
|
13
|
+
}
|
|
14
|
+
if (props.serviceName) {
|
|
15
|
+
CODENOTCH_ENV.serviceName = props.serviceName;
|
|
16
|
+
}
|
|
17
|
+
if (props.tenantName) {
|
|
18
|
+
CODENOTCH_ENV.tenantName = props.tenantName;
|
|
19
|
+
}
|
|
20
|
+
if (props.userId) {
|
|
21
|
+
CODENOTCH_ENV.userId = props.userId;
|
|
22
|
+
}
|
|
23
|
+
if (props.accessToken) {
|
|
24
|
+
CODENOTCH_ENV.accessToken = props.accessToken;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
5
29
|
function useCodenotch() {
|
|
6
30
|
console.log("useCodenotch has been called");
|
|
7
31
|
return {
|
|
@@ -103,4 +127,4 @@ function useCodenotchApp(props) {
|
|
|
103
127
|
return useCodenotch();
|
|
104
128
|
}
|
|
105
129
|
|
|
106
|
-
module.exports = { useCodenotch, useCodenotchApp };
|
|
130
|
+
module.exports = { useCodenotch, useCodenotchApp, CodenotchAppComponent };
|