Skip to content

Commit

Permalink
Serverless awsProvider.d.ts fix + addition (DefinitelyTyped#49104)
Browse files Browse the repository at this point in the history
* Fixed filterPolicty alternative type

* Allow AwsFunction layers property to be defined as key with string so Ref can be used.

* Added optional type to Stream interface

* Update types/serverless/plugins/aws/provider/awsProvider.d.ts

Co-authored-by: Frédéric Barthelet <fredericb@theodo.fr>

* Update types/serverless/plugins/aws/provider/awsProvider.d.ts

Co-authored-by: Frédéric Barthelet <fredericb@theodo.fr>

* Update types/serverless/plugins/aws/provider/awsProvider.d.ts

* Update awsProvider.d.ts

Added missing semicolon

* awsProvider.d.ts
Formatted document
Used Array<> syntax for AwsFunction.layers

* Fixed SNS filterPolicy test

Co-authored-by: Frédéric Barthelet <fredericb@theodo.fr>
  • Loading branch information
Niels van Amstel and fredericbarthelet authored Dec 22, 2020
1 parent 5b373c2 commit 3c1e642
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions types/serverless/plugins/aws/provider/awsProvider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ declare namespace Aws {
arn?: string;
topicName?: string;
displayName?: string;
filterPolicy?: string[] | { [key: string]: string };
filterPolicy?: Record<string, unknown>;
redrivePolicy?: RedrivePolicy;
}

Expand All @@ -388,6 +388,7 @@ declare namespace Aws {
batchSize?: number | string;
startingPosition?: number | string;
enabled?: boolean;
type?: 'dynamodb' | 'kinesis';
}

interface Msk {
Expand Down Expand Up @@ -526,7 +527,7 @@ declare namespace Aws {
tags?: Tags;
vpc?: Vpc;
package?: Package;
layers?: string[];
layers?: Array<string | Record<string, string>>;
tracing?: string;
condition?: string;
dependsOn?: string[];
Expand Down
2 changes: 1 addition & 1 deletion types/serverless/serverless-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ const awsServerless: Aws.Serverless = {
arn: 'testarn',
topicName: 'testtopicName',
displayName: 'testdisplayName',
filterPolicy: ['testfilterpolicy'],
filterPolicy: { testFilterPolicy: 'testfilterpolicy' },
redrivePolicy: {
deadLetterTargetArn: 'testdeadLetterTargetArn',
deadLetterTargetRef: 'testdeadLetterTargetRef',
Expand Down

0 comments on commit 3c1e642

Please sign in to comment.