@seasketch/geoprocessing
Version:
Geoprocessing and reporting framework for SeaSketch 2.0
21 lines (20 loc) • 1.42 kB
TypeScript
import { Context, APIGatewayProxyResult, APIGatewayProxyEvent } from "aws-lambda";
import { PreprocessingHandlerOptions, PreprocessingRequest, Geometry, Feature, Polygon, LineString, Point, Sketch, JSONValue } from "../types/index.js";
/**
* Lambda handler for a preprocessing function
* @template G the geometry type of the feature for the geoprocessing function, automatically set from func feature type
*/
export declare class PreprocessingHandler<G extends Geometry = Polygon | LineString | Point, P = Record<string, JSONValue>> {
func: (feature: Feature<G> | Sketch<G>, extraParams: P) => Promise<Feature<G> | Sketch<G>>;
options: PreprocessingHandlerOptions;
lastRequestId?: string;
/**
* @param func the preprocessing function, overloaded to allow caller to pass Feature *or* Sketch
* @param options prerocessing function deployment options
* @template G the geometry type of features for the preprocessing function, automatically set from func feature type
*/
constructor(func: (feature: Feature<G>, extraParams: P) => Promise<Feature<G>>, options: PreprocessingHandlerOptions);
constructor(func: (feature: Sketch<G>, extraParams: P) => Promise<Sketch<G>>, options: PreprocessingHandlerOptions);
lambdaHandler(event: APIGatewayProxyEvent, context: Context): Promise<APIGatewayProxyResult>;
parseRequest(event: APIGatewayProxyEvent): PreprocessingRequest;
}