Skip to content

Commit

Permalink
Merge branch 'master' into dprint-fmt-b
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Sep 12, 2023
2 parents ea837f9 + 2506184 commit e190e56
Show file tree
Hide file tree
Showing 2,764 changed files with 124,832 additions and 96,964 deletions.
20 changes: 14 additions & 6 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
/types/ansicolors/ @balupton
/types/antlr4/ @mcchatman8009 @tarilabs @jgellin-sf @codex-
/types/antlr4-autosuggest/ @jonfreedman
/types/any-base/ @yutak23
/types/any-db/ @rogierschouten
/types/any-db-transaction/ @rogierschouten
/types/anyproxy/ @SomaticIT @roland-reed
Expand Down Expand Up @@ -667,6 +668,7 @@
/types/bristol/ @eheikes @ElliottCampbellJHA
/types/bristol-sentry/ @ElliottCampbellJHA
/types/bro-fs/ @ffflorian
/types/broccoli-merge-trees/ @KonradPerlicki
/types/broken-link-checker/ @Haizzz
/types/brorand/ @chrootsu
/types/brotli/ @arturovt
Expand Down Expand Up @@ -1614,8 +1616,8 @@
/types/dotdir-regex/ @mrmlnc
/types/dotdotdot/ @milanjaros
/types/dotenv-defaults/ @peterblazejewicz
/types/dotenv-flow/ @vincentlanglet @kerimdzhanov @aMoniker
/types/dotenv-flow/v2/ @vincentlanglet @kerimdzhanov
/types/dotenv-flow/ @kerimdzhanov @aMoniker
/types/dotenv-flow/v2/ @kerimdzhanov
/types/dotenv-load/ @seleb
/types/dotenv-parse-variables/ @garyking
/types/dotenv-safe/ @krenor
Expand Down Expand Up @@ -1700,6 +1702,7 @@
/types/easy-speech/ @RJWadley
/types/easy-xapi/ @DeadAlready
/types/easy-xapi-utils/ @DeadAlready
/types/easycaptchajs/ @HichemTab-tech
/types/easydate/ @satyarohith
/types/ebay-oauth-nodejs-client/ @JeremyMoeglich
/types/ebml/ @AppLover69
Expand Down Expand Up @@ -2270,7 +2273,7 @@
/types/format-util/ @DefinitelyTyped
/types/formatcoords/ @slaweet
/types/formdata/ @inglec-arista
/types/formidable/ @Nemo157 @martin-badin
/types/formidable/ @Nemo157 @martin-badin @devLana
/types/formidable/v1/ @Nemo157 @martin-badin
/types/formol/ @today-
/types/forms/ @suXinjke @voxpelli @ljharb
Expand Down Expand Up @@ -4013,7 +4016,7 @@
/types/jwa/ @dhritzkiv
/types/jweixin/ @taoqf @gomydodo
/types/jwk-to-pem/ @esilkensen
/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw @bebebebebe @djcsdy @drewwyatt @zetagame @esetnik
/types/jwplayer/ @martinduparc @kutomer @philippguertler @danielmcgraw @bebebebebe @djcsdy @drewwyatt @zetagame @esetnik @nlhiorth
/types/jws/ @JustinBeckwith @dolsem
/types/jwt-client/ @timoteoponce
/types/jwt-encode/ @turisap
Expand Down Expand Up @@ -4913,7 +4916,7 @@
/types/merge2/ @tkrotoff @smac89 @winston01
/types/mergerino/ @fivitti
/types/merkle/ @kerol2r20
/types/mersenne-twister/ @KentarouTakeda
/types/mersenne-twister/ @KentarouTakeda @Shinigami92
/types/mersennetwister/ @krofdrakula
/types/mertasan__tailwindcss-variables/ @LiamMartens
/types/meshblu/ @fnipo
Expand Down Expand Up @@ -5540,6 +5543,7 @@
/types/object-refs/ @3fd
/types/object.fromentries/ @ariofrio
/types/object.getownpropertydescriptors/ @VitorLuizC @ljharb @ExE-Boss
/types/object.groupby/ @chilldriven @ljharb
/types/object.omit/ @ifiokjr
/types/object.pick/ @ifiokjr
/types/objects-to-csv/ @pl4nty
Expand Down Expand Up @@ -6215,6 +6219,7 @@
/types/random-string-gen/ @MadeByRaymond
/types/random-useragent/ @jeffryang24
/types/random-web-token/ @schrudolf
/types/random-word/ @SystemDisc
/types/random-words/ @peterblazejewicz
/types/randomatic/ @execfera @peterblazejewicz
/types/randombytes/ @BendingBender
Expand Down Expand Up @@ -6933,6 +6938,7 @@
/types/recompose/ @iskandersierra @clayne11 @Pajn @lucasterra @TiuSh
/types/reconnect-core/ @thw0rted
/types/reconnectingwebsocket/ @nguarracino @AppLover69
/types/record-locator/ @Kage0x3B
/types/recorder-js/ @higuri
/types/recordrtc/ @k-yle @moonrailgun
/types/recurly__recurly-js/ @chrissrogers
Expand Down Expand Up @@ -7848,7 +7854,7 @@
/types/stubby/ @dex4er
/types/style-inject/ @leonzalion
/types/style-search/ @peterblazejewicz
/types/styled-components/ @Igorbek @Igmat @Jessidhia @jkillian @eps1lon @wagerfield @Lazyuki @lifeiscontent
/types/styled-components/ @Igorbek @Igmat @Jessidhia @jkillian @eps1lon @wagerfield @Lazyuki @lifeiscontent @acdr
/types/styled-components/v3/ @Igorbek @Igmat
/types/styled-components-react-native/ @Methuselah96
/types/styled-react-modal/ @gperl27
Expand Down Expand Up @@ -7916,6 +7922,7 @@
/types/svg2ttf/ @ewan-m
/types/svg4everybody/ @BendingBender @bryceosterhaus
/types/svg64/ @bengry
/types/svgdom/ @altano
/types/svgicons2svgfont/ @casaper
/types/svgjs.draggable/ @LiFeleSs
/types/svgjs.resize/ @jkevingutierrez
Expand Down Expand Up @@ -8233,6 +8240,7 @@
/types/twilio-common/ @DefinitelyTyped
/types/twine-sugarcube/ @ezsh @tmedwards
/types/twit/ @Volox @sapphiredev @abraham @siwalikm @plhery @justgoscha @darkade @brianjychan
/types/twitch-browser/ @idegre
/types/twitch-ext/ @beheh @FedeDR @demensky
/types/twitter/ @BendingBender
/types/twitter-autohook/ @dubisdev
Expand Down
22 changes: 21 additions & 1 deletion types/adm-zip/adm-zip-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ import util = require('adm-zip/util');
const { Constants } = util;

// reading archives
// reading archive causes error
try {
const zip = new AdmZip('./my_file.zip');
} catch (e: unknown) {
const error = e as Error;
switch (error.message) {
case util.Errors.INVALID_FORMAT:
// handle specific error
throw new Error('Invalid zip format');
default:
// handle other errors
throw error;
}
}
// reading archive successfully
const zip = new AdmZip('./my_file.zip');
if (!zip.test()) {
throw new Error('invalid zip?');
Expand All @@ -25,7 +40,12 @@ zip.extractEntryTo(/*entry name*/ 'some_folder/my_file.txt', /*target path*/ '/h
// extracts everything
zip.extractAllTo(/*target path*/ '/home/me/zipcontent/', /*overwrite*/ true);
// extracts everything and calls callback -> async extracction
zip.extractAllToAsync(/*target path*/ '/home/me/zipcontent/', /*overwrite*/ true, /*keepOriginalPermission*/ false, /*callback*/ (error?: Error) => {});
zip.extractAllToAsync(
/*target path*/ '/home/me/zipcontent/',
/*overwrite*/ true,
/*keepOriginalPermission*/ false,
/*callback*/ (error?: Error) => {},
);

// creating archives
new AdmZip();
Expand Down
15 changes: 6 additions & 9 deletions types/adm-zip/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ declare class AdmZip {
readAsTextAsync(
fileName: string | AdmZip.IZipEntry,
callback: (data: string, err: string) => void,
encoding?: string
encoding?: string,
): void;
/**
* Remove the entry from the file or the entry and all its nested directories
Expand Down Expand Up @@ -115,7 +115,7 @@ declare class AdmZip {
localPath: string,
callback: (success?: boolean, err?: string) => void,
zipPath?: string,
filter?: RegExp | ((filename: string) => boolean)
filter?: RegExp | ((filename: string) => boolean),
): void;
/**
*
Expand All @@ -126,7 +126,7 @@ declare class AdmZip {
*/
addLocalFolderPromise(
localPath: string,
props: { zipPath?: string, filter?: RegExp | ((filename: string) => boolean) }
props: { zipPath?: string; filter?: RegExp | ((filename: string) => boolean) },
): Promise<void>;
/**
* Allows you to create a entry (file or directory) in the zip file.
Expand Down Expand Up @@ -203,7 +203,7 @@ declare class AdmZip {
targetPath: string,
overwrite?: boolean,
keepOriginalPermission?: boolean,
password?: string | Buffer
password?: string | Buffer,
): void;
/**
* Extracts the entire archive to the given location.
Expand Down Expand Up @@ -231,10 +231,7 @@ declare class AdmZip {
* if a zip was opened and no `targetFileName` is provided, it will
* overwrite the opened zip.
*/
writeZipPromise(
targetFileName?: string,
props?: { overwrite?: boolean, perm?: number }
): Promise<boolean>;
writeZipPromise(targetFileName?: string, props?: { overwrite?: boolean; perm?: number }): Promise<boolean>;
/**
* Returns the content of the entire zip file.
*/
Expand Down Expand Up @@ -371,7 +368,7 @@ declare namespace AdmZip {
/* Read entries during load (initial loading may be slower) */
readEntries: boolean;
/* Read method */
method: typeof Constants[keyof typeof Constants] | number;
method: (typeof Constants)[keyof typeof Constants] | number;
/* file system */
fs: null | typeof FS;
}
Expand Down
36 changes: 36 additions & 0 deletions types/adm-zip/util.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,39 @@ export const Constants: {
EF_ZIP64_RHO: 16;
EF_ZIP64_DSN: 24;
};

export const Errors: {
/* Header error messages */
INVALID_LOC: 'Invalid LOC header (bad signature)';
INVALID_CEN: 'Invalid CEN header (bad signature)';
INVALID_END: 'Invalid END header (bad signature)';

/* ZipEntry error messages */
NO_DATA: 'Nothing to decompress';
BAD_CRC: 'CRC32 checksum failed';
FILE_IN_THE_WAY: 'There is a file in the way: %s';
UNKNOWN_METHOD: 'Invalid/unsupported compression method';

/* Inflater error messages */
AVAIL_DATA: 'inflate::Available inflate data did not terminate';
INVALID_DISTANCE: 'inflate::Invalid literal/length or distance code in fixed or dynamic block';
TO_MANY_CODES: 'inflate::Dynamic block code description: too many length or distance codes';
INVALID_REPEAT_LEN: 'inflate::Dynamic block code description: repeat more than specified lengths';
INVALID_REPEAT_FIRST: 'inflate::Dynamic block code description: repeat lengths with no first length';
INCOMPLETE_CODES: 'inflate::Dynamic block code description: code lengths codes incomplete';
INVALID_DYN_DISTANCE: 'inflate::Dynamic block code description: invalid distance code lengths';
INVALID_CODES_LEN: 'inflate::Dynamic block code description: invalid literal/length code lengths';
INVALID_STORE_BLOCK: "inflate::Stored block length did not match one's complement";
INVALID_BLOCK_TYPE: 'inflate::Invalid block type (type == 3)';

/* ADM-ZIP error messages */
CANT_EXTRACT_FILE: 'Could not extract the file';
CANT_OVERRIDE: 'Target file already exists';
NO_ZIP: 'No zip file was loaded';
NO_ENTRY: "Entry doesn't exist";
DIRECTORY_CONTENT_ERROR: 'A directory cannot have content';
FILE_NOT_FOUND: 'File not found: %s';
NOT_IMPLEMENTED: 'Not implemented';
INVALID_FILENAME: 'Invalid filename';
INVALID_FORMAT: 'Invalid or unsupported zip format. No END header found';
};
4 changes: 4 additions & 0 deletions types/animals/animals-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import animals = require('animals');

animals(); // $ExpectType string
animals.words // $ExpectType string[]
11 changes: 11 additions & 0 deletions types/animals/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Type definitions for animals 0.0
// Project: https://github.com/boennemann/animals
// Definitions by: Ben Cooper <https://github.com/bencooper222>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare const animals: {
(): string;
readonly words: string[];
}

export = animals;
23 changes: 23 additions & 0 deletions types/animals/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"animals-tests.ts"
]
}
1 change: 1 addition & 0 deletions types/animals/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": "@definitelytyped/dtslint/dt.json" }
3 changes: 3 additions & 0 deletions types/beyonk__gdpr-cookie-consent-banner/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,17 @@ interface GdprConsentInterface {

declare const GdprConsent: GdprConsentInterface;

// eslint-disable-next-line @definitelytyped/no-declare-current-package
declare module "@beyonk/gdpr-cookie-consent-banner" {
const attachBanner: GdprConsentInterface["attachBanner"];
export default attachBanner;
}

// eslint-disable-next-line @definitelytyped/no-declare-current-package
declare module "@beyonk/gdpr-cookie-consent-banner/dist/esm/bundle.js" {
const attachBanner: GdprConsentInterface["attachBanner"];
export default attachBanner;
}

// eslint-disable-next-line @definitelytyped/no-declare-current-package
declare module "@beyonk/gdpr-cookie-consent-banner/dist/style.css" {}
1 change: 1 addition & 0 deletions types/bluebird/v2/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ declare namespace Promise {
}
}

// eslint-disable-next-line @definitelytyped/no-declare-current-package
declare module "bluebird" {
export = Promise;
}
40 changes: 40 additions & 0 deletions types/braintree-web/test/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,46 @@ braintree.client.create(
});
});

// Venmo Create With Desktop, Mobile , Payment Method Options
braintree.venmo.create({
client: clientInstance,
allowDesktop: true,
mobileWebFallBack: true,
allowDesktopWebLogin: true,
paymentMethodUsage: "multi_use",
}, (createErr, venmoInstance) => {
const button = new HTMLButtonElement();

button.addEventListener("click", () => {
// Disable the button so that we don't attempt to open multiple popups.
button.setAttribute("disabled", "disabled");

// Because tokenize opens a new window, this must be called
// as a result of a user action, such as a button click.
venmoInstance
.tokenize()
.then((payload: braintree.VenmoTokenizePayload) => {
console.log(payload.nonce);
})
.catch((tokenizeError: braintree.BraintreeError) => {
// Handle flow errors or premature flow closure
switch (tokenizeError.code) {
case "VENMO_APP_CANCELED":
console.log("User canceled Venmo flow.");
break;
case "VENMO_CANCELED":
console.log("User canceled Venmo, or Venmo app is not available.");
break;
default:
console.error("Error!", tokenizeError);
}
})
.then(() => {
button.removeAttribute("disabled");
});
});
});

// Vault Manager
braintree.vaultManager.create({ client: clientInstance }, (createErr, vaultManagerInstance) => {
vaultManagerInstance
Expand Down
15 changes: 15 additions & 0 deletions types/braintree-web/venmo.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ export interface Venmo {
teardown(): Promise<void>;
}

/**
* Venmo Payment Method Usage
* multi_use: Request authorization for future payments (vaulting allowed)
* single_use: Request authorization for a one-time payment (vaulting not allowed)
*/
export type VenmoPaymentMethodUsage = "single_use" | "multi_use";

/**
* braintree.venmo.create({
* client: clientInstance
Expand All @@ -98,6 +105,10 @@ export function create(options: {
ignoreHistoryChanges?: boolean | undefined;
profileId?: string | undefined;
deepLinkReturnUrl?: string | undefined;
allowDesktopWebLogin?: boolean;
allowDesktop?: boolean;
mobileWebFallBack?: boolean;
paymentMethodUsage?: VenmoPaymentMethodUsage;
}): Promise<Venmo>;

export function create(
Expand All @@ -108,6 +119,10 @@ export function create(
ignoreHistoryChanges?: boolean | undefined;
profileId?: string | undefined;
deepLinkReturnUrl?: string | undefined;
allowDesktopWebLogin?: boolean;
allowDesktop?: boolean;
mobileWebFallBack?: boolean;
paymentMethodUsage?: VenmoPaymentMethodUsage;
},
callback?: callback<Venmo>,
): void;
Loading

0 comments on commit e190e56

Please sign in to comment.