Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion types/aws-synthetics-puppeteer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Types for writing AWS Synthetic Canaries using the syn-nodejs-puppeteer runtime.
### Structure

The syn-nodejs-puppeteer runtime has an unusual structure - files are in node_modules with no package!
````
```
nodejs/node_modules/Synthetics.js
nodejs/node_modules/SyntheticsLogger.js
nodejs/node_modules/SyntheticsScreenshot.js
Expand All @@ -13,3 +13,10 @@ Because of this, every type definition file declares it's own module, similar to

If you choose to define "types" in tsconfig, it must include this package for it to work.

### Contributions

Please ensure that changes are aligned with the runtime.
You can download the runtime with this command (you need to be logged into AWS, any account will do):
```
aws lambda get-layer-version-by-arn --arn arn:aws:lambda:us-east-1:378653112637:layer:Synthetics:73 --query Content.Location --output text
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as synthetics from "Synthetics";

export const handler = async () => {
const page = synthetics.getPage();
const page = await synthetics.getPage();
await page.goto("https://example.com");
await page.waitForFrame("https://example.com");
await page.screenshot({ path: "/tmp/example.png" });
Expand Down
6 changes: 3 additions & 3 deletions types/aws-synthetics-puppeteer/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"private": true,
"name": "@types/aws-synthetics-puppeteer",
"version": "10.0.9999",
"version": "11.0.9999",
"nonNpm": true,
"nonNpmDescription": "aws-synthetics-puppeteer",
"projects": [
"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html"
],
"dependencies": {
"@types/node": "*",
"puppeteer-core": "24.2.0",
"aws-xray-sdk-core": "3.10.3"
"puppeteer-core": "24.25.0",
"aws-xray-sdk-core": "3.5.0"
},
"devDependencies": {
"@types/aws-synthetics-puppeteer": "workspace:."
Expand Down
2 changes: 1 addition & 1 deletion types/aws-synthetics-puppeteer/src/Synthetics.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ declare module "Synthetics" {
getCanaryArn(): string;
getCanaryUserAgentString(): string;
getRuntimeVersion(): string;
getPage(): localPuppeteer.Page;
getPage(): Promise<localPuppeteer.Page>;
getUrl(): string;
/**
* Returns global syntheticsConfiguration instance.
Expand Down
4 changes: 2 additions & 2 deletions types/w3c-direct-sockets/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ export interface UDPSocketOpenInfo extends SocketOpenInfo {

export interface TCPServerSocketOpenInfo {
readable: ReadableStream;
localAddress?: string;
localPort?: number;
localAddress: string;
localPort: number;
}

declare global {
Expand Down