aws-cdk-lib
Version:
Version 2 of the AWS Cloud Development Kit library
12 lines (11 loc) • 625 B
TypeScript
import type { IConstruct } from 'constructs';
export interface StringLengthValidation {
value: string;
fieldName: string;
minLength: number;
maxLength: number;
}
export type ValidationFn<T> = (param: T, scope?: IConstruct) => string[];
export declare function validateStringFieldLength(params: StringLengthValidation, _scope?: IConstruct): string[];
export declare function validateFieldPattern(value: string, fieldName: string, pattern: RegExp, customMessage?: string, _scope?: IConstruct): string[];
export declare function throwIfInvalid<T>(validationFn: ValidationFn<T>, param: T, scope?: IConstruct): T;