Hi, i'm trying to implement a getall method for abstract object of "AbstractGeometry" but getting a error message of "Type '(Promise<AreaGeometry[]> | Promise<LineGeometry[]> | Promise<PointGeometry[]>)[]' is missing the following properties from type 'Promise<AbstractGeometry[][]>': then, catch, finally, [Symbol.toStringTag]ts(2739)"
here is the code:
//Type '(Promise<AreaGeometry[]> | Promise<LineGeometry[]> | Promise<PointGeometry[]>)[]' is missing the following properties from type 'Promise<AbstractGeometry[][]>': then, catch, finally, [Symbol.toStringTag]ts(2739)
getAll(): Promise<(AbstractGeometry|null)[][] | null> {
let areas = this.areaService.getAll();
let lines = this.lineService.getAll();
let points = this.pointService.getAll();
if (!areas && !lines && !points) throw new Error("there isn't any geometry objects");
return [areas, lines, points];
}
here is the other objects:
export type Geometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection;
export interface AbstractGeometry {
id: number;
geom: Geometry;
}
@Entity('areaGeometry')
export class AreaGeometry extends GenericEntity implements AbstractGeometry {
@PrimaryGeneratedColumn()
id: number;
@Column({
type: 'geometry',
spatialFeatureType: 'Polygon',
srid: 4326, // WGS84 reference system
transformer: new GeometryTransformer(),
nullable: false
})
geom: Polygon; // import from 'wkx'