style(data-source): 去掉any

This commit is contained in:
roymondchen 2023-08-25 17:44:57 +08:00
parent 7f48b4d9f5
commit 131ec6fff3
5 changed files with 11 additions and 4 deletions

View File

@ -38,6 +38,7 @@
"lodash-es": "^4.17.21"
},
"devDependencies": {
"@tmagic/core": "1.3.0-alpha.21",
"@types/events": "^3.0.0",
"@types/lodash-es": "^4.17.4",
"@types/node": "^15.12.4",

View File

@ -20,6 +20,7 @@ import EventEmitter from 'events';
import { cloneDeep, template } from 'lodash-es';
import type Core from '@tmagic/core';
import type { DataSourceSchema, Id, MNode } from '@tmagic/schema';
import { compiledCond, compiledNode } from '@tmagic/utils';
@ -37,7 +38,7 @@ class DataSourceManager extends EventEmitter {
return DataSourceManager.dataSourceClassMap.get(type);
}
public app: any;
public app: Core;
public dataSourceMap = new Map<string, DataSource>();
@ -48,7 +49,7 @@ class DataSourceManager extends EventEmitter {
this.app = app;
app.dsl?.dataSources?.forEach((config: any) => {
app.dsl?.dataSources?.forEach((config) => {
this.addDataSource(config);
});
}

View File

@ -17,6 +17,7 @@
*/
import { cloneDeep } from 'lodash-es';
import type Core from '@tmagic/core';
import { getDepNodeIds, getNodes, replaceChildNode } from '@tmagic/utils';
import DataSourceManager from './DataSourceManager';
@ -27,7 +28,7 @@ import DataSourceManager from './DataSourceManager';
* @param httpDataSourceOptions http
* @returns DataSourceManager
*/
export const createDataSourceManager = (app: any) => {
export const createDataSourceManager = (app: Core) => {
const { dsl, platform } = app;
if (!dsl?.dataSources) return;

View File

@ -1,3 +1,4 @@
import type Core from '@tmagic/core';
import type { DataSourceSchema } from '@tmagic/schema';
export interface DataSourceOptions {
@ -31,7 +32,7 @@ export interface HttpDataSourceOptions {
}
export interface DataSourceManagerOptions {
app: any;
app: Core;
}
export interface DataSourceManagerData {

3
pnpm-lock.yaml generated
View File

@ -206,6 +206,9 @@ importers:
specifier: ^4.17.21
version: 4.17.21
devDependencies:
'@tmagic/core':
specifier: 1.3.0-alpha.21
version: link:../core
'@types/events':
specifier: ^3.0.0
version: 3.0.0