@aws-lambda-powertools/parser
Version:
The parser package for the Powertools for AWS Lambda (TypeScript) library.
22 lines • 879 B
TypeScript
import { type ZodType } from 'zod';
import type { ParsedResult } from '../types/index.js';
import { envelopeDiscriminator } from './envelope.js';
/**
* SNS Envelope to extract array of Records
*
* The record's body parameter is a string, though it can also be a JSON encoded string.
* Regardless of its type it'll be parsed into a BaseModel object.
*
* Note: Records will be parsed the same way so if model is str,
* all items in the list will be parsed as str and npt as JSON (and vice versa)
*/
export declare const SnsEnvelope: {
/**
* This is a discriminator to differentiate whether an envelope returns an array or an object
* @hidden
*/
[envelopeDiscriminator]: "array";
parse<T>(data: unknown, schema: ZodType<T>): T[];
safeParse<T>(data: unknown, schema: ZodType<T>): ParsedResult<unknown, T[]>;
};
//# sourceMappingURL=sns.d.ts.map