Add and export types to support serverless typescript configuration file.
When trying to use the serverless configuration with typescript, like: Building a serverless app with TypeScript you need the right typescript types to declare the configuration.
There are two projects that declare the types: https://www.npmjs.com/package/@types/serverless (the interface is called Serverless) and https://github.com/serverless/typescript (the interface is called AWS)
I didn't find an equivalent interface in the serverless defender plugin file https://github.com/OpenZeppelin/defender-serverless/blob/main/src/types/index.ts.
It will be helpful to have something like that exported.
This is the trick I'm using right now, it doesn't make sense to extend from AWS but I'm lazy.
import {YContract, YSentinel} from 'defender-serverless/src/types/index';
import {AWS} from '@serverless/typescript';
import {YNotification, YRelayer, YSecret} from 'defender-serverless/lib/types';
export interface DefenderServerless
extends Omit<AWS, 'provider' | 'resources'> {
provider: {
name: 'defender';
stage: string;
stackName: string;
ssot?: boolean;
};
defender: {
key: string | undefined;
secret: string | undefined;
};
resources?:
| {
Resources: {
secrets?: {
[contractName: string]: YSecret;
};
contracts?: {
[contractName: string]: YContract;
};
sentinels?: {
[contractName: string]: YSentinel;
};
notifications?: {
[contractName: string]: YNotification;
};
relayers?: {
[contractName: string]: YRelayer;
};
};
}
| undefined;
}