@forestadmin/datasource-toolkit
Version:
21 lines • 986 B
TypeScript
import { Caller } from './interfaces/caller';
import { Chart } from './interfaces/chart';
import { Collection, DataSource } from './interfaces/collection';
import { DataSourceSchema } from './interfaces/schema';
export default class BaseDataSource<T extends Collection = Collection> implements DataSource {
protected _collections: {
[collectionName: string]: T;
};
protected _nativeQueryConnections: {
[connectionName: string]: unknown;
};
get collections(): T[];
get nativeQueryConnections(): Record<string, unknown>;
get schema(): DataSourceSchema;
getCollection(name: string): T;
addCollection(collection: T): void;
addNativeQueryConnection(connectionName: string, definition: unknown): void;
renderChart(caller: Caller, name: string): Promise<Chart>;
executeNativeQuery(connectionName: string, query: string, contextVariables: Record<string, unknown>): Promise<unknown>;
}
//# sourceMappingURL=base-datasource.d.ts.map