|
@@ -1,11 +1,13 @@
|
|
|
-import { getGlobalObject } from '@medici/utils';
|
|
|
-import { projectConfig, ProjectConfigType } from './config';
|
|
|
+// import { getGlobalObject } from '@medici/utils';
|
|
|
+// import { projectConfig, ProjectConfigType } from './config';
|
|
|
+import { BaseTrack } from './basicTrack';
|
|
|
+import { History } from './history';
|
|
|
|
|
|
-export function init(config: ProjectConfigType) {
|
|
|
- const global = getGlobalObject<Window>();
|
|
|
- console.log('global', global);
|
|
|
- projectConfig.next(config);
|
|
|
-}
|
|
|
+// export function init(config: ProjectConfigType) {
|
|
|
+// const global = getGlobalObject<Window>();
|
|
|
+// console.log('global', global);
|
|
|
+// projectConfig.next(config);
|
|
|
+// }
|
|
|
|
|
|
export type PlatformType = 'web' | 'miniApp';
|
|
|
|
|
@@ -16,15 +18,17 @@ export interface SDKInitConfig {
|
|
|
}
|
|
|
export interface SDKConfigType {
|
|
|
platform?: PlatformType;
|
|
|
+ autoTrack?: boolean;
|
|
|
config?: SDKInitConfig;
|
|
|
}
|
|
|
-class SDK {
|
|
|
+export class SDK extends BaseTrack {
|
|
|
protected _platform: PlatformType;
|
|
|
protected _config: SDKInitConfig;
|
|
|
+ protected _history = new History(this);
|
|
|
|
|
|
constructor(params: SDKConfigType) {
|
|
|
+ super();
|
|
|
this._config = params.config;
|
|
|
this._platform = params.platform;
|
|
|
}
|
|
|
-
|
|
|
-}
|
|
|
+}
|