@types/sns-validator
TypeScript icon, indicating that this package has built-in type declarations

0.3.3 • Public • Published

Installation

npm install --save @types/sns-validator

Summary

This package contains type definitions for sns-validator (https://github.com/aws/aws-js-sns-message-validator#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sns-validator.

index.d.ts

declare class MessageValidator {
    /**
     * Create a new MessageValidator
     * @param hostPattern - A pattern used to validate that a message's certificate originates from a trusted domain. Default: `/^sns\.[a-zA-Z0-9\-]{3,}\.amazonaws\.com(\.cn)?$/`
     * @param encoding - The encoding of the messages being signed. Default is `utf8`
     */
    constructor(hostPattern?: RegExp, encoding?: string);

    /**
     * Validates a message's signature and passes it to the provided callback.
     * @param hash Can be the raw or parsed message.
     * @param cb The callback which is called with the message when it is valid or with an Error when it isn't.
     */
    validate(
        hash: string | Record<string, unknown>,
        cb: (err: Error | null, message?: Record<string, unknown>) => void,
    ): void;
}
export = MessageValidator;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Kévin Baumeyer.

Versions

Current Tags

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.3.3
    9,089
  • 0.3.2
    431
  • 0.3.1
    6,650
  • 0.3.0
    635

Package Sidebar

Install

npm i @types/sns-validator

Weekly Downloads

13,730

Version

0.3.3

License

MIT

Unpacked Size

4.29 kB

Total Files

5

Last publish

Collaborators

  • types