diff --git a/README.md b/README.md index 026994fdd5..125b897e42 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -# DefinitelyTyped [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.svg?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) - -[![Join the chat at https://gitter.im/borisyankov/DefinitelyTyped](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/borisyankov/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +# DefinitelyTyped > The repository for *high quality* TypeScript type definitions. @@ -8,6 +6,19 @@ Also see the [definitelytyped.org](http://definitelytyped.org) website, although *You can also read this README in [Spanish](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md), [Korean](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md), and [Russian](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ru.md)!* +## Current status + +This section tracks the health of the repository and publishing process. +It may be helpful for contributors experiencing any issues with their PRs and packages. + +* All packages are type-checking/linting cleanly: [![Build Status](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped.svg?branch=master)](https://travis-ci.org/DefinitelyTyped/DefinitelyTyped) +* All packages are being published to npm in under 10,000 seconds: [![Publish Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.types-publisher-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=13) +* [typescript-bot](https://github.com/typescript-bot) has been active on DefinitelyTyped [![Activity Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.typescript-bot-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=14) + +If anything here seems wrong, or any of the above are failing, please raise an issue in [the DefinitelyTyped Gitter channel](https://gitter.im/DefinitelyTyped/DefinitelyTyped). + +[![Join the chat at https://gitter.im/DefinitelyTyped/DefinitelyTyped](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/DefinitelyTyped/DefinitelyTyped?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + ## What are declaration files? See the [TypeScript handbook](http://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html). @@ -342,6 +353,3 @@ This project is licensed under the MIT license. Copyrights on the definition files are respective of each contributor listed at the beginning of each definition file. [![Analytics](https://ga-beacon.appspot.com/UA-47495295-4/borisyankov/DefinitelyTyped)](https://github.com/igrigorik/ga-beacon) - -[![Build Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.types-publisher-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=13) Are packages being published to npm in less than 10,000 seconds on average? -[![Build Status](https://typescript.visualstudio.com/TypeScript/_apis/build/status/sandersn.typescript-bot-watchdog)](https://typescript.visualstudio.com/TypeScript/_build/latest?definitionId=14) Has typescript-bot been active on DefinitelyTyped in the last two hours? diff --git a/README.ru.md b/README.ru.md index b90bdeac7c..9186c2ddd5 100644 --- a/README.ru.md +++ b/README.ru.md @@ -8,7 +8,7 @@ Также посетите веб-сайт [definitelytyped.org](http://definitelytyped.org), хотя информация в этом README более свежая. -*Вы также можете прочитать этот README на [английском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md), [испанском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md) and [корейском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md).* +*Вы также можете прочитать этот README на [английском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md), [испанском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.es.md) и [корейском](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.ko.md).* ## Что такое файлы декларации (файлы описания/объявления типов)? @@ -101,9 +101,9 @@ DefinitelyTyped работает только благодаря вкладу т // John ``` -* Если есть `tslint.json`, запустите `npm run lint package-name`. В противном случае запустите `tsc` in в директории пакета. +* Если есть `tslint.json`, запустите `npm run lint package-name`. В противном случае запустите `tsc` в директории пакета. -Когда вы создаете PR для редактирования существующего пакета, `dt-bot` должен @-уведомить previous authors. +Когда вы создаете PR для редактирования существующего пакета, `dt-bot` должен @-уведомить предыдущих авторов. Если этого не произойдет, вы можете сделать это самостоятельно в комментарии, связанном с PR. @@ -124,7 +124,7 @@ DefinitelyTyped работает только благодаря вкладу т | tsconfig.json | Позволяет вам запускать `tsc` внутри пакета. | | tslint.json | Включает linting. | -Создайте их, запустив `npx dts-gen --dt --name my-package-name --template module` если у вас ≥ 5.2.0, `npm install -g dts-gen` и `dts-gen --dt --name my-package-name --template module` в противном случае. +Создайте их, запустив `npx dts-gen --dt --name my-package-name --template module` если у вас npm ≥ 5.2.0, `npm install -g dts-gen` и `dts-gen --dt --name my-package-name --template module` в противном случае. Посмотреть все варианты на [dts-gen](https://github.com/Microsoft/dts-gen). Вы можете отредактировать `tsconfig.json` чтобы добавить новые файлы, добавить `"target": "es6"` (необходимо для асинхронных функций), добавить в `"lib"`, или добавить опцию компилятора `"jsx"`. @@ -283,7 +283,7 @@ f("one"); "typeRoots": ["../../"], "paths": { "history": [ "history/v2" ] - }, + } }, "files": [ "index.d.ts", diff --git a/types/country-data/country-data-tests.ts b/types/country-data/country-data-tests.ts new file mode 100644 index 0000000000..850116dc63 --- /dev/null +++ b/types/country-data/country-data-tests.ts @@ -0,0 +1,14 @@ +import * as lib from 'country-data'; + +lib.callingCodes.all; // $ExpectType ReadonlyArray +lib.callingCountries.all; // $ExpectType ReadonlyArray +lib.continents.africa; // $ExpectType Continent +lib.continents.africa.countries; // $ExpectType ReadonlyArray +lib.countries.all; // $ExpectType ReadonlyArray +lib.currencies.all; // $ExpectType ReadonlyArray +lib.languages.all; // $ExpectType ReadonlyArray +lib.regions.antarctica; // $ExpectType Region +lib.regions.antarctica.countries; // $ExpectType ReadonlyArray +lib.lookup.countries(""); // $ExpectType ReadonlyArray +lib.lookup.currencies(""); // $ExpectType ReadonlyArray +lib.lookup.languages(""); // $ExpectType ReadonlyArray diff --git a/types/country-data/index.d.ts b/types/country-data/index.d.ts new file mode 100644 index 0000000000..80acbbcbba --- /dev/null +++ b/types/country-data/index.d.ts @@ -0,0 +1,103 @@ +// Type definitions for country-data 0.0 +// Project: https://github.com/OpenBookPrices/country-data +// Definitions by: Logan Dam +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export interface Country { + readonly alpha2: string; + readonly alpha3: string; + readonly countryCallingCodes: ReadonlyArray; + readonly currencies: ReadonlyArray; + readonly emoji: string; + readonly ioc: string; + readonly languages: ReadonlyArray; + readonly name: string; + readonly status: string; +} + +export interface Currency { + readonly code: string; + readonly decimals: number; + readonly name: string; + readonly number: number; +} + +export interface Language { + readonly alpha2: string; + readonly alpha3: string; + readonly bibliographic: string; + readonly name: string; +} + +export interface Continent { + readonly name: string; + readonly regions: ReadonlyArray; + readonly countries: ReadonlyArray; +} + +export interface Region { + readonly name: string; + readonly countries: ReadonlyArray; +} + +export const countries: { + readonly all: ReadonlyArray; +}; + +export const continents: { + readonly africa: Continent; + readonly antarctica: Continent; + readonly asia: Continent; + readonly europe: Continent; + readonly northAmerica: Continent; + readonly oceania: Continent; + readonly southAmerica: Continent; +}; + +export const callingCodes: { + readonly all: ReadonlyArray; +}; + +export const callingCountries: { + readonly all: ReadonlyArray; +}; + +export const currencies: { + readonly all: ReadonlyArray; +}; + +export const languages: { + readonly all: ReadonlyArray; +}; + +export const regions: { + readonly centralAsia: Region; + readonly southernAsia: Region; + readonly southeastAsia: Region; + readonly eastAsia: Region; + readonly westernAsia: Region; + readonly centralAfrica: Region; + readonly northAfrica: Region; + readonly southernAfrica: Region; + readonly eastAfrica: Region; + readonly westAfrica: Region; + readonly centralAmerica: Region; + readonly northernAmerica: Region; + readonly caribbean: Region; + readonly southAmerica: Region; + readonly antarctica: Region; + readonly northernEurope: Region; + readonly southernEurope: Region; + readonly easternEurope: Region; + readonly westernEurope: Region; + readonly australia: Region; + readonly melanesia: Region; + readonly micronesia: Region; + readonly polynesia: Region; +}; + +export const lookup: { + readonly countries: (query: any) => ReadonlyArray; + readonly currencies: (query: any) => ReadonlyArray; + readonly languages: (query: any) => ReadonlyArray; +}; diff --git a/types/country-data/tsconfig.json b/types/country-data/tsconfig.json new file mode 100644 index 0000000000..ccbbf6ecd6 --- /dev/null +++ b/types/country-data/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "country-data-tests.ts" + ] +} diff --git a/types/country-data/tslint.json b/types/country-data/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/country-data/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/custom-functions-runtime/custom-functions-runtime-tests.ts b/types/custom-functions-runtime/custom-functions-runtime-tests.ts index 0a3c482505..8f54ee4f5c 100644 --- a/types/custom-functions-runtime/custom-functions-runtime-tests.ts +++ b/types/custom-functions-runtime/custom-functions-runtime-tests.ts @@ -5,6 +5,11 @@ function add10(n: number) { CustomFunctions.associate('ADD10', add10); +CustomFunctions.associate({ + ADD10: add10, + RANDOM: (n: number) => n * Math.random() +}); + async function getStockValues(ticker: string): Promise { const response = await fetch(`myService.com/prices/${ticker}`); return (await response.json())["price"]; diff --git a/types/custom-functions-runtime/index.d.ts b/types/custom-functions-runtime/index.d.ts index f78f6a45c4..174308c131 100644 --- a/types/custom-functions-runtime/index.d.ts +++ b/types/custom-functions-runtime/index.d.ts @@ -16,9 +16,14 @@ Copyright (c) Microsoft Corporation declare namespace CustomFunctions { /** * @beta - * Ties together the function's JavaScript name with the JSON id property + * Associates the JavaScript function to the name given by the "id" property in the metadata JSON file. */ function associate(id: string, functionObject: Function): void; + /** + * @beta + * Associates the JavaScript functions to the names given by the "id" properties in the metadata JSON file. + */ + function associate(mappings: { [key: string]: Function }): void; /** * A handler passed automatically as the last parameter @@ -28,7 +33,6 @@ declare namespace CustomFunctions { * to handle what happens when the function stops streaming. * @beta */ - interface StreamingHandler extends CancelableHandler { /** * Sets the returned result for a streaming custom function. @@ -36,6 +40,7 @@ declare namespace CustomFunctions { */ setResult: (value: T | Error) => void; } + /** * @beta * CancelableHandler interface diff --git a/types/d3-geo/d3-geo-tests.ts b/types/d3-geo/d3-geo-tests.ts index 6e824e8e69..36c4debbe3 100644 --- a/types/d3-geo/d3-geo-tests.ts +++ b/types/d3-geo/d3-geo-tests.ts @@ -371,6 +371,7 @@ const gnomonicRaw: d3Geo.GeoRawProjection = d3Geo.geoGnomonicRaw(); const mercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoMercatorRaw(); const orthographicRaw: d3Geo.GeoRawProjection = d3Geo.geoOrthographicRaw(); const stereographicRaw: d3Geo.GeoRawProjection = d3Geo.geoStereographicRaw(); +const equalEarthRaw: d3Geo.GeoRawProjection = d3Geo.geoEqualEarthRaw(); const transverseMercatorRaw: d3Geo.GeoRawProjection = d3Geo.geoTransverseMercatorRaw(); const naturalEarth1Raw: d3Geo.GeoRawProjection = d3Geo.geoNaturalEarth1Raw(); @@ -398,6 +399,7 @@ const gnomonic: d3Geo.GeoProjection = d3Geo.geoGnomonic(); const mercator: d3Geo.GeoProjection = d3Geo.geoMercator(); const orthographic: d3Geo.GeoProjection = d3Geo.geoOrthographic(); const stereographic: d3Geo.GeoProjection = d3Geo.geoStereographic(); +const equalEarth: d3Geo.GeoProjection = d3Geo.geoEqualEarth(); const transverseMercator: d3Geo.GeoProjection = d3Geo.geoTransverseMercator(); const naturalEarth1: d3Geo.GeoProjection = d3Geo.geoNaturalEarth1(); diff --git a/types/d3-geo/index.d.ts b/types/d3-geo/index.d.ts index 8f22503d71..16c51dfae6 100644 --- a/types/d3-geo/index.d.ts +++ b/types/d3-geo/index.d.ts @@ -1,10 +1,10 @@ -// Type definitions for D3JS d3-geo module 1.10 +// Type definitions for D3JS d3-geo module 1.11 // Project: https://github.com/d3/d3-geo/ // Definitions by: Hugues Stefanski , Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 1.10.0 +// Last module patch version validated against: 1.11.3 import * as GeoJSON from 'geojson'; @@ -1345,11 +1345,22 @@ export function geoOrthographicRaw(): GeoRawProjection; * The stereographic projection. */ export function geoStereographic(): GeoProjection; + /** * The raw stereographic projection. */ export function geoStereographicRaw(): GeoRawProjection; +/** + * The Equal Eartch projection, by Bojan Šavrič et al., 2018. + */ +export function geoEqualEarth(): GeoProjection; + +/** + * The raw Equal Earth projection, by Bojan Šavrič et al., 2018. + */ +export function geoEqualEarthRaw(): GeoRawProjection; + // Composite Projections --------------------------------------------------- /** diff --git a/types/d3/index.d.ts b/types/d3/index.d.ts index 43c264f280..9b62c1e025 100644 --- a/types/d3/index.d.ts +++ b/types/d3/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for D3JS d3 standard bundle 5.5 +// Type definitions for D3JS d3 standard bundle 5.7 // Project: https://github.com/d3/d3 // Definitions by: Tom Wanzek // Alex Ford @@ -7,7 +7,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// Last module patch version validated against: 5.5.0 +// Last module patch version validated against: 5.7.0 // NOTE TO MAINTAINERS: Review D3 v4.x module dependencies (see v4 sub-folder) and update its path-mappings in tsconfig (v4 folder), // if new MAJOR version of D3 v4 modules are released!!! diff --git a/types/doge-seed/doge-seed-tests.ts b/types/doge-seed/doge-seed-tests.ts new file mode 100644 index 0000000000..fa47414d65 --- /dev/null +++ b/types/doge-seed/doge-seed-tests.ts @@ -0,0 +1,4 @@ +import dogeSeed = require('doge-seed'); + +dogeSeed(); // $ExpectType string +dogeSeed(128); // $ExpectType string diff --git a/types/doge-seed/index.d.ts b/types/doge-seed/index.d.ts new file mode 100644 index 0000000000..8670f36332 --- /dev/null +++ b/types/doge-seed/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for doge-seed 1.0 +// Project: https://github.com/lukechilds/doge-seed#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = dogeSeed; + +/** + * Generates a cryptographically secure mnemonic seed phrase with added dankness. + * The first four words will be a randomly generated Doge-like sentence. + * + * The seed phrases are fully valid checksummed BIP39 seeds. They can be used with any cryptocurrency + * and can be imported into any BIP39 compliant wallet. + * + * @param bits The number of bits to derive a BIP39 mnemonic from. Default: `128`. + * @returns A BIP39 mnemonic seed phrase. + */ +declare function dogeSeed(bits?: 128 | 160 | 192 | 224 | 256): string; diff --git a/types/doge-seed/tsconfig.json b/types/doge-seed/tsconfig.json new file mode 100644 index 0000000000..cd46d1ee9c --- /dev/null +++ b/types/doge-seed/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "doge-seed-tests.ts" + ] +} diff --git a/types/doge-seed/tslint.json b/types/doge-seed/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/doge-seed/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/first-run/first-run-tests.ts b/types/first-run/first-run-tests.ts new file mode 100644 index 0000000000..5451c7c88c --- /dev/null +++ b/types/first-run/first-run-tests.ts @@ -0,0 +1,6 @@ +import firstRun = require('first-run'); + +firstRun(); // $ExpectType boolean +firstRun({ name: 'foo' }); // $ExpectType boolean + +firstRun.clear(); diff --git a/types/first-run/index.d.ts b/types/first-run/index.d.ts new file mode 100644 index 0000000000..dc92053d03 --- /dev/null +++ b/types/first-run/index.d.ts @@ -0,0 +1,26 @@ +// Type definitions for first-run 1.2 +// Project: https://github.com/sindresorhus/first-run +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = firstRun; + +/** + * Check if it's the first time the process is run. + */ +declare function firstRun(options?: firstRun.Options): boolean; + +declare namespace firstRun { + /** + * Clear the state. + */ + function clear(): void; + + interface Options { + /** + * The name used to identify it. + * @default name field in your package.json + */ + name: string; + } +} diff --git a/types/first-run/tsconfig.json b/types/first-run/tsconfig.json new file mode 100644 index 0000000000..6a4ce007ab --- /dev/null +++ b/types/first-run/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "first-run-tests.ts" + ] +} diff --git a/types/first-run/tslint.json b/types/first-run/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/first-run/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/hex-rgb/hex-rgb-tests.ts b/types/hex-rgb/hex-rgb-tests.ts new file mode 100644 index 0000000000..f9bbf5ea71 --- /dev/null +++ b/types/hex-rgb/hex-rgb-tests.ts @@ -0,0 +1,4 @@ +import hexRgb = require('hex-rgb'); + +hexRgb('#cd2222cc'); // $ExpectType RgbaObj +hexRgb('#cd2222cc', { format: 'array' }); // $ExpectType [number, number, number, number] diff --git a/types/hex-rgb/index.d.ts b/types/hex-rgb/index.d.ts new file mode 100644 index 0000000000..ab1de9bf24 --- /dev/null +++ b/types/hex-rgb/index.d.ts @@ -0,0 +1,24 @@ +// Type definitions for hex-rgb 3.0 +// Project: https://github.com/sindresorhus/hex-rgb#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = hexRgb; + +declare function hexRgb(hex: string): hexRgb.RgbaObj; +declare function hexRgb(hex: string, options: hexRgb.Options): hexRgb.RgbaArr; + +declare namespace hexRgb { + interface Options { + format: 'array'; + } + + interface RgbaObj { + red: number; + green: number; + blue: number; + alpha: number; + } + + type RgbaArr = [number, number, number, number]; +} diff --git a/types/hex-rgb/tsconfig.json b/types/hex-rgb/tsconfig.json new file mode 100644 index 0000000000..c20c71b94f --- /dev/null +++ b/types/hex-rgb/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "hex-rgb-tests.ts" + ] +} diff --git a/types/hex-rgb/tslint.json b/types/hex-rgb/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/hex-rgb/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/html-tags/html-tags-tests.ts b/types/html-tags/html-tags-tests.ts new file mode 100644 index 0000000000..802dbb665e --- /dev/null +++ b/types/html-tags/html-tags-tests.ts @@ -0,0 +1,9 @@ +import htmlTags = require('html-tags'); +import voidHtmlTags = require('html-tags/void'); +import htmlTagsJson = require('html-tags/html-tags.json'); +import voidHtmlTagsJson = require('html-tags/html-tags-void.json'); + +htmlTags; // $ExpectType string[] +voidHtmlTags; // $ExpectType string[] +htmlTagsJson; // $ExpectType string[] +voidHtmlTagsJson; // $ExpectType string[] diff --git a/types/html-tags/html-tags-void.json.d.ts b/types/html-tags/html-tags-void.json.d.ts new file mode 100644 index 0000000000..3e194ddf27 --- /dev/null +++ b/types/html-tags/html-tags-void.json.d.ts @@ -0,0 +1,3 @@ +export = voidHtmlTags; + +declare const voidHtmlTags: string[]; diff --git a/types/html-tags/html-tags.json.d.ts b/types/html-tags/html-tags.json.d.ts new file mode 100644 index 0000000000..888779dc9c --- /dev/null +++ b/types/html-tags/html-tags.json.d.ts @@ -0,0 +1,3 @@ +export = htmlTags; + +declare const htmlTags: string[]; diff --git a/types/html-tags/index.d.ts b/types/html-tags/index.d.ts new file mode 100644 index 0000000000..635ce4820f --- /dev/null +++ b/types/html-tags/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for html-tags 2.0 +// Project: https://github.com/sindresorhus/html-tags#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = htmlTags; + +declare const htmlTags: string[]; diff --git a/types/html-tags/tsconfig.json b/types/html-tags/tsconfig.json new file mode 100644 index 0000000000..971c9bb630 --- /dev/null +++ b/types/html-tags/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "void.d.ts", + "html-tags.json.d.ts", + "html-tags-void.json.d.ts", + "html-tags-tests.ts" + ] +} diff --git a/types/html-tags/tslint.json b/types/html-tags/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/html-tags/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/html-tags/void.d.ts b/types/html-tags/void.d.ts new file mode 100644 index 0000000000..3e194ddf27 --- /dev/null +++ b/types/html-tags/void.d.ts @@ -0,0 +1,3 @@ +export = voidHtmlTags; + +declare const voidHtmlTags: string[]; diff --git a/types/http-rx/http-rx-tests.ts b/types/http-rx/http-rx-tests.ts index 082585fdf9..b76ba67832 100644 --- a/types/http-rx/http-rx-tests.ts +++ b/types/http-rx/http-rx-tests.ts @@ -1,13 +1,14 @@ import { Observable } from 'rxjs'; import httpRx = require('http-rx'); +import request = require('request'); -const httpGet: Observable = httpRx.get(''); +const httpGet: Observable<{response: request.Response}> = httpRx.get(''); -const httpHead: Observable = httpRx.head(''); +const httpHead: Observable<{body: any}> = httpRx.head(''); -const httpPatch: Observable = httpRx.patch(''); +const httpPatch: Observable<{response: request.Response, body: any}> = httpRx.patch(''); -const httpPost: Observable = httpRx.post(''); +const httpPost: Observable<{response: request.Response, body: any}> = httpRx.post('', {json: true}); const httpPut: Observable<{}> = httpRx.put(''); diff --git a/types/http-rx/index.d.ts b/types/http-rx/index.d.ts index 3b0c734fb0..c752427b8a 100644 --- a/types/http-rx/index.d.ts +++ b/types/http-rx/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for http-rx 1.1 +// Type definitions for http-rx 2.0 // Project: https://github.com/JasonRammoray/HttpRx // Definitions by: L2jLiga // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -7,18 +7,23 @@ import { Observable } from 'rxjs'; import request = require('request'); +interface ResponseWrapper { + response: request.Response; + body: any; +} + interface HttpRx { - get(url: string, options?: request.CoreOptions): Observable; + get(url: string, options?: request.CoreOptions): Observable; - head(url: string, options?: request.CoreOptions): Observable; + head(url: string, options?: request.CoreOptions): Observable; - patch(url: string, options?: request.CoreOptions): Observable; + patch(url: string, options?: request.CoreOptions): Observable; - post(url: string, options?: request.CoreOptions): Observable; + post(url: string, options?: request.CoreOptions): Observable; - put(url: string, options?: request.CoreOptions): Observable; + put(url: string, options?: request.CoreOptions): Observable; - 'delete'(url: string, options?: request.CoreOptions): Observable; + delete(url: string, options?: request.CoreOptions): Observable; } declare const httpRx: HttpRx; diff --git a/types/js-types/index.d.ts b/types/js-types/index.d.ts new file mode 100644 index 0000000000..756680fd04 --- /dev/null +++ b/types/js-types/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for js-types 2.0 +// Project: https://github.com/sindresorhus/js-types#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = jsTypes; + +declare const jsTypes: string[]; diff --git a/types/js-types/js-types-tests.ts b/types/js-types/js-types-tests.ts new file mode 100644 index 0000000000..b7e5a4fe8b --- /dev/null +++ b/types/js-types/js-types-tests.ts @@ -0,0 +1,5 @@ +import jsTypes = require('js-types'); +import jsTypesJson = require('js-types/js-types.json'); + +jsTypes; // $ExpectType string[] +jsTypesJson; // $ExpectType string[] diff --git a/types/js-types/js-types.json.d.ts b/types/js-types/js-types.json.d.ts new file mode 100644 index 0000000000..83565f43d1 --- /dev/null +++ b/types/js-types/js-types.json.d.ts @@ -0,0 +1,3 @@ +export = jsTypes; + +declare const jsTypes: string[]; diff --git a/types/js-types/tsconfig.json b/types/js-types/tsconfig.json new file mode 100644 index 0000000000..1b81a82e27 --- /dev/null +++ b/types/js-types/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "js-types.json.d.ts", + "js-types-tests.ts" + ] +} diff --git a/types/js-types/tslint.json b/types/js-types/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/js-types/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/keyboardjs/index.d.ts b/types/keyboardjs/index.d.ts index 037bf7189b..c97cda0741 100644 --- a/types/keyboardjs/index.d.ts +++ b/types/keyboardjs/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for KeyboardJS v2.4.1 +// Type definitions for KeyboardJS v2.4.2 // Project: https://github.com/RobertWHurst/KeyboardJS // Definitions by: Vincent Bortone , // David Asmuth , @@ -92,14 +92,16 @@ declare namespace keyboardjs { /** * Triggers a key press. Stays in pressed state until released. - * @param keyCombo String of keys to be pressed to execute 'pressed' callbacks. + * @param keyCombo String of keys or keyCode to be pressed to execute 'pressed' callbacks. + * @param event The KeyEvent, can be null. */ - export function pressKey(keyCombo: string): void + export function pressKey(keyCombo: string | number, event?: KeyEvent): void; /** * Triggers a key release. - * @param keyCombo String of keys to be released to execute 'released' callbacks. + * @param keyCombo String of keys or keyCode to be released to execute 'released' callbacks. + * @param event The KeyEvent, can be null. */ - export function releaseKey(keyCombo: string): void; + export function releaseKey(keyCombo: string | number, event?: KeyEvent): void; /** * Releases all keys. */ diff --git a/types/latest-version/index.d.ts b/types/latest-version/index.d.ts new file mode 100644 index 0000000000..5127714c15 --- /dev/null +++ b/types/latest-version/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for latest-version 4.0 +// Project: https://github.com/sindresorhus/latest-version#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = latestVersion; + +declare function latestVersion(name: string, options?: latestVersion.Options): Promise; + +declare namespace latestVersion { + interface Options { + version?: string; + } +} diff --git a/types/latest-version/latest-version-tests.ts b/types/latest-version/latest-version-tests.ts new file mode 100644 index 0000000000..2cbd29b61f --- /dev/null +++ b/types/latest-version/latest-version-tests.ts @@ -0,0 +1,4 @@ +import latestVersion = require('latest-version'); + +latestVersion('ava'); // $ExpectType Promise +latestVersion('npm', { version: 'latest-5' }); // $ExpectType Promise diff --git a/types/latest-version/tsconfig.json b/types/latest-version/tsconfig.json new file mode 100644 index 0000000000..a62d14b69d --- /dev/null +++ b/types/latest-version/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "latest-version-tests.ts" + ] +} diff --git a/types/latest-version/tslint.json b/types/latest-version/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/latest-version/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/libsodium-wrappers-sumo/index.d.ts b/types/libsodium-wrappers-sumo/index.d.ts index ceeadd5980..5341cca299 100644 --- a/types/libsodium-wrappers-sumo/index.d.ts +++ b/types/libsodium-wrappers-sumo/index.d.ts @@ -7,10 +7,12 @@ export * from 'libsodium-wrappers'; import { - Uint8ArrayOutputFormat, - StringOutputFormat, + KeyPair, onetimeauth_state_address, state_address, + StringKeyPair, + StringOutputFormat, + Uint8ArrayOutputFormat, } from 'libsodium-wrappers'; export const crypto_auth_hmacsha256_BYTES: number; @@ -77,6 +79,12 @@ export const crypto_stream_xchacha20_KEYBYTES: number; export const crypto_stream_xchacha20_NONCEBYTES: number; +export const crypto_box_curve25519xchacha20poly1305_NONCEBYTES: number; + +export const crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES: number; + +export const crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES: number; + export function crypto_auth_hmacsha256( message: string | Uint8Array, key: Uint8Array, @@ -113,6 +121,18 @@ export function crypto_auth_hmacsha512_keygen(outputFormat?: StringOutputFormat export function crypto_auth_hmacsha512_verify(tag: Uint8Array, message: string | Uint8Array, key: Uint8Array): boolean; +export function crypto_box_curve25519xchacha20poly1305_keypair(publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): KeyPair; + +export function crypto_box_curve25519xchacha20poly1305_keypair(publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: StringOutputFormat | null): StringKeyPair; + +export function crypto_box_curve25519xchacha20poly1305_seal(message: Uint8Array, publicKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array; + +export function crypto_box_curve25519xchacha20poly1305_seal(message: Uint8Array, publicKey: Uint8Array, outputFormat?: StringOutputFormat | null): string; + +export function crypto_box_curve25519xchacha20poly1305_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array; + +export function crypto_box_curve25519xchacha20poly1305_seal_open(ciphertext: Uint8Array, publicKey: Uint8Array, secretKey: Uint8Array, outputFormat?: StringOutputFormat | null): string; + export function crypto_hash_sha256( message: string | Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null, @@ -240,6 +260,10 @@ export function crypto_sign_ed25519_sk_to_seed( outputFormat?: StringOutputFormat | null, ): string; +export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat?: StringOutputFormat | null): string; + +export function crypto_stream_chacha20(outLength: number, key: Uint8Array, nonce: Uint8Array, outputFormat?: Uint8ArrayOutputFormat | null): Uint8Array; + export function crypto_stream_chacha20_ietf_xor( input_message: string | Uint8Array, nonce: Uint8Array, diff --git a/types/libsodium-wrappers/index.d.ts b/types/libsodium-wrappers/index.d.ts index e9213da782..2fcbe30a98 100644 --- a/types/libsodium-wrappers/index.d.ts +++ b/types/libsodium-wrappers/index.d.ts @@ -886,30 +886,30 @@ export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat?: Uint export function crypto_secretstream_xchacha20poly1305_keygen(outputFormat?: StringOutputFormat | null): string; export function crypto_secretstream_xchacha20poly1305_pull( - state_address?: secretstream_xchacha20poly1305_state_address, - cipher?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + cipher: string | Uint8Array, ad?: string | Uint8Array | null, outputFormat?: Uint8ArrayOutputFormat | null, -): { message: Uint8Array; tag: Uint8Array }; +): { message: Uint8Array; tag: number }; export function crypto_secretstream_xchacha20poly1305_pull( - state_address?: secretstream_xchacha20poly1305_state_address, - cipher?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + cipher: string | Uint8Array, ad?: string | Uint8Array | null, outputFormat?: StringOutputFormat | null, -): { message: string; tag: Uint8Array }; +): { message: string; tag: number }; export function crypto_secretstream_xchacha20poly1305_push( - state_address?: secretstream_xchacha20poly1305_state_address, - message_chunk?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + message_chunk: string | Uint8Array, ad?: string | Uint8Array | null, tag?: number, outputFormat?: Uint8ArrayOutputFormat | null, ): Uint8Array; export function crypto_secretstream_xchacha20poly1305_push( - state_address?: secretstream_xchacha20poly1305_state_address, - message_chunk?: string | Uint8Array, + state_address: secretstream_xchacha20poly1305_state_address, + message_chunk: string | Uint8Array, ad?: string | Uint8Array | null, tag?: number, outputFormat?: StringOutputFormat | null, diff --git a/types/loopbench/index.d.ts b/types/loopbench/index.d.ts new file mode 100644 index 0000000000..bd5e61d3e2 --- /dev/null +++ b/types/loopbench/index.d.ts @@ -0,0 +1,71 @@ +// Type definitions for loopbench 1.2 +// Project: https://github.com/mcollina/loopbench#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { EventEmitter } from 'events'; + +export = loopbench; + +/** + * Creates a new instance of loopbench. + */ +declare function loopbench(options?: loopbench.Options): loopbench.LoopBench; + +declare namespace loopbench { + interface Options { + /** + * The interval at which the eventLoop should be sampled, defaults to `5`. + */ + sampleInterval?: number; + /** + * The maximum amount of delay that is tolerated before `overLimit` becomes true, + * and the `load` event is emitted, defaults to `42`. + */ + limit?: number; + } + + /** + * Events: + * - `load`, emitted when `instance.delay > instance.limit` + * - `unload`, emitted when `overLimit` goes from `true` and `false` + */ + interface LoopBench extends EventEmitter { + /** + * The delay in milliseconds (and fractions) from the expected run. It might be negative (in older nodes). + */ + readonly delay: number; + + /** + * The maximum amount of delay that is tolerated before `overLimit` becomes true, + * and the `load` event is emitted. + */ + readonly limit: number; + + /** + * Is `true` if the `instance.delay > instance.limit`. + */ + readonly overLimit: boolean; + + /** + * Stops the sampling. + */ + stop(): void; + + addListener(event: 'load' | 'unload', listener: () => void): this; + on(event: 'load' | 'unload', listener: () => void): this; + once(event: 'load' | 'unload', listener: () => void): this; + removeListener(event: 'load' | 'unload', listener: () => void): this; + off(event: 'load' | 'unload', listener: () => void): this; + removeAllListeners(event?: 'load' | 'unload'): this; + listeners(event: 'load' | 'unload'): Array<() => void>; + rawListeners(event: 'load' | 'unload'): Array<() => void>; + emit(event: 'load' | 'unload'): boolean; + listenerCount(type: 'load' | 'unload'): number; + prependListener(event: 'load' | 'unload', listener: () => void): this; + prependOnceListener(event: 'load' | 'unload', listener: () => void): this; + eventNames(): Array<'load' | 'unload'>; + } +} diff --git a/types/loopbench/loopbench-tests.ts b/types/loopbench/loopbench-tests.ts new file mode 100644 index 0000000000..e78a22e08a --- /dev/null +++ b/types/loopbench/loopbench-tests.ts @@ -0,0 +1,11 @@ +import loopbench = require('loopbench'); + +const inst = loopbench(); +inst; // $ExpectType LoopBench +loopbench({ sampleInterval: 1 }); // $ExpectType LoopBench +loopbench({ limit: 1 }); // $ExpectType LoopBench + +inst.delay; // $ExpectType number +inst.limit; // $ExpectType number +inst.overLimit; // $ExpectType boolean +inst.stop(); diff --git a/types/loopbench/tsconfig.json b/types/loopbench/tsconfig.json new file mode 100644 index 0000000000..05e37ab0fa --- /dev/null +++ b/types/loopbench/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "loopbench-tests.ts" + ] +} diff --git a/types/loopbench/tslint.json b/types/loopbench/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/loopbench/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/mangopay2-nodejs-sdk/index.d.ts b/types/mangopay2-nodejs-sdk/index.d.ts new file mode 100644 index 0000000000..e0c5d5c0e2 --- /dev/null +++ b/types/mangopay2-nodejs-sdk/index.d.ts @@ -0,0 +1,4383 @@ +// Type definitions for mangopay2-nodejs-sdk 1.9 +// Project: https://github.com/MangoPay/mangopay2-nodejs-sdk +// Definitions by: Ifiok Jr. +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 + +/// + +import { + ApiMethod, + CountryISO, + CurrencyISO, + MakeKeysRequired, + Omit, + OmitType, + PickPartialRequired, + ValueOf, + PickPartial, + DeepPartial +} from "./types"; + +export = MangoPay; + +declare class MangoPay { + constructor(config: MangoPay.Config); + config: MangoPay.Config; + requestOptions: MangoPay.RequestOptions; + Users: MangoPay.Users; + BankAccounts: MangoPay.BankAccounts; + BankingAliases: MangoPay.BankingAliases; + DisputeDocuments: MangoPay.DisputeDocuments; + Wallets: MangoPay.Wallets; + KycDocuments: MangoPay.KycDocuments; + UboDeclarations: MangoPay.UboDeclarations; + Cards: MangoPay.Cards; + CardRegistrations: MangoPay.CardRegistrations; + CardPreAuthorizations: MangoPay.CardPreAuthorizations; + PayIns: MangoPay.PayIns; + Transfers: MangoPay.Transfers; + PayOuts: MangoPay.PayOuts; + Refunds: MangoPay.Refunds; + Clients: MangoPay.Clients; + Disputes: MangoPay.Disputes; + Repudiations: MangoPay.Repudiations; + Events: MangoPay.Events; + Responses: MangoPay.Responses; + Mandates: MangoPay.Mandates; + Hooks: MangoPay.Hooks; + Reports: MangoPay.Reports; + + models: typeof MangoPay.models; + + Log(...args: any[]): void; + authorize(callback: (data: MangoPay.AuthorizationData) => void): void; + authorize(): Promise; + buildRequestData(entity: any): any; + canReadSubRequestData(entity: any, propertyName: any): boolean; + isExpired(): boolean; + method( + method: ApiMethod, + callback: (...args: any[]) => void, + options: MangoPay.RequestOptions + ): any; +} + +declare namespace MangoPay { + interface AuthorizationData { + access_token: string; + token_type: string; + expires_in: number; + } + + interface Headers { + "Content-Type": string; + "User-Agent": string; + "Idempotency-Key": string; + Authorization: string; + [header: string]: string | undefined; + } + + /** A UTC timestamp in seconds */ + type Timestamp = number; + type ColumnAndDirection = "ASC" | "DESC"; + type AVSResult = + | "NO_CHECK" + | "NO_MATCH" + | "ADDRESS_MATCH_ONLY" + | "POSTAL_CODE_MATCH_ONLY" + | "FULL_MATCH"; + type SecureMode = "DEFAULT" | "FORCE"; + type PreAuthorizationExecutionType = "DIRECT"; + type PaymentStatus = "WAITING" | "CANCELED" | "EXPIRED" | "VALIDATED"; + type PreAuthorizationStatus = "CREATED" | "SUCCEEDED" | "FAILED"; + interface BillingData { + Address: models.Address | address.AddressData | string; + } + + interface SecurityInfoData { + AVSResult: AVSResult; + } + + interface MoneyData { + /** + * The currency - should be ISO_4217 format + */ + Currency: CurrencyISO; + + /** + * An amount of money in the smallest sub-division of the currency, e.g. 12.60 EUR would be represented as 1260 whereas 12 JPY would be represented as just 12) + */ + Amount: number; + } + + interface WithResponse { + statusCode: number; + body: T; + headers: Headers; + } + + interface NoArgMethodOverload { + (options: MethodOptionWithResponse): Promise>; + (options?: MethodOptionWithoutResponse): Promise; + ( + callback: (data: WithResponse) => void, + options?: MethodOptionWithResponse + ): void; + (callback: (data: R) => void, options?: MethodOptionWithoutResponse): void; + } + + interface MethodOverload { + (data: T, options: MethodOptionWithResponse): Promise>; + (data: T, options?: MethodOptionWithoutResponse): Promise; + ( + data: T, + callback: (data: WithResponse) => void, + options: MethodOptionWithResponse + ): void; + ( + data: T, + callback: (data: R) => void, + options?: MethodOptionWithoutResponse + ): void; + } + + interface TwoArgsMethodOverload { + (data: T, extra: U, options: MethodOptionWithResponse): Promise< + WithResponse + >; + (data: T, extra: U, options?: MethodOptionWithoutResponse): Promise; + ( + data: T, + extra: U, + callback: (data: WithResponse) => void, + options?: MethodOptionWithResponse + ): void; + ( + data: T, + extra: U, + callback: (data: R) => void, + options?: MethodOptionWithoutResponse + ): void; + } + + interface ThreeArgsMethodOverload { + (data: T, extra: U, lastArg: V, options: MethodOptionWithResponse): Promise< + WithResponse + >; + ( + data: T, + extra: U, + lastArg: V, + options?: MethodOptionWithoutResponse + ): Promise; + ( + data: T, + extra: U, + lastArg: V, + callback: (data: WithResponse) => void, + options?: MethodOptionWithResponse + ): void; + ( + data: T, + extra: U, + lastArg: V, + callback: (data: R) => void, + options?: MethodOptionWithoutResponse + ): void; + } + + interface Config { + /** + * API Client Id + */ + clientId: string; + + /** + * API Client Api Key + */ + clientApiKey: string; + + /** + * API Base URL.The fault base value points to sandbox. + * Production is 'https://api.mangopay.com' + * + * @default "https://api.sandbox.mangopay.com" + */ + baseUrl?: string; + + /** + * Active debugging + * @default false + */ + debugMode?: boolean; + + /** + * Log function to be used for debug + * @default `console.log` + */ + logClass?(...args: any[]): void; + + /** + * Set the connection timeout limit(in milliseconds) + * @default 30000 + */ + connectionTimeout?: number; + + /** + * Set the response timeout limit(in milliseconds) + * @default 80000 + */ + responseTimeout?: number; + + /** + * API Version + * @default 'v2.01' + */ + apiVersion?: string; + + /** + * Set a custom error handler + * @default `console.error` + */ + errorHandler?(options: any, err: any): void; + } + + interface RequestOptions { + requestConfig: { + timeout: number; + }; + responseConfig: { + timeout: number; + }; + + /** + * Path options are replacing the ${placeholders} from apiMethods + */ + path: { + clientId: string; + apiVersion: string; + readonly id: string; + }; + headers: Partial; + } + + type WithToJson = T & { toJSON(): any }; + + // Determines the shape of the response + interface ReadResponseHeaders { + readResponseHeaders: true; + } + + interface PaginationOptions { + /** + * The page number of results you wish to return + * @default 1 + */ + Page?: number; + + /** + * The number of results to return per page: Max 100; + * @default 10 + */ + Per_Page?: number; + } + + interface FilterOptions extends Record { + /** + * The column to sort against and direction - only CreationDate (or Date for the events) is available and ASC or DESC for the direction + */ + Sort?: ColumnAndDirection; + + /** + * To return only resources that have CreationDate BEFORE this date + */ + BeforeDate?: Timestamp; + + /** + * To return only resources that have CreationDate AFTER this date + */ + AfterDate?: Timestamp; + } + + interface MethodOptions extends DeepPartial { + data?: WithToJson | string; + parameters?: FilterOptions & PaginationOptions; + } + + interface MethodOptionWithResponse extends MethodOptions { + readResponseHeaders: true; + } + + interface MethodOptionWithoutResponse extends MethodOptions { + readResponseHeaders?: false; + } + + interface DependsObject { + dependsPropertyName: string; + propertyName: string; + propertyValueMapping: Record; + } + + interface ModelMethods { + initialize(): void; + + /** + * Returns object property value + * @param attribute + */ + getData(attribute: K): T[K]; + + /** + * @param attribute - attribute's value to be set or hash of properties with values + * @param value - value to be set + */ + setData(attribute: K, value: T[K]): this; + setData(attribute: Partial): this; + + getReadOnlyProperties(): Array; + getDependsObjects(): DependsObject[]; + parse(): void; + } + + namespace models { + const PayInExecutionType: IPayInExecutionType; + const PayInPaymentType: IPayInPaymentType; + const MandateStatus: IMandateStatus; + const LegalPersonType: ILegalPersonType; + const PersonType: IPersonType; + const BankAccountType: IBankAccountType; + const DeclaredUboStatus: IDeclaredUboStatus; + const KycDocumentStatus: IKycDocumentStatus; + const KycDocumentType: IKycDocumentType; + const PayOutPaymentType: IPayOutPaymentType; + const PlatformType: IPlatformType; + const UboDeclarationRefusedReasonType: IUboDeclarationRefusedReasonType; + const UboDeclarationStatus: IUboDeclarationStatus; + const UboRefusedReasonType: IUboRefusedReasonType; + const UserNaturalCapacity: IUserNaturalCapacity; + class DeclaredUbo extends Model { + constructor(data: Partial); + } + + class Model implements ModelMethods { + initialize(): void; + getData(attribute: K): T[K]; + setData(attribute: K, value: T[K]): this; + setData(attribute: Partial): this; + setData(attribute: any, value?: any): this; + getReadOnlyProperties(): Array; + getDependsObjects(): DependsObject[]; + parse(): void; + constructor(data: T); + } + + class EntityBase extends Model { + initialize(): void; + + /** + * Returns object property value + */ + getData(attribute: K): T[K]; + + /** + * @param attribute - attribute's value to be set or hash of properties with values + * @param value - value to be set + */ + setData(attribute: K, value: T[K]): this; + setData(attribute: Partial): this; + + getReadOnlyProperties(): Array; + getDependsObjects(): DependsObject[]; + parse(): void; + toJSON(): any; + } + + class Money extends EntityBase { + constructor(data: MoneyData); + } + + class Billing extends EntityBase { + constructor(data: BillingData); + } + + class Address extends EntityBase { + constructor(data: Partial); + } + + interface Address extends address.AddressData {} + + class BankingAlias extends EntityBase { + constructor(data: Partial); + } + + class BankingAliasIBAN extends BankingAlias {} + + interface BankingAlias extends bankingAlias.IBANBankingAliasData {} + + class BankAccount extends EntityBase { + constructor(data: bankAccount.CreationDetails); + } + interface BankAccount extends bankAccount.DataIntersection {} + + class BankAccountDetails { + constructor(data: any); + } + + class BankAccountDetailsCA extends BankAccountDetails { + constructor(data: any); + } + + interface BankAccountDetailsCA extends bankAccount.CADetails {} + + class BankAccountDetailsOther extends BankAccountDetails { + constructor(data: any); + } + + interface BankAccountDetailsOther extends bankAccount.OtherDetails {} + + class BankAccountDetailsGB extends BankAccountDetails { + constructor(data: any); + } + + interface BankAccountDetailsGB extends bankAccount.GBDetails {} + + class BankAccountDetailsIBAN extends BankAccountDetails { + constructor(data: any); + } + + interface BankAccountDetailsIBAN extends bankAccount.IBANDetails {} + + class BankAccountDetailsUS extends BankAccountDetails { + constructor(data: any); + } + + interface BankAccountDetailsUS extends bankAccount.USDetails {} + + class Transaction extends EntityBase { + constructor(data: transaction.TransactionData); + } + + interface Transaction extends transaction.TransactionData {} + + class ClientWallet extends EntityBase {} + + class Wallet extends EntityBase { + constructor(data: wallet.CreateWallet | wallet.UpdateWallet); + } + + class DocumentPageConsult extends Model { + constructor(data: Partial); + } + + interface DocumentPageConsult extends disputeDocument.DocumentPageConsult {} + + class Document extends EntityBase { + constructor(data: any); + } + + class DisputeDocument extends Document {} + + interface DisputeDocument extends disputeDocument.DisputeDocumentData {} + + class DisputeDocumentPage extends EntityBase { + constructor(data: disputeDocument.CreateDisputeDocumentPage); + } + + interface DisputeDocumentPage + extends disputeDocument.CreateDisputeDocumentPage {} + + class KycDocument extends EntityBase { + constructor(data: Partial); + } + + interface KycDocument extends kycDocument.KycDocumentData {} + + class KycPage { + constructor(data: kycDocument.CreateKycPage); + } + + interface KycPage extends kycDocument.CreateKycPage {} + + class EMoney { + constructor(data: eMoney.EMoneyData); + } + + interface EMoney extends eMoney.EMoneyData {} + + class UboDeclaration extends EntityBase { + constructor( + data: + | uboDeclaration.CreateUboDeclaration + | uboDeclaration.UpdateUboDeclaration + ); + } + + interface UboDeclaration extends uboDeclaration.UboDeclarationData {} + + class CardRegistration extends EntityBase< + cardRegistration.CardRegistrationData + > { + constructor( + data: + | cardRegistration.CreateCardRegistration + | cardRegistration.UpdateCardRegistration + ); + } + + interface CardRegistration extends cardRegistration.CardRegistrationData {} + + class Card extends EntityBase { + constructor(data: card.CardData); + } + + interface Card extends card.CardData {} + + class CardPreAuthorization { + constructor( + data: + | cardPreAuthorization.CardPreAuthorizationData + | cardPreAuthorization.UpdateCardPreAuthorization + ); + } + + interface CardPreAuthorization + extends cardPreAuthorization.CardPreAuthorizationData {} + + class SecurityInfo extends EntityBase< + SecurityInfo & entityBase.EntityBaseData + > { + constructor(data: SecurityInfo); + } + + class UserLegal extends EntityBase { + PersonType: "LEGAL"; + constructor( + data: MakeKeysRequired< + Partial, + user.RequiredUserLegalData + > + ); + + /** + * Sets the person type for the model + * @param personType + */ + setPersonType(type: user.PersonType): void; + } + + interface UserLegal extends user.UserLegalData {} + + class UserNatural extends EntityBase { + PersonType: "NATURAL"; + constructor( + data: MakeKeysRequired< + Partial, + user.RequiredUserNaturalData + > + ); + + /** + * Sets the person type for the model + * @param personType + */ + setPersonType(type: user.PersonType): void; + } + + interface UserNatural extends user.UserNaturalData {} + + class User extends EntityBase { + constructor(data: user.UserData); + + /** + * Sets the person type for the model + * @param personType + */ + setPersonType(type: user.PersonType): void; + } + + interface User extends user.UserData {} + + class PayIn extends EntityBase { + constructor(data: any); + } + + interface PayIn extends payIn.BasePayInData {} + + class PayInPaymentDetails extends EntityBase { + constructor(data: any); + } + + class PayInExecutionDetails extends EntityBase { + constructor(data: any); + } + + class PayInExecutionDetailsDirect extends PayInExecutionDetails { + constructor(data: any); + } + + class PayInExecutionDetailsWeb extends PayInExecutionDetails { + constructor(data: any); + } + + class PayInPaymentDetailsBankWire extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsBankingAlias extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsCard extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsCardDirect extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsCardWeb extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsDirectDebitDirect extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsDirectDebitWeb extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsPayPal extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInPaymentDetailsPreAuthorized extends PayInPaymentDetails { + constructor(data: any); + } + + class PayInTemplateURLOptions extends EntityBase { + constructor(data: any); + } + + class Refund extends EntityBase { + constructor(data: refund.CreatePayInRefund | refund.CreateTransferRefund); + } + + class RefundReasonDetails extends EntityBase { + constructor(data: any); + } + + class Repudiation extends EntityBase { + constructor(data: Partial); + } + + interface Repudiation extends repudiation.RepudiationData {} + + class Client extends EntityBase { + constructor(data?: Partial); + } + + interface Client extends client.ClientData {} + + class PlatformCategorization extends EntityBase< + client.PlatformCategorization + > { + constructor(data: client.PlatformCategorization); + } + + class Dispute extends EntityBase { + constructor(data: Partial); + } + + interface Dispute extends dispute.DisputeData {} + + class DisputeReason extends Model { + constructor(data: any); + } + + class SettlementTransfer extends EntityBase< + settlementTransfer.SettlementTransferData + > { + constructor(data: Partial); + } + + interface SettlementTransfer + extends settlementTransfer.SettlementTransferData {} + + class Transfer extends EntityBase { + constructor(data: Partial); + } + + interface Transfer extends transfer.TransferData {} + + class PayOut extends EntityBase { + constructor(data: Partial); + } + // interface PayOut extends PayOut.PayoutData {} + + class PayOutPaymentDetails extends EntityBase { + constructor(data?: any); + } + + class PayOutPaymentDetailsBankWire extends PayOutPaymentDetails { + constructor(data?: any); + } + + class Mandate extends EntityBase { + constructor(data?: Partial); + } + + interface Mandate extends mandate.MandateData {} + + class Hook extends EntityBase { + constructor(data?: Partial); + } + + interface Hook extends hook.HookData {} + + class Report extends EntityBase { + constructor(data?: Partial); + } + + interface Report extends report.ReportData {} + + class ReportFilter extends Model { + constructor(data?: Partial); + } + + interface Report extends report.Filters {} + } + + interface IPayInExecutionType { + Direct: "DIRECT"; + Web: "WEB"; + } + + interface IPayInPaymentType { + BankWire: "BANK_WIRE"; + Card: "CARD"; + DirectDebit: "DIRECT_DEBIT"; + Preauthorized: "PREAUTHORIZED"; + PayPal: "PAYPAL"; + } + + interface IMandateStatus { + Created: "CREATED"; + Submitted: "SUBMITTED"; + Active: "ACTIVE"; + Failed: "FAILED"; + } + + interface ILegalPersonType { + NotSpecified: "NotSpecified"; + Business: "BUSINESS"; + Organization: "ORGANIZATION"; + Soletrader: "SOLETRADER"; + } + + interface IPersonType { + NotSpecified: "NotSpecified"; + Natural: "NATURAL"; + Legal: "LEGAL"; + } + + interface IBankAccountType { + NotSpecified: "NotSpecified"; + IBAN: "IBAN"; + GB: "GB"; + US: "US"; + CA: "CA"; + OTHER: "OTHER"; + } + + interface IDeclaredUboStatus { + Created: "CREATED"; + Validated: "VALIDATED"; + Refused: "REFUSED"; + } + + interface IKycDocumentStatus { + Created: "CREATED"; + ValidationAsked: "VALIDATION_ASKED"; + Validated: "VALIDATED"; + Refused: "REFUSED"; + } + + interface IKycDocumentType { + IdentityProof: "IDENTITY_PROOF"; + RegistrationProof: "REGISTRATION_PROOF"; + ArticlesOfAssociation: "ARTICLES_OF_ASSOCIATION"; + ShareholderDeclaration: "SHAREHOLDER_DECLARATION"; + AddressProof: "ADDRESS_PROOF"; + } + + interface IPayOutPaymentType { + BankWire: "BANK_WIRE"; + } + + interface IPlatformType { + NotSpecified: "NotSpecified"; + MARKETPLACE: "MARKETPLACE"; + P2P_PAYMENT: "P2P_PAYMENT"; + CROWDFUNDING_DONATION: "CROWDFUNDING_DONATION"; + CROWDFUNDING_REWARD: "CROWDFUNDING_REWARD"; + CROWDFUNDING_EQUITY: "CROWDFUNDING_EQUITY"; + CROWDFUNDING_LOAN: "CROWDFUNDING_LOAN"; + OTHER: "OTHER"; + } + + interface IUboDeclarationRefusedReasonType { + /** + * When at least one natural user is missing on the declaration + */ + MissingUbo: "MISSING_UBO"; + + /** + * When at least one natural user should not be declared as UBO + */ + InvalidDeclaredUbo: "INVALID_DECLARED_UBO"; + + /** + * When at least one natural user declared as UBO has been created + * with wrong details (i.e. date of birth, country of residence) + */ + InvalidUboDetails: "INVALID_UBO_DETAILS"; + } + + interface IUboDeclarationStatus { + /** + * When the UBO declaration was created + */ + Created: "CREATED"; + + /** + * When validation has been requested for the UBO declaration + */ + ValidationAsked: "VALIDATION_ASKED"; + + /** + * When the UBO declaration was validated + */ + Validated: "VALIDATED"; + + /** + * When the UBO declaration was refused + */ + Refused: "REFUSED"; + } + + interface IUboRefusedReasonType { + /** + * When user should not be declared as UBO + */ + InvalidDeclaredUbo: "INVALID_DECLARED_UBO"; + + /** + * When user declared as UBO was created with wrong + * details (i.e. date of birth, country of residence) + */ + InvalidUboDetails: "INVALID_UBO_DETAILS"; + } + + interface IUserNaturalCapacity { + /** + * Real customer + */ + Normal: "NORMAL"; + + /** + * User used only for declaration purpose + */ + Declarative: "DECLARATIVE"; + } + + namespace entityBase { + interface EntityBaseData { + Id: string; + Tag: string; + CreationDate: number; + } + } + + namespace address { + interface AddressData { + AddressLine1: string; + AddressLine2: string; + City: string; + Region: string; + PostalCode: string; + Country: string; + } + type AddressType = string | AddressData | models.Address; + } + + namespace bankingAlias { + type BankingAliasType = "IBAN"; + interface BankingAliasData extends entityBase.EntityBaseData { + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId: string; + + /** + * The ID of a wallet + */ + WalletId: string; + + /** + * The Country of the Address + */ + Country: CountryISO; + + /** + * The type of banking alias (note that only IBAN is available at present) + */ + Type: BankingAliasType; + + /** + * The owner of the wallet/banking alias + */ + OwnerName: string; + + /** + * Whether the banking alias is active or not + */ + Active: boolean; + } + + interface IBANBankingAliasData extends BankingAliasData { + /** + * The type of banking alias (note that only IBAN is available at present) + */ + Type: "IBAN"; + + /** + * The IBAN of the banking alias + */ + IBAN: string; + + /** + * The BIC of the banking alias + */ + BIC: string; + } + + interface CreateIBANBankingAlias + extends PickPartialRequired< + IBANBankingAliasData, + "Tag" | "CreditedUserId", + "OwnerName" | "Country" + > {} + } + + namespace bankAccount { + type BankAccountType = "IBAN" | "GB" | "US" | "CA" | "OTHER"; + type DepositAccountType = "CHECKING" | "SAVINGS"; + + interface BaseData extends entityBase.EntityBaseData { + /** + * The object owner's UserId + */ + UserId: string; + + /** + * The type of bank account + */ + Type: BankAccountType; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: address.AddressType; + + /** + * @deprecated + */ + Details?: models.BankAccountDetails; + + /** + * Whether the bank account is active or not + */ + Active: boolean; + } + + interface IBANDetails { + Type: "IBAN"; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: address.AddressType; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The IBAN of the bank account + */ + IBAN: string; + + /** + * The BIC of the bank account + */ + BIC?: string; + } + + type IBANData = BaseData & IBANDetails; + + interface USDetails { + Type: "US"; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: address.AddressType; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The account number of the bank account. US account numbers must be digits only. + */ + AccountNumber: string; + + /** + * The ABA of the bank account. Must be numbers only, and 9 digits long + */ + ABA: string; + + /** + * The type of account + */ + DepositAccountType?: DepositAccountType; + } + + type USData = BaseData & USDetails; + + interface CADetails { + Type: "CA"; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: address.AddressType; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The branch code of the bank where the bank account. Must be numbers only, and 5 digits long + */ + BranchCode: string; + + /** + * The institution number of the bank account. Must be numbers only, and 3 or 4 digits long + */ + InstitutionNumber: string; + + /** + * The account number of the bank account. Must be numbers only. Canadian account numbers must be a maximum of 20 digits. + */ + AccountNumber: string; + + /** + * The name of the bank where the account is held. Must be letters or numbers only and maximum 50 characters long. + */ + BankName: string; + } + + type CAData = BaseData & CADetails; + + interface GBDetails { + Type: "GB"; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: address.AddressType; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The sort code of the bank account. Must be numbers only, and 6 digits long + */ + SortCode: string; + + /** + * The account number of the bank account. Must be numbers only. GB account numbers must be 8 digits long. + */ + AccountNumber: string; + } + + type GBData = BaseData & GBDetails; + + interface OtherDetails { + Type: "OTHER"; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: address.AddressType; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The Country of the Address + */ + Country: string; + + /** + * The BIC of the bank account + */ + BIC: string; + + /** + * The account number of the bank account. Must be numbers only. Canadian account numbers must be a maximum of 20 digits. + */ + AccountNumber: string; + } + + type OtherData = BaseData & OtherDetails; + + type Data = OtherData | CAData | GBData | IBANData | USData; + type DataIntersection = OtherData & CAData & GBData & IBANData & USData; + type CreationDetails = + | OtherDetails + | CADetails + | GBDetails + | IBANDetails + | USDetails; + } + + namespace transaction { + type TransactionNature = + | "REGULAR" + | "REPUDIATION" + | "REFUND" + | "SETTLEMENT"; + type TransactionType = "PAYIN" | "TRANSFER" | "PAYOUT"; + type TransactionStatus = "CREATED" | "SUCCEEDED" | "FAILED"; + + interface TransactionData extends entityBase.EntityBaseData { + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Details about the funds that are being credited (DebitedFunds – Fees = CreditedFunds) + */ + CreditedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * The ID of the wallet that was debited + */ + DebitedWalletId: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId: string; + + /** + * The nature of the transaction + */ + Nature: TransactionNature; + + /** + * The status of the transaction + */ + Status: TransactionStatus; + + /** + * When the transaction happened + */ + ExecutionDate: Timestamp; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * The type of the transaction + */ + Type: TransactionType; + } + } + + namespace wallet { + type ClientFundsType = "FEES" | "CREDIT"; + type FundsType = "DEFAULT" | ClientFundsType; + + interface WalletData extends entityBase.EntityBaseData { + /** + * An array of userIDs of who own's the wallet. For now, you only can set up a unique owner. + */ + Owners: [string]; + + /** + * The current balance of the wallet + */ + Balance: MoneyData; + + /** + * The type of funds in the wallet + */ + FundsType: FundsType; + + /** + * A desciption of the wallet + */ + Description: string; + + /** + * The currency - should be ISO_4217 format + */ + Currency: CurrencyISO; + } + + interface ClientWalletData + extends Omit { + FundsType: ClientFundsType; + } + + type CreateWallet = UpdateWallet & + Pick; + type UpdateWallet = PickPartial; + } + + namespace disputeDocument { + type DisputeDocumentType = + | "DELIVERY_PROOF" + | "INVOICE" + | "REFUND_PROOF" + | "USER_CORRESPONDANCE" + | "USER_ACCEPTANCE_PROOF" + | "PRODUCT_REPLACEMENT_PROOF" + | "OTHER"; + + type DocumentStatus = + | "CREATED" + | "VALIDATION_ASKED" + | "VALIDATED" + | "REFUSED"; + + type RefusedReasonType = + | "DOCUMENT_UNREADABLE" + | "DOCUMENT_NOT_ACCEPTED" + | "DOCUMENT_HAS_EXPIRED" + | "DOCUMENT_INCOMPLETE" + | "DOCUMENT_MISSING" + | "SPECIFIC_CASE" + | "DOCUMENT_FALSIFIED" + | "OTHER"; + + interface DisputeDocumentData extends entityBase.EntityBaseData { + /** + * Gives the type of the KYC document + */ + Type: DisputeDocumentType; + + /** + * The object owner's UserId + */ + UserId: string; + + /** + * The Id of a Dispute + */ + DisputeId: string; + + /** + * The status of this KYC/Dispute document + */ + Status: DocumentStatus; + + /** + * The message accompanying a refusal + */ + RefusedReasonMessage: string; + + /** + * The type of reason for refusal + */ + RefusedReasonType: RefusedReasonType; + + /** + * The date when the document was processed by MANGOPAY + */ + ProcessedDate: Timestamp; + } + + interface CreateDisputeDocument { + /** + * Gives the type of the KYC document + */ + Type: DisputeDocumentType; + Tag?: string; + } + + interface SubmitDisputeDocument { + /** + * The status of this KYC/Dispute document + */ + Status: "VALIDATION_ASKED"; + Tag?: string; + } + + /** + * - Documents have to be in "CREATED" Status + * - You can create as many pages as needed + * + * Remember to change Status to "VALIDATION_ASKED" to submit KYC documents + * The maximum size per page is about 7Mb (or 10Mb when base64encoded). The following formats are accepted for the documents : .pdf, .jpeg, .jpg, .gif and .png. The minimum size is 1Kb. + */ + interface CreateDisputeDocumentPage { + /** + * The base64 encoded file which needs to be uploaded + * + * You need to fill in only the binary code. Do not send the first part that some converters add into the binary code which is + * `` + * + * e.g. + * ```json + * { + * "File": "/9j/4AAQSkZJRgABAQEBLAEsAAD/.../wgARCAAyADIDAREAAhEBAxEB/8QAGwAAAgMBAQEA" + * } + * ``` + */ + File: string; + } + + interface DocumentPageConsult { + /** + * URL where this document page can be viewed. + */ + Url: string; + + /** + * Time in millis when the page consult will expire. + */ + ExpirationDate: Timestamp; + } + } + + namespace kycDocument { + type KycDocumentType = + | "IDENTITY_PROOF" + | "REGISTRATION_PROOF" + | "ARTICLES_OF_ASSOCIATION" + | "SHAREHOLDER_DECLARATION" + | "ADDRESS_PROOF"; + type DocumentStatus = + | "CREATED" + | "VALIDATION_ASKED" + | "VALIDATED" + | "REFUSED"; + + type KYCDocumentRefusedReasonType = + | "DOCUMENT_UNREADABLE" + | "DOCUMENT_NOT_ACCEPTED" + | "DOCUMENT_HAS_EXPIRED" + | "DOCUMENT_INCOMPLETE" + | "DOCUMENT_MISSING" + | "DOCUMENT_DO_NOT_MATCH_USER_DATA" + | "DOCUMENT_DO_NOT_MATCH_ACCOUNT_DATA" + | "SPECIFIC_CASE" + | "DOCUMENT_FALSIFIED" + | "UNDERAGE_PERSON" + | "SPECIFIC_CASE"; + + interface KycDocumentData extends entityBase.EntityBaseData { + /** + * Gives the type of the KYC document + */ + Type: KycDocumentType; + + /** + * The object owner's UserId + */ + UserId: string; + + /** + * The status of this KYC/Dispute document + */ + Status: DocumentStatus; + + /** + * The message accompanying a refusal + */ + RefusedReasonMessage: string; + + /** + * The type of reason for refusal + */ + RefusedReasonType: KYCDocumentRefusedReasonType; + + /** + * The date when the document was processed by MANGOPAY + */ + ProcessedDate: Timestamp; + } + + interface CreateKycDocument { + /** + * Gives the type of the KYC document + */ + Type: KycDocumentType; + Tag?: string; + } + + interface CreateKycDocument { + /** + * Gives the type of the KYC document + */ + Type: KycDocumentType; + Tag?: string; + } + + interface SubmitKycDocument { + /** + * The status of this KYC/Dispute document + */ + Status: "VALIDATION_ASKED"; + Tag?: string; + } + + /** + * - Documents have to be in "CREATED" Status + * - You can create as many pages as needed + * + * Remember to change Status to "VALIDATION_ASKED" to submit KYC documents + * The maximum size per page is about 7Mb (or 10Mb when base64encoded). The following formats are accepted for the documents : .pdf, .jpeg, .jpg, .gif and .png. The minimum size is 1Kb. + */ + interface CreateKycPage { + /** + * The base64 encoded file which needs to be uploaded + * + * You need to fill in only the binary code. Do not send the first part that some converters add into the binary code which is + * `` + * + * e.g. + * ```json + * { + * "File": "/9j/4AAQSkZJRgABAQEBLAEsAAD/.../wgARCAAyADIDAREAAhEBAxEB/8QAGwAAAgMBAQEA" + * } + * ``` + */ + File: string; + } + } + + namespace eMoney { + interface EMoneyData extends entityBase.EntityBaseData { + /** + * The object owner's UserId + */ + UserId: string; + + /** + * The amount of money that has been credited to this user + */ + CreditedEMoney: MoneyData; + + /** + * The amount of money that has been debited from this user + */ + DebitedEMoney: MoneyData; + } + } + + namespace uboDeclaration { + interface UboDeclarationData extends entityBase.EntityBaseData { + /** + * The object owner's UserId + */ + UserId: string; + + /** + * Status of a UBO Declaration + */ + Status: kycDocument.DocumentStatus; + + /** + * Reason types for a UBO Declaration + */ + RefusedReasonTypes: string[]; + + /** + * Refused Reason Message for a UBO Declaration + */ + RefusedReasonMessage: string; + + /** + * An array of UserIDs declared as Ultimate Beneficial Owners of a BUSINESS Legal User. + */ + DeclaredUBOs: string[]; + } + + interface CreateUboDeclaration { + DeclaredUBOs?: string[]; + } + + interface UpdateUboDeclaration { + Id: string; + Tag?: string; + Status?: "VALIDATION_ASKED"; + + /** + * An array of UserIDs declared as Ultimate Beneficial Owners of a BUSINESS Legal User. + */ + DeclaredUBOs?: string[]; + } + } + + namespace cardRegistration { + interface CardRegistrationData extends entityBase.EntityBaseData { + /** + * The object owner's UserId + */ + UserId: string; + /** + * The currency - should be ISO_4217 format + */ + Currency: CurrencyISO; + + /** + * A special key to use when registering a card + */ + AccessKey: string; + + /** + * A specific value to pass to the CardRegistrationURL + */ + PreregistrationData: string; + + /** + * The URL to submit the card details form to + */ + CardRegistrationURL: string; + + /** + * Having registered a card, this confirmation hash needs to be updated to the card item + */ + RegistrationData: string; + + /** + * The type of card + */ + CardType: card.CardType; + + /** + * The ID of a card + */ + CardId: string; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * Status of the card registration + */ + Status: card.CardStatus; + } + + interface CreateCardRegistration + extends PickPartialRequired< + CardRegistrationData, + "CardType" | "Tag", + "UserId" | "Currency" + > {} + type UpdateCardRegistration = PickPartial< + CardRegistrationData, + "Tag" | "RegistrationData" + >; + } + + namespace card { + type CardType = + | "CB_VISA_MASTERCARD" + | "DINERS" + | "MASTERPASS" + | "MAESTRO" + | "P24" + | "IDEAL" + | "BCMC" + | "PAYLIB"; + type CardStatus = "CREATED" | "VALIDATED" | "ERROR"; + type CardValidity = "UNKNOWN" | "VALID" | "INVALID"; + + interface CardData extends entityBase.EntityBaseData { + /** + * The expiry date of the card - must be in format MMYY + */ + ExpirationDate: string; + + /** + * A partially obfuscated version of the credit card number + */ + Alias: string; + + /** + * The provider of the card + */ + CardProvider: string; + + /** + * The type of card + */ + CardType: CardType; + + /** + * The Country of the Address + */ + Country: string; + + /** + * The card product type - more info + */ + Product: string; + + /** + * The bank code + */ + BankCode: string; + + /** + * Whether the card is active or not + */ + Active: boolean; + + /** + * The currency - should be ISO_4217 format + */ + Currency: CurrencyISO; + + /** + * Whether the card is valid or not. Once they process (or attempt to process) a payment with the card we are able to indicate if it is "valid" or "invalid". + * If they didn’t process a payment yet the "Validity" stay at "unknown". + */ + Validity: CardValidity; + + /** + * A unique representation of a 16-digits card number + */ + Fingerprint: string; + } + + interface UpdateCard { + Id: string; + Active?: false; + } + } + + namespace cardPreAuthorization { + interface CardPreAuthorizationData extends entityBase.EntityBaseData { + /** + * A user's ID + */ + AuthorId: string; + + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Status of the PreAuthorization + */ + Status: PreAuthorizationStatus; + + /** + * The status of the payment after the PreAuthorization. You can pass the PaymentStatus from "WAITING" to "CANCELED" should you need/want to + */ + PaymentStatus: PaymentStatus; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * How the PreAuthorization has been executed + */ + ExecutionType: PreAuthorizationExecutionType; + + /** + * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. + * The field lets you activate it automatically with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects there is a higher risk ), + * "FORCE" (if you wish to specifically force the secured mode). + */ + SecureMode: SecureMode; + + /** + * The ID of a card + */ + CardId: string; + + /** + * The value is 'true' if the SecureMode was used + */ + SecureModeNeeded: boolean; + + /** + * This is the URL where to redirect users to proceed to 3D secure validation + */ + SecureModeRedirectUrl: string; + + /** + * This is the URL where users are automatically redirected after 3D secure validation (if activated) + */ + SecureModeReturnURL: string; + + /** + * The date when the payment is to be processed by + */ + ExpirationDate: Timestamp; + + /** + * The Id of the associated PayIn + */ + PayInId: string; + + /** + * Contains useful information related to the user billing + */ + Billing: BillingData; + + /** + * Contains useful information related to security and fraud + */ + SecurityInfo: SecurityInfoData; + } + + type CreateCardPreAuthorization = PickPartialRequired< + CardPreAuthorizationData, + "Tag" | "Billing" | "SecureMode", + "AuthorId" | "DebitedFunds" | "CardId" | "SecureModeReturnURL" + >; + type UpdateCardPreAuthorization = PickPartialRequired< + CardPreAuthorizationData, + "Tag", + "PaymentStatus" | "Id" + >; + } + + namespace hook { + type HookValidity = "UNKNOWN" | "VALID" | "INVALID"; + type HookStatus = "DISABLED" | "ENABLED"; + + interface HookData extends entityBase.EntityBaseData { + /** + * This is the URL where your receive notification for each EventType + */ + Url: string; + + /** + * Whether the hook is enabled or not + */ + Status: HookStatus; + + /** + * Whether the hook is valid or not + */ + Validity: HookValidity; + + /** + * The event type + */ + EventType: event.EventType; + } + + interface CreateHook + extends PickPartialRequired {} + + interface UpdateHook + extends PickPartialRequired< + HookData, + "EventType" | "Url" | "Tag", + "Id" + > {} + } + + namespace report { + interface Filters { + /** + * To return only resources that have CreationDate BEFORE this date + */ + BeforeDate: Timestamp; + + /** + * To return only resources that have CreationDate AFTER this date + */ + AfterDate: Timestamp; + + /** + * The type of the transaction + */ + Type: transaction.TransactionType[]; + + /** + * The status of the transaction + */ + Status: transaction.TransactionStatus[]; + + /** + * The nature of the transaction + */ + Nature: transaction.TransactionNature[]; + + /** + * The minimum amount of DebitedFunds + */ + MinDebitedFundsAmount: number; + + /** + * The currency for the minimum amount of DebitedFunds + */ + MinDebitedFundsCurrency: CurrencyISO; + + /** + * The maximum amount of DebitedFunds + */ + MaxDebitedFundsAmount: number; + + /** + * The currency for the maximum amount of DebitedFunds + */ + MaxDebitedFundsCurrency: CurrencyISO; + + /** + * The minimum amount of Fees + */ + MinFeesAmount: number; + + /** + * The currency for the minimum amount of Fees + */ + MinFeesCurrency: CurrencyISO; + + /** + * The maximum amount of Fees + */ + MaxFeesAmount: number; + + /** + * The currency for the maximum amount of Fees + */ + MaxFeesCurrency: CurrencyISO; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The ID of a wallet + */ + WalletId: string; + } + + type Column = + | "Alias" + | "AuthorId" + | "BankAccountId" + | "BankWireRef" + | "CardId" + | "CardType" + | "Country" + | "CreationDate" + | "CreditedFundsAmount" + | "CreditedFundsCurrency" + | "CreditedUserId" + | "CreditedWalletId" + | "Culture" + | "DebitedFundsAmount" + | "DebitedFundsCurrency" + | "DebitedWalletId" + | "DeclaredDebitedFundsAmount" + | "DeclaredDebitedFundsCurrency" + | "DeclaredFeesAmount" + | "DeclaredFeesCurrency" + | "ExecutionDate" + | "ExecutionType" + | "ExpirationDate" + | "FeesAmount" + | "FeesCurrency" + | "Id" + | "Nature" + | "PaymentType" + | "PreauthorizationId" + | "ResultCode" + | "ResultMessage" + | "Status" + | "Tag" + | "Type" + | "WireReference"; + + interface ReportData extends entityBase.EntityBaseData { + /** + * The date when the report was executed + */ + ReportDate: Timestamp; + + /** + * The URL to download the report + */ + DownloadURL: string; + + /** + * A URL that we will ping when the report is ready to download(works in a similar way to the hooks) + */ + CallbackURL: string; + + /** + * The format of the report download + */ + DownloadFormat: "CSV"; + + /** + * The type of report + */ + ReportType: "TRANSACTIONS"; + + /** + * The column to sort against and direction seperate by a `:` + */ + Sort: string; + + /** + * Whether the report should be limited to the first 10 lines(and therefore quicker to execute) + */ + Preview: boolean; + + /** + * An object of various filters for the report + */ + Filters: Filters; + + /** + * A list of columns / infos to show in the report + */ + Columns: Column[]; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + } + + interface CreateReport + extends PickPartial< + ReportData, + | "Tag" + | "CallbackURL" + | "DownloadFormat" + | "Sort" + | "Preview" + | "Filters" + | "Columns" + > {} + } + + namespace mandate { + /** + * - "CREATED" - the mandate has been created + * - "SUBMITTED" - the mandate has been submitted to the banks and you can now do payments with this mandate + * - "ACTIVE" - the mandate is active and has been accepted by the banks and/or successfully used in a payment + * - "FAILED" - the mandate has failed for a variety of reasons and is no longer available for payments + */ + type MandateStatus = ValueOf; + type MandateScheme = "SEPA" | "BACS"; + type MandateCultureCode = "EN" | "FR" | "NL" | "DE" | "ES" | "IT" | "PL"; + type MandateExecutionType = "WEB"; + type MandateType = "DIRECT_DEBIT"; + interface MandateData extends entityBase.EntityBaseData { + /** + * An ID of a Bank Account + */ + BankAccountId: string; + + /** + * The object owner's UserId + */ + UserId: string; + + /** + * The URL to redirect to after payment (whether successful or not) + */ + ReturnURL: string; + + /** + * The URL to redirect to user to for them to proceed with the payment + */ + RedirectURL: string; + + /** + * The URL to download the mandate + */ + DocumentURL: string; + + /** + * The language to use for the mandate confirmation page - needs to be the ISO code of the language + */ + Culture: MandateCultureCode; + + /** + * The type of mandate, but will only be completed once the mandate has been submitted + */ + Scheme: MandateScheme; + + /** + * The status of the mandate: + */ + Status: MandateStatus; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * The execution type for creating the mandate + */ + ExecutionType: MandateExecutionType; + + /** + * The type of Mandate + */ + MandateType: MandateType; + + /** + * The banking reference for this mandate + */ + BankReference: string; + } + + interface CreateMandate + extends PickPartialRequired< + MandateData, + "Tag", + "BankAccountId" | "Culture" | "ReturnURL" + > {} + } + + namespace user { + /** + * Should be only one of these values: + * 1 - for incomes <18K€), + * 2 - for incomes between 18 and 30K€, + * 3 - for incomes between 30 and 50K€, + * 4 - for incomes between 50 and 80K€, + * 5 - for incomes between 80 and 120K€, + * 6 - for incomes >120K€ + */ + type IncomeRange = 1 | 2 | 3 | 4 | 5 | 6; + type PersonType = "NATURAL" | "LEGAL"; + type KYCLevel = "LIGHT" | "REGULAR"; + type LegalPersonType = "BUSINESS" | "ORGANIZATION" | "SOLETRADER"; + type StaticKeys = + | "KYCLevel" + | "PersonType" + | "Id" + | "CreationDate" + | "ProofOfIdentity" + | "ProofOfAddress" + | "ProofOfRegistration" + | "LegalRepresentativeProofOfIdentity" + | "ShareholderDeclaration" + | "Statute"; + interface UserData extends entityBase.EntityBaseData { + /** + * Type of user + */ + PersonType: PersonType; + + /** + * The person's email address (not more than 12 consecutive numbers) - must be a valid email + */ + Email: string; + + /** + * KYC Level (LIGHT or REGULAR) + */ + KYCLevel: KYCLevel; + } + + interface UserLegalData extends UserData { + PersonType: "LEGAL"; + + /** + * The name of the legal user + */ + Name: string; + + /** + * Type for legal user. + */ + LegalPersonType: LegalPersonType; + + /** + * The address of the company’s headquarters + */ + HeadquartersAddress: address.AddressType; + + /** + * The first name of the company’s Legal representative person + */ + LegalRepresentativeFirstName: string; + + /** + * The last name of the company’s Legal representative person + */ + LegalRepresentativeLastName: string; + + /** + * The address of the company’s Legal representative person + */ + LegalRepresentativeAddress: address.AddressType; + + /** + * The email of the company’s Legal representative person - must be valid + */ + LegalRepresentativeEmail: string; + + /** + * The date of birth of the company’s Legal representative person - be careful to set the right timezone (should be UTC) to avoid 00h becoming 23h (and hence interpreted as the day before) + */ + LegalRepresentativeBirthday: Timestamp; + + /** + * The nationality of the company’s Legal representative person + */ + LegalRepresentativeNationality: CountryISO; + + /** + * The country of residence of the company’s Legal representative person + */ + LegalRepresentativeCountryOfResidence: CountryISO; + ProofOfIdentity: string | null; + + /** + * The business statute of the company + */ + Statute: string | null; + + /** + * A MANGOPAY reference to the validated document of the proof of registration of the company + */ + ProofOfRegistration: string | null; + + /** + * The shareholder declaration of the company + */ + ShareholderDeclaration: string | null; + + /** + * The official registered number of the business + */ + CompanyNumber: string; + } + + interface UserNaturalData extends UserData { + PersonType: "NATURAL"; + + /** + * The name of the user + */ + FirstName: string; + + /** + * The last name of the user + */ + LastName: string; + + /** + * The user address + */ + Address: string | address.AddressData; + + /** + * The date of birth of the user - be careful to set the right timezone (should be UTC) to avoid 00h becoming 23h (and hence interpreted as the day before) + */ + Birthday: Timestamp; + + /** + * The user’s nationality. ISO 3166-1 alpha-2 format is expected + */ + Nationality: CountryISO; + + /** + * The user’s country of residence. ISO 3166-1 alpha-2 format is expected + */ + CountryOfResidence: CountryISO; + + /** + * User’s occupation, ie. Work + */ + Occupation: string; + IncomeRange: IncomeRange; + + /** + * Maximum length is 255 characters + */ + ProofOfIdentity: string | null; + + /** + * Maximum length is 255 characters + */ + ProofOfAddress: string | null; + + /** + * The capacity of this user - for use with UBO declarations + */ + Capacity: "NORMAL" | "DECLARATIVE"; + } + + type RequiredUserLegalData = + | "LegalPersonType" + | "Name" + | "LegalRepresentativeBirthday" + | "LegalRepresentativeCountryOfResidence" + | "LegalRepresentativeNationality" + | "LegalRepresentativeFirstName" + | "LegalRepresentativeLastName" + | "Email"; + + type RequiredUserNaturalData = + | "FirstName" + | "LastName" + | "Birthday" + | "Nationality" + | "CountryOfResidence" + | "Email"; + + interface BaseUserLegalData + extends PickPartial< + UserLegalData, + | RequiredUserLegalData + | "CompanyNumber" + | "LegalRepresentativeEmail" + | "LegalRepresentativeAddress" + | "HeadquartersAddress" + | "Tag" + > { + PersonType: "LEGAL"; + } + + interface UpdateUserLegalData extends BaseUserLegalData { + Id: string; + } + + interface CreateUserLegalData + extends MakeKeysRequired< + BaseUserLegalData, + RequiredUserLegalData | "PersonType" + > {} + + interface BaseUserNaturalData + extends PickPartial< + UserNaturalData, + RequiredUserNaturalData | "Address" | "Occupation" | "IncomeRange" + > { + PersonType: "NATURAL"; + } + + interface UpdateUserNaturalData extends BaseUserNaturalData { + Id: string; + } + + interface CreateUserNaturalData + extends MakeKeysRequired< + BaseUserNaturalData, + RequiredUserNaturalData | "PersonType" + > {} + } + + namespace payIn { + type PayInPaymentType = ValueOf; + type PayInExecutionType = + | ValueOf + | "EXTERNAL_INSTRUCTION"; + + interface TemplateURLOptions { + Payline: string; + } + + interface BasePayInData extends entityBase.EntityBaseData { + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Details about the funds that are being credited (DebitedFunds – Fees = CreditedFunds) + */ + CreditedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * The ID of the wallet that was debited + */ + DebitedWalletId: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId: string; + + /** + * The nature of the transaction + */ + Nature: transaction.TransactionNature; + + /** + * The status of the transaction + */ + Status: transaction.TransactionStatus; + + /** + * When the transaction happened + */ + ExecutionDate: Timestamp; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * The type of the transaction + */ + Type: transaction.TransactionType; + + /** + * The type of payin + */ + PaymentType: PayInPaymentType; + + /** + * The type of execution for the payin + */ + ExecutionType: PayInExecutionType; + } + + interface CardWebPayInData extends BasePayInData { + ExecutionType: "WEB"; + PaymentType: "CARD"; + + /** + * The URL to redirect to after payment (whether successful or not) + */ + ReturnURL: string; + + /** + * The type of card + */ + CardType: card.CardType; + + /** + * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. The field lets you activate it + * automatically with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects there is a higher risk ), "FORCE" (if you wish to specifically force the secured mode). + */ + SecureMode: SecureMode; + + /** + * The language to use for the payment page - needs to be the ISO code of the language + */ + Culture: CountryISO; + + /** + * The URL to use for the payment page template + */ + TemplateURL: string; + + /** + * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric characters or spaces. + * See here for important info. Note that each bank handles this information differently, some show less or no information. + */ + StatementDescriptor: string; + + /** + * The URL to redirect to user to for them to proceed with the payment + */ + RedirectURL: string; + } + + interface CreateCardWebPayIn { + ExecutionType: "WEB"; + PaymentType: "CARD"; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId?: string; + + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * The URL to redirect to after payment (whether successful or not) + */ + ReturnURL: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * The type of card + */ + CardType: card.CardType; + + /** + * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. + * The field lets you activate it automatically with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects + * there is a higher risk ), "FORCE" (if you wish to specifically force the secured mode). + */ + SecureMode?: SecureMode; + + /** + * The language to use for the payment page - needs to be the ISO code of the language + */ + Culture: CountryISO; + + /** + * A URL to an SSL page to allow you to customise the payment page. Must be in the format: array("PAYLINE"=>"https://...") and meet all the + * specifications listed here. Note that only a template for Payline is currently available + */ + TemplateURLOptions?: TemplateURLOptions; + + /** + * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and + * can only include alphanumeric characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. + */ + StatementDescriptor?: string; + } + + interface CardDirectPayInData extends BasePayInData { + ExecutionType: "DIRECT"; + PaymentType: "CARD"; + + /** + * This is the URL where users are automatically redirected after 3D secure validation (if activated) + */ + SecureModeReturnURL: string; + + /** + * The ID of a card + */ + CardId: string; + + /** + * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. The field lets you activate it + * automatically with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects there is a higher risk ), "FORCE" (if you wish to specifically force the secured mode). + */ + SecureMode: SecureMode; + + /** + * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric + * characters or spaces. See here for important info. Note that each bank handles this information differently, some show less or no information. + */ + StatementDescriptor: string; + + /** + * Contains useful information related to the user billing + */ + Billing: BillingData; + + /** + * Contains information related to security and fraud + */ + SecurityInfo: SecurityInfoData; + + /** + * The value is 'true' if the SecureMode was used + */ + SecureModeNeeded: boolean; + + /** + * This is the URL where to redirect users to proceed to 3D secure validation + */ + SecureModeRedirectUrl: string; + } + + interface CreateCardDirectPayIn { + ExecutionType: "DIRECT"; + PaymentType: "CARD"; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId?: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * This is the URL where users are automatically redirected after 3D secure validation (if activated) + */ + SecureModeReturnURL: string; + + /** + * The ID of a card + */ + CardId: string; + + /** + * The SecureMode corresponds to '3D secure' for CB Visa and MasterCard. This field lets you activate it manually. The field lets you activate it automatically + * with "DEFAULT" (Secured Mode will be activated from €50 or when MANGOPAY detects there is a higher risk ), "FORCE" (if you wish to specifically force the secured mode). + */ + SecureMode?: SecureMode; + + /** + * Contains useful information related to the user billing + */ + Billing?: BillingData; + + /** + * A custom description to appear on the user's bank statement. It can be up to 10 characters long, and can only include alphanumeric characters or spaces. + * See here for important info. Note that each bank handles this information differently, some show less or no information. + */ + StatementDescriptor?: string; + } + + interface CardPreAuthorizedPayInData extends BasePayInData { + PreauthorizationId: string; + ExecutionType: "DIRECT"; + PaymentType: "PREAUTHORIZED"; + } + + interface CreateCardPreAuthorizedPayIn { + ExecutionType: "DIRECT"; + PaymentType: "PREAUTHORIZED"; + + /** + * Custom data that you can add to this item + */ + Tag?: string; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId?: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * The ID of the Preauthorization object + */ + PreauthorizationId: string; + } + + interface BankAccountData { + /** + * The BIC of the bank account + */ + BIC: string; + + /** + * The IBAN of the bank account + */ + IBAN: string; + + /** + * The name of the owner of the bank account + */ + OwnerName: string; + + /** + * The address of the owner of the bank account + */ + OwnerAddress: string; + + /** + * The type of bank account + */ + Type: ValueOf; + } + + interface BankWireDirectPayInData extends BasePayInData { + ExecutionType: "DIRECT"; + PaymentType: "BANK_WIRE"; + + /** + * The declared debited funds + */ + DeclaredDebitedFunds: MoneyData; + + /** + * The declared fees + */ + DeclaredFees: MoneyData; + + /** + * Wire reference + */ + WireReference: string; + + /** + * Bank account details + */ + BankAccount: BankAccountData; + } + + interface CreateBankWireDirectPayIn + extends PickPartialRequired< + BankWireDirectPayInData, + "Tag", + | "AuthorId" + | "CreditedUserId" + | "CreditedWalletId" + | "DeclaredDebitedFunds" + | "DeclaredFees" + > { + ExecutionType: "DIRECT"; + PaymentType: "BANK_WIRE"; + } + + type PayInData = + | CardDirectPayInData + | CardPreAuthorizedPayInData + | CardWebPayInData + | BankWireDirectPayInData; + } + + namespace refund { + type RefundReasonType = + | "INITIALIZED_BY_CLIENT" + | "BANKACCOUNT_INCORRECT" + | "OWNER_DO_NOT_MATCH_BANKACCOUNT" + | "BANKACCOUNT_HAS_BEEN_CLOSED" + | "WITHDRAWAL_IMPOSSIBLE_ON_SAVINGS_ACCOUNTS" + | "OTHER"; + interface RefundReason { + RefundReasonType: RefundReasonType; + } + + interface RefundData extends transaction.TransactionData { + /** + * The nature of the transaction + */ + Nature: "REFUND"; + + /** + * The initial transaction ID + */ + InitialTransactionId: string; + + /** + * The initial transaction type + */ + InitialTransactionType: transaction.TransactionType; + + /** + * Contains info about the reason for refund + */ + RefundReason: RefundReason; + } + + interface CreatePayInRefund { + AuthorId: string; + Tag?: string; + DebitedFunds?: MoneyData; + Fees?: MoneyData; + } + + interface CreateTransferRefund { + AuthorId: string; + Tag?: string; + } + } + + namespace repudiation { + interface RepudiationData extends transaction.TransactionData { + /** + * The nature of the transaction + */ + Nature: "REPUDIATION"; + + /** + * The initial transaction ID + */ + InitialTransactionId: string; + + /** + * The initial transaction type + */ + InitialTransactionType: transaction.TransactionType; + + /** + * Contains info about the reason for refund + */ + RefundReason: refund.RefundReason; + } + } + + namespace client { + type BusinessType = "MARKETPLACE" | "CROWDFUNDING" | "FRANCHISE" | "OTHER"; + type Sector = + | "RENTALS" + | "STORES_FASHION_ACCESSORIES_OBJECTS" + | "BEAUTY_COSMETICS_HEALTH" + | "FOOD_WINE_RESTAURANTS" + | "HOSPITALITY_TRAVEL_CORIDING" + | "ART_MUSIC_ENTERTAINMENT" + | "FURNITURE_GARDEN" + | "SERVICES_JOBBING_EDUCATION" + | "SPORT_RECREATION_ACTIVITIES" + | "TICKETING"; + type PlatformType = ValueOf; + + interface PlatformCategorization { + Sector: Sector; + BusinessType: BusinessType; + } + + interface ClientData extends entityBase.EntityBaseData { + /** + * The pretty name for the client + */ + Name: string; + + /** + * The registered name of your company + */ + RegisteredName: string; + + /** + * An ID for the client (i.e. url friendly, lowercase etc - sort of namespace identifier) + */ + ClientId: string; + + /** + * The primary branding colour to use for your merchant + */ + PrimaryThemeColour: string; + + /** + * The primary branding colour to use for buttons for your merchant + */ + PrimaryButtonColour: string; + + /** + * The URL of the logo of your client + */ + Logo: string; + + /** + * A list of email addresses to use when contacting you for technical issues/communications + */ + TechEmails: string[]; + + /** + * A list of email addresses to use when contacting you for admin/commercial issues/communications + */ + AdminEmails: string[]; + + /** + * A list of email addresses to use when contacting you for fraud/compliance issues/communications + */ + FraudEmails: string[]; + + /** + * A list of email addresses to use when contacting you for billing issues/communications + */ + BillingEmails: string[]; + + /** + * The Categorization of your platform, in terms of Business Type and Sector + */ + PlatformCategorization: PlatformCategorization; + + /** + * A description of what your platform does + */ + PlatformDescription: string; + + /** + * The URL for your website + */ + PlatformURL: string; + + /** + * The address of the company’s headquarters + */ + HeadquartersAddress: address.AddressType; + + /** + * The tax (or VAT) number for your company + */ + TaxNumber: string; + + /** + * Your unique MANGOPAY reference which you should use when contacting us + */ + CompanyReference: string; + } + + interface UpdateClient { + /** + * The primary branding colour to use for buttons for your merchant + */ + PrimaryButtonColour?: string; + + /** + * The primary branding colour to use for your merchant + */ + PrimaryThemeColour?: string; + + /** + * A list of email addresses to use when contacting you for admin/commercial issues/communications + */ + AdminEmails?: string[]; + + /** + * A list of email addresses to use when contacting you for technical issues/communications + */ + TechEmails?: string[]; + + /** + * A list of email addresses to use when contacting you for billing issues/communications + */ + BillingEmails?: string[]; + + /** + * A list of email addresses to use when contacting you for fraud/compliance issues/communications + */ + FraudEmails?: string[]; + + /** + * The address of the company’s headquarters + */ + HeadquartersAddress?: address.AddressType; + + /** + * The tax (or VAT) number for your company + */ + TaxNumber?: string; + + /** + * The type of platform + */ + PlatformType?: PlatformType; + + /** + * A description of what your platform does + */ + PlatformDescription?: string; + + /** + * The URL for your website + */ + PlatformURL?: string; + } + + interface UpdateClientLogo { + /** + * The base64 encoded file which needs to be uploaded + */ + File: string; + } + } + + namespace event { + type EventType = + | "PAYIN_NORMAL_CREATED" + | "PAYIN_NORMAL_SUCCEEDED" + | "PAYIN_NORMAL_FAILED" + | "PAYOUT_NORMAL_CREATED" + | "PAYOUT_NORMAL_SUCCEEDED" + | "PAYOUT_NORMAL_FAILED" + | "TRANSFER_NORMAL_CREATED" + | "TRANSFER_NORMAL_SUCCEEDED" + | "TRANSFER_NORMAL_FAILED" + | "PAYIN_REFUND_CREATED" + | "PAYIN_REFUND_SUCCEEDED" + | "PAYIN_REFUND_FAILED" + | "PAYOUT_REFUND_CREATED" + | "PAYOUT_REFUND_SUCCEEDED" + | "PAYOUT_REFUND_FAILED" + | "TRANSFER_REFUND_CREATED" + | "TRANSFER_REFUND_SUCCEEDED" + | "TRANSFER_REFUND_FAILED" + | "KYC_CREATED" + | "KYC_VALIDATION_ASKED" + | "KYC_SUCCEEDED" + | "KYC_FAILED" + | "PAYIN_REPUDIATION_CREATED" + | "PAYIN_REPUDIATION_SUCCEEDED" + | "PAYIN_REPUDIATION_FAILED" + | "DISPUTE_DOCUMENT_CREATED" + | "DISPUTE_DOCUMENT_VALIDATION_ASKED" + | "DISPUTE_DOCUMENT_SUCCEEDED" + | "DISPUTE_DOCUMENT_FAILED" + | "DISPUTE_CREATED" + | "DISPUTE_SUBMITTED" + | "DISPUTE_ACTION_REQUIRED" + | "DISPUTE_FURTHER_ACTION_REQUIRED" + | "DISPUTE_CLOSED" + | "DISPUTE_SENT_TO_BANK" + | "TRANSFER_SETTLEMENT_CREATED" + | "TRANSFER_SETTLEMENT_SUCCEEDED" + | "TRANSFER_SETTLEMENT_FAILED" + | "MANDATE_CREATED" + | "MANDATE_FAILED" + | "MANDATE_ACTIVATED" + | "MANDATE_SUBMITTED" + | "PREAUTHORIZATION_PAYMENT_WAITING" + | "PREAUTHORIZATION_PAYMENT_EXPIRED" + | "PREAUTHORIZATION_PAYMENT_CANCELED" + | "PREAUTHORIZATION_PAYMENT_VALIDATED" + | "UBO_DECLARATION_CREATED" + | "UBO_DECLARATION_VALIDATION_ASKED" + | "UBO_DECLARATION_REFUSED" + | "UBO_DECLARATION_VALIDATED"; + + interface EventData { + /** + * The ID of whatever the event is + */ + ResourceId: string; + + /** + * When the event happened + */ + Date: Timestamp; + + /** + * The event type + */ + EventType: EventType; + } + } + + namespace dispute { + type DisputeReasonType = + | "DUPLICATE" + | "FRAUD" + | "PRODUCT_UNACCEPTABLE" + | "UNKNOWN" + | "OTHER" + | "REFUND_CONVERSION_RATE" + | "LATE_FAILURE_INSUFFICIENT_FUNDS" + | "LATE_FAILURE_CONTACT_USER" + | "LATE_FAILURE_BANKACCOUNT_CLOSED" + | "LATE_FAILURE_BANKACCOUNT_INCOMPATIBLE" + | "LATE_FAILURE_BANKACCOUNT_INCORRECT" + | "AUTHORISATION_DISPUTED" + | "TRANSACTION_NOT_RECOGNIZED" + | "PRODUCT_NOT_PROVIDED" + | "CANCELED_REOCCURING_TRANSACTION" + | "REFUND_NOT_PROCESSED"; + + type DisputeStatus = + | "CREATED" + | "PENDING_CLIENT_ACTION" + | "SUBMITTED" + | "PENDING_BANK_ACTION" + | "REOPENED_PENDING_CLIENT_ACTION" + | "CLOSED"; + + type DisputeType = "CONTESTABLE" | "NOT_CONTESTABLE" | "RETRIEVAL"; + + interface DisputeReason { + DisputeReasonType: DisputeReasonType; + DisputeReasonMessage: string; + } + + interface DisputeData extends entityBase.EntityBaseData { + /** + * The initial transaction ID + */ + InitialTransactionId: string; + + /** + * The initial transaction type + */ + InitialTransactionType: transaction.TransactionType; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * Info about the reason for the dispute + */ + DisputeReason: DisputeReason; + + /** + * The status of the dispute + */ + Status: DisputeStatus; + + /** + * Used to communicate information about the dispute status to you + */ + StatusMessage: string; + + /** + * The amount of funds that were disputed + */ + DisputedFunds: MoneyData; + + /** + * The amount you wish to contest + */ + ContestedFunds: MoneyData; + + /** + * The type of dispute + */ + DisputeType: DisputeType; + + /** + * The deadline by which you must contest the dispute (if you wish to contest it) + */ + ContestDeadlineDate: Timestamp; + + /** + * The ID of the associated repudiation transaction + */ + RepudiationId: string; + } + + interface SubmitDispute + extends PickPartial {} + + interface UpdateDispute extends PickPartial {} + } + + interface DisputeReason extends dispute.DisputeReason {} + + namespace settlementTransfer { + interface SettlementTransferData extends transaction.TransactionData { + /** + * The nature of the transaction + */ + Nature: "SETTLEMENT"; + + /** + * The ID of the associated repudiation transaction + */ + RepudiationId: string; + + /** + * The initial transaction ID + */ + InitialTransactionId: string; + + /** + * The initial transaction type + */ + InitialTransactionType: transaction.TransactionType; + + /** + * Contains info about the reason for refund + */ + RefundReason: refund.RefundReason; + } + + interface CreateSettlementTransfer + extends PickPartialRequired< + SettlementTransferData, + "Tag", + "AuthorId" | "DebitedFunds" | "Fees" + > {} + } + + namespace transfer { + interface TransferData extends entityBase.EntityBaseData { + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Details about the funds that are being credited (DebitedFunds – Fees = CreditedFunds) + */ + CreditedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * The ID of the wallet that was debited + */ + DebitedWalletId: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId: string; + + /** + * The nature of the transaction + */ + Nature: transaction.TransactionNature; + + /** + * The status of the transaction + */ + Status: transaction.TransactionStatus; + + /** + * When the transaction happened + */ + ExecutionDate: Timestamp; + + /** + * The result code + */ + ResultCode: string; + + /** + * A verbal explanation of the ResultCode + */ + ResultMessage: string; + + /** + * The type of the transaction + */ + Type: "TRANSFER"; + } + + interface CreateTransfer { + /** + * Custom data that you can add to this item + */ + Tag?: string; + + /** + * A user's ID + */ + AuthorId: string; + + /** + * The user ID who is credited (defaults to the owner of the wallet) + */ + CreditedUserId?: string; + + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * The ID of the wallet that was debited + */ + DebitedWalletId: string; + + /** + * The ID of the wallet where money will be credited + */ + CreditedWalletId: string; + } + } + + namespace PayOut { + interface PayOutData extends Omit { + /** + * The type of the transaction + */ + Type: "PAYOUT"; + + PaymentType: IPayOutPaymentType["BankWire"]; + + /** + * An ID of a Bank Account + */ + BankAccountId: string; + + /** + * A custom reference you wish to appear on the user’s bank statement (your Client Name is already shown). This reference can contain max 12 characters + */ + BankWireRef: string; + } + + interface CreatePayOut { + /** + * A user's ID + */ + AuthorId: string; + + /** + * Information about the funds that are being debited + */ + DebitedFunds: MoneyData; + + /** + * Information about the fees that were taken by the client for this transaction (and were hence transferred to the Client's platform wallet) + */ + Fees: MoneyData; + + /** + * An ID of a Bank Account + */ + BankAccountId: string; + + /** + * The ID of the wallet that was debited + */ + DebitedWalletId: string; + + /** + * A custom reference you wish to appear on the user’s bank statement (your Client Name is already shown). This reference can contain max 12 characters + */ + BankWireRef?: string; + Tag?: string; + } + } + + class Users { + /** + * Create a new user + * @param user + */ + create: MethodOverload & + MethodOverload; + + /** + * Update a user + * @param user + * @param options + */ + update: MethodOverload< + models.UserLegal | user.UpdateUserLegalData, + user.UserLegalData + > & + MethodOverload< + models.UserNatural | user.UpdateUserNaturalData, + user.UserNaturalData + >; + + /** + * Get natural or legal user by ID + * @param userId + * @param options + */ + get: MethodOverload; + + /** + * Get natural user by ID + * @param userId + * @param options + */ + getNatural: MethodOverload; + + /** + * Get legal user by ID + * @param userId + * @param options + */ + getLegal: MethodOverload; + + /** + * Get all users + */ + getAll: NoArgMethodOverload< + Array + >; + + /** + * Create bank account for user + * @param userId + * @param bankAccount + * @param options + */ + createBankAccount: TwoArgsMethodOverload< + string, + bankAccount.USDetails, + bankAccount.USData + > & + TwoArgsMethodOverload< + string, + bankAccount.OtherDetails, + bankAccount.OtherData + > & + TwoArgsMethodOverload< + string, + bankAccount.IBANDetails, + bankAccount.IBANData + > & + TwoArgsMethodOverload & + TwoArgsMethodOverload; + + /** + * Deactivate a bank account + * + * Note that once deactivated, a bank account can't be reactivated afterwards + * @param userId + * @param bankAccountId + * @param options + */ + deactivateBankAccount: TwoArgsMethodOverload; + + /** + * Get all bank accounts for user + * @param userId + * @param options + */ + getBankAccounts: MethodOverload; + + /** + * Get all bank accounts for user + * @param userId + * @param bankAccountId + * @param options + */ + getBankAccount: TwoArgsMethodOverload; + + /** + * Get all wallets accounts for user + */ + getWallets: MethodOverload; + + /** + * Get all transactions for user + * @param userId + * @param options + */ + getTransactions: MethodOverload; + + /** + * Get all cards for user + * @param userId + * @param options + */ + getCards: MethodOverload; + + /** + * Create new KYC document + * @param userId + * @param kycDocument + * @param options + */ + createKycDocument: TwoArgsMethodOverload< + string, + kycDocument.CreateKycDocument, + kycDocument.KycDocumentData + >; + + /** + * Get all KYC documents for user + * @param userId + * @param options + */ + getKycDocuments: MethodOverload; + + /** + * Get KYC document + * @param userId + * @param kycDocumentId + * @param options + */ + getKycDocument: TwoArgsMethodOverload< + string, + string, + kycDocument.KycDocumentData + >; + + /** + * Update status of KYC Document (Currently only allows for submitting the document) + * @param userId + * @param kycDocument + * @param options + */ + updateKycDocument: TwoArgsMethodOverload< + string, + kycDocument.SubmitKycDocument, + kycDocument.KycDocumentData + >; + + /** + * Create page for KYC document + * @param userId + * @param kycDocumentId + * @param kycPage + * @param options + */ + createKycPage: ThreeArgsMethodOverload< + string, + string, + kycDocument.CreateKycPage, + kycDocument.KycDocumentData + >; + + /** + * Create page for KYC document + * @param userId + * @param kycDocumentId + * @param filePath + * @param options + */ + createKycPageFromFile: ThreeArgsMethodOverload< + string, + string, + string, + kycDocument.KycDocumentData + >; + + /** + * Get users's EMoney + * @param userId + * @param options + */ + getEMoney: MethodOverload; + + /** + * Create an UboDeclaration for the user + * @param userId + * @param uboDeclaration + * @param options + */ + createUboDeclaration: TwoArgsMethodOverload< + string, + uboDeclaration.CreateUboDeclaration, + uboDeclaration.UboDeclarationData + >; + + /** + * Get all user preauthorizations + * @param userId + * @param options + */ + getPreAuthorizations: MethodOverload< + string, + cardPreAuthorization.CardPreAuthorizationData[] + >; + } + + /** + * You need to create document in order to upload pages on this document. + * + * 1. The KYC Document Object is a request to validate a required document. There is one request for one Type of document + * 2. Upload a file through a Page. A document should get several pages + * 3. Edit the object Document and set the Status field to "VALIDATION_ASKED" (instead of "CREATED") + * 4. The demand is received by our team. The object is waiting for a "VALIDATED" status + * + * Note that you are not allowed to store KYC documents on your side unless you have permission from the approriate authorities in your country + */ + class KycDocuments { + /** + * Get all KycDocuments + * @param options + */ + getAll: NoArgMethodOverload; + + /** + * Get KycDocument + * @param kycDocumentId + * @param options + */ + get: MethodOverload; + + /** + * Creates temporary URLs where each page of a KYC document can be viewed. + * @param documentId + */ + createKycDocumentConsult: MethodOverload< + string, + any // Unsure of data structure from docs + >; + } + + /** + * An UBO Declaration is an electronic version of the previous KYC document "Shareholder Declaration", in order to declare all the Ultimate Beneficial Owners of a BUSINESS-typed legal User + * (ie the shareholders with >25% of capital or voting rights). + * + * 1. Create each Ultimate Beneficial Owner as a Natural User, who must have a "DECLARATIVE" Capacity. + * 2. Create a new UBO Declaration for your legal user, and link every Ultimate Beneficial Owners created previously thanks to DeclaredUBOs. + * - This list can be empty if your legal user has no Ultimate Beneficial Owner, or no eligible one (ie. no Ultimate Beneficial Owner that owns more than 25% of this company). + * 3. Edit the UBODeclaration object and set the Status field to "VALIDATION_ASKED" (instead of "CREATED") + * 4. The demand is received by our team and once processed, it will either get a "VALIDATED" status, or "REFUSED" with more information provided in the RefusedReasonTypes parameter + * + * Note that UBO declarations are not yet a requirement for your user to be KYC verified and are optional at this stage + */ + class UboDeclarations { + /** + * Retrieves a UBO declaration object from the API. + * @param id + * @param options + */ + get: MethodOverload; + + /** + * Updates a UBO declaration entity. + * @param uboDeclaration Updated UBO declaration entity - must have ID + * @param options + */ + update: MethodOverload< + uboDeclaration.UpdateUboDeclaration, + uboDeclaration.UboDeclarationData + >; + } + + class BankAccounts { + /** + * Retrieve list of transactions for a bank account + * @param bankAccountId + * @param options + */ + getTransactions: MethodOverload; + } + + class Wallets { + /** + * Create new wallet + * @param wallet + * @param options + */ + create: MethodOverload< + wallet.CreateWallet | models.Wallet, + wallet.WalletData + >; + + /** + * Update wallet + * @param wallet + * @param options + */ + update: MethodOverload< + wallet.UpdateWallet | models.Wallet, + wallet.WalletData + >; + + /** + * Get a specific wallet + * @param walletId + */ + get: MethodOverload; + + /** + * Get transactions for the wallet + * @param walletId + * @param options + */ + getTransactions: MethodOverload; + } + + class Cards { + /** + * Get card + * @param cardId + * @param ptions + */ + get: MethodOverload; + + /** + * Gets a list of cards having the same fingerprint. + * The fingerprint is a hash uniquely generated per 16-digit card number. + * + * @param fingerprint The fingerprint hash + */ + getByFingerprint: MethodOverload; + + /** + * Update card (currently only supports deactivation) + * @param card + * @param options + */ + update: MethodOverload; + + /** + * Get list of Transactions of a Card + * @param cardId + * @param options + */ + getTransactions: MethodOverload; + + /** + * Gets list of PreAuthorizations of a Card. + * @param cardId + * @param options + */ + getPreAuthorizations: MethodOverload< + string, + cardPreAuthorization.CardPreAuthorizationData[] + >; + } + + /** + * You need to register a card in order to process a Direct PayIn. Card registration enables you to tokenize a Card. These are the steps to follow: + * + * 1. Create a CardRegistration Object + * 2. Get a PreRegistrationData + * 3. The user posts PreRegistrationData, AccessKey and card details through a form (PHP & JS samples) to the CardRegistrationURL (5. in the diagram) + * 4. Get a RegistrationData back + * 5. Edit the CardRegistration Object (POST method) with the RegistrationData just received + * 6. Get the CardId ready to use into the Direct PayIn Object + * + * - If you don’t want to save the card you must change the field ACTIVE in the card object to false + */ + class CardRegistrations { + /** + * Create new card registration + * @param cardRegistration + * @param options + */ + create: MethodOverload< + cardRegistration.CreateCardRegistration, + cardRegistration.CardRegistrationData + >; + + /** + * Create new card registration + * @param cardRegistrationId + * @param options + */ + get: MethodOverload; + + /** + * Update card registration + * @param cardRegistration + */ + update: MethodOverload< + cardRegistration.UpdateCardRegistration, + cardRegistration.CardRegistrationData + >; + } + + /** + * The PreAuthorization Object ensures the solvency of a registered card for 7 days. The overall process is as follows: + * + * 1. Register a card (CardRegistration) + * 2. Create a PreAuthorization with the CardId. This allows you to charge an amount on a card + * 3. Charge the card through the PreAuthorized PayIn object (Payins/preauthorized/direct) + * + * How does PreAuthorization work? + * - Once the PreAuthorization object is created the Status is "CREATED" until 3D secure validation. + * - If the authorization is successful the status is "SUCCEEDED" if it failed the status is "FAILED". + * - Once Status = "SUCCEEDED" and PaymentStatus = "WAITING" you can charge the card. + * - The Pay-In amount has to be less than or equal to the amount authorized. + */ + class CardPreAuthorizations { + /** + * Create new pre-authorization + * @param cardPreAuthorization + * @param options + */ + create: MethodOverload< + cardPreAuthorization.CreateCardPreAuthorization, + cardPreAuthorization.CardPreAuthorizationData + >; + + /** + * Get data for Card pre-authorization + * @param cardPreAuthorizationId + * @param options + */ + get: MethodOverload; + + /** + * Update pre-authorization object (currently only supports cancellation) + * @param cardPreAuthorization + */ + update: MethodOverload< + cardPreAuthorization.UpdateCardPreAuthorization, + cardPreAuthorization.CardPreAuthorizationData + >; + } + + class PayIns { + /** + * Create new pay-in + * @param payIn + * @param options + */ + create: MethodOverload< + payIn.CreateCardDirectPayIn, + payIn.CardDirectPayInData + > & + MethodOverload< + payIn.CreateCardPreAuthorizedPayIn, + payIn.CardPreAuthorizedPayInData + > & + MethodOverload & + MethodOverload< + payIn.CreateBankWireDirectPayIn, + payIn.BankWireDirectPayInData + >; + + /** + * Get pay-in + * @param payInId + * @param options + */ + get: MethodOverload; + + /** + * Create refund for pay-in object + * @param payInId + * @param refundData + * @param options + */ + createRefund: TwoArgsMethodOverload< + string, + refund.CreatePayInRefund, + refund.RefundData + >; + + /** + * Gets list of Refunds for a PayIn + * @param payInId + * @param options + */ + getRefunds: MethodOverload; + } + + class Refunds { + /** + * Get events + * @param refundId + * @param options + */ + get: MethodOverload; + } + + class Clients { + /** + * Get the client + */ + get: NoArgMethodOverload; + + /** + * Update the client + * @param client + * @param options + */ + update: MethodOverload; + + /** + * Upload client logo from base64 image string + * @param base64Logo + * @param options + */ + uploadLogo: MethodOverload; + + /** + * Upload client logo from file path + * @param filePath + * @param options + */ + uploadLogoFromFile: MethodOverload; + + /** + * Get all client wallets + * @param options + */ + getClientWallets: NoArgMethodOverload; + + /** + * Get a client wallet + * @param fundsType + * @param currency + * @param options + */ + getClientWallet: TwoArgsMethodOverload< + wallet.ClientFundsType, + CurrencyISO, + wallet.ClientWalletData + >; + + /** + * Get client wallets by the type of funds + * @param fundsType + * @param options + */ + getClientWalletsByFundsType: MethodOverload< + wallet.ClientFundsType, + wallet.ClientWalletData[] + >; + + /** + * Get a client wallet's transactions + * @param fundsType + * @param currency + * @param options + */ + getClientWalletTransactions: TwoArgsMethodOverload< + wallet.ClientFundsType, + CurrencyISO, + transaction.TransactionData[] + >; + } + + class PayOuts { + /** + * Create new pay-out + * @param payOut + * @param options + */ + create: MethodOverload; + + /** + * Get payout + * @param payOutId + * @param options + */ + get: MethodOverload; + + /** + * Gets list of Refunds of a PayOut + * @param payOutId + * @param options + */ + getRefunds: MethodOverload; + } + + class Transfers { + /** + * Create new transfer + * @param transfer + * @param options + */ + create: MethodOverload; + + /** + * Get transfer + * @param transferId + * @param options + */ + get: MethodOverload; + + /** + * Create refund for transfer object + * @param transferId + * @param refund + * @param options + */ + createRefund: TwoArgsMethodOverload< + string, + refund.CreateTransferRefund, + refund.RefundData + >; + + /** + * Gets list of Refunds of a Transfer + * @param transferId + * @param options + */ + getRefunds: MethodOverload; + } + + class BankingAliases { + /** + * Create a banking alias + * @param bankingAlias + * @param options + */ + create: MethodOverload< + bankingAlias.CreateIBANBankingAlias, + bankingAlias.IBANBankingAliasData + >; + + /** + * Get a banking alias + * @param bankingAliasId + * @param options + */ + get: MethodOverload; + + /** + * Get all banking aliases + * @param options + */ + getAll: NoArgMethodOverload; + + /** + * Update banking alias + * @param bankingAliasId + * @param options + */ + update: MethodOverload< + Partial>, + bankingAlias.IBANBankingAliasData + >; + + /** + * Deactivate banking alias + * @param bankingAliasId + * @param options + */ + deactivate: MethodOverload; + + /** + * Activate banking alias + * @param bankingAliasId + * @param options + */ + activate: MethodOverload; + } + + class DisputeDocuments { + /** + * Get all KycDocuments + * @param options + */ + getAll: NoArgMethodOverload; + + /** + * Get KycDocument + * @param documentId + * @param options + */ + get: MethodOverload; + + /** + * Creates temporary URLs where each page of a KYC document can be viewed. + * @param documentId + */ + createDisputeDocumentConsult: MethodOverload< + string, + any // Unsure of data structure from docs + >; + } + + class Repudiations { + /** + * Gets list of Refunds of a Repudiation + * @param repudiationId + * @param options + */ + getRefunds: MethodOverload; + } + + class Disputes { + /** + * Get dispute + * @param disputeId + * @param options + */ + get: MethodOverload; + + /** + * Get all disputes + * @param options + */ + getAll: NoArgMethodOverload; + + /** + * Update dispute's tag + * @param dispute + * @param options + */ + update: MethodOverload; + + /** + * Contest dispute + * @param disputeId + * @param contestedFunds + * @param options + */ + contestDispute: TwoArgsMethodOverload< + string, + MoneyData, + dispute.DisputeData + >; + + /** + * This method is used to resubmit a Dispute if it is reopened requiring more docs + * @param disputeId + * @param options + */ + resubmitDispute: MethodOverload; + + /** + * Close dispute + * @param disputeId + * @param options + */ + closeDispute: MethodOverload; + + /** + * Gets dispute's transactions + * @param disputeId + * @param options + */ + getTransactions: MethodOverload; + + /** + * Gets dispute's documents for wallet + * @param walletId + * @param options + */ + getDisputesForWallet: MethodOverload; + + /** + * Gets user's disputes + * @param userId + * @param options + */ + getDisputesForUser: MethodOverload; + + /** + * Gets repudiation + * @param repudiationId + * @param options + */ + getRepudiation: MethodOverload; + + /** + * Creates settlement transfer + * @param settlementTransfer + * @param repudiationId + * @param options + */ + createSettlementTransfer: TwoArgsMethodOverload< + settlementTransfer.CreateSettlementTransfer, + string, + settlementTransfer.SettlementTransferData + >; + + /** + * Gets settlement transfer + * @param settlementTransferId + * @param options + */ + getSettlementTransfer: MethodOverload< + string, + settlementTransfer.SettlementTransferData + >; + + /** + * Gets documents for dispute + * @param disputeId + * @param options + */ + getDocumentsForDispute: MethodOverload< + string, + disputeDocument.DisputeDocumentData[] + >; + + /** + * Update dispute document + * @param disputeId + * @param disputeDocument + * @param options + */ + updateDisputeDocument: TwoArgsMethodOverload< + string, + Partial, + disputeDocument.DisputeDocumentData + >; + + /** + * Creates document for dispute + * @param disputeId + * @param disputeDocument + * @param options + */ + createDisputeDocument: TwoArgsMethodOverload< + string, + disputeDocument.CreateDisputeDocument, + disputeDocument.DisputeDocumentData + >; + + /** + * Creates document's page for dispute + * @param disputeId + * @param disputeDocumentId + * @param disputeDocumentPage + * @param options + */ + createDisputeDocumentPage: ThreeArgsMethodOverload< + string, + string, + disputeDocument.CreateDisputeDocumentPage, + disputeDocument.DisputeDocumentData + >; + + /** + * Creates document's page for dispute from file + * @param disputeId + * @param disputeDocumentId + * @param file + * @param options + */ + createDisputeDocumentPageFromFile: ThreeArgsMethodOverload< + string, + string, + string, + disputeDocument.DisputeDocumentData + >; + + /** + * Retrieve a list of Disputes pending settlement + * @param options + */ + getPendingSettlement: NoArgMethodOverload; + } + + class Events { + /** + * Get events + * @param options + */ + getAll: NoArgMethodOverload; + } + + class Responses { + /** + * Get response from previous call + * @param options + */ + get: NoArgMethodOverload; + } + + class Mandates { + /** + * Create a new Mandate + * @param mandate + * @param options + */ + create: MethodOverload; + + /** + * Get all mandates + * @param options + */ + getAll: NoArgMethodOverload; + + /** + * Get mandate by ID + * @param mandateId + * @param options + */ + get: MethodOverload; + + /** + * Cancel a mandate + * @param mandateId + * @param options + */ + cancel: MethodOverload; + + /** + * Gets user's mandates + * @param userId + * @param options + */ + getMandatesForUser: MethodOverload; + + /** + * Gets bank account mandates + * @param userId + * @param bankAccountId + * @param options + */ + getMandatesForBankAccount: TwoArgsMethodOverload< + string, + string, + mandate.MandateData[] + >; + + /** + * Gets Transactions for a Mandate + * @param mandateId + * @param options + */ + getTransactions: MethodOverload; + } + class Hooks { + /** + * Create new hook + * @param hook + * @param options + */ + create: MethodOverload; + + /** + * Get hook + * @param hookId + * @param options + */ + get: MethodOverload; + + /** + * Save hook + * @param hook + * @param options + */ + update: MethodOverload; + + /** + * Get all hooks + * @param options + */ + getAll: NoArgMethodOverload; + } + + class Reports { + /** + * Create a report + * @param report + * @param options + */ + create: MethodOverload; + + /** + * Get a report + * @param reportId + * @param options + */ + get: MethodOverload; + + /** + * Get all reports + * @param options + */ + getAll: NoArgMethodOverload; + } +} diff --git a/types/mangopay2-nodejs-sdk/mangopay2-nodejs-sdk-tests.ts b/types/mangopay2-nodejs-sdk/mangopay2-nodejs-sdk-tests.ts new file mode 100644 index 0000000000..ba15315ce7 --- /dev/null +++ b/types/mangopay2-nodejs-sdk/mangopay2-nodejs-sdk-tests.ts @@ -0,0 +1,721 @@ +import Mangopay = require("mangopay2-nodejs-sdk"); + +// $ExpectError +const invalidConfig: Mangopay.Config = {}; + +/* General Types */ + +const validConfig: Mangopay.Config = { + clientId: "your_client_id", + clientApiKey: "your_client_api_key", + baseUrl: "https://api.mangopay.com" +}; + +const api = new Mangopay(validConfig); // IGNORE-TEST $ExpectType MangoPay +const payIn: Mangopay.models.PayIn = new api.models.PayIn({}); // IGNORE-TEST $ExpectType PayIn +const address: Mangopay.models.Address = new api.models.Address({}); // IGNORE-TEST $ExpectType Address + +const addressData: Mangopay.address.AddressData = { + AddressLine1: "20 T Street", + AddressLine2: "", + City: "London", + Country: "UK", + PostalCode: "FR43 2WE", + Region: "London" +}; + +/* Users */ + +const legalUser = new api.models.UserLegal({ + Name: "MangoPay", + Email: "info@mangopay.com", + LegalPersonType: "BUSINESS", + LegalRepresentativeFirstName: "Mango", + LegalRepresentativeLastName: "Pay", + LegalRepresentativeEmail: "mango@mangopay.com", + HeadquartersAddress: new api.models.Address({ + AddressLine1: "4101 Reservoir Rd NW", + AddressLine2: "", + City: "Washington", + Region: "District of Columbia", + PostalCode: "20007", + Country: "US" + }), + LegalRepresentativeBirthday: 1300186358, + LegalRepresentativeNationality: "FR", + LegalRepresentativeCountryOfResidence: "FR", + Tag: "custom tag" +}); + +api.Users.create(legalUser).then(data => { + const d = data; // IGNORE-TEST $ExpectType UserLegalData + const value = data.PersonType; // IGNORE-TEST $ExpectType "LEGAL" + + console.log(`${legalUser.Name} user created at ${legalUser.CreationDate}`); +}); + +api.Users.create(legalUser, { readResponseHeaders: true }).then(data => { + const d = data; // IGNORE-TEST $ExpectType WithResponse + const value = data.body; // IGNORE-TEST $ExpectType UserLegalData +}); + +api.Users.create( + { + PersonType: "LEGAL", + Name: "MangoPay", + Email: "info@mangopay.com", + LegalPersonType: "BUSINESS", + LegalRepresentativeFirstName: "Mango", + LegalRepresentativeLastName: "Pay", + LegalRepresentativeEmail: "mango@mangopay.com", + HeadquartersAddress: new api.models.Address({ + AddressLine1: "4101 Reservoir Rd NW", + AddressLine2: "", + City: "Washington", + Region: "District of Columbia", + PostalCode: "20007", + Country: "US" + }), + LegalRepresentativeBirthday: 1300186358, + LegalRepresentativeNationality: "FR", + LegalRepresentativeCountryOfResidence: "FR", + Tag: "custom tag" + }, + { headers: {} } +).then(data => { + const d = data; // IGNORE-TEST $ExpectType UserLegalData +}); + +const naturalUser = new api.models.UserNatural({ + Email: "info@mangopay.com", + Birthday: 1300186358, + FirstName: "Sara", + LastName: "McNick", + CountryOfResidence: "GB", + Nationality: "US" +}); + +api.Users.create(naturalUser, {}).then(data => { + const d = data; // IGNORE-TEST $ExpectType UserNaturalData + const value = data.PersonType; // IGNORE-TEST $ExpectType "NATURAL" + return; +}); + +api.Users.create( + { + PersonType: "NATURAL", + Email: "info@mangopay.com", + Birthday: 1300186358, + FirstName: "Sara", + LastName: "McNick", + CountryOfResidence: "GB", + Nationality: "US" + }, + data => { + const d = data; // IGNORE-TEST $ExpectType UserNaturalData + console.log("create", data); + } +); + +api.Users.get("1234").then(data => { + const d = data; // IGNORE-TEST $ExpectType UserLegalData | UserNaturalData + if (data.PersonType === "LEGAL") { + const legalData = data; // IGNORE-TEST $ExpectType UserLegalData + } else { + const naturalData = data; // IGNORE-TEST $ExpectType UserNaturalData + } +}); + +api.Users.getAll().then(users => { + users.forEach(user => { + const d = user; // IGNORE-TEST $ExpectType UserLegalData | UserNaturalData + if (user.PersonType === "LEGAL") { + const legalData = user; // IGNORE-TEST $ExpectType UserLegalData + } else { + const naturalData = user; // IGNORE-TEST $ExpectType UserNaturalData + } + }); +}); + +api.Users.update({ + Id: "1234", + PersonType: "NATURAL", + Email: "info@mangopay.com", + Birthday: 1300186358, + FirstName: "Sara", + LastName: "McNick", + CountryOfResidence: "GB", + Nationality: "US" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType UserNaturalData +}); + +api.Users.createBankAccount("user-id", { + Type: "GB", + AccountNumber: "12345678", + SortCode: "123456", + OwnerAddress: "", + OwnerName: "" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType GBData +}); + +api.Users.getBankAccount("user-id", "bankAccount-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType Data +}); + +api.Users.getBankAccounts("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType Data[] +}); + +api.Users.deactivateBankAccount("user-id", "bankAccount-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType void +}); + +api.Users.getTransactions("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransactionData[] +}); + +api.Users.getWallets("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType WalletData[] +}); + +api.Users.getCards("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType CardData[] +}); + +api.Users.createKycDocument("user-id", { Type: "ADDRESS_PROOF" }).then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData +}); + +api.Users.getKycDocuments("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData[] +}); + +api.Users.getKycDocument("user-id", "kycDocument-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData +}); + +api.Users.updateKycDocument("user-id", { Status: "VALIDATION_ASKED" }).then( + data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData + } +); + +api.Users.createKycPage("user-id", "kycDocument-id", { + File: "...base64data..." +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData +}); + +api.Users.createKycPageFromFile( + "user-id", + "kyc-document-id", + "path/to/file" +).then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData +}); + +// MangoPay. + +api.Users.getEMoney("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType EMoneyData +}); + +api.Users.createUboDeclaration("user-id", { DeclaredUBOs: ["user1"] }).then( + data => { + const d = data; // IGNORE-TEST $ExpectType UboDeclarationData + } +); + +api.Users.getPreAuthorizations("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType CardPreAuthorizationData[] +}); + +/* KycDocuments */ + +api.KycDocuments.getAll().then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData[] +}); + +api.KycDocuments.get("kyc-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType KycDocumentData +}); + +api.KycDocuments.createKycDocumentConsult("kyc-id").then(data => { + const d = data; // TODO unsure of expected type +}); + +/* UboDeclarations */ + +api.UboDeclarations.get("ubo-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType UboDeclarationData +}); + +api.UboDeclarations.update({ + Id: "ubo-id", + DeclaredUBOs: ["user1", "user2"] +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType UboDeclarationData +}); + +/* BankAccounts */ + +api.BankAccounts.getTransactions("account-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransactionData[] +}); + +/* Wallets */ + +api.Wallets.create({ + Currency: "GBP", + Description: "A description", + Owners: ["user-id"] +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType WalletData +}); + +const wallet = new api.models.Wallet({ + Currency: "GB", + Description: "A description", + Owners: ["user-id"] +}); + +api.Wallets.create(wallet).then(data => { + const d = data; // IGNORE-TEST $ExpectType WalletData +}); + +api.Wallets.update({ + Description: "A description" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType WalletData +}); + +api.Wallets.get("wallet-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType WalletData +}); + +api.Wallets.getTransactions("wallet-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransactionData[] +}); + +/* Cards */ + +api.Cards.get("card-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType CardData +}); + +api.Cards.getByFingerprint("fingerprinthash").then(data => { + const d = data; // IGNORE-TEST $ExpectType CardData[] +}); + +api.Cards.update({ Active: false, Id: "card-id" }).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardData +}); + +api.Cards.getTransactions("card-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransactionData[] +}); + +/* CardRegistrations */ + +api.CardRegistrations.create({ + CardType: "BCMC", + Currency: "GBP", + UserId: "user-id" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardRegistrationData +}); + +api.CardRegistrations.get("reg-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType CardRegistrationData +}); + +api.CardRegistrations.update({ RegistrationData: "hmmm" }).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardRegistrationData +}); + +/* CardPreAuthorizations */ + +api.CardPreAuthorizations.create({ + AuthorId: "user", + CardId: "card-id", + DebitedFunds: { Currency: "AUD", Amount: 4000 }, + SecureModeReturnURL: "https://secureurl.com" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardPreAuthorizationData +}); + +api.CardPreAuthorizations.get("auth-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType CardPreAuthorizationData +}); + +api.CardPreAuthorizations.update({ + Id: "auth-id", + PaymentStatus: "CANCELED" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardPreAuthorizationData +}); + +/* Refunds */ + +api.Refunds.get("refund-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType RefundData +}); + +/* PayIns */ + +api.PayIns.create({ + PaymentType: "CARD", + ExecutionType: "DIRECT", + AuthorId: "user-id", + CardId: "card-id", + CreditedWalletId: "wallet-id", + Fees: { Amount: 100, Currency: "GBP" }, + DebitedFunds: { Amount: 2000, Currency: "GBP" }, + SecureModeReturnURL: "https://secure-return.co" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardDirectPayInData +}); + +api.PayIns.create({ + PaymentType: "CARD", + ExecutionType: "WEB", + AuthorId: "user-id", + CreditedWalletId: "wallet-id", + Fees: { Amount: 100, Currency: "GBP" }, + DebitedFunds: { Amount: 2000, Currency: "GBP" }, + ReturnURL: "https://secure-return.co", + Culture: "AD", + CardType: "MAESTRO" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType CardWebPayInData +}); + +api.PayIns.create({ + PaymentType: "BANK_WIRE", + ExecutionType: "DIRECT", + AuthorId: "user-id", + CreditedWalletId: "wallet-id", + CreditedUserId: "credited-user-id", + DeclaredDebitedFunds: { Amount: 10000, Currency: "GBP" }, + DeclaredFees: { Amount: 500, Currency: "GBP" } +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType BankWireDirectPayInData +}); + +api.PayIns.get("payin-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType PayInData +}); + +api.PayIns.createRefund("payin-id", { AuthorId: "user-id" }).then(data => { + const d = data; // IGNORE-TEST $ExpectType RefundData +}); + +api.PayIns.getRefunds("payin-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType RefundData[] +}); + +/* Clients */ +api.Clients.get().then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientData +}); + +api.Clients.update({ PlatformType: "CROWDFUNDING_DONATION" }).then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientData +}); + +api.Clients.uploadLogo("...logobase64...").then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientData +}); + +api.Clients.uploadLogoFromFile("path/to/file").then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientData +}); + +api.Clients.getClientWallets().then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientWalletData[] +}); + +api.Clients.getClientWallet("CREDIT", "GBP").then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientWalletData +}); + +api.Clients.getClientWalletsByFundsType("FEES").then(data => { + const d = data; // IGNORE-TEST $ExpectType ClientWalletData[] +}); + +api.Clients.getClientWalletTransactions("CREDIT", "GBP").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransactionData[] +}); + +/* PayOuts */ + +api.PayOuts.create({ + Fees: { Amount: 0, Currency: "GBP" }, + AuthorId: "user-id", + DebitedFunds: { Amount: 2000, Currency: "GBP" }, + BankAccountId: "bank-id", + DebitedWalletId: "wallet-id" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType PayOutData +}); + +api.PayOuts.get("payout-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType PayOutData +}); + +api.PayOuts.getRefunds("payout-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType RefundData[] +}); + +/* Transfers */ + +api.Transfers.create({ + Fees: { Amount: 0, Currency: "GBP" }, + AuthorId: "user-id", + DebitedFunds: { Amount: 2000, Currency: "GBP" }, + DebitedWalletId: "debit-wallet-id", + CreditedWalletId: "credit-wallet-id" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType TransferData +}); + +api.Transfers.get("transfer-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransferData +}); + +api.Transfers.createRefund("transfer-id", { AuthorId: "user-id" }).then( + data => { + const d = data; // IGNORE-TEST $ExpectType RefundData + } +); + +api.Transfers.getRefunds("transfer-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType RefundData[] +}); + +/* BankingAliases */ + +api.BankingAliases.create({ + Country: "GB", + CreditedUserId: "user-id", + OwnerName: "owner-id" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType IBANBankingAliasData +}); +api.BankingAliases.get("alias-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType IBANBankingAliasData +}); +api.BankingAliases.getAll().then(data => { + const d = data; // IGNORE-TEST $ExpectType IBANBankingAliasData[] +}); +api.BankingAliases.update({ OwnerName: "some-name" }).then(data => { + const d = data; // IGNORE-TEST $ExpectType IBANBankingAliasData +}); +api.BankingAliases.deactivate("alias-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType IBANBankingAliasData +}); +api.BankingAliases.activate("alias-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType IBANBankingAliasData +}); + +/* DisputeDocuments */ + +api.DisputeDocuments.getAll().then(data => { + const d = data; // IGNORE-TEST $ExpectType DisputeDocumentData[] +}); + +api.DisputeDocuments.get("dispute-doc-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType DisputeDocumentData +}); + +api.DisputeDocuments.createDisputeDocumentConsult("dispute-doc-id").then( + data => { + const d = data; // TODO unsure of expected type + } +); + +/* Repudiations */ + +api.Repudiations.getRefunds("repudiation-id").then(data => { + const d = data; // $Expect RefundData[] +}); + +/* Disputes */ + +api.Disputes.get("dispute-id").then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.getAll().then(data => { + const d = data; // $Expect DisputeData[] +}); + +api.Disputes.update({ Tag: "any tags" }).then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.contestDispute("dispute-id", { + Amount: 1000, + Currency: "GBP" +}).then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.resubmitDispute("dispute-id").then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.closeDispute("dispute-id").then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.getTransactions("dispute-id").then(data => { + const d = data; // $Expect TransactionData[] +}); + +api.Disputes.getDisputesForWallet("wallet-id").then(data => { + const d = data; // $Expect DisputeData[] +}); + +api.Disputes.getDisputesForUser("user-id").then(data => { + const d = data; // $Expect DisputeData[] +}); + +api.Disputes.getRepudiation("repudiation-id").then(data => { + const d = data; // $Expect RepudationData +}); + +api.Disputes.createSettlementTransfer( + { + AuthorId: "user-id", + DebitedFunds: { Amount: 1000, Currency: "GBP" }, + Fees: { Amount: 200, Currency: "GBP" } + }, + "repudiation-id" +).then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.getSettlementTransfer("settlement-id").then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.getDocumentsForDispute("dispute-id").then(data => { + const d = data; // $Expect DisputeDocumentData[] +}); + +api.Disputes.updateDisputeDocument("dispute-id", { Tag: "update" }).then( + data => { + const d = data; // $Expect DisputeDocumentData + } +); + +api.Disputes.createDisputeDocument("dispute-id", { + Type: "DELIVERY_PROOF" +}).then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.createDisputeDocumentPage("dispute-id", "dispute-doc-id", { + File: "...base64string..." +}).then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.createDisputeDocumentPageFromFile( + "dispute-id", + "dispute-doc-id", + "path/to/file" +).then(data => { + const d = data; // $Expect DisputeData +}); + +api.Disputes.getPendingSettlement().then(data => { + const d = data; // $Expect DisputeData +}); + +/* Events */ + +api.Events.getAll().then(data => { + const d = data; // $Expect EventData[] +}); + +/* Responses */ + +api.Responses.get().then(data => { + const d = data; // IGNORE-TEST $ExpectType any[] +}); + +/* Mandates */ + +api.Mandates.create({ + BankAccountId: "bank-account-id", + ReturnURL: "https://return-url.com", + Culture: "EN" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType MandateData +}); + +api.Mandates.getAll().then(data => { + const d = data; // IGNORE-TEST $ExpectType MandateData[] +}); + +api.Mandates.get("mandate-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType MandateData +}); + +api.Mandates.cancel("mandate-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType MandateData +}); + +api.Mandates.getMandatesForUser("user-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType MandateData[] +}); + +api.Mandates.getMandatesForBankAccount("user-id", "bank-account-id").then( + data => { + const d = data; // IGNORE-TEST $ExpectType MandateData[] + } +); +api.Mandates.getTransactions("mandate-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType TransactionData[] +}); + +/* Hooks */ + +api.Hooks.create({ + Url: "https://hook-url.com", + EventType: "DISPUTE_ACTION_REQUIRED" +}).then(data => { + const d = data; // IGNORE-TEST $ExpectType HookData +}); + +api.Hooks.get("hook-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType HookData +}); + +api.Hooks.update({ Id: "hook-id", Url: "https://new-hook.com/hooks" }).then( + data => { + const d = data; // IGNORE-TEST $ExpectType HookData + } +); + +api.Hooks.getAll().then(data => { + const d = data; // IGNORE-TEST $ExpectType HookData[] +}); + +/* Reports */ + +api.Reports.create({ Columns: ["Alias", "AuthorId"] }).then(data => { + const d = data; // IGNORE-TEST $ExpectType ReportData +}); + +api.Reports.get("report-id").then(data => { + const d = data; // IGNORE-TEST $ExpectType ReportData +}); + +api.Reports.getAll().then(data => { + const d = data; // IGNORE-TEST $ExpectType ReportData[] +}); diff --git a/types/mangopay2-nodejs-sdk/tsconfig.json b/types/mangopay2-nodejs-sdk/tsconfig.json new file mode 100644 index 0000000000..5ff752d7e4 --- /dev/null +++ b/types/mangopay2-nodejs-sdk/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "noEmit": true, + "lib": ["es6"], + "noUnusedLocals": false, + "noUnusedParameters": false, + "forceConsistentCasingInFileNames": true, + "experimentalDecorators": true, + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "types": [], + "typeRoots": ["../"] + }, + + "files": ["index.d.ts", "types.d.ts", "mangopay2-nodejs-sdk-tests.ts"] +} diff --git a/types/mangopay2-nodejs-sdk/tslint.json b/types/mangopay2-nodejs-sdk/tslint.json new file mode 100644 index 0000000000..c31797feab --- /dev/null +++ b/types/mangopay2-nodejs-sdk/tslint.json @@ -0,0 +1,10 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-redundant-jsdoc": false, + "no-misused-new": false, + "no-empty-interface": false, + "interface-name": false, + "no-unnecessary-class": false + } +} diff --git a/types/mangopay2-nodejs-sdk/types.d.ts b/types/mangopay2-nodejs-sdk/types.d.ts new file mode 100644 index 0000000000..1edb7bd4f2 --- /dev/null +++ b/types/mangopay2-nodejs-sdk/types.d.ts @@ -0,0 +1,565 @@ +/** + * Makes specified keys of an interface Optional. + */ +export type MakeKeysOptional = Omit & + Partial>; + +export type PickPartial = Pick, Par>; + +export type PickPartialRequired< + T, + Par extends keyof T, + Req extends keyof T +> = Pick, Par> & Pick, Req>; + +export type DeepPartial = { [P in keyof T]?: DeepPartial }; + +/** + * Makes specified keys of an interface nullable. + */ +export type MakeKeysNullable = Omit & + { [P in T2]: T1[P] | null }; + +/** + * Makes specified keys of an interface Required. + */ +export type MakeKeysRequired = Omit & + Required>; + +export type Omit = Pick>; + +export type OmitType = Omit; + +export type ValueOf = T[keyof T]; + +export type ApiMethod = + | "authentication_oauth" + | "responses_get" + | "events_all" + | "hooks_create" + | "hooks_all" + | "hooks_get" + | "hooks_save" + | "cardregistration_create" + | "cardregistration_get" + | "cardregistration_save" + | "preauthorization_create" + | "preauthorization_get" + | "preauthorization_save" + | "preauthorizations_get_for_user" + | "card_get" + | "cards_get_by_fingerprint" + | "card_save" + | "card_get_preauthorizations" + | "payins_card-web_create" + | "payins_card-direct_create" + | "payins_preauthorized-direct_create" + | "payins_bankwire-direct_create" + | "payins_directdebit-web_create" + | "payins_directdebit-direct_create" + | "payins_paypal-web_create" + | "payins_get" + | "payins_createrefunds" + | "payouts_bankwire_create" + | "payouts_get" + | "refunds_get" + | "refunds_get_for_repudiation" + | "refunds_get_for_transfer" + | "refunds_get_for_payin" + | "refunds_get_for_payout" + | "transfers_create" + | "transfers_get" + | "transfers_createrefunds" + | "users_createnaturals" + | "users_createlegals" + | "users_createbankaccounts_iban" + | "users_createbankaccounts_gb" + | "users_createbankaccounts_us" + | "users_createbankaccounts_ca" + | "users_createbankaccounts_other" + | "users_all" + | "users_allwallets" + | "users_allbankaccount" + | "users_allcards" + | "users_alltransactions" + | "users_allkycdocuments" + | "users_get" + | "users_getnaturals" + | "users_getlegals" + | "users_getbankaccount" + | "users_deactivate_bankaccount" + | "users_savenaturals" + | "users_savelegals" + | "users_getemoney" + | "wallets_create" + | "wallets_alltransactions" + | "wallets_get" + | "wallets_save" + | "kyc_documents_create" + | "kyc_documents_get" + | "kyc_documents_save" + | "kyc_page_create" + | "kyc_documents_all" + | "kyc_documents_get_alt" + | "kyc_documents_create_consult" + | "disputes_get" + | "disputes_save_tag" + | "disputes_save_contest_funds" + | "dispute_save_close" + | "disputes_get_transactions" + | "disputes_all" + | "disputes_get_for_wallet" + | "disputes_get_for_user" + | "disputes_document_create" + | "disputes_document_page_create" + | "disputes_document_save" + | "disputes_document_get" + | "disputes_document_get_for_dispute" + | "disputes_document_all" + | "disputes_document_create_consult" + | "disputes_repudiation_get" + | "disputes_repudiation_create_settlement" + | "disputes_repudiation_get_settlement" + | "disputes_pending_settlement" + | "reports_transaction_create" + | "reports_wallet_create" + | "reports_get" + | "reports_all" + | "mandates_directdebit-web_create" + | "mandates_get" + | "mandates_cancel" + | "mandates_all" + | "mandates_get_for_user" + | "mandates_get_for_bank_account" + | "clients_get" + | "clients_update" + | "clients_upload_logo" + | "client_wallets_all" + | "client_wallets_get" + | "client_wallets_by_fundsType" + | "client_wallets_transactions" + | "banking_aliases_iban_create" + | "banking_aliases_get" + | "banking_aliases_update" + | "banking_aliases_all" + | "ubo_declaration_create" + | "ubo_declaration_update" + | "ubo_declaration_get" + | "transactions_get_for_mandate" + | "transactions_get_for_card" + | "transactions_get_for_bank_account"; + +export type CountryISO = + | "AD" + | "AE" + | "AF" + | "AG" + | "AI" + | "AL" + | "AM" + | "AO" + | "AQ" + | "AR" + | "AS" + | "AT" + | "AU" + | "AW" + | "AX" + | "AZ" + | "BA" + | "BB" + | "BD" + | "BE" + | "BF" + | "BG" + | "BH" + | "BI" + | "BJ" + | "BL" + | "BM" + | "BN" + | "BO" + | "BQ" + | "BR" + | "BS" + | "BT" + | "BV" + | "BW" + | "BY" + | "BZ" + | "CA" + | "CC" + | "CD" + | "CF" + | "CG" + | "CH" + | "CI" + | "CK" + | "CL" + | "CM" + | "CN" + | "CO" + | "CR" + | "CU" + | "CV" + | "CW" + | "CX" + | "CY" + | "CZ" + | "DE" + | "DJ" + | "DK" + | "DM" + | "DO" + | "DZ" + | "EC" + | "EE" + | "EG" + | "EH" + | "ER" + | "ES" + | "ET" + | "FI" + | "FJ" + | "FK" + | "FM" + | "FO" + | "FR" + | "GA" + | "GB" + | "GD" + | "GE" + | "GF" + | "GG" + | "GH" + | "GI" + | "GL" + | "GM" + | "GN" + | "GP" + | "GQ" + | "GR" + | "GS" + | "GT" + | "GU" + | "GW" + | "GY" + | "HK" + | "HM" + | "HN" + | "HR" + | "HT" + | "HU" + | "ID" + | "IE" + | "IL" + | "IM" + | "IN" + | "IO" + | "IQ" + | "IR" + | "IS" + | "IT" + | "JE" + | "JM" + | "JO" + | "JP" + | "KE" + | "KG" + | "KH" + | "KI" + | "KM" + | "KN" + | "KP" + | "KR" + | "KW" + | "KY" + | "KZ" + | "LA" + | "LB" + | "LC" + | "LI" + | "LK" + | "LR" + | "LS" + | "LT" + | "LU" + | "LV" + | "LY" + | "MA" + | "MC" + | "MD" + | "ME" + | "MF" + | "MG" + | "MH" + | "MK" + | "ML" + | "MM" + | "MN" + | "MO" + | "MP" + | "MQ" + | "MR" + | "MS" + | "MT" + | "MU" + | "MV" + | "MW" + | "MX" + | "MY" + | "MZ" + | "NA" + | "NC" + | "NE" + | "NF" + | "NG" + | "NI" + | "NL" + | "NO" + | "NP" + | "NR" + | "NU" + | "NZ" + | "OM" + | "PA" + | "PE" + | "PF" + | "PG" + | "PH" + | "PK" + | "PL" + | "PM" + | "PN" + | "PR" + | "PS" + | "PT" + | "PW" + | "PY" + | "QA" + | "RE" + | "RO" + | "RS" + | "RU" + | "RW" + | "SA" + | "SB" + | "SC" + | "SD" + | "SE" + | "SG" + | "SH" + | "SI" + | "SJ" + | "SK" + | "SL" + | "SM" + | "SN" + | "SO" + | "SR" + | "SS" + | "ST" + | "SV" + | "SX" + | "SY" + | "SZ" + | "TC" + | "TD" + | "TF" + | "TG" + | "TH" + | "TJ" + | "TK" + | "TL" + | "TM" + | "TN" + | "TO" + | "TR" + | "TT" + | "TV" + | "TW" + | "TZ" + | "UA" + | "UG" + | "UM" + | "US" + | "UY" + | "UZ" + | "VA" + | "VC" + | "VE" + | "VG" + | "VI" + | "VN" + | "VU" + | "WF" + | "WS" + | "YE" + | "YT" + | "ZA" + | "ZM" + | "ZW"; + +export type CurrencyISO = + | "AED" + | "AFN" + | "ALL" + | "AMD" + | "ANG" + | "AOA" + | "ARS" + | "AUD" + | "AWG" + | "AZN" + | "BAM" + | "BBD" + | "BDT" + | "BGN" + | "BHD" + | "BIF" + | "BMD" + | "BND" + | "BOB" + | "BRL" + | "BSD" + | "BTN" + | "BWP" + | "BYN" + | "BZD" + | "CAD" + | "CDF" + | "CHF" + | "CLP" + | "CNY" + | "COP" + | "CRC" + | "CUC" + | "CUP" + | "CVE" + | "CZK" + | "DJF" + | "DKK" + | "DOP" + | "DZD" + | "EGP" + | "ERN" + | "ETB" + | "EUR" + | "FJD" + | "FKP" + | "GBP" + | "GEL" + | "GGP" + | "GHS" + | "GIP" + | "GMD" + | "GNF" + | "GTQ" + | "GYD" + | "HKD" + | "HNL" + | "HRK" + | "HTG" + | "HUF" + | "IDR" + | "ILS" + | "IMP" + | "INR" + | "IQD" + | "IRR" + | "ISK" + | "JEP" + | "JMD" + | "JOD" + | "JPY" + | "KES" + | "KGS" + | "KHR" + | "KMF" + | "KPW" + | "KRW" + | "KWD" + | "KYD" + | "KZT" + | "LAK" + | "LBP" + | "LKR" + | "LRD" + | "LSL" + | "LYD" + | "MAD" + | "MDL" + | "MGA" + | "MKD" + | "MMK" + | "MNT" + | "MOP" + | "MRU" + | "MUR" + | "MVR" + | "MWK" + | "MXN" + | "MYR" + | "MZN" + | "NAD" + | "NGN" + | "NIO" + | "NOK" + | "NPR" + | "NZD" + | "OMR" + | "PAB" + | "PEN" + | "PGK" + | "PHP" + | "PKR" + | "PLN" + | "PYG" + | "QAR" + | "RON" + | "RSD" + | "RUB" + | "RWF" + | "SAR" + | "SBD" + | "SCR" + | "SDG" + | "SEK" + | "SGD" + | "SHP" + | "SLL" + | "SOS" + | "SPL" + | "SRD" + | "STN" + | "SVC" + | "SYP" + | "SZL" + | "THB" + | "TJS" + | "TMT" + | "TND" + | "TOP" + | "TRY" + | "TTD" + | "TVD" + | "TWD" + | "TZS" + | "UAH" + | "UGX" + | "USD" + | "UYU" + | "UZS" + | "VEF" + | "VND" + | "VUV" + | "WST" + | "XAF" + | "XCD" + | "XDR" + | "XOF" + | "XPF" + | "YER" + | "ZAR" + | "ZMW" + | "ZWD"; diff --git a/types/mapbox__geo-viewport/index.d.ts b/types/mapbox__geo-viewport/index.d.ts index 6cfa8638f8..d48321ffb8 100644 --- a/types/mapbox__geo-viewport/index.d.ts +++ b/types/mapbox__geo-viewport/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for @mapbox/geo-viewport 0.3 +// Type definitions for @mapbox/geo-viewport 0.4 // Project: https://github.com/mapbox/geo-viewport // Definitions by: Fabio Berta // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -10,6 +10,6 @@ export interface GeoViewport { export type BoundingBox = [number, number, number, number]; -export function viewport(bounds: BoundingBox, dimensions: [number, number], minzoom?: number, maxzoom?: number, tileSize?: number): GeoViewport; +export function viewport(bounds: BoundingBox, dimensions: [number, number], minzoom?: number, maxzoom?: number, tileSize?: number, allowFloat?: boolean): GeoViewport; export function bounds(viewport: { lon: number; lat: number } | [number, number], zoom: number, dimensions: [number, number], tileSize?: number): BoundingBox; diff --git a/types/mnemonic-words/index.d.ts b/types/mnemonic-words/index.d.ts new file mode 100644 index 0000000000..4ce91c08d6 --- /dev/null +++ b/types/mnemonic-words/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for mnemonic-words 1.0 +// Project: https://github.com/sindresorhus/mnemonic-words#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = mnemonicWords; + +declare const mnemonicWords: string[]; diff --git a/types/mnemonic-words/mnemonic-words-tests.ts b/types/mnemonic-words/mnemonic-words-tests.ts new file mode 100644 index 0000000000..a3c5569c8c --- /dev/null +++ b/types/mnemonic-words/mnemonic-words-tests.ts @@ -0,0 +1,5 @@ +import mnemonicWords = require('mnemonic-words'); +import mnemonicWordsJson = require('mnemonic-words/words.json'); + +mnemonicWords; // $ExpectType string[] +mnemonicWordsJson; // $ExpectType string[] diff --git a/types/mnemonic-words/tsconfig.json b/types/mnemonic-words/tsconfig.json new file mode 100644 index 0000000000..44998ff2f3 --- /dev/null +++ b/types/mnemonic-words/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "words.json.d.ts", + "mnemonic-words-tests.ts" + ] +} diff --git a/types/mnemonic-words/tslint.json b/types/mnemonic-words/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/mnemonic-words/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/mnemonic-words/words.json.d.ts b/types/mnemonic-words/words.json.d.ts new file mode 100644 index 0000000000..2d95294802 --- /dev/null +++ b/types/mnemonic-words/words.json.d.ts @@ -0,0 +1,3 @@ +export = mnemonicWords; + +declare const mnemonicWords: string[]; diff --git a/types/new-github-issue-url/index.d.ts b/types/new-github-issue-url/index.d.ts new file mode 100644 index 0000000000..f784a0d85d --- /dev/null +++ b/types/new-github-issue-url/index.d.ts @@ -0,0 +1,81 @@ +// Type definitions for new-github-issue-url 0.1 +// Project: https://github.com/sindresorhus/new-github-issue-url#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +export = newGithubIssueUrl; + +/** + * Returns a URL string. + */ +declare function newGithubIssueUrl(options: newGithubIssueUrl.Options): string; + +declare namespace newGithubIssueUrl { + type Without = { [P in Exclude]?: never }; + type XOR = (T | U) extends object ? (Without & U) | (Without & T) : T | U; + + type Options = XOR; + + interface BaseOptions { + /** + * The issue body. + */ + body?: string; + /** + * The issue title. + */ + title?: string; + /** + * Use an [issue template](https://help.github.com/articles/manually-creating-a-single-issue-template-for-your-repository). + * + * For example, if you want to use a template at `ISSUE_TEMPLATE/unicorn.md`, you would specify `unicorn.md` here. + */ + template?: string; + /** + * The labels for the issue. + * + * *Requires the user to have the permission to add labels.* + */ + labels?: string[]; + /** + * The milestone for the issue. + * + * *Requires the user to have the permission to add milestone.* + */ + milestone?: string; + /** + * The user to assign to the issue. + * + * *Requires the user to have the permission to add assignee.* + */ + assignee?: string; + /** + * The projects to add the issue to. + * + * The project reference format is `user/`, for example, if the URL to the project + * is `https://github.com/sindresorhus/some-repo/projects/3`, the project reference would be `some-repo/3`. + * + * *Requires the user to have the permission to add projects.* + */ + projects?: string[]; + } + + interface RepoUrlOptions extends BaseOptions { + /** + * The full URL to the repo. + */ + repoUrl: string; + } + + interface UserRepoOptions extends BaseOptions { + /** + * GitHub username or organization. + */ + user: string; + /** + * GitHub repo. + */ + repo: string; + } +} diff --git a/types/new-github-issue-url/new-github-issue-url-tests.ts b/types/new-github-issue-url/new-github-issue-url-tests.ts new file mode 100644 index 0000000000..c64b1aaa61 --- /dev/null +++ b/types/new-github-issue-url/new-github-issue-url-tests.ts @@ -0,0 +1,54 @@ +import newGithubIssueUrl = require('new-github-issue-url'); + +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-issue-url.git', +}); +// $ExpectType string +newGithubIssueUrl({ + user: 'sindresorhus', + repo: 'new-github-issue-url', +}); +// $ExpectError +newGithubIssueUrl({ + user: 'sindresorhus', +}); +// $ExpectError +newGithubIssueUrl({ + repo: 'new-github-issue-url', +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + body: 'foo', +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + title: 'foo', +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + template: 'unicorn.md', +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + labels: ['foo', 'bar'], +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + milestone: 'foo', +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + assignee: 'sindresorhus', +}); +// $ExpectType string +newGithubIssueUrl({ + repoUrl: 'https://github.com/sindresorhus/new-github-release-url.git', + projects: ['some-repo/3'], +}); diff --git a/types/new-github-issue-url/tsconfig.json b/types/new-github-issue-url/tsconfig.json new file mode 100644 index 0000000000..3b1da7ee63 --- /dev/null +++ b/types/new-github-issue-url/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "new-github-issue-url-tests.ts" + ] +} diff --git a/types/new-github-issue-url/tslint.json b/types/new-github-issue-url/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/new-github-issue-url/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/npm-email/index.d.ts b/types/npm-email/index.d.ts new file mode 100644 index 0000000000..055a68f8af --- /dev/null +++ b/types/npm-email/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for npm-email 3.0 +// Project: https://github.com/sindresorhus/npm-email#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = npmEmail; + +/** + * Get the email of an npm user. + * + * @param username npm username to look up. + * @returns A promise for the user's email address. + */ +declare function npmEmail(username: string): Promise; diff --git a/types/npm-email/npm-email-tests.ts b/types/npm-email/npm-email-tests.ts new file mode 100644 index 0000000000..b0640c73e3 --- /dev/null +++ b/types/npm-email/npm-email-tests.ts @@ -0,0 +1,3 @@ +import npmEmail = require('npm-email'); + +npmEmail('sindresorhus'); // $ExpectType Promise diff --git a/types/npm-email/tsconfig.json b/types/npm-email/tsconfig.json new file mode 100644 index 0000000000..985ed0472a --- /dev/null +++ b/types/npm-email/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "npm-email-tests.ts" + ] +} diff --git a/types/npm-email/tslint.json b/types/npm-email/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/npm-email/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/npm-keyword/index.d.ts b/types/npm-keyword/index.d.ts new file mode 100644 index 0000000000..94c8af9f13 --- /dev/null +++ b/types/npm-keyword/index.d.ts @@ -0,0 +1,44 @@ +// Type definitions for npm-keyword 5.0 +// Project: https://github.com/sindresorhus/npm-keyword#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = npmKeyword; + +/** + * Get a list of npm packages with a certain keyword. + * + * @param keyword One or more keywords. Only matches packages that have *all* the given keywords. Example: `['string', 'camelcase']` + * @returns A promise for a list of packages having the specified keyword in their package.json `keyword` property. + */ +declare function npmKeyword( + keyword: string | string[], + options?: npmKeyword.Options +): Promise; + +declare namespace npmKeyword { + /** + * @param keyword One or more keywords. Only matches packages that have *all* the given keywords. Example: `['string', 'camelcase']` + * @returns A promise for a list of package names. Use this if you don't need the description as it's faster. + */ + function names(keyword: string | string[], options?: Options): Promise; + + /** + * @param keyword One or more keywords. Only matches packages that have *all* the given keywords. Example: `['string', 'camelcase']` + * @returns A promise for the count of packages. + */ + function count(keyword: string | string[]): Promise; + + interface Options { + /** + * Limits the amount of results. + * @default 250 + */ + size?: number; + } + + interface PackageDescriptor { + name: string; + description: string; + } +} diff --git a/types/npm-keyword/npm-keyword-tests.ts b/types/npm-keyword/npm-keyword-tests.ts new file mode 100644 index 0000000000..17418bdb04 --- /dev/null +++ b/types/npm-keyword/npm-keyword-tests.ts @@ -0,0 +1,7 @@ +import npmKeyword = require('npm-keyword'); + +npmKeyword('gulpplugin'); // $ExpectType Promise +npmKeyword('gulpplugin', { size: 10 }); // $ExpectType Promise +npmKeyword.names('gulpplugin'); // $ExpectType Promise +npmKeyword.names('gulpplugin', { size: 10 }); // $ExpectType Promise +npmKeyword.count('gulpplugin'); // $ExpectType Promise diff --git a/types/npm-keyword/tsconfig.json b/types/npm-keyword/tsconfig.json new file mode 100644 index 0000000000..b0c0fed33d --- /dev/null +++ b/types/npm-keyword/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "npm-keyword-tests.ts" + ] +} diff --git a/types/npm-keyword/tslint.json b/types/npm-keyword/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/npm-keyword/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/npm-run-path/index.d.ts b/types/npm-run-path/index.d.ts new file mode 100644 index 0000000000..6a052e0450 --- /dev/null +++ b/types/npm-run-path/index.d.ts @@ -0,0 +1,45 @@ +// Type definitions for npm-run-path 2.0 +// Project: https://github.com/sindresorhus/npm-run-path#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = npmRunPath; + +/** + * Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries. + */ +declare function npmRunPath(options?: npmRunPath.Options): string; + +declare namespace npmRunPath { + function env(options?: EnvOptions): ProcessEnv; + + interface Options { + /** + * Working directory. + */ + cwd?: string; + /** + * PATH to be appended. + * Set it to an empty string to exclude the default [PATH](https://github.com/sindresorhus/path-key). + * @default PATH + */ + path?: string; + } + + interface EnvOptions { + /** + * Working directory. + */ + cwd?: string; + /** + * Accepts an object of environment variables, like `process.env`, and modifies the PATH using the correct + * [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use + * in the `child_process` options. + */ + env?: ProcessEnv; + } + + interface ProcessEnv { + [key: string]: string | undefined; + } +} diff --git a/types/npm-run-path/npm-run-path-tests.ts b/types/npm-run-path/npm-run-path-tests.ts new file mode 100644 index 0000000000..4cff236373 --- /dev/null +++ b/types/npm-run-path/npm-run-path-tests.ts @@ -0,0 +1,16 @@ +/// + +import childProcess = require('child_process'); +import npmRunPath = require('npm-run-path'); + +npmRunPath(); // $ExpectType string +npmRunPath({ cwd: '/foo' }); // $ExpectType string +npmRunPath({ path: '/usr/local/bin' }); // $ExpectType string + +npmRunPath.env(); // $ExpectType ProcessEnv +npmRunPath.env({ cwd: '/foo' }); // $ExpectType ProcessEnv +npmRunPath.env({ env: process.env }); // $ExpectType ProcessEnv + +childProcess.execFileSync('foo', { + env: npmRunPath.env(), +}); diff --git a/types/npm-run-path/tsconfig.json b/types/npm-run-path/tsconfig.json new file mode 100644 index 0000000000..d6738a23ca --- /dev/null +++ b/types/npm-run-path/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "npm-run-path-tests.ts" + ] +} diff --git a/types/npm-run-path/tslint.json b/types/npm-run-path/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/npm-run-path/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/npm-user-packages/index.d.ts b/types/npm-user-packages/index.d.ts new file mode 100644 index 0000000000..99ed62012f --- /dev/null +++ b/types/npm-user-packages/index.d.ts @@ -0,0 +1,43 @@ +// Type definitions for npm-user-packages 3.0 +// Project: https://github.com/kevva/npm-user-packages#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = npmUserPackages; + +/** + * Get packages by a npm user. + * @param username User to fetch packages from. + */ +declare function npmUserPackages(username: string): Promise; + +declare namespace npmUserPackages { + interface PackageData { + author: { + email?: string; + name: string; + url?: string; + username?: string; + }; + date: string; + description: string; + keywords: string[]; + links: { + bugs?: string; + homepage?: string; + npm: string; + repository?: string; + }; + maintainers: Array<{ + email: string; + username: string; + }>; + name: string; + publisher: { + email: string; + username: string; + }; + scope: string; + version: string; + } +} diff --git a/types/npm-user-packages/npm-user-packages-tests.ts b/types/npm-user-packages/npm-user-packages-tests.ts new file mode 100644 index 0000000000..509e82a16b --- /dev/null +++ b/types/npm-user-packages/npm-user-packages-tests.ts @@ -0,0 +1,3 @@ +import npmUserPackages = require('npm-user-packages'); + +npmUserPackages('kevva'); // $ExpectType Promise diff --git a/types/npm-user-packages/tsconfig.json b/types/npm-user-packages/tsconfig.json new file mode 100644 index 0000000000..5650f12560 --- /dev/null +++ b/types/npm-user-packages/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "npm-user-packages-tests.ts" + ] +} diff --git a/types/npm-user-packages/tslint.json b/types/npm-user-packages/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/npm-user-packages/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/npm-user/index.d.ts b/types/npm-user/index.d.ts new file mode 100644 index 0000000000..2d03c12c0c --- /dev/null +++ b/types/npm-user/index.d.ts @@ -0,0 +1,18 @@ +// Type definitions for npm-user 3.0 +// Project: https://github.com/sindresorhus/npm-user#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = npmUser; + +declare function npmUser(name: string): Promise; + +declare namespace npmUser { + interface UserData { + name: string | null; + avatar: string | null; + email: string | null; + github: string | null; + twitter: string | null; + } +} diff --git a/types/npm-user/npm-user-tests.ts b/types/npm-user/npm-user-tests.ts new file mode 100644 index 0000000000..1d63de27ef --- /dev/null +++ b/types/npm-user/npm-user-tests.ts @@ -0,0 +1,11 @@ +import npmUser = require('npm-user'); + +npmUser('sindresorhus').then(user => { + user; // $ExpectType UserData + + user.name; // $ExpectType string | null + user.avatar; // $ExpectType string | null + user.email; // $ExpectType string | null + user.github; // $ExpectType string | null + user.twitter; // $ExpectType string | null +}); diff --git a/types/npm-user/tsconfig.json b/types/npm-user/tsconfig.json new file mode 100644 index 0000000000..1e5c1d464f --- /dev/null +++ b/types/npm-user/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "npm-user-tests.ts" + ] +} diff --git a/types/npm-user/tslint.json b/types/npm-user/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/npm-user/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 6468bbfffa..005e9cf037 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -17761,7 +17761,7 @@ declare namespace Excel { * * @param base64File Optional. The base64 encoded .xlsx file. The default value is null. */ - function createWorkbook(base64?: string): Promise; + function createWorkbook(base64?: string): Promise; interface ThreeArrowsSet { [index: number]: Icon; redDownArrow: Icon; @@ -18536,6 +18536,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.5] */ class Runtime extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Turn on/off JavaScript events in current taskpane or content add-in. @@ -18578,6 +18580,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.Runtime; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Runtime object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RuntimeData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RuntimeData; } /** @@ -18587,6 +18593,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class Application extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the calculation mode used in the workbook, as defined by the constants in Excel.CalculationMode. Possible values are: `Automatic`, where Excel controls recalculation; `AutomaticExceptTables`, where Excel controls recalculation but ignores changes in tables; `Manual`, where calculation is done when the user requests it. @@ -18654,6 +18662,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.Application; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Application object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ApplicationData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ApplicationData; } /** @@ -18663,6 +18675,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class Workbook extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the Excel application instance that contains this workbook. Read-only. @@ -18826,6 +18840,10 @@ declare namespace Excel { * @eventproperty */ readonly onSelectionChanged: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Workbook object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorkbookData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.WorkbookData; } /** @@ -18835,6 +18853,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class WorkbookProtection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Indicates if the workbook is protected. Read-Only. @@ -18881,6 +18901,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.WorkbookProtection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.WorkbookProtection object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorkbookProtectionData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.WorkbookProtectionData; } /** @@ -18890,6 +18914,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class WorkbookCreated extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. * @@ -18910,6 +18936,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.WorkbookCreated; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.WorkbookCreated object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorkbookCreatedData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.WorkbookCreatedData; } /** @@ -18922,6 +18952,8 @@ declare namespace Excel { * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-worksheets | how-to guide on working with worksheets} has detailed walkthroughs and code samples. */ class Worksheet extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns collection of charts that are part of the worksheet. Read-only. @@ -19240,6 +19272,10 @@ declare namespace Excel { * @eventproperty */ readonly onSelectionChanged: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Worksheet object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorksheetData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.WorksheetData; } /** @@ -19249,6 +19285,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class WorksheetCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.Worksheet[]; /** @@ -19375,6 +19413,10 @@ declare namespace Excel { * @eventproperty */ readonly onDeleted: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.WorksheetCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorksheetCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.WorksheetCollectionData; } /** @@ -19384,6 +19426,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class WorksheetProtection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Sheet protection options. Read-only. @@ -19438,6 +19482,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.WorksheetProtection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.WorksheetProtection object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorksheetProtectionData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.WorksheetProtectionData; } /** @@ -19550,6 +19598,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class WorksheetFreezePanes extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Sets the frozen cells in the active worksheet view. @@ -19602,6 +19652,10 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ unfreeze(): void; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.WorksheetFreezePanes object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.WorksheetFreezePanesData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): { [key: string]: string; }; @@ -19616,6 +19670,8 @@ declare namespace Excel { * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-ranges | how-to guide on working with ranges} has detailed walkthroughs, images, and code samples. */ class Range extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Collection of ConditionalFormats that intersect the range. Read-only. @@ -20142,6 +20198,10 @@ declare namespace Excel { * Release the memory associated with this object, if it has previously been tracked. This call is shorthand for context.trackedObjects.remove(thisObject). Having many tracked objects slows down the host application, so please remember to free any objects you add, once you're done using them. You will need to call "context.sync()" before the memory release takes effect. */ untrack(): Excel.Range; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Range object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RangeData; } /** @@ -20202,6 +20262,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.3] */ class RangeView extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents a collection of range views associated with the range. Read-only. @@ -20328,6 +20390,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.RangeView; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RangeView object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeViewData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RangeViewData; } /** @@ -20337,6 +20403,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.3] */ class RangeViewCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.RangeView[]; /** @@ -20373,6 +20441,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.RangeViewCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.RangeViewCollection; load(option?: string | string[]): Excel.RangeViewCollection; load(option?: OfficeExtension.LoadOption): Excel.RangeViewCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.RangeViewCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeViewCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.RangeViewCollectionData; } /** @@ -20382,6 +20454,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.4] */ class SettingCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.Setting[]; /** @@ -20393,7 +20467,7 @@ declare namespace Excel { * @param key The Key of the new setting. * @param value The Value for the new setting. */ - add(key: string, value: string | number | boolean | Date | any[] | any): Excel.Setting; + add(key: string, value: string | number | boolean | Date | Array | any): Excel.Setting; /** * * Gets the number of Settings in the collection. @@ -20446,6 +20520,10 @@ declare namespace Excel { * @eventproperty */ readonly onSettingsChanged: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.SettingCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.SettingCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.SettingCollectionData; } /** @@ -20455,6 +20533,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.4] */ class Setting extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; private static DateJSONPrefix; private static DateJSONSuffix; private static replaceStringDateWithDate(value); @@ -20514,6 +20594,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.Setting; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Setting object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.SettingData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.SettingData; } /** @@ -20523,6 +20607,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class NamedItemCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.NamedItem[]; /** @@ -20592,6 +20678,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.NamedItemCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.NamedItemCollection; load(option?: string | string[]): Excel.NamedItemCollection; load(option?: OfficeExtension.LoadOption): Excel.NamedItemCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.NamedItemCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.NamedItemCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.NamedItemCollectionData; } /** @@ -20601,6 +20691,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class NamedItem extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns an object containing values and types of the named item. Read-only. @@ -20727,6 +20819,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.NamedItem; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.NamedItem object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.NamedItemData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.NamedItemData; } /** @@ -20736,6 +20832,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class NamedItemArrayValues extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the types for each item in the named item array @@ -20771,6 +20869,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.NamedItemArrayValues; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.NamedItemArrayValues object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.NamedItemArrayValuesData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.NamedItemArrayValuesData; } /** @@ -20780,6 +20882,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class Binding extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents binding identifier. Read-only. @@ -20861,6 +20965,10 @@ declare namespace Excel { * @eventproperty */ readonly onSelectionChanged: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Binding object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.BindingData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.BindingData; } /** @@ -20870,6 +20978,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class BindingCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.Binding[]; /** @@ -20999,6 +21109,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.BindingCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.BindingCollection; load(option?: string | string[]): Excel.BindingCollection; load(option?: OfficeExtension.LoadOption): Excel.BindingCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.BindingCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.BindingCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.BindingCollectionData; } /** @@ -21008,6 +21122,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class TableCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.Table[]; /** @@ -21088,6 +21204,10 @@ declare namespace Excel { * @eventproperty */ readonly onChanged: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.TableCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.TableCollectionData; } /** @@ -21100,6 +21220,8 @@ declare namespace Excel { * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-tables | how-to guide on working with tables} has detailed walkthroughs, images, and code samples. */ class Table extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents a collection of all the columns in the table. Read-only. @@ -21314,6 +21436,10 @@ declare namespace Excel { * @eventproperty */ readonly onSelectionChanged: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Table object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.TableData; } /** @@ -21323,6 +21449,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class TableColumnCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.TableColumn[]; /** @@ -21395,6 +21523,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.TableColumnCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.TableColumnCollection; load(option?: string | string[]): Excel.TableColumnCollection; load(option?: OfficeExtension.LoadOption): Excel.TableColumnCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.TableColumnCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableColumnCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.TableColumnCollectionData; } /** @@ -21404,6 +21536,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class TableColumn extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Retrieve the filter applied to the column. Read-only. @@ -21509,6 +21643,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.TableColumn; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.TableColumn object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableColumnData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.TableColumnData; } /** @@ -21523,6 +21661,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class TableRowCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.TableRow[]; /** @@ -21586,6 +21726,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.TableRowCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.TableRowCollection; load(option?: string | string[]): Excel.TableRowCollection; load(option?: OfficeExtension.LoadOption): Excel.TableRowCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.TableRowCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableRowCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.TableRowCollectionData; } /** @@ -21600,6 +21744,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class TableRow extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the index number of the row within the rows collection of the table. Zero-indexed. Read-only. @@ -21663,6 +21809,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.TableRow; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.TableRow object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableRowData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.TableRowData; } /** @@ -21672,6 +21822,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class DataValidation extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Error alert when user enters invalid data. @@ -21758,6 +21910,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.DataValidation; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.DataValidation object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.DataValidationData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.DataValidationData; } /** @@ -21993,6 +22149,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class RangeFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Collection of border objects that apply to the overall range. Read-only. @@ -22134,6 +22292,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.RangeFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RangeFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RangeFormatData; } /** @@ -22143,6 +22305,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class FormatProtection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Indicates if Excel hides the formula for the cells in the range. A null value indicates that the entire range doesn't have uniform formula hidden setting. @@ -22192,6 +22356,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.FormatProtection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.FormatProtection object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.FormatProtectionData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.FormatProtectionData; } /** @@ -22201,6 +22369,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class RangeFill extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of the background, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange") @@ -22250,6 +22420,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.RangeFill; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RangeFill object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeFillData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RangeFillData; } /** @@ -22259,6 +22433,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class RangeBorder extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). @@ -22322,6 +22498,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.RangeBorder; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RangeBorder object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeBorderData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RangeBorderData; } /** @@ -22331,6 +22511,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class RangeBorderCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.RangeBorder[]; /** @@ -22385,6 +22567,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.RangeBorderCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.RangeBorderCollection; load(option?: string | string[]): Excel.RangeBorderCollection; load(option?: OfficeExtension.LoadOption): Excel.RangeBorderCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.RangeBorderCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeBorderCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.RangeBorderCollectionData; } /** @@ -22394,6 +22580,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class RangeFont extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the bold status of font. @@ -22471,6 +22659,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.RangeFont; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RangeFont object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeFontData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RangeFontData; } /** @@ -22480,6 +22672,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.Chart[]; /** @@ -22600,6 +22794,10 @@ declare namespace Excel { * @eventproperty */ readonly onDeleted: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ChartCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ChartCollectionData; } /** @@ -22612,6 +22810,8 @@ declare namespace Excel { * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-charts | how-to guide on working with charts} has detailed walkthroughs, images, and code samples. */ class Chart extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents chart axes. Read-only. @@ -22670,7 +22870,8 @@ declare namespace Excel { readonly worksheet: Excel.Worksheet; /** * - * Returns or sets a ChartCategoryLabelLevel enumeration constant referring to the level of where the category labels are being sourced from. Read/Write. + * Returns or sets a ChartCategoryLabelLevel enumeration constant referring to + the level of where the category labels are being sourced from. Read/Write. * * [Api set: ExcelApi 1.8] */ @@ -22733,7 +22934,8 @@ declare namespace Excel { plotVisibleOnly: boolean; /** * - * Returns or sets a ChartSeriesNameLevel enumeration constant referring to the level of where the series names are being sourced from. Read/Write. + * Returns or sets a ChartSeriesNameLevel enumeration constant referring to + the level of where the series names are being sourced from. Read/Write. * * [Api set: ExcelApi 1.8] */ @@ -22889,6 +23091,10 @@ declare namespace Excel { * @eventproperty */ readonly onDeactivated: OfficeExtension.EventHandlers; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Chart object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartData; } /** @@ -22898,6 +23104,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartAreaFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format of chart area, which includes color, linestyle, and weight. Read-only. @@ -22954,6 +23162,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartAreaFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartAreaFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartAreaFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartAreaFormatData; } /** @@ -22963,6 +23175,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartSeriesCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.ChartSeries[]; /** @@ -23016,6 +23230,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.ChartSeriesCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ChartSeriesCollection; load(option?: string | string[]): Excel.ChartSeriesCollection; load(option?: OfficeExtension.LoadOption): Excel.ChartSeriesCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ChartSeriesCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartSeriesCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ChartSeriesCollectionData; } /** @@ -23025,6 +23243,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartSeries extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents a collection of all dataLabels in the series. @@ -23194,7 +23414,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.8] */ - splitType: "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit"; + splitType: Excel.ChartSplitType | "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit"; /** * * True if Microsoft Excel assigns a different color or pattern to each data marker. The chart must contain only one series. Read/Write. @@ -23271,6 +23491,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartSeries; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartSeries object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartSeriesData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartSeriesData; } /** @@ -23280,6 +23504,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartSeriesFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the fill format of a chart series, which includes background formating information. Read-only. @@ -23329,6 +23555,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartSeriesFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartSeriesFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartSeriesFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartSeriesFormatData; } /** @@ -23338,6 +23568,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartPointsCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.ChartPoint[]; /** @@ -23381,6 +23613,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.ChartPointsCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ChartPointsCollection; load(option?: string | string[]): Excel.ChartPointsCollection; load(option?: OfficeExtension.LoadOption): Excel.ChartPointsCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ChartPointsCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartPointsCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ChartPointsCollectionData; } /** @@ -23390,6 +23626,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartPoint extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the data label of a chart point. Read-only. @@ -23481,6 +23719,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartPoint; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartPoint object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartPointData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartPointData; } /** @@ -23490,6 +23732,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartPointFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format of a chart data point, which includes color, style, and weight information. Read-only. @@ -23539,6 +23783,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartPointFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartPointFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartPointFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartPointFormatData; } /** @@ -23548,6 +23796,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartAxes extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the category axis in a chart. Read-only. @@ -23624,6 +23874,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartAxes; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartAxes object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartAxesData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartAxesData; } /** @@ -23633,6 +23887,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartAxis extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of a chart object, which includes line and font formatting. Read-only. @@ -23961,6 +24217,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartAxis; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartAxis object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartAxisData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartAxisData; } /** @@ -23970,6 +24230,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartAxisFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents chart fill formatting. Read-only. @@ -24026,6 +24288,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartAxisFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartAxisFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartAxisFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartAxisFormatData; } /** @@ -24035,6 +24301,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartAxisTitle extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of chart axis title. Read-only. @@ -24100,6 +24368,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartAxisTitle; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartAxisTitle object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartAxisTitleData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartAxisTitleData; } /** @@ -24109,6 +24381,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartAxisTitleFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format, which includes color, linestyle, and weight. @@ -24165,6 +24439,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartAxisTitleFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartAxisTitleFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartAxisTitleFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartAxisTitleFormatData; } /** @@ -24174,6 +24452,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartDataLabels extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the format of chart data labels, which includes fill and font formatting. Read-only. @@ -24190,7 +24470,8 @@ declare namespace Excel { autoText: boolean; /** * - * Represents the horizontal alignment for chart data label. See Excel.ChartTextHorizontalAlignment for details. This property is valid only when TextOrientation of data label is 0. + * Represents the horizontal alignment for chart data label. See Excel.ChartTextHorizontalAlignment for details. + This property is valid only when TextOrientation of data label is 0. * * [Api set: ExcelApi 1.8] */ @@ -24267,7 +24548,8 @@ declare namespace Excel { textOrientation: number; /** * - * Represents the vertical alignment of chart data label. See Excel.ChartTextVerticalAlignment for details. This property is valid only when TextOrientation of data label is -90, 90, or 180. + * Represents the vertical alignment of chart data label. See Excel.ChartTextVerticalAlignment for details. + This property is valid only when TextOrientation of data label is 90, -90 or 180. * * [Api set: ExcelApi 1.8] */ @@ -24307,6 +24589,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartDataLabels; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartDataLabels object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartDataLabelsData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartDataLabelsData; } /** @@ -24316,6 +24602,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartDataLabel extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the format of chart data label. @@ -24493,6 +24781,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartDataLabel; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartDataLabel object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartDataLabelData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartDataLabelData; } /** @@ -24502,6 +24794,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartDataLabelFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format, which includes color, linestyle, and weight. Read-only. @@ -24558,6 +24852,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartDataLabelFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartDataLabelFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartDataLabelFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartDataLabelFormatData; } /** @@ -24567,6 +24865,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartGridlines extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of chart gridlines. Read-only. @@ -24616,6 +24916,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartGridlines; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartGridlines object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartGridlinesData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartGridlinesData; } /** @@ -24625,6 +24929,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartGridlinesFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents chart line formatting. Read-only. @@ -24667,6 +24973,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartGridlinesFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartGridlinesFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartGridlinesFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartGridlinesFormatData; } /** @@ -24676,6 +24986,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartLegend extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of a chart legend, which includes fill and font formatting. Read-only. @@ -24781,6 +25093,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartLegend; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartLegend object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartLegendData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartLegendData; } /** @@ -24790,6 +25106,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartLegendEntry extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the height of the legendEntry on the chart Legend. @@ -24867,6 +25185,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartLegendEntry; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartLegendEntry object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartLegendEntryData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartLegendEntryData; } /** @@ -24876,6 +25198,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartLegendEntryCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.ChartLegendEntry[]; /** @@ -24912,6 +25236,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.ChartLegendEntryCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ChartLegendEntryCollection; load(option?: string | string[]): Excel.ChartLegendEntryCollection; load(option?: OfficeExtension.LoadOption): Excel.ChartLegendEntryCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ChartLegendEntryCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartLegendEntryCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ChartLegendEntryCollectionData; } /** @@ -24921,6 +25249,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartLegendFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format, which includes color, linestyle, and weight. Read-only. @@ -24977,6 +25307,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartLegendFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartLegendFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartLegendFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartLegendFormatData; } /** @@ -24986,6 +25320,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartTitle extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of a chart title, which includes fill and font formatting. Read-only. @@ -25131,6 +25467,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartTitle; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartTitle object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTitleData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartTitleData; } /** @@ -25140,6 +25480,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartFormatString extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the font attributes, such as font name, font size, color, etc. of chart characters object. @@ -25182,6 +25524,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartFormatString; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartFormatString object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartFormatStringData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartFormatStringData; } /** @@ -25191,6 +25537,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartTitleFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format of chart title, which includes color, linestyle, and weight. Read-only. @@ -25247,6 +25595,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartTitleFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartTitleFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTitleFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartTitleFormatData; } /** @@ -25256,6 +25608,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartFill extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. */ @@ -25276,6 +25630,10 @@ declare namespace Excel { * @param color HTML color code representing the color of the background, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). */ setSolidColor(color: string): void; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartFill object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartFillData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): { [key: string]: string; }; @@ -25287,6 +25645,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartBorder extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of borders in the chart. @@ -25350,6 +25710,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartBorder; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartBorder object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartBorderData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartBorderData; } /** @@ -25359,6 +25723,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartLineFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of lines in the chart. @@ -25422,6 +25788,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartLineFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartLineFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartLineFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartLineFormatData; } /** @@ -25431,6 +25801,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ class ChartFont extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the bold status of font. @@ -25508,6 +25880,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartFont; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartFont object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartFontData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartFontData; } /** @@ -25517,6 +25893,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartTrendline extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of a chart trendline. @@ -25636,6 +26014,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartTrendline; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartTrendline object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTrendlineData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartTrendlineData; } /** @@ -25645,6 +26027,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartTrendlineCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.ChartTrendline[]; /** @@ -25699,6 +26083,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.ChartTrendlineCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ChartTrendlineCollection; load(option?: string | string[]): Excel.ChartTrendlineCollection; load(option?: OfficeExtension.LoadOption): Excel.ChartTrendlineCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ChartTrendlineCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTrendlineCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ChartTrendlineCollectionData; } /** @@ -25708,6 +26096,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class ChartTrendlineFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents chart line formatting. Read-only. @@ -25750,6 +26140,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartTrendlineFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartTrendlineFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTrendlineFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartTrendlineFormatData; } /** @@ -25759,6 +26153,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class ChartTrendlineLabel extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the format of chart trendline label. @@ -25880,6 +26276,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartTrendlineLabel; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartTrendlineLabel object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTrendlineLabelData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartTrendlineLabelData; } /** @@ -25889,6 +26289,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class ChartTrendlineLabelFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border format, which includes color, linestyle, and weight. @@ -25945,6 +26347,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartTrendlineLabelFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartTrendlineLabelFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartTrendlineLabelFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartTrendlineLabelFormatData; } /** @@ -25954,6 +26360,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class ChartPlotArea extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the formatting of a chart plotArea. @@ -26059,6 +26467,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartPlotArea; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartPlotArea object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartPlotAreaData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartPlotAreaData; } /** @@ -26068,6 +26480,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class ChartPlotAreaFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the border attributes of a chart plotArea. @@ -26117,6 +26531,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ChartPlotAreaFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ChartPlotAreaFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ChartPlotAreaFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ChartPlotAreaFormatData; } /** @@ -26126,6 +26544,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class RangeSort extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Perform a sort operation. @@ -26152,6 +26572,10 @@ declare namespace Excel { * @param method Optional. The ordering method used for Chinese characters. */ apply(fields: Excel.SortField[], matchCase?: boolean, hasHeaders?: boolean, orientation?: "Rows" | "Columns", method?: "PinYin" | "StrokeCount"): void; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RangeSort object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RangeSortData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): { [key: string]: string; }; @@ -26163,6 +26587,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class TableSort extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the current conditions used to last sort the table. Read-only. @@ -26241,6 +26667,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.TableSort; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.TableSort object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TableSortData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.TableSortData; } /** @@ -26300,6 +26730,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class Filter extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * The currently applied filter on the given column. Read-only. @@ -26456,6 +26888,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.Filter; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Filter object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.FilterData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.FilterData; } /** @@ -26567,7 +27003,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.2] */ - set: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes"; + set: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes" | "LinkedEntityFinanceIcon" | "LinkedEntityMapIcon"; } /** * @@ -26578,6 +27014,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.5] */ class CustomXmlPartScopedCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.CustomXmlPart[]; /** @@ -26640,6 +27078,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.CustomXmlPartScopedCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.CustomXmlPartScopedCollection; load(option?: string | string[]): Excel.CustomXmlPartScopedCollection; load(option?: OfficeExtension.LoadOption): Excel.CustomXmlPartScopedCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.CustomXmlPartScopedCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CustomXmlPartScopedCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.CustomXmlPartScopedCollectionData; } /** @@ -26649,6 +27091,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.5] */ class CustomXmlPartCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.CustomXmlPart[]; /** @@ -26713,6 +27157,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.CustomXmlPartCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.CustomXmlPartCollection; load(option?: string | string[]): Excel.CustomXmlPartCollection; load(option?: OfficeExtension.LoadOption): Excel.CustomXmlPartCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.CustomXmlPartCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CustomXmlPartCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.CustomXmlPartCollectionData; } /** @@ -26722,6 +27170,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.5] */ class CustomXmlPart extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * The custom XML part's ID. Read-only. @@ -26780,6 +27230,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.CustomXmlPart; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.CustomXmlPart object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CustomXmlPartData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.CustomXmlPartData; } /** @@ -26789,6 +27243,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.3] */ class PivotTableCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.PivotTable[]; /** @@ -26853,6 +27309,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.PivotTableCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.PivotTableCollection; load(option?: string | string[]): Excel.PivotTableCollection; load(option?: OfficeExtension.LoadOption): Excel.PivotTableCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.PivotTableCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotTableCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.PivotTableCollectionData; } /** @@ -26865,6 +27325,8 @@ declare namespace Excel { * Our {@link https://docs.microsoft.com/office/dev/add-ins/excel/excel-add-ins-pivottables | how-to guide on working with PivotTables} has detailed walkthroughs, images, and code samples. */ class PivotTable extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * The Column Pivot Hierarchies of the PivotTable. @@ -26977,6 +27439,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.PivotTable; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.PivotTable object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotTableData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.PivotTableData; } /** @@ -26986,6 +27452,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotLayout extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * This property indicates the PivotLayoutType of all fields on the PivotTable. If fields have different states, this will be null. @@ -27084,6 +27552,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.PivotLayout; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.PivotLayout object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotLayoutData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.PivotLayoutData; } /** @@ -27093,6 +27565,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotHierarchyCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.PivotHierarchy[]; /** @@ -27138,6 +27612,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.PivotHierarchyCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.PivotHierarchyCollection; load(option?: string | string[]): Excel.PivotHierarchyCollection; load(option?: OfficeExtension.LoadOption): Excel.PivotHierarchyCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.PivotHierarchyCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotHierarchyCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.PivotHierarchyCollectionData; } /** @@ -27147,6 +27625,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotHierarchy extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the PivotFields associated with the PivotHierarchy. @@ -27203,6 +27683,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.PivotHierarchy; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.PivotHierarchy object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotHierarchyData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.PivotHierarchyData; } /** @@ -27212,6 +27696,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class RowColumnPivotHierarchyCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.RowColumnPivotHierarchy[]; /** @@ -27272,6 +27758,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.RowColumnPivotHierarchyCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.RowColumnPivotHierarchyCollection; load(option?: string | string[]): Excel.RowColumnPivotHierarchyCollection; load(option?: OfficeExtension.LoadOption): Excel.RowColumnPivotHierarchyCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.RowColumnPivotHierarchyCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RowColumnPivotHierarchyCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.RowColumnPivotHierarchyCollectionData; } /** @@ -27281,6 +27771,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class RowColumnPivotHierarchy extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the PivotFields associated with the RowColumnPivotHierarchy. @@ -27351,6 +27843,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.RowColumnPivotHierarchy; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.RowColumnPivotHierarchy object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.RowColumnPivotHierarchyData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.RowColumnPivotHierarchyData; } /** @@ -27360,6 +27856,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class FilterPivotHierarchyCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.FilterPivotHierarchy[]; /** @@ -27420,6 +27918,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.FilterPivotHierarchyCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.FilterPivotHierarchyCollection; load(option?: string | string[]): Excel.FilterPivotHierarchyCollection; load(option?: OfficeExtension.LoadOption): Excel.FilterPivotHierarchyCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.FilterPivotHierarchyCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.FilterPivotHierarchyCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.FilterPivotHierarchyCollectionData; } /** @@ -27429,6 +27931,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class FilterPivotHierarchy extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the PivotFields associated with the FilterPivotHierarchy. @@ -27506,6 +28010,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.FilterPivotHierarchy; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.FilterPivotHierarchy object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.FilterPivotHierarchyData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.FilterPivotHierarchyData; } /** @@ -27515,6 +28023,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class DataPivotHierarchyCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.DataPivotHierarchy[]; /** @@ -27574,6 +28084,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.DataPivotHierarchyCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.DataPivotHierarchyCollection; load(option?: string | string[]): Excel.DataPivotHierarchyCollection; load(option?: OfficeExtension.LoadOption): Excel.DataPivotHierarchyCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.DataPivotHierarchyCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.DataPivotHierarchyCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.DataPivotHierarchyCollectionData; } /** @@ -27583,6 +28097,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class DataPivotHierarchy extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the PivotFields associated with the DataPivotHierarchy. @@ -27674,6 +28190,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.DataPivotHierarchy; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.DataPivotHierarchy object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.DataPivotHierarchyData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.DataPivotHierarchyData; } /** @@ -27709,6 +28229,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotFieldCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.PivotField[]; /** @@ -27754,6 +28276,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.PivotFieldCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.PivotFieldCollection; load(option?: string | string[]): Excel.PivotFieldCollection; load(option?: OfficeExtension.LoadOption): Excel.PivotFieldCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.PivotFieldCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotFieldCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.PivotFieldCollectionData; } /** @@ -27763,6 +28289,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotField extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the PivotFields associated with the PivotField. @@ -27820,7 +28348,7 @@ declare namespace Excel { * * @param sortby Represents whether the sorting is done in an ascending or descending order. */ - sortByLabels(sortby: Excel.SortBy): void; + sortByLabels(sortby: SortBy): void; /** * Queues up a command to load the specified properties of the object. You must call "context.sync()" before reading the properties. * @@ -27842,6 +28370,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.PivotField; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.PivotField object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotFieldData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.PivotFieldData; } /** @@ -27851,6 +28383,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotItemCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.PivotItem[]; /** @@ -27896,6 +28430,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.PivotItemCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.PivotItemCollection; load(option?: string | string[]): Excel.PivotItemCollection; load(option?: OfficeExtension.LoadOption): Excel.PivotItemCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.PivotItemCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotItemCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.PivotItemCollectionData; } /** @@ -27905,6 +28443,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.8] */ class PivotItem extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Id of the PivotItem. @@ -27968,6 +28508,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.PivotItem; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.PivotItem object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PivotItemData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.PivotItemData; } /** @@ -28073,7 +28617,7 @@ declare namespace Excel { product = "Product", /** * - * Aggregate using the count of numbers in the data, equivalent to the COUNTA function. + * Aggregate using the count of numbers in the data, equivalent to the COUNT function. * */ countNumbers = "CountNumbers", @@ -28214,6 +28758,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class DocumentProperties extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Gets the collection of custom properties of the workbook. Read only. @@ -28333,6 +28879,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.DocumentProperties; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.DocumentProperties object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.DocumentPropertiesData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.DocumentPropertiesData; } /** @@ -28342,6 +28892,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class CustomProperty extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Gets the key of the custom property. Read only. @@ -28405,6 +28957,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.CustomProperty; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.CustomProperty object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CustomPropertyData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.CustomPropertyData; } /** @@ -28414,6 +28970,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class CustomPropertyCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.CustomProperty[]; /** @@ -28476,6 +29034,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.CustomPropertyCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.CustomPropertyCollection; load(option?: string | string[]): Excel.CustomPropertyCollection; load(option?: OfficeExtension.LoadOption): Excel.CustomPropertyCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.CustomPropertyCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CustomPropertyCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.CustomPropertyCollectionData; } /** @@ -28485,6 +29047,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalFormatCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** Gets the loaded child items in this collection. */ readonly items: Excel.ConditionalFormat[]; /** @@ -28556,6 +29120,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.ConditionalFormatCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ConditionalFormatCollection; load(option?: string | string[]): Excel.ConditionalFormatCollection; load(option?: OfficeExtension.LoadOption): Excel.ConditionalFormatCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ConditionalFormatCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalFormatCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ConditionalFormatCollectionData; } /** @@ -28565,6 +29133,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the cell value conditional format properties if the current conditional format is a CellValue type. @@ -28772,6 +29342,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalFormatData; } /** @@ -28781,6 +29355,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class DataBarConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Representation of all values to the left of the axis in an Excel data bar. Read-only. @@ -28873,6 +29449,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.DataBarConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.DataBarConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.DataBarConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.DataBarConditionalFormatData; } /** @@ -28882,6 +29462,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalDataBarPositiveFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). @@ -28939,6 +29521,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalDataBarPositiveFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalDataBarPositiveFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalDataBarPositiveFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalDataBarPositiveFormatData; } /** @@ -28948,6 +29534,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalDataBarNegativeFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). @@ -29012,6 +29600,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalDataBarNegativeFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalDataBarNegativeFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalDataBarNegativeFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalDataBarNegativeFormatData; } /** @@ -29043,6 +29635,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class CustomConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns a format object, encapsulating the conditional formats font, fill, borders, and other properties. Read-only. @@ -29092,6 +29686,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.CustomConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.CustomConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CustomConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.CustomConditionalFormatData; } /** @@ -29101,6 +29699,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalFormatRule extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * The formula, if required, to evaluate the conditional format rule on. @@ -29157,6 +29757,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalFormatRule; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalFormatRule object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalFormatRuleData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalFormatRuleData; } /** @@ -29166,6 +29770,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class IconSetConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * An array of Criteria and IconSets for the rules and potential custom icons for conditional icons. Note that for the first criterion only the custom icon can be modified, while type, formula, and operator will be ignored when set. @@ -29193,7 +29799,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.6] */ - style: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes"; + style: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes" | "LinkedEntityFinanceIcon" | "LinkedEntityMapIcon"; /** Sets multiple properties of an object at the same time. You can pass either a plain object with the appropriate properties, or another API object of the same type. * * @remarks @@ -29229,6 +29835,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.IconSetConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.IconSetConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.IconSetConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.IconSetConditionalFormatData; } /** @@ -29274,6 +29884,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ColorScaleConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * The criteria of the color scale. Midpoint is optional when using a two point color scale. @@ -29323,6 +29935,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ColorScaleConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ColorScaleConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ColorScaleConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ColorScaleConditionalFormatData; } /** @@ -29390,6 +30006,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class TopBottomConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns a format object, encapsulating the conditional formats font, fill, borders, and other properties. Read-only. @@ -29439,6 +30057,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.TopBottomConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.TopBottomConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TopBottomConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.TopBottomConditionalFormatData; } /** @@ -29470,6 +30092,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class PresetCriteriaConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns a format object, encapsulating the conditional formats font, fill, borders, and other properties. @@ -29519,6 +30143,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.PresetCriteriaConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.PresetCriteriaConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.PresetCriteriaConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.PresetCriteriaConditionalFormatData; } /** @@ -29543,6 +30171,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class TextConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns a format object, encapsulating the conditional formats font, fill, borders, and other properties. Read-only. @@ -29592,6 +30222,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.TextConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.TextConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.TextConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.TextConditionalFormatData; } /** @@ -29623,6 +30257,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class CellValueConditionalFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns a format object, encapsulating the conditional formats font, fill, borders, and other properties. @@ -29672,6 +30308,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.CellValueConditionalFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.CellValueConditionalFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.CellValueConditionalFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.CellValueConditionalFormatData; } /** @@ -29710,6 +30350,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalRangeFormat extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Collection of border objects that apply to the overall conditional format range. Read-only. @@ -29773,6 +30415,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalRangeFormat; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalRangeFormat object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalRangeFormatData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalRangeFormatData; } /** @@ -29782,6 +30428,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalRangeFont extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Represents the bold status of font. @@ -29859,6 +30507,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalRangeFont; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalRangeFont object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalRangeFontData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalRangeFontData; } /** @@ -29868,6 +30520,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalRangeFill extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of the fill, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). @@ -29917,6 +30571,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalRangeFill; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalRangeFill object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalRangeFillData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalRangeFillData; } /** @@ -29926,6 +30584,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalRangeBorder extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * HTML color code representing the color of the border line, of the form #RRGGBB (e.g. "FFA500") or as a named HTML color (e.g. "orange"). @@ -29982,6 +30642,10 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.ConditionalRangeBorder; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.ConditionalRangeBorder object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalRangeBorderData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.ConditionalRangeBorderData; } /** @@ -29991,6 +30655,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.6] */ class ConditionalRangeBorderCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Gets the bottom border. Read-only. @@ -30073,6 +30739,10 @@ declare namespace Excel { load(option?: Excel.Interfaces.ConditionalRangeBorderCollectionLoadOptions & Excel.Interfaces.CollectionLoadOptions): Excel.ConditionalRangeBorderCollection; load(option?: string | string[]): Excel.ConditionalRangeBorderCollection; load(option?: OfficeExtension.LoadOption): Excel.ConditionalRangeBorderCollection; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original `Excel.ConditionalRangeBorderCollection` object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.ConditionalRangeBorderCollectionData`) that contains an "items" array with shallow copies of any loaded properties from the collection's items. + */ toJSON(): Excel.Interfaces.ConditionalRangeBorderCollectionData; } /** @@ -30082,6 +30752,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class Style extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * A Border collection of four Border objects that represent the style of the four borders. @@ -30285,9 +30957,12 @@ declare namespace Excel { select?: string; expand?: string; }): Excel.Style; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Style object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.StyleData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Excel.Interfaces.StyleData; } - /** * * Represents a collection of all the styles. WARNING: The StyleCollection items array has a known issue when loading items from the collection. Do not use `StyleCollection.items`, any `load()` method, and the `toJSON()` method. @@ -30295,6 +30970,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class StyleCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * WARNING: The StyleCollection items array has a known issue when loading items from the collection. Do not use `StyleCollection.items`, any `load()` method, and the `toJSON()` method. */ @@ -30335,6 +31012,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ class DataConnectionCollection extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Refreshes all the Data Connections in the collection. @@ -30342,6 +31021,10 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ refreshAll(): void; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.DataConnectionCollection object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.DataConnectionCollectionData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): { [key: string]: string; }; @@ -30761,6 +31444,15 @@ declare namespace Excel { rows = "Rows", columns = "Columns", } + /** + * [Api set: ExcelApi 1.8] + */ + enum ChartSplitType { + splitByPosition = "SplitByPosition", + splitByValue = "SplitByValue", + splitByPercentValue = "SplitByPercentValue", + splitByCustomSplit = "SplitByCustomSplit", + } /** * [Api set: ExcelApi 1.8] */ @@ -31317,6 +32009,8 @@ declare namespace Excel { threeStars = "ThreeStars", threeTriangles = "ThreeTriangles", fiveBoxes = "FiveBoxes", + linkedEntityFinanceIcon = "LinkedEntityFinanceIcon", + linkedEntityMapIcon = "LinkedEntityMapIcon", } /** * [Api set: ExcelApi 1.2] @@ -31639,6 +32333,18 @@ declare namespace Excel { * */ visualChange = "VisualChange", + /** + * + * WorkbookAutoSaveSettingChanged represents the type of event registered on workbook, and occurs when there is an auto save setting change. + * + */ + workbookAutoSaveSettingChanged = "WorkbookAutoSaveSettingChanged", + /** + * + * WorksheetFormatChanged represents the type of event registered on worksheet, and occurs when there is a format changed. + * + */ + worksheetFormatChanged = "WorksheetFormatChanged", } /** * [Api set: ExcelApi 1.7] @@ -31836,6 +32542,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class FunctionResult extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Error value (such as "#DIV/0") representing the error. If the error string is not set, then the function succeeded, and its result is written to the Value field. The error is always in the English locale. @@ -31871,6 +32579,10 @@ declare namespace Excel { select?: string; expand?: string; }): FunctionResult; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original FunctionResult object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Interfaces.FunctionResultData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): Interfaces.FunctionResultData; } /** @@ -31880,6 +32592,8 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ class Functions extends OfficeExtension.ClientObject { + /** The request context associated with the object. This connects the add-in's process to the Office host application's process. */ + context: RequestContext; /** * * Returns the absolute value of a number, a number without its sign. @@ -35616,6 +36330,10 @@ declare namespace Excel { * @param sigma Is the population (known) standard deviation. If omitted, the sample standard deviation is used. */ z_Test(array: number | Excel.Range | Excel.RangeReference | Excel.FunctionResult, x: number | Excel.Range | Excel.RangeReference | Excel.FunctionResult, sigma?: number | Excel.Range | Excel.RangeReference | Excel.FunctionResult): FunctionResult; + /** + * Overrides the JavaScript `toJSON()` method in order to provide more useful output when an API object is passed to `JSON.stringify()`. (`JSON.stringify`, in turn, calls the `toJSON` method of the object that is passed to it.) + * Whereas the original Excel.Functions object is an API object, the `toJSON` method returns a plain JavaScript object (typed as `Excel.Interfaces.FunctionsData`) that contains shallow copies of any loaded child properties from the original object. + */ toJSON(): { [key: string]: string; }; @@ -35633,6 +36351,7 @@ declare namespace Excel { invalidSelection = "InvalidSelection", itemAlreadyExists = "ItemAlreadyExists", itemNotFound = "ItemNotFound", + nonBlankCellOffSheet = "NonBlankCellOffSheet", notImplemented = "NotImplemented", unsupportedOperation = "UnsupportedOperation", invalidOperationInCellEditMode = "InvalidOperationInCellEditMode", @@ -36578,7 +37297,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.8] */ - splitType?: "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit"; + splitType?: Excel.ChartSplitType | "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit"; /** * * True if Microsoft Excel assigns a different color or pattern to each data marker. The chart must contain only one series. Read/Write. @@ -36738,13 +37457,6 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ categoryType?: Excel.ChartAxisCategoryType | "Automatic" | "TextAxis" | "DateAxis"; - /** - * [DEPRECATED; kept for back-compat with existing first-party solutions]. Please use `Position` instead. - * Represents the specified axis where the other axis crosses. See Excel.ChartAxisPosition for details. - * - * [Api set: ExcelApi 1.7] - */ - crosses?: Excel.ChartAxisPosition | "Automatic" | "Maximum" | "Minimum" | "Custom"; /** * * Represents the axis display unit. See Excel.ChartAxisDisplayUnit for details. @@ -38441,7 +39153,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.6] */ - style?: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes"; + style?: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes" | "LinkedEntityFinanceIcon" | "LinkedEntityMapIcon"; } /** An interface for updating data on the ColorScaleConditionalFormat object, for use in "colorScaleConditionalFormat.set({ ... })". */ interface ColorScaleConditionalFormatUpdateData { @@ -38818,13 +39530,6 @@ declare namespace Excel { } /** An interface describing the data returned by calling "workbook.toJSON()". */ interface WorkbookData { - /** - * - * Represents the Excel application instance that contains this workbook. Read-only. - * - * [Api set: ExcelApi 1.1] - */ - application?: Excel.Interfaces.ApplicationData; /** * * Represents a collection of bindings that are part of the workbook. Read-only. @@ -38922,13 +39627,6 @@ declare namespace Excel { } /** An interface describing the data returned by calling "workbookCreated.toJSON()". */ interface WorkbookCreatedData { - /** - * - * Returns a value that uniquely identifies the WorkbookCreated object. - * - * [Api set: ExcelApi 1.8] - */ - id?: string; } /** An interface describing the data returned by calling "worksheet.toJSON()". */ interface WorksheetData { @@ -39080,13 +39778,6 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ format?: Excel.Interfaces.RangeFormatData; - /** - * - * The worksheet containing the current range. Read-only. - * - * [Api set: ExcelApi 1.1] - */ - worksheet?: Excel.Interfaces.WorksheetData; /** * * Represents the range reference in A1-style. Address value will contain the Sheet reference (e.g. "Sheet1!A1:B4"). Read-only. @@ -39375,20 +40066,6 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ arrayValues?: Excel.Interfaces.NamedItemArrayValuesData; - /** - * - * Returns the worksheet on which the named item is scoped to. Throws an error if the item is scoped to the workbook instead. - * - * [Api set: ExcelApi 1.4] - */ - worksheet?: Excel.Interfaces.WorksheetData; - /** - * - * Returns the worksheet on which the named item is scoped to. Returns a null object if the item is scoped to the workbook instead. - * - * [Api set: ExcelApi 1.4] - */ - worksheetOrNullObject?: Excel.Interfaces.WorksheetData; /** * * Represents the comment associated with this name. @@ -39504,13 +40181,6 @@ declare namespace Excel { * [Api set: ExcelApi 1.2] */ sort?: Excel.Interfaces.TableSortData; - /** - * - * The worksheet containing the current table. Read-only. - * - * [Api set: ExcelApi 1.2] - */ - worksheet?: Excel.Interfaces.WorksheetData; /** * * Indicates whether the first column contains special formatting. @@ -39956,13 +40626,6 @@ declare namespace Excel { * [Api set: ExcelApi 1.1] */ title?: Excel.Interfaces.ChartTitleData; - /** - * - * The worksheet containing the current chart. Read-only. - * - * [Api set: ExcelApi 1.2] - */ - worksheet?: Excel.Interfaces.WorksheetData; /** * * Returns or sets a ChartCategoryLabelLevel enumeration constant referring to @@ -40265,7 +40928,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.8] */ - splitType?: "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit"; + splitType?: Excel.ChartSplitType | "SplitByPosition" | "SplitByValue" | "SplitByPercentValue" | "SplitByCustomSplit"; /** * * True if Microsoft Excel assigns a different color or pattern to each data marker. The chart must contain only one series. Read/Write. @@ -40439,20 +41102,6 @@ declare namespace Excel { * [Api set: ExcelApi 1.7] */ categoryType?: Excel.ChartAxisCategoryType | "Automatic" | "TextAxis" | "DateAxis"; - /** - * [DEPRECATED; kept for back-compat with existing first-party solutions]. Please use `Position` instead. - * Represents the specified axis where the other axis crosses. See Excel.ChartAxisPosition for details. - * - * [Api set: ExcelApi 1.7] - */ - crosses?: Excel.ChartAxisPosition | "Automatic" | "Maximum" | "Minimum" | "Custom"; - /** - * [DEPRECATED; kept for back-compat with existing first-party solutions]. Please use `PositionAt` instead. - * Represents the specified axis where the other axis crosses at. Read Only. Set to this property should use SetCrossesAt(double) method. - * - * [Api set: ExcelApi 1.7] - */ - crossesAt?: number; /** * * Represents the custom axis display unit value. Read-only. To set this property, please use the SetCustomDisplayUnit(double) method. @@ -41745,25 +42394,11 @@ declare namespace Excel { hierarchies?: Excel.Interfaces.PivotHierarchyData[]; /** * - * The PivotLayout describing the layout and visual structure of the PivotTable. - * - * [Api set: ExcelApi 1.8] - */ - layout?: Excel.Interfaces.PivotLayoutData; - /** - * * The Row Pivot Hierarchies of the PivotTable. * * [Api set: ExcelApi 1.8] */ rowHierarchies?: Excel.Interfaces.RowColumnPivotHierarchyData[]; - /** - * - * The worksheet containing the current PivotTable. - * - * [Api set: ExcelApi 1.3] - */ - worksheet?: Excel.Interfaces.WorksheetData; /** * * Id of the PivotTable. Read-only. @@ -42508,7 +43143,7 @@ declare namespace Excel { * * [Api set: ExcelApi 1.6] */ - style?: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes"; + style?: Excel.IconSet | "Invalid" | "ThreeArrows" | "ThreeArrowsGray" | "ThreeFlags" | "ThreeTrafficLights1" | "ThreeTrafficLights2" | "ThreeSigns" | "ThreeSymbols" | "ThreeSymbols2" | "FourArrows" | "FourArrowsGray" | "FourRedToBlack" | "FourRating" | "FourTrafficLights" | "FiveArrows" | "FiveArrowsGray" | "FiveRating" | "FiveQuarters" | "ThreeStars" | "ThreeTriangles" | "FiveBoxes" | "LinkedEntityFinanceIcon" | "LinkedEntityMapIcon"; } /** An interface describing the data returned by calling "colorScaleConditionalFormat.toJSON()". */ interface ColorScaleConditionalFormatData { @@ -49004,6 +49639,7 @@ declare namespace Excel { + //////////////////////////////////////////////////////////////// diff --git a/types/pkg-versions/index.d.ts b/types/pkg-versions/index.d.ts new file mode 100644 index 0000000000..a271a57485 --- /dev/null +++ b/types/pkg-versions/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for pkg-versions 1.1 +// Project: https://github.com/sindresorhus/pkg-versions#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = pkgVersions; + +declare function pkgVersions(name: string): Promise>; diff --git a/types/pkg-versions/pkg-versions-tests.ts b/types/pkg-versions/pkg-versions-tests.ts new file mode 100644 index 0000000000..f0b963b998 --- /dev/null +++ b/types/pkg-versions/pkg-versions-tests.ts @@ -0,0 +1,3 @@ +import pkgVersions = require('pkg-versions'); + +pkgVersions('ava'); // $ExpectType Promise> diff --git a/types/pkg-versions/tsconfig.json b/types/pkg-versions/tsconfig.json new file mode 100644 index 0000000000..cc9bffbcd4 --- /dev/null +++ b/types/pkg-versions/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "pkg-versions-tests.ts" + ] +} diff --git a/types/pkg-versions/tslint.json b/types/pkg-versions/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/pkg-versions/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-lifecycles-compat/index.d.ts b/types/react-lifecycles-compat/index.d.ts new file mode 100644 index 0000000000..7db045bdde --- /dev/null +++ b/types/react-lifecycles-compat/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for react-lifecycles-compat 3.0 +// Project: https://github.com/reactjs/react-lifecycles-compat#readme +// Definitions by: bySabi Files +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.8 + +import * as React from 'react'; + +export function polyfill

(Comp: React.ComponentType

): React.ComponentType

; diff --git a/types/react-lifecycles-compat/react-lifecycles-compat-tests.ts b/types/react-lifecycles-compat/react-lifecycles-compat-tests.ts new file mode 100644 index 0000000000..bf514b6818 --- /dev/null +++ b/types/react-lifecycles-compat/react-lifecycles-compat-tests.ts @@ -0,0 +1,10 @@ +import * as React from 'react'; +import { polyfill } from 'react-lifecycles-compat'; + +class A extends React.Component { + render() { + return null; + } +} + +const Comp = polyfill(A); diff --git a/types/react-lifecycles-compat/tsconfig.json b/types/react-lifecycles-compat/tsconfig.json new file mode 100644 index 0000000000..25d2d0307d --- /dev/null +++ b/types/react-lifecycles-compat/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "jsx": "preserve" + }, + "files": [ + "index.d.ts", + "react-lifecycles-compat-tests.ts" + ] +} diff --git a/types/react-lifecycles-compat/tslint.json b/types/react-lifecycles-compat/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/react-lifecycles-compat/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/react-virtualized/index.d.ts b/types/react-virtualized/index.d.ts index b1f9acdc6d..c105c4db2f 100644 --- a/types/react-virtualized/index.d.ts +++ b/types/react-virtualized/index.d.ts @@ -4,7 +4,6 @@ // John Gunther // Konstantin Nesterov // Szőke Szabolcs -// Kræn Hansen // Steve Zhang // Maciej Goszczycki // Brandon Hall diff --git a/types/rgb-hex/index.d.ts b/types/rgb-hex/index.d.ts new file mode 100644 index 0000000000..44a54bad35 --- /dev/null +++ b/types/rgb-hex/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for rgb-hex 2.1 +// Project: https://github.com/sindresorhus/rgb-hex#readme +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = rgbHex; + +declare function rgbHex(rgba: string): string; +declare function rgbHex(red: number, green: number, blue: number, alpha?: string | number): string; diff --git a/types/rgb-hex/rgb-hex-tests.ts b/types/rgb-hex/rgb-hex-tests.ts new file mode 100644 index 0000000000..b2c950dd1b --- /dev/null +++ b/types/rgb-hex/rgb-hex-tests.ts @@ -0,0 +1,6 @@ +import rgbHex = require('rgb-hex'); + +rgbHex('rgb(40, 42, 54)'); // $ExpectType string +rgbHex(65, 131, 196); // $ExpectType string +rgbHex(65, 131, 196, 0.2); // $ExpectType string +rgbHex(40, 42, 54, '75%'); // $ExpectType string diff --git a/types/rgb-hex/tsconfig.json b/types/rgb-hex/tsconfig.json new file mode 100644 index 0000000000..cb4498db23 --- /dev/null +++ b/types/rgb-hex/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "rgb-hex-tests.ts" + ] +} diff --git a/types/rgb-hex/tslint.json b/types/rgb-hex/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/rgb-hex/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/showdown/index.d.ts b/types/showdown/index.d.ts index c058591d91..5b1e844cbf 100644 --- a/types/showdown/index.d.ts +++ b/types/showdown/index.d.ts @@ -340,11 +340,12 @@ declare namespace Showdown { /** * Converts an HTML string into a markdown string - * @param src + * + * @param src The input text (HTML) * @param [HTMLParser] A WHATWG DOM and HTML parser, such as JSDOM. If none is supplied, window.document will be used. - * @returns {string} + * @returns The output markdown */ - makeMarkdown(src: string, HTMLParser?: any): string; + makeMarkdown(src: string, HTMLParser?: HTMLDocument): string; /** * Setting a "local" option only affects the specified Converter object. diff --git a/types/simpl-schema/index.d.ts b/types/simpl-schema/index.d.ts index c59833b12e..16ba8245b0 100644 --- a/types/simpl-schema/index.d.ts +++ b/types/simpl-schema/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for simpl-schema 0.1 +// Type definitions for simpl-schema 0.2 // Project: https://github.com/aldeed/simple-schema-js // Definitions by: Andreas Richter // Qkramer @@ -135,6 +135,7 @@ interface SimpleSchemaStatic { objectKeys(keyPrefix: any): any[]; validate(obj: any, options?: ValidationOption): void; validator(options?: ValidationOption): () => boolean; + extendOptions(options: string[]): void; RegEx: { Email: RegExp; EmailWithTLD: RegExp; @@ -236,7 +237,6 @@ export interface SimpleSchema extends SimpleSchemaStatic { /** Validate a data object. Options: {keys: []} to limit */ validate(obj: any, options?: ValidationOption): void; addValidator(validator: () => boolean): any; - extendOptions(options: {[key: string]: any}): void; messages(messages: any): void; } diff --git a/types/simpl-schema/simpl-schema-tests.ts b/types/simpl-schema/simpl-schema-tests.ts index 48f246261e..92b103b20f 100644 --- a/types/simpl-schema/simpl-schema-tests.ts +++ b/types/simpl-schema/simpl-schema-tests.ts @@ -81,3 +81,5 @@ new SimpleSchema({ shortArray: Array, subSchema: StringSchemaWithOptions }); + +SimpleSchema.extendOptions(['autoform']); diff --git a/types/snapsvg/index.d.ts b/types/snapsvg/index.d.ts index 85f1eda7b8..cc9c4f3627 100644 --- a/types/snapsvg/index.d.ts +++ b/types/snapsvg/index.d.ts @@ -1,7 +1,11 @@ -// Type definitions for Snap-SVG 0.4.1 +// Type definitions for Snap-SVG 0.5.1 // Project: https://github.com/adobe-webplatform/Snap.svg -// Definitions by: Lars Klein , Mattanja Kern , Andrey Kurdyumov +// Definitions by: Lars Klein , +// Mattanja Kern , +// Andrey Kurdyumov , +// Terry Mun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.0 /// export = Snap; @@ -31,6 +35,7 @@ declare namespace Snap { export function plugin(f:Function):void; export function select(query:string):Snap.Element; export function selectAll(query:string):any; + export function set(...els:Snap.Element[]):Snap.Set; export function snapTo(values:Array|number,value:number,tolerance?:number):number; export function animate(from:number|number[],to:number|number[],updater:(n:number)=>void,duration:number,easing?:(num:number)=>number,callback?:()=>void):mina.MinaAnimation; @@ -299,22 +304,24 @@ declare namespace Snap { } export interface Set { - animate(attrs:{[attr:string]:string|number|boolean|any},duration:number,easing?:(num:number)=>number,callback?:()=>void):Snap.Element; - animate(...params:Array<{attrs:any,duration:number,easing:(num:number)=>number,callback?:()=>void}>):Snap.Element; - attr(params: {[attr:string]:string|number|boolean|BBox|any}): Snap.Element; - attr(param: "viewBox"): BBox; - attr(param: string): string; - bind(attr: string, callback: Function): Snap.Set; + animate(attrs:{[attr:string]:string|number|boolean|any},duration:number,easing?:(num:number)=>number,callback?:()=>void):Snap.Set; + animate(...attrs:[{[attr:string]:string|number|boolean|any},number?,((num:number)=>number)?,(()=>void)?][]):Snap.Element; + attr(params:{[attr:string]:string|number|boolean|BBox|any}):Snap.Set; + attr(param:"viewBox"):Snap.Set; + attr(param:string):Snap.Set; + bind(attr:string,callback:Function):Snap.Set; bind(attr:string,element:Snap.Element):Snap.Set; bind(attr:string,element:Snap.Element,eattr:string):Snap.Set; - clear():Snap.Set; - exclude(element:Snap.Element):boolean; - forEach(callback:Function,thisArg?:Object):Snap.Set; + clear():void; + exclude(el:Snap.Element):boolean; + forEach(callback:(el:Snap.Element,index?:number)=>void|boolean,thisArg?:Object):Snap.Set; + getBBox():BBox; + insertAfter():Snap.Set; pop():Snap.Element; - push(el:Snap.Element):Snap.Element; - push(els:Snap.Element[]):Snap.Element; - remove(): Snap.Set; - splice(index:number,count:number,insertion?:Object[]):Snap.Element[]; + push(el:Snap.Element):Snap.Set; + push(...els:Snap.Element[]):Snap.Set; + remove():Snap.Set; + splice(index:number,count:number,...insertion:Snap.Element[]):Snap.Set; } interface Filter { diff --git a/types/snapsvg/test/4.ts b/types/snapsvg/test/4.ts new file mode 100644 index 0000000000..cfe9b40b14 --- /dev/null +++ b/types/snapsvg/test/4.ts @@ -0,0 +1,121 @@ +(() => { + // Tests by Terry Mun + // Checks that Snap.set() is properly typed + + const s = Snap(300, 500); + s.attr({ + viewBox: '0 0 200 500' + }); + + // Create multiple elements to be added to set + const rect1 = s.rect(0, 0, 50, 50); + const rect2 = s.rect(0, 100, 50, 50); + const rect3 = s.rect(0, 200, 50, 50); + const rect4 = s.rect(0, 300, 50, 50); + let rect5: Snap.Element; + + // Create new set + const rectSet = Snap.set(rect1, rect2); + + // Add missing rectangles to set + rectSet.push(rect3, rect4); + + // Set all attributes + rectSet.attr({ + fill: 'steelblue' + }); + + // Animate all elements in set + function animateTest() { + return new Promise(resolve => { + rectSet.animate({ + x: 50 + }, 500, mina.bounce, resolve); + }); + } + + // Animate elements individually + function animateMultipleTest() { + return new Promise(resolve => { + rectSet.animate( + [{ x: 100 }, 500, mina.linear], + [{ x: 100 }, 1000, mina.linear], + [{ x: 100 }, 1500, mina.linear], + [{ x: 100 }, 2000, mina.linear, resolve] + ); + }); + } + + // Animate elements individually + function forEachTest() { + const colors = ['red', 'green', 'blue']; + return new Promise(resolve => { + rectSet.forEach((element, idx) => { + element.attr({ + fill: colors[idx] || '#aaa' + }); + }); + resolve(); + }); + } + + // Exclude rect4 from set + function excludeTest() { + return new Promise(resolve => { + rectSet.exclude(rect4); + rectSet.animate({ + x: 150 + }, 500, mina.bounce, resolve); + }); + } + + // Remove rect2 from set (it has index of 1) + // Add new rect5 to set + async function spliceTest() { + rectSet.splice(1, 1); + rectSet.attr({ + fill: '#000' + }); + + rect5 = s.rect(100, 400, 50, 50); + rectSet.splice(1, 0, rect5); + return; + } + + // Clear set. Rectangles should not go back to x=0 + function clearTest() { + return new Promise(resolve => { + rectSet.clear(); + + // SHOULD NOT WORK + rectSet.animate({ + x: 0 + }, 500, mina.bounce, resolve); + + // Re-add rects to set + rectSet.push(rect1, rect2, rect3, rect4, rect5); + resolve(); + }); + } + + // Remove all elements from DOM that are present in set + async function removeTest() { + rectSet.remove(); + return; + } + + // Start test + async function startTest() { + await animateTest(); + await animateMultipleTest(); + await forEachTest(); + await excludeTest(); + await spliceTest(); + await clearTest(); + await removeTest(); + + return; + } + + startTest(); +})(); diff --git a/types/snapsvg/tsconfig.json b/types/snapsvg/tsconfig.json index 7ee69cd259..23101593c7 100644 --- a/types/snapsvg/tsconfig.json +++ b/types/snapsvg/tsconfig.json @@ -21,6 +21,7 @@ "index.d.ts", "test/1.ts", "test/2.ts", - "test/3.ts" + "test/3.ts", + "test/4.ts" ] } \ No newline at end of file diff --git a/types/socketcluster-server/scserver.d.ts b/types/socketcluster-server/scserver.d.ts index 48952a8a8a..c04c4888f0 100644 --- a/types/socketcluster-server/scserver.d.ts +++ b/types/socketcluster-server/scserver.d.ts @@ -49,8 +49,27 @@ declare class SCServer extends EventEmitter { addMiddleware(type: "publishOut", middlewareFn: (req: SCServer.PublishOutRequest, next: SCServer.nextMiddlewareFunction) => void): void; addMiddleware(type: "emit", middlewareFn: (req: SCServer.EmitRequest, next: SCServer.nextMiddlewareFunction) => void): void; + removeMiddleware(type: "handshakeWS", middlewareFn: (req: IncomingMessage, next: SCServer.nextMiddlewareFunction) => void): void; + removeMiddleware(type: "handshakeSC", middlewareFn: (req: SCServer.HandshakeSCRequest, next: SCServer.nextHandshakeSCMiddlewareFunction) => void): void; + removeMiddleware(type: "authenticate", middlewareFn: (req: SCServer.AuthenticateRequest, next: SCServer.nextAuthenticateMiddlewareFunction) => void): void; + removeMiddleware(type: "subscribe", middlewareFn: (req: SCServer.SubscribeRequest, next: SCServer.nextMiddlewareFunction) => void): void; + removeMiddleware(type: "publishIn", middlewareFn: (req: SCServer.PublishInRequest, next: SCServer.nextMiddlewareFunction) => void): void; + removeMiddleware(type: "publishOut", middlewareFn: (req: SCServer.PublishOutRequest, next: SCServer.nextMiddlewareFunction) => void): void; + removeMiddleware(type: "emit", middlewareFn: (req: SCServer.EmitRequest, next: SCServer.nextMiddlewareFunction) => void): void; + setAuthEngine(authEngine: SCAuthEngine): void; setCodecEngine(codecEngine: SCServer.SCCodecEngine): void; + + close(cb?: (err?: Error) => void): void; + + getPath(): string; + generateId(): string; + + verifyHandshake(info: SCServer.VerifyHandshakeInfo, cb: SCServer.verifyHandshakeFunction): void; + verifyInboundEvent(socket: SCServerSocket, eventName: string, eventData: any, cb: (err: Error, eventData: any, ackData?: any) => void): void; + verifyOutboundEvent(socket: SCServerSocket, eventName: string, eventData: any, options: {} | null, cb: (err: Error | null, eventData: any) => void): void; + + isAuthTokenExpired(token: SCServer.AuthToken): boolean; } export = SCServer; @@ -322,7 +341,7 @@ declare namespace SCServer { type nextAuthenticateMiddlewareFunction = (error?: true | string | Error | null, isBadToken?: boolean) => void; type connectionListenerFunction = (scSocket: SCServerSocket, serverSocketStatus: SCServerSocketStatus) => void; type disconnectionListenerFunction = (scSocket: SCServerSocket, code: number, data: any) => void; - type subscriptionListenerFunction = (scSocket: SCServerSocket, name: string, options: {channel: string}) => void; + type subscriptionListenerFunction = (scSocket: SCServerSocket, name: string, options: { channel: string }) => void; type unsubscriptionListenerFunction = (scSocket: SCServerSocket, channel: string) => void; type handshakeListenerFunction = (scSocket: SCServerSocket) => void; type badSocketAuthTokenListenerFunction = (scSocket: SCServerSocket, status: badAuthStatus) => void; @@ -331,4 +350,11 @@ declare namespace SCServer { decode: (input: any) => any; ncode: (object: any) => any; } + + interface VerifyHandshakeInfo { + req: IncomingMessage; + origin?: string; + } + + type verifyHandshakeFunction = (success: boolean, errorCode?: number, errorMessage?: string) => void; } diff --git a/types/spected/index.d.ts b/types/spected/index.d.ts new file mode 100644 index 0000000000..13b46ddd22 --- /dev/null +++ b/types/spected/index.d.ts @@ -0,0 +1,30 @@ +// Type definitions for spected 0.26 +// Project: https://github.com/25th-floor/spected +// Definitions by: Benjamin Makus +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +declare var spected: Spected; + +export type Spected = (spec: Spec, input: any) => Result; + +export type Predicate = (value: any, inputs: any) => boolean; + +export type ErrorMsg = + | string + | ((value: any, field: string) => string); + +export interface Spec { + [key: string]: SpecValue; +} + +export type SpecValue = + | ReadonlyArray<[Predicate, ErrorMsg]> + | ((value: any) => any) + | Spec; + +export interface Result { + [key: string]: true | string[] | Result; +} + +export default spected; diff --git a/types/spected/tsconfig.json b/types/spected/tsconfig.json new file mode 100644 index 0000000000..ecc22c8314 --- /dev/null +++ b/types/spected/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts" + ] +} diff --git a/types/spected/tslint.json b/types/spected/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/spected/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/weixin-app/index.d.ts b/types/weixin-app/index.d.ts index b33af483a1..9422850bc5 100644 --- a/types/weixin-app/index.d.ts +++ b/types/weixin-app/index.d.ts @@ -1920,9 +1920,9 @@ declare namespace wx { */ title: string; /** - * 图标,只支持"success"、"loading" + * 图标,只支持 "success", "loading", "none" */ - icon?: "success" | "loading"; + icon?: "success" | "loading" | "none"; /** * 自定义图标的本地路径,image 的优先级高于 icon */ diff --git a/types/when-dom-ready/index.d.ts b/types/when-dom-ready/index.d.ts new file mode 100644 index 0000000000..4c7dda748c --- /dev/null +++ b/types/when-dom-ready/index.d.ts @@ -0,0 +1,13 @@ +// Type definitions for when-dom-ready 1.2 +// Project: https://github.com/lukechilds/when-dom-ready +// Definitions by: BendingBender +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export = whenDomReady; + +declare function whenDomReady(document?: EventTarget): Promise; +declare function whenDomReady(callback?: () => void, document?: EventTarget): Promise; + +declare namespace whenDomReady { + function resume(document?: EventTarget): (value: T) => Promise; +} diff --git a/types/when-dom-ready/tsconfig.json b/types/when-dom-ready/tsconfig.json new file mode 100644 index 0000000000..a00e26ff4a --- /dev/null +++ b/types/when-dom-ready/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "when-dom-ready-tests.ts" + ] +} diff --git a/types/when-dom-ready/tslint.json b/types/when-dom-ready/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/when-dom-ready/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } diff --git a/types/when-dom-ready/when-dom-ready-tests.ts b/types/when-dom-ready/when-dom-ready-tests.ts new file mode 100644 index 0000000000..0bc9e061a7 --- /dev/null +++ b/types/when-dom-ready/when-dom-ready-tests.ts @@ -0,0 +1,7 @@ +import whenDomReady = require('when-dom-ready'); + +whenDomReady(); // $ExpectType Promise +whenDomReady(document); // $ExpectType Promise +whenDomReady(() => {}, document); // $ExpectType Promise + +Promise.resolve('foo').then(whenDomReady.resume(document)); // $ExpectType Promise