Skip to content

Commit

Permalink
Formatted types/s* packages with dprint (DefinitelyTyped#66540)
Browse files Browse the repository at this point in the history
* Formatted types/s* packages with dprint

* Fixed introduced issues

* Fix introduced issues
  • Loading branch information
JoshuaKGoldberg authored Sep 25, 2023
1 parent 3a2e6cb commit b84746a
Show file tree
Hide file tree
Showing 1,599 changed files with 86,597 additions and 80,615 deletions.
2 changes: 1 addition & 1 deletion types/s3-download-stream/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

/// <reference types="node" />

import { Readable } from "stream";
import { S3 } from "aws-sdk2-types";
import { Readable } from "stream";

declare namespace s3Stream {
interface S3StreamDownloaderOptions {
Expand Down
12 changes: 6 additions & 6 deletions types/s3-download-stream/s3-download-stream-tests.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import * as S3Stream from "s3-download-stream";
import * as AWS from "aws-sdk2-types";
import * as fs from "fs";
import * as S3Stream from "s3-download-stream";

// Documentation for "params":
// http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#getObject-property
const config = {
client: new AWS.S3({}),
concurrency: 6,
chunkSize: '512KB',
chunkSize: "512KB",
params: {
Key: 'key-name',
Bucket: 'bucket-name'
}
Key: "key-name",
Bucket: "bucket-name",
},
};

S3Stream(config).pipe(fs.createWriteStream('/path/to/a/file'));
S3Stream(config).pipe(fs.createWriteStream("/path/to/a/file"));
4 changes: 2 additions & 2 deletions types/s3-streams/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

/// <reference types="node" />

import { S3 } from 'aws-sdk2-types';
import { Readable, Writable } from 'stream';
import { S3 } from "aws-sdk2-types";
import { Readable, Writable } from "stream";

export interface StreamOptions {
/**
Expand Down
12 changes: 6 additions & 6 deletions types/s3-streams/s3-streams-tests.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import * as AWS from 'aws-sdk2-types';
import * as S3S from 's3-streams';
import * as AWS from "aws-sdk2-types";
import * as S3S from "s3-streams";

const s3 = new AWS.S3();
const ws = new S3S.WriteStream(
s3,
{
Bucket: 'my-bucket',
Key: 'my-key',
Bucket: "my-bucket",
Key: "my-key",
},
{ highWaterMark: 42 },
);

const rs = new S3S.ReadStream(
s3,
{
Bucket: 'my-bucket',
Key: 'my-key',
Bucket: "my-bucket",
Key: "my-key",
},
{ highWaterMark: 42 },
);
Expand Down
4 changes: 2 additions & 2 deletions types/s3-upload-stream/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

/// <reference types="node" />

import * as stream from 'stream';
import * as AWS from 'aws-sdk2-types';
import * as AWS from "aws-sdk2-types";
import * as stream from "stream";

declare namespace s3Stream {
interface S3StreamUploader {
Expand Down
18 changes: 9 additions & 9 deletions types/s3-upload-stream/s3-upload-stream-tests.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import * as fs from 'fs';
import S3Stream = require('s3-upload-stream');
import * as AWS from 'aws-sdk2-types';
import * as fs from "fs";
import S3Stream = require("s3-upload-stream");
import * as AWS from "aws-sdk2-types";

const s3Stream = S3Stream(new AWS.S3());

const read = fs.createReadStream('/path/to/a/file');
const read = fs.createReadStream("/path/to/a/file");
const upload = s3Stream.upload({
Bucket: "bucket-name",
Key: "key-name",
ACL: "public-read",
StorageClass: "REDUCED_REDUNDANCY",
ContentType: "binary/octet-stream"
Bucket: "bucket-name",
Key: "key-name",
ACL: "public-read",
StorageClass: "REDUCED_REDUNDANCY",
ContentType: "binary/octet-stream",
});

upload.concurrentParts(5);
Expand Down
8 changes: 6 additions & 2 deletions types/s3-uploader/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Definitions by: COLSA Corporation <http://www.colsa.com/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

//NOTE: Does require GM (https://github.com/aheckmann/gm) thus requires GraphicsMagick (http://www.graphicsmagick.org/) or ImageMagick (http://www.imagemagick.org/)
// NOTE: Does require GM (https://github.com/aheckmann/gm) thus requires GraphicsMagick (http://www.graphicsmagick.org/) or ImageMagick (http://www.imagemagick.org/)

export = Upload;

Expand Down Expand Up @@ -63,5 +63,9 @@ declare namespace Upload {
declare class Upload {
public constructor(awsBucketName: string, opts: Upload.S3UploaderOptions);

public upload(src: string, opts?: Upload.S3UploaderOptions, cb?: (err: string, images: Upload.image[], meta: Upload.Meta) => void): void;
public upload(
src: string,
opts?: Upload.S3UploaderOptions,
cb?: (err: string, images: Upload.image[], meta: Upload.Meta) => void,
): void;
}
35 changes: 17 additions & 18 deletions types/s3-uploader/s3-uploader-tests.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
//NOTE: Does require GM (https://github.com/aheckmann/gm) thus requires GraphicsMagick (http://www.graphicsmagick.org/) or ImageMagick (http://www.imagemagick.org/)
// NOTE: Does require GM (https://github.com/aheckmann/gm) thus requires GraphicsMagick (http://www.graphicsmagick.org/) or ImageMagick (http://www.imagemagick.org/)

import Upload = require('s3-uploader');
import Upload = require("s3-uploader");
declare var console: { log(x: any): void };

var s3VersionOriginal = {
original: true
original: true,
};

var s3VersionHeader = {
suffix: '-header',
suffix: "-header",
quality: 100,
maxHeight: 300,
maxWidth: 600
}
maxWidth: 600,
};

var s3Config = {
awsAccessKeyId: 'awsKeyId',
awsSecretAccessKey: 'awsSecretAccessKey',
awsBucketPath: '',
awsBucketRegion: 'us-east-1' /*Whatever region s3 is located*/,
awsBucketAcl: 'public-read',
awsAccessKeyId: "awsKeyId",
awsSecretAccessKey: "awsSecretAccessKey",
awsBucketPath: "",
awsBucketRegion: "us-east-1", /*Whatever region s3 is located*/
awsBucketAcl: "public-read",
awsHttpTimeout: 60000,
versions: [s3VersionOriginal, s3VersionHeader]
}
versions: [s3VersionOriginal, s3VersionHeader],
};

var client = new Upload('bucketName', s3Config);
var client = new Upload("bucketName", s3Config);

client.upload('/images/File.png', s3Config, function (err, images, meta) {
client.upload("/images/File.png", s3Config, function(err, images, meta) {
var returnVal: boolean = false;
if (err) {
console.log(err);
}
else {
} else {
if (images.length >= 2) {
var originalImageUrl = images[0].url;
var headerImageUrl = images[1].url;

console.log('Original: ' + originalImageUrl + ' headerImageUrl: ' + headerImageUrl);
console.log("Original: " + originalImageUrl + " headerImageUrl: " + headerImageUrl);
}
}
});
6 changes: 3 additions & 3 deletions types/s3rver/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

/// <reference types="node" />

import { AddressInfo } from 'net';
import { IncomingMessage, ServerResponse } from 'http';
import { Http2ServerRequest, Http2ServerResponse } from 'http2';
import { IncomingMessage, ServerResponse } from "http";
import { Http2ServerRequest, Http2ServerResponse } from "http2";
import { AddressInfo } from "net";

declare class S3rver {
constructor(options: S3rverOptions);
Expand Down
22 changes: 11 additions & 11 deletions types/s3rver/s3rver-tests.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import S3rver = require('s3rver');
import { IncomingMessage, ServerResponse } from 'http';
import { Http2ServerRequest, Http2ServerResponse } from 'http2';
import { AddressInfo } from 'net';
import S3rver = require("s3rver");
import { IncomingMessage, ServerResponse } from "http";
import { Http2ServerRequest, Http2ServerResponse } from "http2";
import { AddressInfo } from "net";

const s3rver = new S3rver({
address: 'localhost',
address: "localhost",
port: 5694,
key: '',
cert: '',
key: "",
cert: "",
silent: true,
serviceEndpoint: '',
directory: '/tmp/s3rver_test_directory',
serviceEndpoint: "",
directory: "/tmp/s3rver_test_directory",
resetOnClose: false,
allowMismatchedSignatures: false,
vhostBuckets: true,
configureBuckets: [
{ name: 'bucket1', configs: [''] },
{ name: 'bucket1', configs: [Buffer.alloc(1)] },
{ name: "bucket1", configs: [""] },
{ name: "bucket1", configs: [Buffer.alloc(1)] },
],
});

Expand Down
2 changes: 1 addition & 1 deletion types/sade/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import * as mri from 'mri';
import * as mri from "mri";

/**
* Sade is a small but powerful tool for building command-line interface (CLI) applications for Node.js that are fast, responsive, and helpful!
Expand Down
40 changes: 20 additions & 20 deletions types/sade/sade-tests.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import sade = require('sade');
import sade = require("sade");

const prog = sade('my-cli');
const prog = sade("my-cli");

const argv = ['sirv', 'build'];
const argv = ["sirv", "build"];

prog.version('1.0.5')
.option('--global, -g')
.option('--global, -g', 'An example global flag')
.option('-c, --config', 'Provide path to custom config', 'foo.config.js');
prog.version("1.0.5")
.option("--global, -g")
.option("--global, -g", "An example global flag")
.option("-c, --config", "Provide path to custom config", "foo.config.js");

prog.command('build <src> <dest>')
.describe('Build the source directory. Expects an `index.js` entry file.')
.option('-o, --output', 'Change the name of the output file', 'bundle.js')
.option('-m, --minify', 'Minify production assets', true)
.example('build src build --global --config my-conf.js')
.example('build app public -o main.js')
prog.command("build <src> <dest>")
.describe("Build the source directory. Expects an `index.js` entry file.")
.option("-o, --output", "Change the name of the output file", "bundle.js")
.option("-m, --minify", "Minify production assets", true)
.example("build src build --global --config my-conf.js")
.example("build app public -o main.js")
.action((src: any, dest: any, opts: any) => {});

prog.help('build');
prog.help("build");

// $ExpectType void
prog.parse(argv);
Expand All @@ -29,14 +29,14 @@ prog.parse(argv, { lazy: false });
prog.parse(argv, { lazy: true });

// $ExpectType Sade
prog.alias('a');
prog.alias("a");
// $ExpectType Sade
prog.alias('a', 'b');
prog.alias("a", "b");
// $ExpectType Sade
prog.command('command', 'description', {
alias: 'a',
prog.command("command", "description", {
alias: "a",
});
// $ExpectType Sade
prog.command('command', 'description', {
alias: ['a', 'b']
prog.command("command", "description", {
alias: ["a", "b"],
});
56 changes: 28 additions & 28 deletions types/safari-extension-content/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,59 +14,59 @@ declare namespace safari {

interface SafariEvent {
/**
* The type of the event.
* The string used to identify a particular type of event is documented in the reference for that class.
*/
* The type of the event.
* The string used to identify a particular type of event is documented in the reference for that class.
*/
type: string;

/**
* The target of the event.
* This attribute stays the same as the event moves through the event-dispatch hierarchy. Its value is the same as the object that the event is sent to during the targeting phase.
*/
* The target of the event.
* This attribute stays the same as the event moves through the event-dispatch hierarchy. Its value is the same as the object that the event is sent to during the targeting phase.
*/
target: SafariEventTarget;

/**
* The object that the event is currently being sent to.
* This attribute varies as the event progresses through the phases, changing as the event moves through the event-dispatch hierarchy.
*/
* The object that the event is currently being sent to.
* This attribute varies as the event progresses through the phases, changing as the event moves through the event-dispatch hierarchy.
*/
currentTarget: SafariEventTarget;

/**
* The time and date that the event was created.
*/
* The time and date that the event was created.
*/
timestamp: number;

/**
* The event-handling phase that the event is in.
* The values for this property are the same as the values used by Webkit to identify the event-handling phases.
*/
* The event-handling phase that the event is in.
* The values for this property are the same as the values used by Webkit to identify the event-handling phases.
*/
eventPhase: number;

/**
* A Boolean value that indicates whether the event goes through the bubbling phase.
*/
* A Boolean value that indicates whether the event goes through the bubbling phase.
*/
bubbles: boolean;

/**
* A Boolean value that indicates whether the event can be canceled.
*/
* A Boolean value that indicates whether the event can be canceled.
*/
cancelable: boolean;

/**
* A Boolean value that indicates whether the event’s default action has been prevented.
*/
* A Boolean value that indicates whether the event’s default action has been prevented.
*/
defaultPrevented: boolean;

/**
* Prevents the event from any further propagation.
* Propagation can be stopped only fon cancelable events. After propagation is stopped, the event is not sent to any other targets.
*/
stopPropagation() : void;
* Prevents the event from any further propagation.
* Propagation can be stopped only fon cancelable events. After propagation is stopped, the event is not sent to any other targets.
*/
stopPropagation(): void;

/**
* Prevents the browser from performing the default action for an event.
* Use this method to indicate that your extension has already fully handled the event; you don’t want the browser to do anything. Note that preventing the default action does not stop an event from propagating.
*/
* Prevents the browser from performing the default action for an event.
* Use this method to indicate that your extension has already fully handled the event; you don’t want the browser to do anything. Note that preventing the default action does not stop an event from propagating.
*/
preventDefault(): void;
}

Expand Down Expand Up @@ -106,5 +106,5 @@ interface SafariContentBrowserTabProxy {
}

interface BeforeLoadEvent extends Event {
url: string;
url: string;
}
Loading

0 comments on commit b84746a

Please sign in to comment.