@fctc/interface-logic 2.9.8 → 3.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,77 +0,0 @@
1
- declare const localStorageUtils: () => {
2
- setToken: (access_token: string) => Promise<void>;
3
- setRefreshToken: (refresh_token: string) => Promise<void>;
4
- getAccessToken: () => Promise<string | null>;
5
- getRefreshToken: () => Promise<string | null>;
6
- clearToken: () => Promise<void>;
7
- };
8
- type LocalStorageUtilsType = ReturnType<typeof localStorageUtils>;
9
-
10
- declare const sessionStorageUtils: () => {
11
- getMenuFocus: () => IMenu;
12
- setMenuFocus: (menuTree: IMenu) => void;
13
- setActionData: (actData: any) => void;
14
- getActionData: () => any | null;
15
- getViewData: () => any | null;
16
- setViewData: (viewData: any) => void;
17
- getBrowserSession: () => string | null;
18
- };
19
- interface IMenu {
20
- id: number | undefined;
21
- service: string;
22
- }
23
- type SessionStorageUtilsType = ReturnType<typeof sessionStorageUtils>;
24
-
25
- interface EnvConfig {
26
- env?: any;
27
- baseUrl: string;
28
- requests?: any;
29
- context?: {
30
- uid?: number | null;
31
- allowed_company_ids?: number[];
32
- lang?: string;
33
- tz?: string;
34
- };
35
- defaultCompany?: {
36
- id?: number | null;
37
- logo?: string;
38
- secondary_color?: string;
39
- primary_color?: string;
40
- };
41
- database?: string;
42
- xNode?: string;
43
- default_service?: string;
44
- config?: any;
45
- companies?: any[];
46
- user?: any;
47
- db?: string;
48
- refreshTokenEndpoint?: string;
49
- localStorageUtils?: LocalStorageUtilsType;
50
- sessionStorageUtils?: SessionStorageUtilsType;
51
- envFile?: any;
52
- }
53
- declare class EnvStore {
54
- private state;
55
- private emitter;
56
- private localStorageUtil;
57
- private sessionStorageUtil;
58
- constructor(localStorageUtil?: LocalStorageUtilsType, sessionStorageUtil?: SessionStorageUtilsType);
59
- getEnv(): EnvConfig;
60
- onUpdate(callback: (env: EnvConfig) => void): void;
61
- setupEnv(envConfig: Partial<EnvConfig>): EnvConfig;
62
- setUid(uid: number): void;
63
- setLang(lang: string): void;
64
- setAllowCompanies(allowed_company_ids: number[]): void;
65
- setCompanies(companies: any[]): void;
66
- setDefaultCompany(defaultCompany: EnvConfig['defaultCompany']): void;
67
- setUserInfo(user: any): void;
68
- setConfig(config: any): void;
69
- setEnvFile(envFile: any): void;
70
- }
71
- declare function initEnv({ localStorageUtils: localStorageUtil, sessionStorageUtils: sessionStorageUtil, }: {
72
- localStorageUtils?: LocalStorageUtilsType;
73
- sessionStorageUtils?: SessionStorageUtilsType;
74
- }): EnvStore;
75
- declare function getEnv(): any;
76
-
77
- export { type EnvConfig as E, type LocalStorageUtilsType as L, type SessionStorageUtilsType as S, EnvStore as a, getEnv as g, initEnv as i };
@@ -1,77 +0,0 @@
1
- declare const localStorageUtils: () => {
2
- setToken: (access_token: string) => Promise<void>;
3
- setRefreshToken: (refresh_token: string) => Promise<void>;
4
- getAccessToken: () => Promise<string | null>;
5
- getRefreshToken: () => Promise<string | null>;
6
- clearToken: () => Promise<void>;
7
- };
8
- type LocalStorageUtilsType = ReturnType<typeof localStorageUtils>;
9
-
10
- declare const sessionStorageUtils: () => {
11
- getMenuFocus: () => IMenu;
12
- setMenuFocus: (menuTree: IMenu) => void;
13
- setActionData: (actData: any) => void;
14
- getActionData: () => any | null;
15
- getViewData: () => any | null;
16
- setViewData: (viewData: any) => void;
17
- getBrowserSession: () => string | null;
18
- };
19
- interface IMenu {
20
- id: number | undefined;
21
- service: string;
22
- }
23
- type SessionStorageUtilsType = ReturnType<typeof sessionStorageUtils>;
24
-
25
- interface EnvConfig {
26
- env?: any;
27
- baseUrl: string;
28
- requests?: any;
29
- context?: {
30
- uid?: number | null;
31
- allowed_company_ids?: number[];
32
- lang?: string;
33
- tz?: string;
34
- };
35
- defaultCompany?: {
36
- id?: number | null;
37
- logo?: string;
38
- secondary_color?: string;
39
- primary_color?: string;
40
- };
41
- database?: string;
42
- xNode?: string;
43
- default_service?: string;
44
- config?: any;
45
- companies?: any[];
46
- user?: any;
47
- db?: string;
48
- refreshTokenEndpoint?: string;
49
- localStorageUtils?: LocalStorageUtilsType;
50
- sessionStorageUtils?: SessionStorageUtilsType;
51
- envFile?: any;
52
- }
53
- declare class EnvStore {
54
- private state;
55
- private emitter;
56
- private localStorageUtil;
57
- private sessionStorageUtil;
58
- constructor(localStorageUtil?: LocalStorageUtilsType, sessionStorageUtil?: SessionStorageUtilsType);
59
- getEnv(): EnvConfig;
60
- onUpdate(callback: (env: EnvConfig) => void): void;
61
- setupEnv(envConfig: Partial<EnvConfig>): EnvConfig;
62
- setUid(uid: number): void;
63
- setLang(lang: string): void;
64
- setAllowCompanies(allowed_company_ids: number[]): void;
65
- setCompanies(companies: any[]): void;
66
- setDefaultCompany(defaultCompany: EnvConfig['defaultCompany']): void;
67
- setUserInfo(user: any): void;
68
- setConfig(config: any): void;
69
- setEnvFile(envFile: any): void;
70
- }
71
- declare function initEnv({ localStorageUtils: localStorageUtil, sessionStorageUtils: sessionStorageUtil, }: {
72
- localStorageUtils?: LocalStorageUtilsType;
73
- sessionStorageUtils?: SessionStorageUtilsType;
74
- }): EnvStore;
75
- declare function getEnv(): any;
76
-
77
- export { type EnvConfig as E, type LocalStorageUtilsType as L, type SessionStorageUtilsType as S, EnvStore as a, getEnv as g, initEnv as i };