Skip to content

Commit

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

* Fixed introduced issues

* Fix mapbox__mapbox-sdk

* Another import-default suppression

* Fix some conflicts

* Reset mp4frag to master
  • Loading branch information
JoshuaKGoldberg authored Sep 27, 2023
1 parent eaf4e76 commit 07b78cb
Show file tree
Hide file tree
Showing 952 changed files with 50,354 additions and 46,910 deletions.
7 changes: 6 additions & 1 deletion types/macaca-circular-json/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

export function parse(text: string, reviver?: (key: any, value: any) => any): any;
export function stringify(value: any, replacer?: ((key: string, value: any) => any) | Array<number | string> | null, space?: any, placeholder?: boolean): string;
export function stringify(
value: any,
replacer?: ((key: string, value: any) => any) | Array<number | string> | null,
space?: any,
placeholder?: boolean,
): string;
24 changes: 12 additions & 12 deletions types/macaca-circular-json/macaca-circular-json-tests.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import CircularJSON = require('macaca-circular-json');
import CircularJSON = require("macaca-circular-json");

const replacer = (key: any, val: any) => {
return val;
return val;
};

const replacerArray = ['a', 'x'];
const replacerArray = ["a", "x"];

CircularJSON.parse('{"a":"b"}');
CircularJSON.parse("{\"a\":\"b\"}");

CircularJSON.parse('{"a":"b"}', replacer);
CircularJSON.parse("{\"a\":\"b\"}", replacer);

// just stringify a value
CircularJSON.stringify({a: 'b'});
CircularJSON.stringify({ a: "b" });

// do replacements for part of the object
CircularJSON.stringify({a: 'b'}, replacer);
CircularJSON.stringify({a: 'b'}, replacerArray);
CircularJSON.stringify({ a: "b" }, replacer);
CircularJSON.stringify({ a: "b" }, replacerArray);

// add whitespace to the output
CircularJSON.stringify({a: 'b'}, replacer, 5);
CircularJSON.stringify({a: 'b'}, replacerArray, 5);
CircularJSON.stringify({ a: "b" }, replacer, 5);
CircularJSON.stringify({ a: "b" }, replacerArray, 5);

// do not actually set up a re-parseable object
CircularJSON.stringify({a: 'b'}, replacer, 5, true);
CircularJSON.stringify({a: 'b'}, replacerArray, 5, true);
CircularJSON.stringify({ a: "b" }, replacer, 5, true);
CircularJSON.stringify({ a: "b" }, replacerArray, 5, true);
2 changes: 1 addition & 1 deletion types/macrotask/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export function clear(cancel: CancelToken): void;

export class CancelToken {
// needed for TS to not accept just any object, only instances of CancelToken
private __cancel__prop: 'imaginary';
private __cancel__prop: "imaginary";
}
10 changes: 5 additions & 5 deletions types/macrotask/macrotask-tests.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { run, clear } from 'macrotask';
import { clear, run } from "macrotask";

const token = run(() => {});
// @ts-expect-error
Expand All @@ -9,13 +9,13 @@ run(
arg1; // $ExpectType string
arg2; // $ExpectType number
},
'foo',
1
"foo",
1,
);
// @ts-expect-error
run((arg1, arg2) => {}, 'foo');
run((arg1, arg2) => {}, "foo");
// @ts-expect-error
run((arg1: string, arg2: number) => {}, 'foo', 'bar');
run((arg1: string, arg2: number) => {}, "foo", "bar");

clear(token);
// @ts-expect-error
Expand Down
2 changes: 1 addition & 1 deletion types/madge/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ declare namespace madge {
*
* @default 'LR'
*/
rankdir?: 'TB' | 'LR' | 'BT' | 'RL';
rankdir?: "TB" | "LR" | "BT" | "RL";

/**
* Font name to use in the graph.
Expand Down
104 changes: 52 additions & 52 deletions types/madge/madge-tests.ts
Original file line number Diff line number Diff line change
@@ -1,101 +1,101 @@
import madge = require("madge");

// $ExpectType Promise<MadgeInstance>
madge('');
madge("");

// $ExpectType Promise<MadgeInstance>
madge('', {});
madge("", {});

// $ExpectType Promise<MadgeInstance>
madge('', { baseDir: '/src' });
madge("", { baseDir: "/src" });

// $ExpectType Promise<MadgeInstance>
madge('', {
baseDir: '/src',
madge("", {
baseDir: "/src",
includeNpm: true,
fileExtensions: ['ts', 'js'],
fileExtensions: ["ts", "js"],
excludeRegExp: [/ab+c/],
requireConfig: '',
webpackConfig: '',
tsConfig: '',
layout: '',
rankdir: 'RL',
fontName: '',
fontSize: '',
backgroundColor: '',
nodeShape: '',
nodeStyle: '',
nodeColor: '',
noDependencyColor: '',
cyclicNodeColor: '',
edgeColor: '',
requireConfig: "",
webpackConfig: "",
tsConfig: "",
layout: "",
rankdir: "RL",
fontName: "",
fontSize: "",
backgroundColor: "",
nodeShape: "",
nodeStyle: "",
nodeColor: "",
noDependencyColor: "",
cyclicNodeColor: "",
edgeColor: "",
graphVizOptions: {},
graphVizPath: '',
graphVizPath: "",
detectiveOptions: {},
dependencyFilter: (id: string) => id !== 'filtered-path'
dependencyFilter: (id: string) => id !== "filtered-path",
});

// @ts-expect-error
madge();
// @ts-expect-error
madge(0);
// @ts-expect-error
madge('', 0);
madge("", 0);
// @ts-expect-error
madge('', { unexpectedConfig: 1 });
madge("", { unexpectedConfig: 1 });

(async () => {
await madge(''); // $ExpectType MadgeInstance
await madge(""); // $ExpectType MadgeInstance
// @ts-expect-error
await madge();

(await madge('')).obj(); // $ExpectType MadgeModuleDependencyGraph
(await madge("")).obj(); // $ExpectType MadgeModuleDependencyGraph
// @ts-expect-error
(await madge('')).obj(0);
(await madge("")).obj(0);

(await madge('')).warnings(); // $ExpectType MadgeWarnings
(await madge("")).warnings(); // $ExpectType MadgeWarnings
// @ts-expect-error
(await madge('')).warnings(0);
(await madge("")).warnings(0);

(await madge('')).circular(); // $ExpectType string[][]
(await madge("")).circular(); // $ExpectType string[][]
// @ts-expect-error
(await madge('')).circular(0);
(await madge("")).circular(0);

(await madge('')).circularGraph(); // $ExpectType MadgeModuleDependencyGraph
(await madge("")).circularGraph(); // $ExpectType MadgeModuleDependencyGraph
// @ts-expect-error
(await madge('')).circularGraph(0);
(await madge("")).circularGraph(0);

(await madge('')).depends(''); // $ExpectType string[]
(await madge("")).depends(""); // $ExpectType string[]
// @ts-expect-error
(await madge('')).depends();
(await madge("")).depends();
// @ts-expect-error
(await madge('')).depends(0);
(await madge("")).depends(0);

(await madge('')).orphans(); // $ExpectType string[]
(await madge("")).orphans(); // $ExpectType string[]
// @ts-expect-error
(await madge('')).orphans(0);
(await madge("")).orphans(0);

(await madge('')).leaves(); // $ExpectType string[]
(await madge("")).leaves(); // $ExpectType string[]
// @ts-expect-error
(await madge('')).leaves(0);
(await madge("")).leaves(0);

(await madge('')).dot(); // $ExpectType Promise<string>
(await madge('')).dot(true); // $ExpectType Promise<string>
(await madge('')).dot(false); // $ExpectType Promise<string>
(await madge("")).dot(); // $ExpectType Promise<string>
(await madge("")).dot(true); // $ExpectType Promise<string>
(await madge("")).dot(false); // $ExpectType Promise<string>
// @ts-expect-error
(await madge('')).dot(0);
(await madge("")).dot(0);

(await madge('')).image(''); // $ExpectType Promise<string>
(await madge("")).image(""); // $ExpectType Promise<string>
// @ts-expect-error
(await madge('')).image();
(await madge("")).image();
// @ts-expect-error
(await madge('')).image(0);
(await madge('')).image('', true); // $ExpectType Promise<string>
(await madge('')).image('', false); // $ExpectType Promise<string>
(await madge("")).image(0);
(await madge("")).image("", true); // $ExpectType Promise<string>
(await madge("")).image("", false); // $ExpectType Promise<string>
// @ts-expect-error
(await madge('')).image('', 0);
(await madge("")).image("", 0);

(await madge('')).svg(); // $ExpectType Promise<Buffer>
(await madge("")).svg(); // $ExpectType Promise<Buffer>
// @ts-expect-error
(await madge('')).svg(0);
(await madge("")).svg(0);
})();
1 change: 0 additions & 1 deletion types/magic-number/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped


export declare function detectFile(file: string): string;
12 changes: 6 additions & 6 deletions types/magic-number/magic-number-tests.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/// <reference types="node" />

import fs = require('fs');
import magic = require('magic-number');
import fs = require("fs");
import magic = require("magic-number");

var buffer: any = new Buffer(100);
buffer.write('7z', 'binary');
fs.writeFile('test.love', buffer, function(err: any) {
console.log(magic.detectFile('test.love')); // => 'application/7z-x-compressed'
fs.unlinkSync('test.love');
buffer.write("7z", "binary");
fs.writeFile("test.love", buffer, function(err: any) {
console.log(magic.detectFile("test.love")); // => 'application/7z-x-compressed'
fs.unlinkSync("test.love");
});
6 changes: 3 additions & 3 deletions types/magicmirror-module/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ declare namespace Module {
}

/* tslint:disable:no-single-declare-module */
declare module 'node_helper' {
declare module "node_helper" {
function create(object: ThisType<NonNullable<NodeHelperModule>> & Partial<NodeHelperModule>): void;

interface NodeHelperModule {
Expand All @@ -75,7 +75,7 @@ declare module 'node_helper' {
}
}

declare module 'logger' {
declare module "logger" {
function debug(message?: any, ...optionalParams: any[]): void;
function info(message?: any, ...optionalParams: any[]): void;
function log(message?: any, ...optionalParams: any[]): void;
Expand All @@ -99,6 +99,6 @@ declare const config: {
modules: any[];
port: number;
timeFormat: 12 | 24;
units: 'metric' | 'imperial';
units: "metric" | "imperial";
zoom: number;
};
Loading

0 comments on commit 07b78cb

Please sign in to comment.