From 836e57e76558b4a97189c4ccf65c751807db7655 Mon Sep 17 00:00:00 2001 From: Kyle Buzby Date: Fri, 1 Sep 2017 13:54:42 -0500 Subject: [PATCH 001/177] Update dts-gen example with proper command line option --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b16884273..5631d78375 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ Your package should have this structure: | tsconfig.json | This allows you to run `tsc` within the package. | | tslint.json | Enables linting. | -Generate these by running `npm install -g dts-gen` and `dts-gen --dt --name my-package-name --template module`. +Generate these by running `npm install -g dts-gen` and `dts-gen --dt --name my-package-name --module module`. See all options at [dts-gen](https://github.com/Microsoft/dts-gen). You may edit the `tsconfig.json` to add new files, to add `"target": "es6"` (needed for async functions), to add to `"lib"`, or to add the `"jsx"` compiler option. From 109298354cabba3ee9959f213ce456c7e424971c Mon Sep 17 00:00:00 2001 From: Brice BERNARD Date: Sat, 9 Dec 2017 18:19:19 +0100 Subject: [PATCH 002/177] Prettier test --- types/jsonwebtoken/jsonwebtoken-tests.ts | 76 +++++++++++++----------- 1 file changed, 42 insertions(+), 34 deletions(-) diff --git a/types/jsonwebtoken/jsonwebtoken-tests.ts b/types/jsonwebtoken/jsonwebtoken-tests.ts index 9e495d31cb..3ced0ccfb5 100644 --- a/types/jsonwebtoken/jsonwebtoken-tests.ts +++ b/types/jsonwebtoken/jsonwebtoken-tests.ts @@ -11,39 +11,44 @@ var token: string; var cert: Buffer; interface ITestObject { - 'foo': string + foo: string; } -const testObject = { foo: 'bar' } +const testObject = { foo: "bar" }; /** * jwt.sign * https://github.com/auth0/node-jsonwebtoken#usage */ // sign with default (HMAC SHA256) -token = jwt.sign(testObject, 'shhhhh'); +token = jwt.sign(testObject, "shhhhh"); // sign with default (HMAC SHA256) and single audience -token = jwt.sign(testObject, 'shhhhh', { audience: "theAudience"}); +token = jwt.sign(testObject, "shhhhh", { audience: "theAudience" }); // sign with default (HMAC SHA256) and multiple audiences -token = jwt.sign(testObject, 'shhhhh', { audience: ["audience1", "audience2"]}); +token = jwt.sign(testObject, "shhhhh", { + audience: ["audience1", "audience2"], +}); // sign with default (HMAC SHA256) and a keyid -token = jwt.sign(testObject, 'shhhhh', { keyid: "theKeyId"}); +token = jwt.sign(testObject, "shhhhh", { keyid: "theKeyId" }); // sign with RSA SHA256 -cert = fs.readFileSync('private.key'); // get private key -token = jwt.sign(testObject, cert, { algorithm: 'RS256'}); +cert = fs.readFileSync("private.key"); // get private key +token = jwt.sign(testObject, cert, { algorithm: "RS256" }); // sign with encrypted RSA SHA256 private key (only PEM encoding is supported) -const privKey: Buffer = fs.readFileSync('encrypted_private.key'); // get private key -const secret = {key: privKey.toString(), passphrase: 'keypwd'} -token = jwt.sign(testObject, secret, { algorithm: 'RS256' }); // the algorithm option is mandatory in this case +const privKey: Buffer = fs.readFileSync("encrypted_private.key"); // get private key +const secret = { key: privKey.toString(), passphrase: "keypwd" }; +token = jwt.sign(testObject, secret, { algorithm: "RS256" }); // the algorithm option is mandatory in this case // sign asynchronously -jwt.sign(testObject, cert, { algorithm: 'RS256' }, function(err: Error, token: string) { - console.log(token); +jwt.sign(testObject, cert, { algorithm: "RS256" }, function( + err: Error, + token: string, +) { + console.log(token); }); /** @@ -51,48 +56,51 @@ jwt.sign(testObject, cert, { algorithm: 'RS256' }, function(err: Error, token: s * https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback */ // verify a token symmetric -jwt.verify(token, 'shhhhh', function(err, decoded) { - const result = decoded as ITestObject +jwt.verify(token, "shhhhh", function(err, decoded) { + const result = decoded as ITestObject; - console.log(result.foo) // bar + console.log(result.foo); // bar }); // invalid token -jwt.verify(token, 'wrong-secret', function(err, decoded) { - // err - // decoded undefined +jwt.verify(token, "wrong-secret", function(err, decoded) { + // err + // decoded undefined }); // verify a token asymmetric -cert = fs.readFileSync('public.pem'); // get public key -jwt.verify(token, cert, function (err, decoded) { - const result = decoded as ITestObject +cert = fs.readFileSync("public.pem"); // get public key +jwt.verify(token, cert, function(err, decoded) { + const result = decoded as ITestObject; - console.log(result.foo) // bar + console.log(result.foo); // bar }); // verify audience -cert = fs.readFileSync('public.pem'); // get public key -jwt.verify(token, cert, { audience: 'urn:foo' }, function(err, decoded) { - // if audience mismatch, err == invalid audience +cert = fs.readFileSync("public.pem"); // get public key +jwt.verify(token, cert, { audience: "urn:foo" }, function(err, decoded) { + // if audience mismatch, err == invalid audience }); // verify issuer -cert = fs.readFileSync('public.pem'); // get public key -jwt.verify(token, cert, { audience: 'urn:foo', issuer: 'urn:issuer' }, function(err, decoded) { - // if issuer mismatch, err == invalid issuer +cert = fs.readFileSync("public.pem"); // get public key +jwt.verify(token, cert, { audience: "urn:foo", issuer: "urn:issuer" }, function( + err, + decoded, +) { + // if issuer mismatch, err == invalid issuer }); // verify algorithm -cert = fs.readFileSync('public.pem'); // get public key -jwt.verify(token, cert, { algorithms: ['RS256'] }, function(err, decoded) { - // if algorithm mismatch, err == invalid algorithm +cert = fs.readFileSync("public.pem"); // get public key +jwt.verify(token, cert, { algorithms: ["RS256"] }, function(err, decoded) { + // if algorithm mismatch, err == invalid algorithm }); // verify without expiration check -cert = fs.readFileSync('public.pem'); // get public key +cert = fs.readFileSync("public.pem"); // get public key jwt.verify(token, cert, { ignoreExpiration: true }, function(err, decoded) { - // if ignoreExpration == false and token is expired, err == expired token + // if ignoreExpration == false and token is expired, err == expired token }); /** From ed28cd0b50ea04fb5d458710b403e1bfc371c8db Mon Sep 17 00:00:00 2001 From: Brice BERNARD Date: Sat, 9 Dec 2017 18:22:02 +0100 Subject: [PATCH 003/177] Add test and related fix --- types/jsonwebtoken/index.d.ts | 2 +- types/jsonwebtoken/jsonwebtoken-tests.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/jsonwebtoken/index.d.ts b/types/jsonwebtoken/index.d.ts index 766042e627..6455eeb1ba 100644 --- a/types/jsonwebtoken/index.d.ts +++ b/types/jsonwebtoken/index.d.ts @@ -166,4 +166,4 @@ declare function verify( declare function decode( token: string, options?: DecodeOptions, -): null | object | string; +): null | { [key: string]: any } | string; diff --git a/types/jsonwebtoken/jsonwebtoken-tests.ts b/types/jsonwebtoken/jsonwebtoken-tests.ts index 3ced0ccfb5..87e3a56390 100644 --- a/types/jsonwebtoken/jsonwebtoken-tests.ts +++ b/types/jsonwebtoken/jsonwebtoken-tests.ts @@ -111,6 +111,10 @@ var decoded = jwt.decode(token); decoded = jwt.decode(token, { complete: false }); +if (decoded !== null && typeof decoded === "object") { + console.log(decoded.foo); +} + decoded = jwt.decode(token, { json: false }); decoded = jwt.decode(token, { complete: false, json: false }); From 8a94d4a3d434602d3fbc7d6b768bb9d535410d3b Mon Sep 17 00:00:00 2001 From: Brice BERNARD Date: Sat, 9 Dec 2017 18:32:00 +0100 Subject: [PATCH 004/177] Bump version --- types/jsonwebtoken/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jsonwebtoken/index.d.ts b/types/jsonwebtoken/index.d.ts index 6455eeb1ba..cd05b54d69 100644 --- a/types/jsonwebtoken/index.d.ts +++ b/types/jsonwebtoken/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jsonwebtoken 7.2.1 +// Type definitions for jsonwebtoken 7.2.2 // Project: https://github.com/auth0/node-jsonwebtoken // Definitions by: Maxime LUCE , // Daniel Heim , From 722a3b0a0a4e04766cca4487c16b8b386a11ad62 Mon Sep 17 00:00:00 2001 From: Kyle Buzby Date: Wed, 14 Feb 2018 18:30:27 -0600 Subject: [PATCH 005/177] add dts-gen files --- types/postman-collection/index.d.ts | 5877 +++++++++++++++++ .../postman-collection-tests.ts | 0 types/postman-collection/tsconfig.json | 22 + types/postman-collection/tslint.json | 1 + 4 files changed, 5900 insertions(+) create mode 100644 types/postman-collection/index.d.ts create mode 100644 types/postman-collection/postman-collection-tests.ts create mode 100644 types/postman-collection/tsconfig.json create mode 100644 types/postman-collection/tslint.json diff --git a/types/postman-collection/index.d.ts b/types/postman-collection/index.d.ts new file mode 100644 index 0000000000..92e39e82d2 --- /dev/null +++ b/types/postman-collection/index.d.ts @@ -0,0 +1,5877 @@ +// Type definitions for postman-collection 3.0 +// Project: https://github.com/postmanlabs/postman-collection#readme +// Definitions by: My Self +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +export class Certificate { + constructor(options: any, ...args: any[]); + + canApplyTo(url: any): any; + + toJSON(): any; + + update(options: any): void; + + static isCertificate(obj: any): any; + +} + +export class CertificateList { + constructor(parent: any, list: any); + + resolveOne(url: any): any; + + static isCertificateList(obj: any): any; + +} + +export class Collection { + constructor(definition: any, environments: any); + + syncVariablesFrom(obj: any, track: any): any; + + syncVariablesTo(obj: any): any; + + toJSON(): any; + + static isCollection(obj: any): any; + +} + +export class Cookie { + constructor(options: any); + + update(options: any): void; + + valueOf(): any; + + static isCookie(obj: any): any; + + static parse(str: any): any; + + static splitParam(param: any): any; + +} + +export class Description { + constructor(definition: any); + + toJSON(): any; + + toString(): any; + + update(content: any, type: any): void; + + static isDescription(obj: any): any; + +} + +export class Event { + constructor(definition: any); + + update(definition: any): void; + +} + +export class EventList { + constructor(parent: any, populate: any); + + listeners(name: any): any; + + listenersOwn(name: any): any; + + static isEventList(obj: any): any; + +} + +export class FormParam { + constructor(options: any, ...args: any[]); + + toString(): any; + + valueOf(): any; + + static parse(): void; + +} + +export class Header { + constructor(options: any, name: any, ...args: any[]); + + toString(): any; + + update(options: any): void; + + valueOf(): any; + + static create(...args: any[]): any; + + static isHeader(obj: any): any; + + static parse(headerString: any): any; + + static parseSingle(header: any): any; + + static unparse(headers: any, separator: any): any; + + static unparseSingle(header: any): any; + +} + +export class HeaderList { + constructor(parent: any, headers: any); + + contentSize(): any; + + static isHeaderList(obj: any): any; + +} + +export class Item { + constructor(definition: any, ...args: any[]); + + authorizeRequestUsing(type: any, options: any): any; + + getAuth(): any; + + getEvents(name: any): any; + + static isItem(obj: any): any; + +} + +export class ItemGroup { + constructor(definition: any, ...args: any[]); + + authorizeRequestsUsing(type: any, options: any): void; + + forEachItem(callback: any): any; + + forEachItemGroup(callback: any): void; + + oneDeep(idOrName: any): any; + + static isItemGroup(obj: any): any; + +} + +export class Property { + constructor(definition: any, ...args: any[]); + + describe(content: any, type: any): void; + + toObjectResolved(scope: any, overrides: any, options: any): any; + + static replaceSubstitutions(str: any, variables: any, ...args: any[]): any; + + static replaceSubstitutionsIn(obj: any, variables: any, mutate: any): any; + +} + +export class PropertyBase { + constructor(definition: any); + + findInParents(property: any, customizer: any): any; + + findParentContaining(property: any, customizer: any): any; + + forEachParent(options: any, iterator: any): void; + + meta(...args: any[]): any; + + parent(): any; + + setParent(parent: any): void; + + toJSON(): any; + + static propertyIsMeta(value: any, key: any): any; + + static propertyUnprefixMeta(value: any, key: any): any; + + static toJSON(obj: any): any; + +} + +export class PropertyList { + constructor(type: any, parent: any, populate: any); + + add(item: any, ...args: any[]): void; + + all(): any; + + append(item: any): any; + + assimilate(source: any, prune: any): void; + + clear(): void; + + count(): any; + + each(iterator: any, context: any): void; + + eachParent(iterator: any, context: any): void; + + filter(rule: any, context: any): any; + + find(rule: any, context: any): any; + + get(key: any): any; + + has(item: any, value: any, ...args: any[]): any; + + idx(index: any): any; + + indexOf(item: any): any; + + insert(item: any, before: any): void; + + insertAfter(item: any, after: any): any; + + map(iterator: any, context: any): any; + + one(id: any): any; + + populate(items: any): void; + + prepend(item: any): any; + + remove(predicate: any, context: any, ...args: any[]): any; + + repopulate(items: any): void; + + toJSON(): any; + + toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; + + toString(): any; + + upsert(item: any): any; + + static isPropertyList(obj: any): any; + +} + +export class ProxyConfig { + constructor(options: any); + + getProtocols(): any; + + getProxyUrl(): any; + + test(urlStr: any): any; + + update(options: any): void; + + updateProtocols(protocols: any): void; + + static isProxyConfig(obj: any): any; + +} + +export class ProxyConfigList { + constructor(parent: any, populate: any); + + resolve(url: any): any; + + static isProxyConfigList(obj: any): any; + +} + +export class QueryParam { + constructor(options: any, ...args: any[]); + + toString(): any; + + update(param: any): void; + + valueOf(): any; + + static parse(query: any): any; + + static parseSingle(param: any, idx: any, all: any): any; + + static unparse(params: any, options: any): any; + + static unparseSingle(obj: any, encode: any): any; + +} + +export class Request { + constructor(options: any, ...args: any[]); + + addHeader(header: any): void; + + addQueryParams(params: any): void; + + authorize(): void; + + authorizeUsing(type: any, options: any): void; + + clone(): any; + + forEachHeader(callback: any): any; + + getHeaders(options: any): any; + + removeHeader(toRemove: any, options: any): any; + + removeQueryParams(params: any): void; + + toJSON(): any; + + update(options: any): void; + + upsertHeader(header: any): any; + + static isRequest(obj: any): any; + +} + +export class RequestAuth { + constructor(options: any, parent: any); + + clear(type: any): void; + + current(): any; + + parameters(): any; + + update(options: any, type: any): void; + + use(type: any, options: any): void; + + static isValidType(type: any): any; + +} + +export class RequestBody { + constructor(options: any, ...args: any[]); + + isEmpty(): any; + + toString(): any; + + update(options: any): void; + + static MODES: { + file: string; + formdata: string; + raw: string; + urlencoded: string; + }; + +} + +export class Response { + constructor(options: any, ...args: any[]); + + dataURI(): any; + + details(): any; + + encoding(): any; + + json(reviver: any, strict: any): any; + + mime(contentType: any, contentDisposition: any): any; + + reason(): any; + + size(): any; + + text(): any; + + toJSON(): any; + + update(options: any): void; + + static createFromNode(response: any, cookies: any): any; + + static isResponse(obj: any): any; + + static mimeInfo(type: any, disposition: any): any; + +} + +export class Script { + constructor(options: any, ...args: any[]); + + toSource(): any; + + update(options: any): void; + + static isScript(obj: any): any; + +} + +export class Url { + constructor(options: any, ...args: any[]); + + addQueryParams(params: any): void; + + getHost(): any; + + getOAuth1BaseUrl(): any; + + getPath(options: any): any; + + getPathWithQuery(): any; + + getQueryString(options: any): any; + + getRaw(): any; + + getRemote(options: any): any; + + removeQueryParams(params: any): any; + + toString(forceProtocol: any): any; + + update(url: any): any; + + static isUrl(obj: any): any; + + static parse(url: any): any; + +} + +export class UrlMatchPattern { + constructor(options: any, ...args: any[]); + + createMatchPattern(): any; + + getProtocols(): any; + + globPatternToRegexp(pattern: any): any; + + matchAbsoluteHostPattern(matchRegexObject: any, remote: any): any; + + matchAnyHost(matchRegexObject: any): any; + + matchSuffixHostPattern(matchRegexObject: any, remote: any): any; + + test(urlStr: any): any; + + testHost(host: any): any; + + testPath(path: any): any; + + testProtocol(protocol: any): any; + + toJSON(): any; + + toString(): any; + + update(options: any): void; + + static MATCH_ALL_URLS: string; + + static PROTOCOL_DELIMITER: string; + +} + +export class UrlMatchPatternList { + constructor(parent: any, list: any); + + test(urlStr: any): any; + +} + +export class Variable { + constructor(definition: any, ...args: any[]); + + cast(value: any): any; + + castIn(value: any): any; + + castOut(value: any): any; + + get(): any; + + set(value: any): void; + + toString(): any; + + update(options: any): void; + + valueOf(value: any, ...args: any[]): any; + + valueType(typeName: any, _noCast: any): any; + + static isVariable(obj: any): any; + +} + +export class VariableList { + constructor(parent: any, populate: any); + + replace(str: any, overrides: any): any; + + substitute(obj: any, overrides: any, mutate: any): any; + + syncFromObject(obj: any, track: any, prune: any): any; + + syncToObject(obj: any): any; + + static isVariableList(obj: any): any; + +} + +export class VariableScope { + constructor(definition: any, layers: any); + + addLayer(list: any): void; + + clear(): void; + + get(key: any): any; + + has(variableName: any): any; + + set(key: any, value: any, type: any): any; + + syncVariablesFrom(obj: any, track: any): any; + + syncVariablesTo(obj: any): any; + + toJSON(): any; + + toObject(excludeDisabled: any, caseSensitive: any): any; + + unset(key: any): void; + + variables(): any; + + static isVariableScope(obj: any): any; + +} + +export class Version { + constructor(options: any); + + set(value: any): void; + + toString(): any; + +} + +export function CookieList(parent: any, cookies: any): void; + +export namespace Certificate { + namespace isCertificate { + const prototype: { + }; + + } + + namespace prototype { + function canApplyTo(url: any): any; + + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function meta(...args: any[]): any; + + function parent(): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + function update(options: any): void; + + namespace canApplyTo { + const prototype: { + }; + + } + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + } + +} + +export namespace CertificateList { + namespace isCertificateList { + const prototype: { + }; + + } + + namespace prototype { + function add(item: any, ...args: any[]): void; + + function all(): any; + + function append(item: any): any; + + function assimilate(source: any, prune: any): void; + + function clear(): void; + + function count(): any; + + function each(iterator: any, context: any): void; + + function eachParent(iterator: any, context: any): void; + + function filter(rule: any, context: any): any; + + function find(rule: any, context: any): any; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function get(key: any): any; + + function has(item: any, value: any, ...args: any[]): any; + + function idx(index: any): any; + + function indexOf(item: any): any; + + function insert(item: any, before: any): void; + + function insertAfter(item: any, after: any): any; + + function map(iterator: any, context: any): any; + + function meta(...args: any[]): any; + + function one(id: any): any; + + function parent(): any; + + function populate(items: any): void; + + function prepend(item: any): any; + + function remove(predicate: any, context: any, ...args: any[]): any; + + function repopulate(items: any): void; + + function resolveOne(url: any): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; + + function toString(): any; + + function upsert(item: any): any; + + namespace add { + const prototype: { + }; + + } + + namespace all { + const prototype: { + }; + + } + + namespace append { + const prototype: { + }; + + } + + namespace assimilate { + const prototype: { + }; + + } + + namespace clear { + const prototype: { + }; + + } + + namespace count { + const prototype: { + }; + + } + + namespace each { + const prototype: { + }; + + } + + namespace eachParent { + const prototype: { + }; + + } + + namespace filter { + const prototype: { + }; + + } + + namespace find { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace get { + const prototype: { + }; + + } + + namespace has { + const prototype: { + }; + + } + + namespace idx { + const prototype: { + }; + + } + + namespace indexOf { + const prototype: { + }; + + } + + namespace insert { + const prototype: { + }; + + } + + namespace insertAfter { + const prototype: { + }; + + } + + namespace map { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace one { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace populate { + const prototype: { + }; + + } + + namespace prepend { + const prototype: { + }; + + } + + namespace remove { + const prototype: { + }; + + } + + namespace repopulate { + const prototype: { + }; + + } + + namespace resolveOne { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObject { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace upsert { + const prototype: { + }; + + } + + } + +} + +export namespace Collection { + namespace isCollection { + const prototype: { + }; + + } + + namespace prototype { + function authorizeRequestsUsing(type: any, options: any): void; + + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachItem(callback: any): any; + + function forEachItemGroup(callback: any): void; + + function forEachParent(options: any, iterator: any): void; + + function meta(...args: any[]): any; + + function oneDeep(idOrName: any): any; + + function parent(): any; + + function setParent(parent: any): void; + + function syncVariablesFrom(obj: any, track: any): any; + + function syncVariablesTo(obj: any): any; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + namespace authorizeRequestsUsing { + const prototype: { + }; + + } + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachItem { + const prototype: { + }; + + } + + namespace forEachItemGroup { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace oneDeep { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace syncVariablesFrom { + const prototype: { + }; + + } + + namespace syncVariablesTo { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + } + +} + +export namespace Cookie { + namespace isCookie { + const prototype: { + }; + + } + + namespace parse { + const prototype: { + }; + + } + + namespace prototype { + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function meta(...args: any[]): any; + + function parent(): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function update(options: any): void; + + function valueOf(): any; + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + namespace valueOf { + const prototype: { + }; + + } + + } + + namespace splitParam { + const prototype: { + }; + + } + +} + +export namespace CookieList { + function isCookieList(obj: any): any; + + namespace isCookieList { + const prototype: { + }; + + } + + namespace prototype { + function add(item: any, ...args: any[]): void; + + function all(): any; + + function append(item: any): any; + + function assimilate(source: any, prune: any): void; + + function clear(): void; + + function count(): any; + + function each(iterator: any, context: any): void; + + function eachParent(iterator: any, context: any): void; + + function filter(rule: any, context: any): any; + + function find(rule: any, context: any): any; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function get(key: any): any; + + function has(item: any, value: any, ...args: any[]): any; + + function idx(index: any): any; + + function indexOf(item: any): any; + + function insert(item: any, before: any): void; + + function insertAfter(item: any, after: any): any; + + function map(iterator: any, context: any): any; + + function meta(...args: any[]): any; + + function one(id: any): any; + + function parent(): any; + + function populate(items: any): void; + + function prepend(item: any): any; + + function remove(predicate: any, context: any, ...args: any[]): any; + + function repopulate(items: any): void; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; + + function toString(): any; + + function upsert(item: any): any; + + namespace add { + const prototype: { + }; + + } + + namespace all { + const prototype: { + }; + + } + + namespace append { + const prototype: { + }; + + } + + namespace assimilate { + const prototype: { + }; + + } + + namespace clear { + const prototype: { + }; + + } + + namespace count { + const prototype: { + }; + + } + + namespace each { + const prototype: { + }; + + } + + namespace eachParent { + const prototype: { + }; + + } + + namespace filter { + const prototype: { + }; + + } + + namespace find { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace get { + const prototype: { + }; + + } + + namespace has { + const prototype: { + }; + + } + + namespace idx { + const prototype: { + }; + + } + + namespace indexOf { + const prototype: { + }; + + } + + namespace insert { + const prototype: { + }; + + } + + namespace insertAfter { + const prototype: { + }; + + } + + namespace map { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace one { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace populate { + const prototype: { + }; + + } + + namespace prepend { + const prototype: { + }; + + } + + namespace remove { + const prototype: { + }; + + } + + namespace repopulate { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObject { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace upsert { + const prototype: { + }; + + } + + } + +} + +export namespace Description { + namespace format { + } + + namespace isDescription { + const prototype: { + }; + + } + + namespace prototype { + function toJSON(): any; + + function toString(): any; + + function update(content: any, type: any): void; + + namespace toJSON { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + } + +} + +export namespace Event { + namespace prototype { + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function meta(...args: any[]): any; + + function parent(): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + function update(definition: any): void; + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + } + +} + +export namespace EventList { + namespace isEventList { + const prototype: { + }; + + } + + namespace prototype { + function add(item: any, ...args: any[]): void; + + function all(): any; + + function append(item: any): any; + + function assimilate(source: any, prune: any): void; + + function clear(): void; + + function count(): any; + + function each(iterator: any, context: any): void; + + function eachParent(iterator: any, context: any): void; + + function filter(rule: any, context: any): any; + + function find(rule: any, context: any): any; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function get(key: any): any; + + function has(item: any, value: any, ...args: any[]): any; + + function idx(index: any): any; + + function indexOf(item: any): any; + + function insert(item: any, before: any): void; + + function insertAfter(item: any, after: any): any; + + function listeners(name: any): any; + + function listenersOwn(name: any): any; + + function map(iterator: any, context: any): any; + + function meta(...args: any[]): any; + + function one(id: any): any; + + function parent(): any; + + function populate(items: any): void; + + function prepend(item: any): any; + + function remove(predicate: any, context: any, ...args: any[]): any; + + function repopulate(items: any): void; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; + + function toString(): any; + + function upsert(item: any): any; + + namespace add { + const prototype: { + }; + + } + + namespace all { + const prototype: { + }; + + } + + namespace append { + const prototype: { + }; + + } + + namespace assimilate { + const prototype: { + }; + + } + + namespace clear { + const prototype: { + }; + + } + + namespace count { + const prototype: { + }; + + } + + namespace each { + const prototype: { + }; + + } + + namespace eachParent { + const prototype: { + }; + + } + + namespace filter { + const prototype: { + }; + + } + + namespace find { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace get { + const prototype: { + }; + + } + + namespace has { + const prototype: { + }; + + } + + namespace idx { + const prototype: { + }; + + } + + namespace indexOf { + const prototype: { + }; + + } + + namespace insert { + const prototype: { + }; + + } + + namespace insertAfter { + const prototype: { + }; + + } + + namespace listeners { + const prototype: { + }; + + } + + namespace listenersOwn { + const prototype: { + }; + + } + + namespace map { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace one { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace populate { + const prototype: { + }; + + } + + namespace prepend { + const prototype: { + }; + + } + + namespace remove { + const prototype: { + }; + + } + + namespace repopulate { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObject { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace upsert { + const prototype: { + }; + + } + + } + +} + +export namespace FormParam { + namespace parse { + const prototype: { + }; + + } + + namespace prototype { + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function meta(...args: any[]): any; + + function parent(): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + function toString(): any; + + function valueOf(): any; + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace valueOf { + const prototype: { + }; + + } + + } + +} + +export namespace Header { + namespace create { + const prototype: { + }; + + } + + namespace isHeader { + const prototype: { + }; + + } + + namespace parse { + const prototype: { + }; + + } + + namespace parseSingle { + const prototype: { + }; + + } + + namespace prototype { + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function meta(...args: any[]): any; + + function parent(): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + function toString(): any; + + function update(options: any): void; + + function valueOf(): any; + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + namespace valueOf { + const prototype: { + }; + + } + + } + + namespace unparse { + const prototype: { + }; + + } + + namespace unparseSingle { + const prototype: { + }; + + } + +} + +export namespace HeaderList { + namespace isHeaderList { + const prototype: { + }; + + } + + namespace prototype { + function add(item: any, ...args: any[]): void; + + function all(): any; + + function append(item: any): any; + + function assimilate(source: any, prune: any): void; + + function clear(): void; + + function contentSize(): any; + + function count(): any; + + function each(iterator: any, context: any): void; + + function eachParent(iterator: any, context: any): void; + + function filter(rule: any, context: any): any; + + function find(rule: any, context: any): any; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function get(key: any): any; + + function has(item: any, value: any, ...args: any[]): any; + + function idx(index: any): any; + + function indexOf(item: any): any; + + function insert(item: any, before: any): void; + + function insertAfter(item: any, after: any): any; + + function map(iterator: any, context: any): any; + + function meta(...args: any[]): any; + + function one(id: any): any; + + function parent(): any; + + function populate(items: any): void; + + function prepend(item: any): any; + + function remove(predicate: any, context: any, ...args: any[]): any; + + function repopulate(items: any): void; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; + + function toString(): any; + + function upsert(item: any): any; + + namespace add { + const prototype: { + }; + + } + + namespace all { + const prototype: { + }; + + } + + namespace append { + const prototype: { + }; + + } + + namespace assimilate { + const prototype: { + }; + + } + + namespace clear { + const prototype: { + }; + + } + + namespace contentSize { + const prototype: { + }; + + } + + namespace count { + const prototype: { + }; + + } + + namespace each { + const prototype: { + }; + + } + + namespace eachParent { + const prototype: { + }; + + } + + namespace filter { + const prototype: { + }; + + } + + namespace find { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace get { + const prototype: { + }; + + } + + namespace has { + const prototype: { + }; + + } + + namespace idx { + const prototype: { + }; + + } + + namespace indexOf { + const prototype: { + }; + + } + + namespace insert { + const prototype: { + }; + + } + + namespace insertAfter { + const prototype: { + }; + + } + + namespace map { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace one { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace populate { + const prototype: { + }; + + } + + namespace prepend { + const prototype: { + }; + + } + + namespace remove { + const prototype: { + }; + + } + + namespace repopulate { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObject { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace upsert { + const prototype: { + }; + + } + + } + +} + +export namespace Item { + namespace isItem { + const prototype: { + }; + + } + + namespace prototype { + function authorizeRequestUsing(type: any, options: any): any; + + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function getAuth(): any; + + function getEvents(name: any): any; + + function meta(...args: any[]): any; + + function parent(): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + namespace authorizeRequestUsing { + const prototype: { + }; + + } + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace getAuth { + const prototype: { + }; + + } + + namespace getEvents { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + } + +} + +export namespace ItemGroup { + namespace isItemGroup { + const prototype: { + }; + + } + + namespace prototype { + function authorizeRequestsUsing(type: any, options: any): void; + + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachItem(callback: any): any; + + function forEachItemGroup(callback: any): void; + + function forEachParent(options: any, iterator: any): void; + + function meta(...args: any[]): any; + + function oneDeep(idOrName: any): any; + + function parent(): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + namespace authorizeRequestsUsing { + const prototype: { + }; + + } + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachItem { + const prototype: { + }; + + } + + namespace forEachItemGroup { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace oneDeep { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + } + +} + +export namespace Property { + namespace prototype { + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function meta(...args: any[]): any; + + function parent(): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + } + + namespace replaceSubstitutions { + const prototype: { + }; + + } + + namespace replaceSubstitutionsIn { + const prototype: { + }; + + } + +} + +export namespace PropertyBase { + namespace propertyIsMeta { + const prototype: { + }; + + } + + namespace propertyUnprefixMeta { + const prototype: { + }; + + } + + namespace prototype { + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function meta(...args: any[]): any; + + function parent(): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + } + + namespace toJSON { + const prototype: { + }; + + } + +} + +export namespace PropertyList { + namespace isPropertyList { + const prototype: { + }; + + } + + namespace prototype { + function add(item: any, ...args: any[]): void; + + function all(): any; + + function append(item: any): any; + + function assimilate(source: any, prune: any): void; + + function clear(): void; + + function count(): any; + + function each(iterator: any, context: any): void; + + function eachParent(iterator: any, context: any): void; + + function filter(rule: any, context: any): any; + + function find(rule: any, context: any): any; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function get(key: any): any; + + function has(item: any, value: any, ...args: any[]): any; + + function idx(index: any): any; + + function indexOf(item: any): any; + + function insert(item: any, before: any): void; + + function insertAfter(item: any, after: any): any; + + function map(iterator: any, context: any): any; + + function meta(...args: any[]): any; + + function one(id: any): any; + + function parent(): any; + + function populate(items: any): void; + + function prepend(item: any): any; + + function remove(predicate: any, context: any, ...args: any[]): any; + + function repopulate(items: any): void; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; + + function toString(): any; + + function upsert(item: any): any; + + namespace add { + const prototype: { + }; + + } + + namespace all { + const prototype: { + }; + + } + + namespace append { + const prototype: { + }; + + } + + namespace assimilate { + const prototype: { + }; + + } + + namespace clear { + const prototype: { + }; + + } + + namespace count { + const prototype: { + }; + + } + + namespace each { + const prototype: { + }; + + } + + namespace eachParent { + const prototype: { + }; + + } + + namespace filter { + const prototype: { + }; + + } + + namespace find { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace get { + const prototype: { + }; + + } + + namespace has { + const prototype: { + }; + + } + + namespace idx { + const prototype: { + }; + + } + + namespace indexOf { + const prototype: { + }; + + } + + namespace insert { + const prototype: { + }; + + } + + namespace insertAfter { + const prototype: { + }; + + } + + namespace map { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace one { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace populate { + const prototype: { + }; + + } + + namespace prepend { + const prototype: { + }; + + } + + namespace remove { + const prototype: { + }; + + } + + namespace repopulate { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObject { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace upsert { + const prototype: { + }; + + } + + } + +} + +export namespace ProxyConfig { + namespace isProxyConfig { + const prototype: { + }; + + } + + namespace prototype { + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function getProtocols(): any; + + function getProxyUrl(): any; + + function meta(...args: any[]): any; + + function parent(): any; + + function setParent(parent: any): void; + + function test(urlStr: any): any; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + function update(options: any): void; + + function updateProtocols(protocols: any): void; + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace getProtocols { + const prototype: { + }; + + } + + namespace getProxyUrl { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace test { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + namespace updateProtocols { + const prototype: { + }; + + } + + } + +} + +export namespace ProxyConfigList { + namespace isProxyConfigList { + const prototype: { + }; + + } + + namespace prototype { + function add(item: any, ...args: any[]): void; + + function all(): any; + + function append(item: any): any; + + function assimilate(source: any, prune: any): void; + + function clear(): void; + + function count(): any; + + function each(iterator: any, context: any): void; + + function eachParent(iterator: any, context: any): void; + + function filter(rule: any, context: any): any; + + function find(rule: any, context: any): any; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function get(key: any): any; + + function has(item: any, value: any, ...args: any[]): any; + + function idx(index: any): any; + + function indexOf(item: any): any; + + function insert(item: any, before: any): void; + + function insertAfter(item: any, after: any): any; + + function map(iterator: any, context: any): any; + + function meta(...args: any[]): any; + + function one(id: any): any; + + function parent(): any; + + function populate(items: any): void; + + function prepend(item: any): any; + + function remove(predicate: any, context: any, ...args: any[]): any; + + function repopulate(items: any): void; + + function resolve(url: any): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; + + function toString(): any; + + function upsert(item: any): any; + + namespace add { + const prototype: { + }; + + } + + namespace all { + const prototype: { + }; + + } + + namespace append { + const prototype: { + }; + + } + + namespace assimilate { + const prototype: { + }; + + } + + namespace clear { + const prototype: { + }; + + } + + namespace count { + const prototype: { + }; + + } + + namespace each { + const prototype: { + }; + + } + + namespace eachParent { + const prototype: { + }; + + } + + namespace filter { + const prototype: { + }; + + } + + namespace find { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace get { + const prototype: { + }; + + } + + namespace has { + const prototype: { + }; + + } + + namespace idx { + const prototype: { + }; + + } + + namespace indexOf { + const prototype: { + }; + + } + + namespace insert { + const prototype: { + }; + + } + + namespace insertAfter { + const prototype: { + }; + + } + + namespace map { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace one { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace populate { + const prototype: { + }; + + } + + namespace prepend { + const prototype: { + }; + + } + + namespace remove { + const prototype: { + }; + + } + + namespace repopulate { + const prototype: { + }; + + } + + namespace resolve { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObject { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace upsert { + const prototype: { + }; + + } + + } + +} + +export namespace QueryParam { + namespace parse { + const prototype: { + }; + + } + + namespace parseSingle { + const prototype: { + }; + + } + + namespace prototype { + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function meta(...args: any[]): any; + + function parent(): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + function toString(): any; + + function update(param: any): void; + + function valueOf(): any; + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + namespace valueOf { + const prototype: { + }; + + } + + } + + namespace unparse { + const prototype: { + }; + + } + + namespace unparseSingle { + const prototype: { + }; + + } + +} + +export namespace Request { + namespace isRequest { + const prototype: { + }; + + } + + namespace prototype { + function addHeader(header: any): void; + + function addQueryParams(params: any): void; + + function authorize(): void; + + function authorizeUsing(type: any, options: any): void; + + function clone(): any; + + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachHeader(callback: any): any; + + function forEachParent(options: any, iterator: any): void; + + function getHeaders(options: any): any; + + function meta(...args: any[]): any; + + function parent(): any; + + function removeHeader(toRemove: any, options: any): any; + + function removeQueryParams(params: any): void; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + function update(options: any): void; + + function upsertHeader(header: any): any; + + namespace addHeader { + const prototype: { + }; + + } + + namespace addQueryParams { + const prototype: { + }; + + } + + namespace authorize { + const prototype: { + }; + + } + + namespace authorizeUsing { + const prototype: { + }; + + } + + namespace clone { + const prototype: { + }; + + } + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachHeader { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace getHeaders { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace removeHeader { + const prototype: { + }; + + } + + namespace removeQueryParams { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + namespace upsertHeader { + const prototype: { + }; + + } + + } + +} + +export namespace RequestAuth { + namespace isValidType { + const prototype: { + }; + + } + + namespace prototype { + function clear(type: any): void; + + function current(): any; + + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function meta(...args: any[]): any; + + function parameters(): any; + + function parent(): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + function update(options: any, type: any): void; + + function use(type: any, options: any): void; + + namespace clear { + const prototype: { + }; + + } + + namespace current { + const prototype: { + }; + + } + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parameters { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + namespace use { + const prototype: { + }; + + } + + } + +} + +export namespace RequestBody { + namespace prototype { + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function isEmpty(): any; + + function meta(...args: any[]): any; + + function parent(): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toString(): any; + + function update(options: any): void; + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace isEmpty { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + } + +} + +export namespace Response { + namespace createFromNode { + const prototype: { + }; + + } + + namespace isResponse { + const prototype: { + }; + + } + + namespace mimeInfo { + const prototype: { + }; + + } + + namespace prototype { + function dataURI(): any; + + function describe(content: any, type: any): void; + + function details(): any; + + function encoding(): any; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function json(reviver: any, strict: any): any; + + function meta(...args: any[]): any; + + function mime(contentType: any, contentDisposition: any): any; + + function parent(): any; + + function reason(): any; + + function setParent(parent: any): void; + + function size(): any; + + function text(): any; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + function update(options: any): void; + + namespace dataURI { + const prototype: { + }; + + } + + namespace describe { + const prototype: { + }; + + } + + namespace details { + const prototype: { + }; + + } + + namespace encoding { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace json { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace mime { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace reason { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace size { + const prototype: { + }; + + } + + namespace text { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + } + +} + +export namespace Script { + namespace isScript { + const prototype: { + }; + + } + + namespace prototype { + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function meta(...args: any[]): any; + + function parent(): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + function toSource(): any; + + function update(options: any): void; + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + namespace toSource { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + } + +} + +export namespace Url { + namespace isUrl { + const prototype: { + }; + + } + + namespace parse { + const prototype: { + }; + + } + + namespace prototype { + function addQueryParams(params: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function getHost(): any; + + function getOAuth1BaseUrl(): any; + + function getPath(options: any): any; + + function getPathWithQuery(): any; + + function getQueryString(options: any): any; + + function getRaw(): any; + + function getRemote(options: any): any; + + function meta(...args: any[]): any; + + function parent(): any; + + function removeQueryParams(params: any): any; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toString(forceProtocol: any): any; + + function update(url: any): any; + + namespace addQueryParams { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace getHost { + const prototype: { + }; + + } + + namespace getOAuth1BaseUrl { + const prototype: { + }; + + } + + namespace getPath { + const prototype: { + }; + + } + + namespace getPathWithQuery { + const prototype: { + }; + + } + + namespace getQueryString { + const prototype: { + }; + + } + + namespace getRaw { + const prototype: { + }; + + } + + namespace getRemote { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace removeQueryParams { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + } + +} + +export namespace UrlMatchPattern { + namespace prototype { + function createMatchPattern(): any; + + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function getProtocols(): any; + + function globPatternToRegexp(pattern: any): any; + + function matchAbsoluteHostPattern(matchRegexObject: any, remote: any): any; + + function matchAnyHost(matchRegexObject: any): any; + + function matchSuffixHostPattern(matchRegexObject: any, remote: any): any; + + function meta(...args: any[]): any; + + function parent(): any; + + function setParent(parent: any): void; + + function test(urlStr: any): any; + + function testHost(host: any): any; + + function testPath(path: any): any; + + function testProtocol(protocol: any): any; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + function toString(): any; + + function update(options: any): void; + + namespace createMatchPattern { + const prototype: { + }; + + } + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace getProtocols { + const prototype: { + }; + + } + + namespace globPatternToRegexp { + const prototype: { + }; + + } + + namespace matchAbsoluteHostPattern { + const prototype: { + }; + + } + + namespace matchAnyHost { + const prototype: { + }; + + } + + namespace matchSuffixHostPattern { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace test { + const prototype: { + }; + + } + + namespace testHost { + const prototype: { + }; + + } + + namespace testPath { + const prototype: { + }; + + } + + namespace testProtocol { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + } + +} + +export namespace UrlMatchPatternList { + namespace prototype { + function add(item: any, ...args: any[]): void; + + function all(): any; + + function append(item: any): any; + + function assimilate(source: any, prune: any): void; + + function clear(): void; + + function count(): any; + + function each(iterator: any, context: any): void; + + function eachParent(iterator: any, context: any): void; + + function filter(rule: any, context: any): any; + + function find(rule: any, context: any): any; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function get(key: any): any; + + function has(item: any, value: any, ...args: any[]): any; + + function idx(index: any): any; + + function indexOf(item: any): any; + + function insert(item: any, before: any): void; + + function insertAfter(item: any, after: any): any; + + function map(iterator: any, context: any): any; + + function meta(...args: any[]): any; + + function one(id: any): any; + + function parent(): any; + + function populate(items: any): void; + + function prepend(item: any): any; + + function remove(predicate: any, context: any, ...args: any[]): any; + + function repopulate(items: any): void; + + function setParent(parent: any): void; + + function test(urlStr: any): any; + + function toJSON(): any; + + function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; + + function toString(): any; + + function upsert(item: any): any; + + namespace add { + const prototype: { + }; + + } + + namespace all { + const prototype: { + }; + + } + + namespace append { + const prototype: { + }; + + } + + namespace assimilate { + const prototype: { + }; + + } + + namespace clear { + const prototype: { + }; + + } + + namespace count { + const prototype: { + }; + + } + + namespace each { + const prototype: { + }; + + } + + namespace eachParent { + const prototype: { + }; + + } + + namespace filter { + const prototype: { + }; + + } + + namespace find { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace get { + const prototype: { + }; + + } + + namespace has { + const prototype: { + }; + + } + + namespace idx { + const prototype: { + }; + + } + + namespace indexOf { + const prototype: { + }; + + } + + namespace insert { + const prototype: { + }; + + } + + namespace insertAfter { + const prototype: { + }; + + } + + namespace map { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace one { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace populate { + const prototype: { + }; + + } + + namespace prepend { + const prototype: { + }; + + } + + namespace remove { + const prototype: { + }; + + } + + namespace repopulate { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace test { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObject { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace upsert { + const prototype: { + }; + + } + + } + +} + +export namespace Variable { + namespace isVariable { + const prototype: { + }; + + } + + namespace prototype { + function cast(value: any): any; + + function castIn(value: any): any; + + function castOut(value: any): any; + + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function get(): any; + + function meta(...args: any[]): any; + + function parent(): any; + + function set(value: any): void; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + function toString(): any; + + function update(options: any): void; + + function valueOf(value: any, ...args: any[]): any; + + function valueType(typeName: any, _noCast: any): any; + + namespace cast { + const prototype: { + }; + + } + + namespace castIn { + const prototype: { + }; + + } + + namespace castOut { + const prototype: { + }; + + } + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace get { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace set { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace update { + const prototype: { + }; + + } + + namespace valueOf { + const prototype: { + }; + + } + + namespace valueType { + const prototype: { + }; + + } + + } + + namespace types { + class number { + constructor(p0: any); + + // Native method; no parameter or return type inference available + toExponential(p0: any): any; + + // Native method; no parameter or return type inference available + toFixed(p0: any): any; + + // Native method; no parameter or return type inference available + toLocaleString(): any; + + // Native method; no parameter or return type inference available + toPrecision(p0: any): any; + + // Native method; no parameter or return type inference available + toString(p0: any): any; + + // Native method; no parameter or return type inference available + valueOf(): any; + + static EPSILON: number; + + static MAX_SAFE_INTEGER: number; + + static MAX_VALUE: number; + + static MIN_SAFE_INTEGER: number; + + static MIN_VALUE: number; + + static NEGATIVE_INFINITY: number; + + static NaN: number; + + static POSITIVE_INFINITY: number; + + static isFinite(p0: any): any; + + static isInteger(p0: any): any; + + static isNaN(p0: any): any; + + static isSafeInteger(p0: any): any; + + static parseFloat(p0: any): any; + + static parseInt(p0: any, p1: any): any; + + } + + class string { + constructor(p0: any); + + // Native method; no parameter or return type inference available + anchor(p0: any): any; + + // Native method; no parameter or return type inference available + big(): any; + + // Native method; no parameter or return type inference available + blink(): any; + + // Native method; no parameter or return type inference available + bold(): any; + + // Native method; no parameter or return type inference available + charAt(p0: any): any; + + // Native method; no parameter or return type inference available + charCodeAt(p0: any): any; + + // Native method; no parameter or return type inference available + codePointAt(p0: any): any; + + // Native method; no parameter or return type inference available + concat(p0: any): any; + + // Native method; no parameter or return type inference available + endsWith(p0: any): any; + + // Native method; no parameter or return type inference available + fixed(): any; + + // Native method; no parameter or return type inference available + fontcolor(p0: any): any; + + // Native method; no parameter or return type inference available + fontsize(p0: any): any; + + // Native method; no parameter or return type inference available + includes(p0: any): any; + + // Native method; no parameter or return type inference available + indexOf(p0: any): any; + + // Native method; no parameter or return type inference available + italics(): any; + + // Native method; no parameter or return type inference available + lastIndexOf(p0: any): any; + + // Native method; no parameter or return type inference available + link(p0: any): any; + + // Native method; no parameter or return type inference available + localeCompare(p0: any): any; + + // Native method; no parameter or return type inference available + match(p0: any): any; + + // Native method; no parameter or return type inference available + normalize(): any; + + // Native method; no parameter or return type inference available + padEnd(p0: any): any; + + // Native method; no parameter or return type inference available + padStart(p0: any): any; + + // Native method; no parameter or return type inference available + repeat(p0: any): any; + + // Native method; no parameter or return type inference available + replace(p0: any, p1: any): any; + + // Native method; no parameter or return type inference available + search(p0: any): any; + + // Native method; no parameter or return type inference available + slice(p0: any, p1: any): any; + + // Native method; no parameter or return type inference available + small(): any; + + // Native method; no parameter or return type inference available + split(p0: any, p1: any): any; + + // Native method; no parameter or return type inference available + startsWith(p0: any): any; + + // Native method; no parameter or return type inference available + strike(): any; + + // Native method; no parameter or return type inference available + sub(): any; + + // Native method; no parameter or return type inference available + substr(p0: any, p1: any): any; + + // Native method; no parameter or return type inference available + substring(p0: any, p1: any): any; + + // Native method; no parameter or return type inference available + sup(): any; + + // Native method; no parameter or return type inference available + toLocaleLowerCase(): any; + + // Native method; no parameter or return type inference available + toLocaleUpperCase(): any; + + // Native method; no parameter or return type inference available + toLowerCase(): any; + + // Native method; no parameter or return type inference available + toString(): any; + + // Native method; no parameter or return type inference available + toUpperCase(): any; + + // Native method; no parameter or return type inference available + trim(): any; + + // Native method; no parameter or return type inference available + trimLeft(): any; + + // Native method; no parameter or return type inference available + trimRight(): any; + + // Native method; no parameter or return type inference available + valueOf(): any; + + static fromCharCode(p0: any): any; + + static fromCodePoint(p0: any): any; + + static raw(p0: any): any; + + } + + namespace any { + function out(val: any): any; + + namespace out { + // Too-deep object hierarchy from postman_collection.Variable.types.any.out + const prototype: any; + + } + + } + + namespace json { + function out(val: any): any; + + namespace out { + // Too-deep object hierarchy from postman_collection.Variable.types.json.out + const prototype: any; + + } + + } + + namespace number { + namespace prototype { + // Too-deep object hierarchy from postman_collection.Variable.types.number.prototype + const toExponential: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.number.prototype + const toFixed: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.number.prototype + const toLocaleString: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.number.prototype + const toPrecision: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.number.prototype + const toString: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.number.prototype + const valueOf: any; + + } + + } + + namespace string { + namespace prototype { + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const anchor: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const big: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const blink: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const bold: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const charAt: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const charCodeAt: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const codePointAt: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const concat: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const endsWith: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const fixed: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const fontcolor: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const fontsize: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const includes: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const indexOf: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const italics: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const lastIndexOf: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const length: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const link: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const localeCompare: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const match: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const normalize: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const padEnd: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const padStart: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const repeat: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const replace: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const search: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const slice: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const small: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const split: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const startsWith: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const strike: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const sub: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const substr: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const substring: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const sup: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const toLocaleLowerCase: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const toLocaleUpperCase: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const toLowerCase: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const toString: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const toUpperCase: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const trim: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const trimLeft: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const trimRight: any; + + // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype + const valueOf: any; + + } + + } + + } + +} + +export namespace VariableList { + namespace isVariableList { + const prototype: { + }; + + } + + namespace prototype { + function add(item: any, ...args: any[]): void; + + function all(): any; + + function append(item: any): any; + + function assimilate(source: any, prune: any): void; + + function clear(): void; + + function count(): any; + + function each(iterator: any, context: any): void; + + function eachParent(iterator: any, context: any): void; + + function filter(rule: any, context: any): any; + + function find(rule: any, context: any): any; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function get(key: any): any; + + function has(item: any, value: any, ...args: any[]): any; + + function idx(index: any): any; + + function indexOf(item: any): any; + + function insert(item: any, before: any): void; + + function insertAfter(item: any, after: any): any; + + function map(iterator: any, context: any): any; + + function meta(...args: any[]): any; + + function one(id: any): any; + + function parent(): any; + + function populate(items: any): void; + + function prepend(item: any): any; + + function remove(predicate: any, context: any, ...args: any[]): any; + + function replace(str: any, overrides: any): any; + + function repopulate(items: any): void; + + function setParent(parent: any): void; + + function substitute(obj: any, overrides: any, mutate: any): any; + + function syncFromObject(obj: any, track: any, prune: any): any; + + function syncToObject(obj: any): any; + + function toJSON(): any; + + function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; + + function toString(): any; + + function upsert(item: any): any; + + namespace add { + const prototype: { + }; + + } + + namespace all { + const prototype: { + }; + + } + + namespace append { + const prototype: { + }; + + } + + namespace assimilate { + const prototype: { + }; + + } + + namespace clear { + const prototype: { + }; + + } + + namespace count { + const prototype: { + }; + + } + + namespace each { + const prototype: { + }; + + } + + namespace eachParent { + const prototype: { + }; + + } + + namespace filter { + const prototype: { + }; + + } + + namespace find { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace get { + const prototype: { + }; + + } + + namespace has { + const prototype: { + }; + + } + + namespace idx { + const prototype: { + }; + + } + + namespace indexOf { + const prototype: { + }; + + } + + namespace insert { + const prototype: { + }; + + } + + namespace insertAfter { + const prototype: { + }; + + } + + namespace map { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace one { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace populate { + const prototype: { + }; + + } + + namespace prepend { + const prototype: { + }; + + } + + namespace remove { + const prototype: { + }; + + } + + namespace replace { + const prototype: { + }; + + } + + namespace repopulate { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace substitute { + const prototype: { + }; + + } + + namespace syncFromObject { + const prototype: { + }; + + } + + namespace syncToObject { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObject { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + namespace upsert { + const prototype: { + }; + + } + + } + +} + +export namespace VariableScope { + namespace isVariableScope { + const prototype: { + }; + + } + + namespace prototype { + function addLayer(list: any): void; + + function clear(): void; + + function describe(content: any, type: any): void; + + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function get(key: any): any; + + function has(variableName: any): any; + + function meta(...args: any[]): any; + + function parent(): any; + + function set(key: any, value: any, type: any): any; + + function setParent(parent: any): void; + + function syncVariablesFrom(obj: any, track: any): any; + + function syncVariablesTo(obj: any): any; + + function toJSON(): any; + + function toObject(excludeDisabled: any, caseSensitive: any): any; + + function toObjectResolved(scope: any, overrides: any, options: any): any; + + function unset(key: any): void; + + function variables(): any; + + namespace addLayer { + const prototype: { + }; + + } + + namespace clear { + const prototype: { + }; + + } + + namespace describe { + const prototype: { + }; + + } + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace get { + const prototype: { + }; + + } + + namespace has { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace set { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace syncVariablesFrom { + const prototype: { + }; + + } + + namespace syncVariablesTo { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toObject { + const prototype: { + }; + + } + + namespace toObjectResolved { + const prototype: { + }; + + } + + namespace unset { + const prototype: { + }; + + } + + namespace variables { + const prototype: { + }; + + } + + } + +} + +export namespace Version { + namespace prototype { + function findInParents(property: any, customizer: any): any; + + function findParentContaining(property: any, customizer: any): any; + + function forEachParent(options: any, iterator: any): void; + + function meta(...args: any[]): any; + + function parent(): any; + + function set(value: any): void; + + function setParent(parent: any): void; + + function toJSON(): any; + + function toString(): any; + + namespace findInParents { + const prototype: { + }; + + } + + namespace findParentContaining { + const prototype: { + }; + + } + + namespace forEachParent { + const prototype: { + }; + + } + + namespace meta { + const prototype: { + }; + + } + + namespace parent { + const prototype: { + }; + + } + + namespace set { + const prototype: { + }; + + } + + namespace setParent { + const prototype: { + }; + + } + + namespace toJSON { + const prototype: { + }; + + } + + namespace toString { + const prototype: { + }; + + } + + } + +} + diff --git a/types/postman-collection/postman-collection-tests.ts b/types/postman-collection/postman-collection-tests.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/types/postman-collection/tsconfig.json b/types/postman-collection/tsconfig.json new file mode 100644 index 0000000000..3f176970e4 --- /dev/null +++ b/types/postman-collection/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "postman-collection-tests.ts" + ] +} diff --git a/types/postman-collection/tslint.json b/types/postman-collection/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/postman-collection/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" } From b044535ed9892ca463096a46a8d11b5bf10bb272 Mon Sep 17 00:00:00 2001 From: Kyle Buzby Date: Thu, 15 Feb 2018 09:55:50 -0600 Subject: [PATCH 006/177] add example tests --- types/postman-collection/postman-collection-tests.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/postman-collection/postman-collection-tests.ts b/types/postman-collection/postman-collection-tests.ts index e69de29bb2..fd65e5e3d9 100644 --- a/types/postman-collection/postman-collection-tests.ts +++ b/types/postman-collection/postman-collection-tests.ts @@ -0,0 +1,7 @@ +import * as pmCollection from 'postman-collection'; + +/* Example https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/base64-js/base64-js-tests.ts +base64js.byteLength(""); // $ExpectType number +base64js.toByteArray(""); // $ExpectType Uint8Array +base64js.fromByteArray(new Uint8Array(0)); // $ExpectType string +*/ From 009e85b173cfa589189096fbdf4449d29db400e9 Mon Sep 17 00:00:00 2001 From: Kyle Buzby Date: Thu, 15 Feb 2018 09:56:05 -0600 Subject: [PATCH 007/177] remove unnecessary namespaces pt 1 --- types/postman-collection/index.d.ts | 4692 ++++----------------------- 1 file changed, 558 insertions(+), 4134 deletions(-) diff --git a/types/postman-collection/index.d.ts b/types/postman-collection/index.d.ts index 92e39e82d2..1247493c85 100644 --- a/types/postman-collection/index.d.ts +++ b/types/postman-collection/index.d.ts @@ -1,563 +1,566 @@ // Type definitions for postman-collection 3.0 -// Project: https://github.com/postmanlabs/postman-collection#readme -// Definitions by: My Self +// Project: https://github.com/postmanlabs/postman-collection +// Definitions by: Kyle Buzby // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export class Certificate { - constructor(options: any, ...args: any[]); - - canApplyTo(url: any): any; - - toJSON(): any; - - update(options: any): void; - - static isCertificate(obj: any): any; - +declare module PostmanCollection { + export class Certificate { + constructor(options: any, ...args: any[]); + + canApplyTo(url: any): any; + + toJSON(): any; + + update(options: any): void; + + static isCertificate(obj: any): any; + + } + + export class CertificateList { + constructor(parent: any, list: any); + + resolveOne(url: any): any; + + static isCertificateList(obj: any): any; + + } + + export class Collection { + constructor(definition: any, environments: any); + + syncVariablesFrom(obj: any, track: any): any; + + syncVariablesTo(obj: any): any; + + toJSON(): any; + + static isCollection(obj: any): any; + + } + + export class Cookie { + constructor(options: any); + + update(options: any): void; + + valueOf(): any; + + static isCookie(obj: any): any; + + static parse(str: any): any; + + static splitParam(param: any): any; + + } + + export class Description { + constructor(definition: any); + + toJSON(): any; + + toString(): any; + + update(content: any, type: any): void; + + static isDescription(obj: any): any; + + } + + export class Event { + constructor(definition: any); + + update(definition: any): void; + + } + + export class EventList { + constructor(parent: any, populate: any); + + listeners(name: any): any; + + listenersOwn(name: any): any; + + static isEventList(obj: any): any; + + } + + export class FormParam { + constructor(options: any, ...args: any[]); + + toString(): any; + + valueOf(): any; + + static parse(): void; + + } + + export class Header { + constructor(options: any, name: any, ...args: any[]); + + toString(): any; + + update(options: any): void; + + valueOf(): any; + + static create(...args: any[]): any; + + static isHeader(obj: any): any; + + static parse(headerString: any): any; + + static parseSingle(header: any): any; + + static unparse(headers: any, separator: any): any; + + static unparseSingle(header: any): any; + + } + + export class HeaderList { + constructor(parent: any, headers: any); + + contentSize(): any; + + static isHeaderList(obj: any): any; + + } + + export class Item { + constructor(definition: any, ...args: any[]); + + authorizeRequestUsing(type: any, options: any): any; + + getAuth(): any; + + getEvents(name: any): any; + + static isItem(obj: any): any; + + } + + export class ItemGroup { + constructor(definition: any, ...args: any[]); + + authorizeRequestsUsing(type: any, options: any): void; + + forEachItem(callback: any): any; + + forEachItemGroup(callback: any): void; + + oneDeep(idOrName: any): any; + + static isItemGroup(obj: any): any; + + } + + export class Property { + constructor(definition: any, ...args: any[]); + + describe(content: any, type: any): void; + + toObjectResolved(scope: any, overrides: any, options: any): any; + + static replaceSubstitutions(str: any, variables: any, ...args: any[]): any; + + static replaceSubstitutionsIn(obj: any, variables: any, mutate: any): any; + + } + + export class PropertyBase { + constructor(definition: any); + + findInParents(property: any, customizer: any): any; + + findParentContaining(property: any, customizer: any): any; + + forEachParent(options: any, iterator: any): void; + + meta(...args: any[]): any; + + parent(): any; + + setParent(parent: any): void; + + toJSON(): any; + + static propertyIsMeta(value: any, key: any): any; + + static propertyUnprefixMeta(value: any, key: any): any; + + static toJSON(obj: any): any; + + } + + export class PropertyList { + constructor(type: any, parent: any, populate: any); + + add(item: any, ...args: any[]): void; + + all(): any; + + append(item: any): any; + + assimilate(source: any, prune: any): void; + + clear(): void; + + count(): any; + + each(iterator: any, context: any): void; + + eachParent(iterator: any, context: any): void; + + filter(rule: any, context: any): any; + + find(rule: any, context: any): any; + + get(key: any): any; + + has(item: any, value: any, ...args: any[]): any; + + idx(index: any): any; + + indexOf(item: any): any; + + insert(item: any, before: any): void; + + insertAfter(item: any, after: any): any; + + map(iterator: any, context: any): any; + + one(id: any): any; + + populate(items: any): void; + + prepend(item: any): any; + + remove(predicate: any, context: any, ...args: any[]): any; + + repopulate(items: any): void; + + toJSON(): any; + + toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; + + toString(): any; + + upsert(item: any): any; + + static isPropertyList(obj: any): any; + + } + + export class ProxyConfig { + constructor(options: any); + + getProtocols(): any; + + getProxyUrl(): any; + + test(urlStr: any): any; + + update(options: any): void; + + updateProtocols(protocols: any): void; + + static isProxyConfig(obj: any): any; + + } + + export class ProxyConfigList { + constructor(parent: any, populate: any); + + resolve(url: any): any; + + static isProxyConfigList(obj: any): any; + + } + + export class QueryParam { + constructor(options: any, ...args: any[]); + + toString(): any; + + update(param: any): void; + + valueOf(): any; + + static parse(query: any): any; + + static parseSingle(param: any, idx: any, all: any): any; + + static unparse(params: any, options: any): any; + + static unparseSingle(obj: any, encode: any): any; + + } + + export class Request { + constructor(options: any, ...args: any[]); + + addHeader(header: any): void; + + addQueryParams(params: any): void; + + authorize(): void; + + authorizeUsing(type: any, options: any): void; + + clone(): any; + + forEachHeader(callback: any): any; + + getHeaders(options: any): any; + + removeHeader(toRemove: any, options: any): any; + + removeQueryParams(params: any): void; + + toJSON(): any; + + update(options: any): void; + + upsertHeader(header: any): any; + + static isRequest(obj: any): any; + + } + + export class RequestAuth { + constructor(options: any, parent: any); + + clear(type: any): void; + + current(): any; + + parameters(): any; + + update(options: any, type: any): void; + + use(type: any, options: any): void; + + static isValidType(type: any): any; + + } + + export class RequestBody { + constructor(options: any, ...args: any[]); + + isEmpty(): any; + + toString(): any; + + update(options: any): void; + + static MODES: { + file: string; + formdata: string; + raw: string; + urlencoded: string; + }; + + } + + export class Response { + constructor(options: any, ...args: any[]); + + dataURI(): any; + + details(): any; + + encoding(): any; + + json(reviver: any, strict: any): any; + + mime(contentType: any, contentDisposition: any): any; + + reason(): any; + + size(): any; + + text(): any; + + toJSON(): any; + + update(options: any): void; + + static createFromNode(response: any, cookies: any): any; + + static isResponse(obj: any): any; + + static mimeInfo(type: any, disposition: any): any; + + } + + export class Script { + constructor(options: any, ...args: any[]); + + toSource(): any; + + update(options: any): void; + + static isScript(obj: any): any; + + } + + export class Url { + constructor(options: any, ...args: any[]); + + addQueryParams(params: any): void; + + getHost(): any; + + getOAuth1BaseUrl(): any; + + getPath(options: any): any; + + getPathWithQuery(): any; + + getQueryString(options: any): any; + + getRaw(): any; + + getRemote(options: any): any; + + removeQueryParams(params: any): any; + + toString(forceProtocol: any): any; + + update(url: any): any; + + static isUrl(obj: any): any; + + static parse(url: any): any; + + } + + export class UrlMatchPattern { + constructor(options: any, ...args: any[]); + + createMatchPattern(): any; + + getProtocols(): any; + + globPatternToRegexp(pattern: any): any; + + matchAbsoluteHostPattern(matchRegexObject: any, remote: any): any; + + matchAnyHost(matchRegexObject: any): any; + + matchSuffixHostPattern(matchRegexObject: any, remote: any): any; + + test(urlStr: any): any; + + testHost(host: any): any; + + testPath(path: any): any; + + testProtocol(protocol: any): any; + + toJSON(): any; + + toString(): any; + + update(options: any): void; + + static MATCH_ALL_URLS: string; + + static PROTOCOL_DELIMITER: string; + + } + + export class UrlMatchPatternList { + constructor(parent: any, list: any); + + test(urlStr: any): any; + + } + + export class Variable { + constructor(definition: any, ...args: any[]); + + cast(value: any): any; + + castIn(value: any): any; + + castOut(value: any): any; + + get(): any; + + set(value: any): void; + + toString(): any; + + update(options: any): void; + + valueOf(value: any, ...args: any[]): any; + + valueType(typeName: any, _noCast: any): any; + + static isVariable(obj: any): any; + + } + + export class VariableList { + constructor(parent: any, populate: any); + + replace(str: any, overrides: any): any; + + substitute(obj: any, overrides: any, mutate: any): any; + + syncFromObject(obj: any, track: any, prune: any): any; + + syncToObject(obj: any): any; + + static isVariableList(obj: any): any; + + } + + export class VariableScope { + constructor(definition: any, layers: any); + + addLayer(list: any): void; + + clear(): void; + + get(key: any): any; + + has(variableName: any): any; + + set(key: any, value: any, type: any): any; + + syncVariablesFrom(obj: any, track: any): any; + + syncVariablesTo(obj: any): any; + + toJSON(): any; + + toObject(excludeDisabled: any, caseSensitive: any): any; + + unset(key: any): void; + + variables(): any; + + static isVariableScope(obj: any): any; + + } + + export class Version { + constructor(options: any); + + set(value: any): void; + + toString(): any; + + } + + export function CookieList(parent: any, cookies: any): void; + } -export class CertificateList { - constructor(parent: any, list: any); - - resolveOne(url: any): any; - - static isCertificateList(obj: any): any; - -} - -export class Collection { - constructor(definition: any, environments: any); - - syncVariablesFrom(obj: any, track: any): any; - - syncVariablesTo(obj: any): any; - - toJSON(): any; - - static isCollection(obj: any): any; - -} - -export class Cookie { - constructor(options: any); - - update(options: any): void; - - valueOf(): any; - - static isCookie(obj: any): any; - - static parse(str: any): any; - - static splitParam(param: any): any; - -} - -export class Description { - constructor(definition: any); - - toJSON(): any; - - toString(): any; - - update(content: any, type: any): void; - - static isDescription(obj: any): any; - -} - -export class Event { - constructor(definition: any); - - update(definition: any): void; - -} - -export class EventList { - constructor(parent: any, populate: any); - - listeners(name: any): any; - - listenersOwn(name: any): any; - - static isEventList(obj: any): any; - -} - -export class FormParam { - constructor(options: any, ...args: any[]); - - toString(): any; - - valueOf(): any; - - static parse(): void; - -} - -export class Header { - constructor(options: any, name: any, ...args: any[]); - - toString(): any; - - update(options: any): void; - - valueOf(): any; - - static create(...args: any[]): any; - - static isHeader(obj: any): any; - - static parse(headerString: any): any; - - static parseSingle(header: any): any; - - static unparse(headers: any, separator: any): any; - - static unparseSingle(header: any): any; - -} - -export class HeaderList { - constructor(parent: any, headers: any); - - contentSize(): any; - - static isHeaderList(obj: any): any; - -} - -export class Item { - constructor(definition: any, ...args: any[]); - - authorizeRequestUsing(type: any, options: any): any; - - getAuth(): any; - - getEvents(name: any): any; - - static isItem(obj: any): any; - -} - -export class ItemGroup { - constructor(definition: any, ...args: any[]); - - authorizeRequestsUsing(type: any, options: any): void; - - forEachItem(callback: any): any; - - forEachItemGroup(callback: any): void; - - oneDeep(idOrName: any): any; - - static isItemGroup(obj: any): any; - -} - -export class Property { - constructor(definition: any, ...args: any[]); - - describe(content: any, type: any): void; - - toObjectResolved(scope: any, overrides: any, options: any): any; - - static replaceSubstitutions(str: any, variables: any, ...args: any[]): any; - - static replaceSubstitutionsIn(obj: any, variables: any, mutate: any): any; - -} - -export class PropertyBase { - constructor(definition: any); - - findInParents(property: any, customizer: any): any; - - findParentContaining(property: any, customizer: any): any; - - forEachParent(options: any, iterator: any): void; - - meta(...args: any[]): any; - - parent(): any; - - setParent(parent: any): void; - - toJSON(): any; - - static propertyIsMeta(value: any, key: any): any; - - static propertyUnprefixMeta(value: any, key: any): any; - - static toJSON(obj: any): any; - -} - -export class PropertyList { - constructor(type: any, parent: any, populate: any); - - add(item: any, ...args: any[]): void; - - all(): any; - - append(item: any): any; - - assimilate(source: any, prune: any): void; - - clear(): void; - - count(): any; - - each(iterator: any, context: any): void; - - eachParent(iterator: any, context: any): void; - - filter(rule: any, context: any): any; - - find(rule: any, context: any): any; - - get(key: any): any; - - has(item: any, value: any, ...args: any[]): any; - - idx(index: any): any; - - indexOf(item: any): any; - - insert(item: any, before: any): void; - - insertAfter(item: any, after: any): any; - - map(iterator: any, context: any): any; - - one(id: any): any; - - populate(items: any): void; - - prepend(item: any): any; - - remove(predicate: any, context: any, ...args: any[]): any; - - repopulate(items: any): void; - - toJSON(): any; - - toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; - - toString(): any; - - upsert(item: any): any; - - static isPropertyList(obj: any): any; - -} - -export class ProxyConfig { - constructor(options: any); - - getProtocols(): any; - - getProxyUrl(): any; - - test(urlStr: any): any; - - update(options: any): void; - - updateProtocols(protocols: any): void; - - static isProxyConfig(obj: any): any; - -} - -export class ProxyConfigList { - constructor(parent: any, populate: any); - - resolve(url: any): any; - - static isProxyConfigList(obj: any): any; - -} - -export class QueryParam { - constructor(options: any, ...args: any[]); - - toString(): any; - - update(param: any): void; - - valueOf(): any; - - static parse(query: any): any; - - static parseSingle(param: any, idx: any, all: any): any; - - static unparse(params: any, options: any): any; - - static unparseSingle(obj: any, encode: any): any; - -} - -export class Request { - constructor(options: any, ...args: any[]); - - addHeader(header: any): void; - - addQueryParams(params: any): void; - - authorize(): void; - - authorizeUsing(type: any, options: any): void; - - clone(): any; - - forEachHeader(callback: any): any; - - getHeaders(options: any): any; - - removeHeader(toRemove: any, options: any): any; - - removeQueryParams(params: any): void; - - toJSON(): any; - - update(options: any): void; - - upsertHeader(header: any): any; - - static isRequest(obj: any): any; - -} - -export class RequestAuth { - constructor(options: any, parent: any); - - clear(type: any): void; - - current(): any; - - parameters(): any; - - update(options: any, type: any): void; - - use(type: any, options: any): void; - - static isValidType(type: any): any; - -} - -export class RequestBody { - constructor(options: any, ...args: any[]); - - isEmpty(): any; - - toString(): any; - - update(options: any): void; - - static MODES: { - file: string; - formdata: string; - raw: string; - urlencoded: string; - }; - -} - -export class Response { - constructor(options: any, ...args: any[]); - - dataURI(): any; - - details(): any; - - encoding(): any; - - json(reviver: any, strict: any): any; - - mime(contentType: any, contentDisposition: any): any; - - reason(): any; - - size(): any; - - text(): any; - - toJSON(): any; - - update(options: any): void; - - static createFromNode(response: any, cookies: any): any; - - static isResponse(obj: any): any; - - static mimeInfo(type: any, disposition: any): any; - -} - -export class Script { - constructor(options: any, ...args: any[]); - - toSource(): any; - - update(options: any): void; - - static isScript(obj: any): any; - -} - -export class Url { - constructor(options: any, ...args: any[]); - - addQueryParams(params: any): void; - - getHost(): any; - - getOAuth1BaseUrl(): any; - - getPath(options: any): any; - - getPathWithQuery(): any; - - getQueryString(options: any): any; - - getRaw(): any; - - getRemote(options: any): any; - - removeQueryParams(params: any): any; - - toString(forceProtocol: any): any; - - update(url: any): any; - - static isUrl(obj: any): any; - - static parse(url: any): any; - -} - -export class UrlMatchPattern { - constructor(options: any, ...args: any[]); - - createMatchPattern(): any; - - getProtocols(): any; - - globPatternToRegexp(pattern: any): any; - - matchAbsoluteHostPattern(matchRegexObject: any, remote: any): any; - - matchAnyHost(matchRegexObject: any): any; - - matchSuffixHostPattern(matchRegexObject: any, remote: any): any; - - test(urlStr: any): any; - - testHost(host: any): any; - - testPath(path: any): any; - - testProtocol(protocol: any): any; - - toJSON(): any; - - toString(): any; - - update(options: any): void; - - static MATCH_ALL_URLS: string; - - static PROTOCOL_DELIMITER: string; - -} - -export class UrlMatchPatternList { - constructor(parent: any, list: any); - - test(urlStr: any): any; - -} - -export class Variable { - constructor(definition: any, ...args: any[]); - - cast(value: any): any; - - castIn(value: any): any; - - castOut(value: any): any; - - get(): any; - - set(value: any): void; - - toString(): any; - - update(options: any): void; - - valueOf(value: any, ...args: any[]): any; - - valueType(typeName: any, _noCast: any): any; - - static isVariable(obj: any): any; - -} - -export class VariableList { - constructor(parent: any, populate: any); - - replace(str: any, overrides: any): any; - - substitute(obj: any, overrides: any, mutate: any): any; - - syncFromObject(obj: any, track: any, prune: any): any; - - syncToObject(obj: any): any; - - static isVariableList(obj: any): any; - -} - -export class VariableScope { - constructor(definition: any, layers: any); - - addLayer(list: any): void; - - clear(): void; - - get(key: any): any; - - has(variableName: any): any; - - set(key: any, value: any, type: any): any; - - syncVariablesFrom(obj: any, track: any): any; - - syncVariablesTo(obj: any): any; - - toJSON(): any; - - toObject(excludeDisabled: any, caseSensitive: any): any; - - unset(key: any): void; - - variables(): any; - - static isVariableScope(obj: any): any; - -} - -export class Version { - constructor(options: any); - - set(value: any): void; - - toString(): any; - -} - -export function CookieList(parent: any, cookies: any): void; - export namespace Certificate { namespace isCertificate { const prototype: { @@ -587,73 +590,6 @@ export namespace Certificate { function toObjectResolved(scope: any, overrides: any, options: any): any; function update(options: any): void; - - namespace canApplyTo { - const prototype: { - }; - - } - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - } } @@ -732,204 +668,6 @@ export namespace CertificateList { function upsert(item: any): any; - namespace add { - const prototype: { - }; - - } - - namespace all { - const prototype: { - }; - - } - - namespace append { - const prototype: { - }; - - } - - namespace assimilate { - const prototype: { - }; - - } - - namespace clear { - const prototype: { - }; - - } - - namespace count { - const prototype: { - }; - - } - - namespace each { - const prototype: { - }; - - } - - namespace eachParent { - const prototype: { - }; - - } - - namespace filter { - const prototype: { - }; - - } - - namespace find { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace get { - const prototype: { - }; - - } - - namespace has { - const prototype: { - }; - - } - - namespace idx { - const prototype: { - }; - - } - - namespace indexOf { - const prototype: { - }; - - } - - namespace insert { - const prototype: { - }; - - } - - namespace insertAfter { - const prototype: { - }; - - } - - namespace map { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace one { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace populate { - const prototype: { - }; - - } - - namespace prepend { - const prototype: { - }; - - } - - namespace remove { - const prototype: { - }; - - } - - namespace repopulate { - const prototype: { - }; - - } - - namespace resolveOne { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObject { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace upsert { - const prototype: { - }; - - } - } } @@ -971,97 +709,6 @@ export namespace Collection { function toJSON(): any; function toObjectResolved(scope: any, overrides: any, options: any): any; - - namespace authorizeRequestsUsing { - const prototype: { - }; - - } - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachItem { - const prototype: { - }; - - } - - namespace forEachItemGroup { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace oneDeep { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace syncVariablesFrom { - const prototype: { - }; - - } - - namespace syncVariablesTo { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - } } @@ -1098,60 +745,6 @@ export namespace Cookie { function valueOf(): any; - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - - namespace valueOf { - const prototype: { - }; - - } - } namespace splitParam { @@ -1236,197 +829,6 @@ export namespace CookieList { function upsert(item: any): any; - namespace add { - const prototype: { - }; - - } - - namespace all { - const prototype: { - }; - - } - - namespace append { - const prototype: { - }; - - } - - namespace assimilate { - const prototype: { - }; - - } - - namespace clear { - const prototype: { - }; - - } - - namespace count { - const prototype: { - }; - - } - - namespace each { - const prototype: { - }; - - } - - namespace eachParent { - const prototype: { - }; - - } - - namespace filter { - const prototype: { - }; - - } - - namespace find { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace get { - const prototype: { - }; - - } - - namespace has { - const prototype: { - }; - - } - - namespace idx { - const prototype: { - }; - - } - - namespace indexOf { - const prototype: { - }; - - } - - namespace insert { - const prototype: { - }; - - } - - namespace insertAfter { - const prototype: { - }; - - } - - namespace map { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace one { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace populate { - const prototype: { - }; - - } - - namespace prepend { - const prototype: { - }; - - } - - namespace remove { - const prototype: { - }; - - } - - namespace repopulate { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObject { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace upsert { - const prototype: { - }; - - } } @@ -1449,24 +851,6 @@ export namespace Description { function update(content: any, type: any): void; - namespace toJSON { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - } } @@ -1492,67 +876,6 @@ export namespace Event { function toObjectResolved(scope: any, overrides: any, options: any): any; function update(definition: any): void; - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - } } @@ -1632,211 +955,6 @@ export namespace EventList { function toString(): any; function upsert(item: any): any; - - namespace add { - const prototype: { - }; - - } - - namespace all { - const prototype: { - }; - - } - - namespace append { - const prototype: { - }; - - } - - namespace assimilate { - const prototype: { - }; - - } - - namespace clear { - const prototype: { - }; - - } - - namespace count { - const prototype: { - }; - - } - - namespace each { - const prototype: { - }; - - } - - namespace eachParent { - const prototype: { - }; - - } - - namespace filter { - const prototype: { - }; - - } - - namespace find { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace get { - const prototype: { - }; - - } - - namespace has { - const prototype: { - }; - - } - - namespace idx { - const prototype: { - }; - - } - - namespace indexOf { - const prototype: { - }; - - } - - namespace insert { - const prototype: { - }; - - } - - namespace insertAfter { - const prototype: { - }; - - } - - namespace listeners { - const prototype: { - }; - - } - - namespace listenersOwn { - const prototype: { - }; - - } - - namespace map { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace one { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace populate { - const prototype: { - }; - - } - - namespace prepend { - const prototype: { - }; - - } - - namespace remove { - const prototype: { - }; - - } - - namespace repopulate { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObject { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace upsert { - const prototype: { - }; - - } - } } @@ -1870,73 +988,6 @@ export namespace FormParam { function toString(): any; function valueOf(): any; - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace valueOf { - const prototype: { - }; - - } - } } @@ -1990,79 +1041,6 @@ export namespace Header { function update(options: any): void; function valueOf(): any; - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - - namespace valueOf { - const prototype: { - }; - - } - } namespace unparse { @@ -2152,205 +1130,6 @@ export namespace HeaderList { function toString(): any; function upsert(item: any): any; - - namespace add { - const prototype: { - }; - - } - - namespace all { - const prototype: { - }; - - } - - namespace append { - const prototype: { - }; - - } - - namespace assimilate { - const prototype: { - }; - - } - - namespace clear { - const prototype: { - }; - - } - - namespace contentSize { - const prototype: { - }; - - } - - namespace count { - const prototype: { - }; - - } - - namespace each { - const prototype: { - }; - - } - - namespace eachParent { - const prototype: { - }; - - } - - namespace filter { - const prototype: { - }; - - } - - namespace find { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace get { - const prototype: { - }; - - } - - namespace has { - const prototype: { - }; - - } - - namespace idx { - const prototype: { - }; - - } - - namespace indexOf { - const prototype: { - }; - - } - - namespace insert { - const prototype: { - }; - - } - - namespace insertAfter { - const prototype: { - }; - - } - - namespace map { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace one { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace populate { - const prototype: { - }; - - } - - namespace prepend { - const prototype: { - }; - - } - - namespace remove { - const prototype: { - }; - - } - - namespace repopulate { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObject { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace upsert { - const prototype: { - }; - - } - } } @@ -2386,79 +1165,6 @@ export namespace Item { function toJSON(): any; function toObjectResolved(scope: any, overrides: any, options: any): any; - - namespace authorizeRequestUsing { - const prototype: { - }; - - } - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace getAuth { - const prototype: { - }; - - } - - namespace getEvents { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - } } @@ -2497,84 +1203,6 @@ export namespace ItemGroup { function toObjectResolved(scope: any, overrides: any, options: any): any; - namespace authorizeRequestsUsing { - const prototype: { - }; - - } - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachItem { - const prototype: { - }; - - } - - namespace forEachItemGroup { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace oneDeep { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - } } @@ -2599,60 +1227,6 @@ export namespace Property { function toObjectResolved(scope: any, overrides: any, options: any): any; - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - } namespace replaceSubstitutions { @@ -2696,57 +1270,7 @@ export namespace PropertyBase { function setParent(parent: any): void; function toJSON(): any; - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - } - - namespace toJSON { - const prototype: { - }; - - } - } export namespace PropertyList { @@ -2820,201 +1344,7 @@ export namespace PropertyList { function toString(): any; function upsert(item: any): any; - - namespace add { - const prototype: { - }; - - } - - namespace all { - const prototype: { - }; - - } - - namespace append { - const prototype: { - }; - - } - - namespace assimilate { - const prototype: { - }; - - } - - namespace clear { - const prototype: { - }; - - } - - namespace count { - const prototype: { - }; - - } - - namespace each { - const prototype: { - }; - - } - - namespace eachParent { - const prototype: { - }; - - } - - namespace filter { - const prototype: { - }; - - } - - namespace find { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace get { - const prototype: { - }; - - } - - namespace has { - const prototype: { - }; - - } - - namespace idx { - const prototype: { - }; - - } - - namespace indexOf { - const prototype: { - }; - - } - - namespace insert { - const prototype: { - }; - - } - - namespace insertAfter { - const prototype: { - }; - - } - - namespace map { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace one { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace populate { - const prototype: { - }; - - } - - namespace prepend { - const prototype: { - }; - - } - - namespace remove { - const prototype: { - }; - - } - - namespace repopulate { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObject { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace upsert { - const prototype: { - }; - - } - } - } export namespace ProxyConfig { @@ -3052,93 +1382,7 @@ export namespace ProxyConfig { function update(options: any): void; function updateProtocols(protocols: any): void; - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace getProtocols { - const prototype: { - }; - - } - - namespace getProxyUrl { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace test { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - - namespace updateProtocols { - const prototype: { - }; - - } - } - } export namespace ProxyConfigList { @@ -3214,207 +1458,7 @@ export namespace ProxyConfigList { function toString(): any; function upsert(item: any): any; - - namespace add { - const prototype: { - }; - - } - - namespace all { - const prototype: { - }; - - } - - namespace append { - const prototype: { - }; - - } - - namespace assimilate { - const prototype: { - }; - - } - - namespace clear { - const prototype: { - }; - - } - - namespace count { - const prototype: { - }; - - } - - namespace each { - const prototype: { - }; - - } - - namespace eachParent { - const prototype: { - }; - - } - - namespace filter { - const prototype: { - }; - - } - - namespace find { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace get { - const prototype: { - }; - - } - - namespace has { - const prototype: { - }; - - } - - namespace idx { - const prototype: { - }; - - } - - namespace indexOf { - const prototype: { - }; - - } - - namespace insert { - const prototype: { - }; - - } - - namespace insertAfter { - const prototype: { - }; - - } - - namespace map { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace one { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace populate { - const prototype: { - }; - - } - - namespace prepend { - const prototype: { - }; - - } - - namespace remove { - const prototype: { - }; - - } - - namespace repopulate { - const prototype: { - }; - - } - - namespace resolve { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObject { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace upsert { - const prototype: { - }; - - } - } - } export namespace QueryParam { @@ -3454,79 +1498,6 @@ export namespace QueryParam { function update(param: any): void; function valueOf(): any; - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - - namespace valueOf { - const prototype: { - }; - - } - } namespace unparse { @@ -3540,7 +1511,6 @@ export namespace QueryParam { }; } - } export namespace Request { @@ -3590,129 +1560,7 @@ export namespace Request { function update(options: any): void; function upsertHeader(header: any): any; - - namespace addHeader { - const prototype: { - }; - - } - - namespace addQueryParams { - const prototype: { - }; - - } - - namespace authorize { - const prototype: { - }; - - } - - namespace authorizeUsing { - const prototype: { - }; - - } - - namespace clone { - const prototype: { - }; - - } - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachHeader { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace getHeaders { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace removeHeader { - const prototype: { - }; - - } - - namespace removeQueryParams { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - - namespace upsertHeader { - const prototype: { - }; - - } - } - } export namespace RequestAuth { @@ -3750,93 +1598,7 @@ export namespace RequestAuth { function update(options: any, type: any): void; function use(type: any, options: any): void; - - namespace clear { - const prototype: { - }; - - } - - namespace current { - const prototype: { - }; - - } - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parameters { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - - namespace use { - const prototype: { - }; - - } - } - } export namespace RequestBody { @@ -3860,69 +1622,7 @@ export namespace RequestBody { function toString(): any; function update(options: any): void; - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace isEmpty { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - } - } export namespace Response { @@ -3980,117 +1680,7 @@ export namespace Response { function toObjectResolved(scope: any, overrides: any, options: any): any; function update(options: any): void; - - namespace dataURI { - const prototype: { - }; - - } - - namespace describe { - const prototype: { - }; - - } - - namespace details { - const prototype: { - }; - - } - - namespace encoding { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace json { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace mime { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace reason { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace size { - const prototype: { - }; - - } - - namespace text { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - } - } export namespace Script { @@ -4122,75 +1712,7 @@ export namespace Script { function toSource(): any; function update(options: any): void; - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - - namespace toSource { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - } - } export namespace Url { @@ -4242,117 +1764,7 @@ export namespace Url { function toString(forceProtocol: any): any; function update(url: any): any; - - namespace addQueryParams { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace getHost { - const prototype: { - }; - - } - - namespace getOAuth1BaseUrl { - const prototype: { - }; - - } - - namespace getPath { - const prototype: { - }; - - } - - namespace getPathWithQuery { - const prototype: { - }; - - } - - namespace getQueryString { - const prototype: { - }; - - } - - namespace getRaw { - const prototype: { - }; - - } - - namespace getRemote { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace removeQueryParams { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - } - } export namespace UrlMatchPattern { @@ -4398,135 +1810,7 @@ export namespace UrlMatchPattern { function toString(): any; function update(options: any): void; - - namespace createMatchPattern { - const prototype: { - }; - - } - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace getProtocols { - const prototype: { - }; - - } - - namespace globPatternToRegexp { - const prototype: { - }; - - } - - namespace matchAbsoluteHostPattern { - const prototype: { - }; - - } - - namespace matchAnyHost { - const prototype: { - }; - - } - - namespace matchSuffixHostPattern { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace test { - const prototype: { - }; - - } - - namespace testHost { - const prototype: { - }; - - } - - namespace testPath { - const prototype: { - }; - - } - - namespace testProtocol { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - } - } export namespace UrlMatchPatternList { @@ -4596,207 +1880,7 @@ export namespace UrlMatchPatternList { function toString(): any; function upsert(item: any): any; - - namespace add { - const prototype: { - }; - - } - - namespace all { - const prototype: { - }; - - } - - namespace append { - const prototype: { - }; - - } - - namespace assimilate { - const prototype: { - }; - - } - - namespace clear { - const prototype: { - }; - - } - - namespace count { - const prototype: { - }; - - } - - namespace each { - const prototype: { - }; - - } - - namespace eachParent { - const prototype: { - }; - - } - - namespace filter { - const prototype: { - }; - - } - - namespace find { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace get { - const prototype: { - }; - - } - - namespace has { - const prototype: { - }; - - } - - namespace idx { - const prototype: { - }; - - } - - namespace indexOf { - const prototype: { - }; - - } - - namespace insert { - const prototype: { - }; - - } - - namespace insertAfter { - const prototype: { - }; - - } - - namespace map { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace one { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace populate { - const prototype: { - }; - - } - - namespace prepend { - const prototype: { - }; - - } - - namespace remove { - const prototype: { - }; - - } - - namespace repopulate { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace test { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObject { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace upsert { - const prototype: { - }; - - } - } - } export namespace Variable { @@ -4843,114 +1927,6 @@ export namespace Variable { function valueType(typeName: any, _noCast: any): any; - namespace cast { - const prototype: { - }; - - } - - namespace castIn { - const prototype: { - }; - - } - - namespace castOut { - const prototype: { - }; - - } - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace get { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace set { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace update { - const prototype: { - }; - - } - - namespace valueOf { - const prototype: { - }; - - } - - namespace valueType { - const prototype: { - }; - - } - } namespace types { @@ -5166,169 +2142,6 @@ export namespace Variable { } } - - namespace number { - namespace prototype { - // Too-deep object hierarchy from postman_collection.Variable.types.number.prototype - const toExponential: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.number.prototype - const toFixed: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.number.prototype - const toLocaleString: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.number.prototype - const toPrecision: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.number.prototype - const toString: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.number.prototype - const valueOf: any; - - } - - } - - namespace string { - namespace prototype { - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const anchor: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const big: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const blink: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const bold: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const charAt: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const charCodeAt: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const codePointAt: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const concat: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const endsWith: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const fixed: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const fontcolor: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const fontsize: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const includes: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const indexOf: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const italics: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const lastIndexOf: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const length: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const link: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const localeCompare: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const match: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const normalize: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const padEnd: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const padStart: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const repeat: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const replace: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const search: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const slice: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const small: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const split: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const startsWith: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const strike: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const sub: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const substr: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const substring: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const sup: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const toLocaleLowerCase: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const toLocaleUpperCase: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const toLowerCase: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const toString: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const toUpperCase: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const trim: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const trimLeft: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const trimRight: any; - - // Too-deep object hierarchy from postman_collection.Variable.types.string.prototype - const valueOf: any; - - } - - } - } } @@ -5412,223 +2225,6 @@ export namespace VariableList { function toString(): any; function upsert(item: any): any; - - namespace add { - const prototype: { - }; - - } - - namespace all { - const prototype: { - }; - - } - - namespace append { - const prototype: { - }; - - } - - namespace assimilate { - const prototype: { - }; - - } - - namespace clear { - const prototype: { - }; - - } - - namespace count { - const prototype: { - }; - - } - - namespace each { - const prototype: { - }; - - } - - namespace eachParent { - const prototype: { - }; - - } - - namespace filter { - const prototype: { - }; - - } - - namespace find { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace get { - const prototype: { - }; - - } - - namespace has { - const prototype: { - }; - - } - - namespace idx { - const prototype: { - }; - - } - - namespace indexOf { - const prototype: { - }; - - } - - namespace insert { - const prototype: { - }; - - } - - namespace insertAfter { - const prototype: { - }; - - } - - namespace map { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace one { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace populate { - const prototype: { - }; - - } - - namespace prepend { - const prototype: { - }; - - } - - namespace remove { - const prototype: { - }; - - } - - namespace replace { - const prototype: { - }; - - } - - namespace repopulate { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace substitute { - const prototype: { - }; - - } - - namespace syncFromObject { - const prototype: { - }; - - } - - namespace syncToObject { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObject { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - - namespace upsert { - const prototype: { - }; - - } - } } @@ -5678,123 +2274,7 @@ export namespace VariableScope { function unset(key: any): void; function variables(): any; - - namespace addLayer { - const prototype: { - }; - - } - - namespace clear { - const prototype: { - }; - - } - - namespace describe { - const prototype: { - }; - - } - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace get { - const prototype: { - }; - - } - - namespace has { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace set { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace syncVariablesFrom { - const prototype: { - }; - - } - - namespace syncVariablesTo { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toObject { - const prototype: { - }; - - } - - namespace toObjectResolved { - const prototype: { - }; - - } - - namespace unset { - const prototype: { - }; - - } - - namespace variables { - const prototype: { - }; - - } - } - } export namespace Version { @@ -5816,62 +2296,6 @@ export namespace Version { function toJSON(): any; function toString(): any; - - namespace findInParents { - const prototype: { - }; - - } - - namespace findParentContaining { - const prototype: { - }; - - } - - namespace forEachParent { - const prototype: { - }; - - } - - namespace meta { - const prototype: { - }; - - } - - namespace parent { - const prototype: { - }; - - } - - namespace set { - const prototype: { - }; - - } - - namespace setParent { - const prototype: { - }; - - } - - namespace toJSON { - const prototype: { - }; - - } - - namespace toString { - const prototype: { - }; - - } - } - } From 7b5682c2412e626dad088fa6917ee42a5e18ff86 Mon Sep 17 00:00:00 2001 From: hisorange Date: Fri, 16 Feb 2018 21:10:24 +0100 Subject: [PATCH 008/177] Add missing limit option --- types/bull/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 8a12db0fd7..97cb7a23df 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -164,6 +164,11 @@ declare namespace Bull { * End date when the repeat job should stop repeating */ endDate?: Date | string | number; + + /** + * Number of times the job should repeat at max. + */ + limit?: number; } interface JobOptions { From 2cd2bd872694741753a201574a8168a4a913cdb2 Mon Sep 17 00:00:00 2001 From: Alex Regan Date: Tue, 20 Feb 2018 15:09:07 -0700 Subject: [PATCH 009/177] fix(bull): adds `Queue.process` overloads --- types/bull/index.d.ts | 59 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index a7a9ea350b..a77552cb9a 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -265,6 +265,24 @@ declare namespace Bull { */ process(callback: (job: Job, done: DoneCallback) => void): void; + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The handlerPath defines the path to the job callback. + * Using a handlerPath has several advantages: + * - The process is sandboxed so if it crashes it does not affect the worker. + * - You can run blocking code without affecting the queue (jobs will not stall). + * - Much better utilization of multi-core CPUs. + * - Less connections to redis. + * + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + */ + process(handlerPath: string): void; + /** * Defines a processing function for the jobs placed into a given Queue. * @@ -291,6 +309,26 @@ declare namespace Bull { */ process(concurrency: number, callback: (job: Job) => void): Promise; + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The handlerPath defines the path to the job callback. + * Using a handlerPath has several advantages: + * - The process is sandboxed so if it crashes it does not affect the worker. + * - You can run blocking code without affecting the queue (jobs will not stall). + * - Much better utilization of multi-core CPUs. + * - Less connections to redis. + * + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + * + * @param concurrency Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, handlerPath: string): void; + /** * Defines a processing function for the jobs placed into a given Queue. * @@ -337,6 +375,27 @@ declare namespace Bull { // tslint:disable-next-line:unified-signatures process(name: string, callback: (job: Job, done: DoneCallback) => void): void; + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The handlerPath defines the path to the job callback. + * Using a handlerPath has several advantages: + * - The process is sandboxed so if it crashes it does not affect the worker. + * - You can run blocking code without affecting the queue (jobs will not stall). + * - Much better utilization of multi-core CPUs. + * - Less connections to redis. + * + * It is passed an instance of the job as first argument. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + * + * @param name Bull will only call the handler if the job name matches + * @param concurrency Bull will then call you handler in parallel respecting this max number. + */ + process(name: string, concurrency: number, handlerPath: string): void; + /** * Defines a named processing function for the jobs placed into a given Queue. * From ebcbc212b7da009de20e1802c05b8f66ec7c2be5 Mon Sep 17 00:00:00 2001 From: Alex Regan Date: Tue, 20 Feb 2018 15:20:04 -0700 Subject: [PATCH 010/177] fix(bull): merge overload decls with same arity --- types/bull/index.d.ts | 87 +++++++++++++------------------------------ 1 file changed, 26 insertions(+), 61 deletions(-) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index a77552cb9a..77317c44ff 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -257,31 +257,19 @@ declare namespace Bull { * * The callback is called everytime a job is placed in the queue. * It is passed an instance of the job as first argument. + * The callback can also be defined as the string path to a module + * exporting the callback function. Using a path has several advantages: + * - The process is sandboxed so if it crashes it does not affect the worker. + * - You can run blocking code without affecting the queue (jobs will not stall). + * - Much better utilization of multi-core CPUs. + * - Less connections to redis. * * The done callback can be called with an Error instance, to signal that the job did not complete successfully, * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. * Errors will be passed as a second argument to the "failed" event; * results, as a second argument to the "completed" event. */ - process(callback: (job: Job, done: DoneCallback) => void): void; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The handlerPath defines the path to the job callback. - * Using a handlerPath has several advantages: - * - The process is sandboxed so if it crashes it does not affect the worker. - * - You can run blocking code without affecting the queue (jobs will not stall). - * - Much better utilization of multi-core CPUs. - * - Less connections to redis. - * - * It is passed an instance of the job as first argument. - * - * A promise must be returned to signal job completion. - * If the promise is rejected, the error will be passed as a second argument to the "failed" event. - * If it is resolved, its value will be the "completed" event's second argument. - */ - process(handlerPath: string): void; + process(callback: (job: Job, done: DoneCallback) => void | string): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -312,29 +300,15 @@ declare namespace Bull { /** * Defines a processing function for the jobs placed into a given Queue. * - * The handlerPath defines the path to the job callback. - * Using a handlerPath has several advantages: + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * The callback can also be defined as the string path to a module + * exporting the callback function. Using a path has several advantages: * - The process is sandboxed so if it crashes it does not affect the worker. * - You can run blocking code without affecting the queue (jobs will not stall). * - Much better utilization of multi-core CPUs. * - Less connections to redis. * - * It is passed an instance of the job as first argument. - * - * A promise must be returned to signal job completion. - * If the promise is rejected, the error will be passed as a second argument to the "failed" event. - * If it is resolved, its value will be the "completed" event's second argument. - * - * @param concurrency Bull will then call you handler in parallel respecting this max number. - */ - process(concurrency: number, handlerPath: string): void; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * * The done callback can be called with an Error instance, to signal that the job did not complete successfully, * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. * Errors will be passed as a second argument to the "failed" event; @@ -342,7 +316,7 @@ declare namespace Bull { * * @param concurrency Bull will then call you handler in parallel respecting this max number. */ - process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; + process(concurrency: number, callback: (job: Job, done: DoneCallback) => void | string): void; /** * Defines a named processing function for the jobs placed into a given Queue. @@ -364,6 +338,12 @@ declare namespace Bull { * * The callback is called everytime a job is placed in the queue. * It is passed an instance of the job as first argument. + * The callback can also be defined as the string path to a module + * exporting the callback function. Using a path has several advantages: + * - The process is sandboxed so if it crashes it does not affect the worker. + * - You can run blocking code without affecting the queue (jobs will not stall). + * - Much better utilization of multi-core CPUs. + * - Less connections to redis. * * The done callback can be called with an Error instance, to signal that the job did not complete successfully, * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. @@ -373,28 +353,7 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches */ // tslint:disable-next-line:unified-signatures - process(name: string, callback: (job: Job, done: DoneCallback) => void): void; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The handlerPath defines the path to the job callback. - * Using a handlerPath has several advantages: - * - The process is sandboxed so if it crashes it does not affect the worker. - * - You can run blocking code without affecting the queue (jobs will not stall). - * - Much better utilization of multi-core CPUs. - * - Less connections to redis. - * - * It is passed an instance of the job as first argument. - * - * A promise must be returned to signal job completion. - * If the promise is rejected, the error will be passed as a second argument to the "failed" event. - * If it is resolved, its value will be the "completed" event's second argument. - * - * @param name Bull will only call the handler if the job name matches - * @param concurrency Bull will then call you handler in parallel respecting this max number. - */ - process(name: string, concurrency: number, handlerPath: string): void; + process(name: string, callback: (job: Job, done: DoneCallback) => void | string): void; /** * Defines a named processing function for the jobs placed into a given Queue. @@ -416,6 +375,12 @@ declare namespace Bull { * * The callback is called everytime a job is placed in the queue. * It is passed an instance of the job as first argument. + * The callback can also be defined as the string path to a module + * exporting the callback function. Using a path has several advantages: + * - The process is sandboxed so if it crashes it does not affect the worker. + * - You can run blocking code without affecting the queue (jobs will not stall). + * - Much better utilization of multi-core CPUs. + * - Less connections to redis. * * The done callback can be called with an Error instance, to signal that the job did not complete successfully, * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. @@ -425,7 +390,7 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches * @param concurrency Bull will then call you handler in parallel respecting this max number. */ - process(name: string, concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; + process(name: string, concurrency: number, callback: (job: Job, done: DoneCallback) => void | string): void; /** * Creates a new job and adds it to the queue. From bf9864b51f6d7d0b9fa3410cbe00d7cad47aa337 Mon Sep 17 00:00:00 2001 From: Kyle Buzby Date: Wed, 21 Feb 2018 17:26:28 -0600 Subject: [PATCH 011/177] roughly complete documented types from the web site TODO: update function signatures for parameters that are functions --- types/postman-collection/index.d.ts | 2733 ++++++--------------------- 1 file changed, 617 insertions(+), 2116 deletions(-) diff --git a/types/postman-collection/index.d.ts b/types/postman-collection/index.d.ts index 1247493c85..5365b9cfaf 100644 --- a/types/postman-collection/index.d.ts +++ b/types/postman-collection/index.d.ts @@ -2,2300 +2,801 @@ // Project: https://github.com/postmanlabs/postman-collection // Definitions by: Kyle Buzby // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + +export class PropertyBase { + constructor(definition: any); -declare module PostmanCollection { - export class Certificate { - constructor(options: any, ...args: any[]); - - canApplyTo(url: any): any; - - toJSON(): any; - - update(options: any): void; - - static isCertificate(obj: any): any; - - } - - export class CertificateList { - constructor(parent: any, list: any); - - resolveOne(url: any): any; - - static isCertificateList(obj: any): any; - - } - - export class Collection { - constructor(definition: any, environments: any); - - syncVariablesFrom(obj: any, track: any): any; - - syncVariablesTo(obj: any): any; - - toJSON(): any; - - static isCollection(obj: any): any; - - } - - export class Cookie { - constructor(options: any); - - update(options: any): void; - - valueOf(): any; - - static isCookie(obj: any): any; - - static parse(str: any): any; - - static splitParam(param: any): any; - - } - - export class Description { - constructor(definition: any); - - toJSON(): any; - - toString(): any; - - update(content: any, type: any): void; - - static isDescription(obj: any): any; - - } - - export class Event { - constructor(definition: any); - - update(definition: any): void; - - } - - export class EventList { - constructor(parent: any, populate: any); - - listeners(name: any): any; - - listenersOwn(name: any): any; - - static isEventList(obj: any): any; - - } - - export class FormParam { - constructor(options: any, ...args: any[]); - - toString(): any; - - valueOf(): any; - - static parse(): void; - - } - - export class Header { - constructor(options: any, name: any, ...args: any[]); - - toString(): any; - - update(options: any): void; - - valueOf(): any; - - static create(...args: any[]): any; - - static isHeader(obj: any): any; - - static parse(headerString: any): any; - - static parseSingle(header: any): any; - - static unparse(headers: any, separator: any): any; - - static unparseSingle(header: any): any; - - } - - export class HeaderList { - constructor(parent: any, headers: any); - - contentSize(): any; - - static isHeaderList(obj: any): any; - - } - - export class Item { - constructor(definition: any, ...args: any[]); - - authorizeRequestUsing(type: any, options: any): any; - - getAuth(): any; - - getEvents(name: any): any; - - static isItem(obj: any): any; - - } - - export class ItemGroup { - constructor(definition: any, ...args: any[]); - - authorizeRequestsUsing(type: any, options: any): void; - - forEachItem(callback: any): any; - - forEachItemGroup(callback: any): void; - - oneDeep(idOrName: any): any; - - static isItemGroup(obj: any): any; - - } - - export class Property { - constructor(definition: any, ...args: any[]); - - describe(content: any, type: any): void; - - toObjectResolved(scope: any, overrides: any, options: any): any; - - static replaceSubstitutions(str: any, variables: any, ...args: any[]): any; - - static replaceSubstitutionsIn(obj: any, variables: any, mutate: any): any; - - } - - export class PropertyBase { - constructor(definition: any); - - findInParents(property: any, customizer: any): any; - - findParentContaining(property: any, customizer: any): any; - - forEachParent(options: any, iterator: any): void; - - meta(...args: any[]): any; - - parent(): any; - - setParent(parent: any): void; - - toJSON(): any; - - static propertyIsMeta(value: any, key: any): any; - - static propertyUnprefixMeta(value: any, key: any): any; - - static toJSON(obj: any): any; - - } - - export class PropertyList { - constructor(type: any, parent: any, populate: any); - - add(item: any, ...args: any[]): void; - - all(): any; - - append(item: any): any; - - assimilate(source: any, prune: any): void; - - clear(): void; - - count(): any; - - each(iterator: any, context: any): void; - - eachParent(iterator: any, context: any): void; - - filter(rule: any, context: any): any; - - find(rule: any, context: any): any; - - get(key: any): any; - - has(item: any, value: any, ...args: any[]): any; - - idx(index: any): any; - - indexOf(item: any): any; - - insert(item: any, before: any): void; - - insertAfter(item: any, after: any): any; - - map(iterator: any, context: any): any; - - one(id: any): any; - - populate(items: any): void; - - prepend(item: any): any; - - remove(predicate: any, context: any, ...args: any[]): any; - - repopulate(items: any): void; - - toJSON(): any; - - toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; - - toString(): any; - - upsert(item: any): any; - - static isPropertyList(obj: any): any; - - } - - export class ProxyConfig { - constructor(options: any); - - getProtocols(): any; - - getProxyUrl(): any; - - test(urlStr: any): any; - - update(options: any): void; - - updateProtocols(protocols: any): void; - - static isProxyConfig(obj: any): any; - - } - - export class ProxyConfigList { - constructor(parent: any, populate: any); - - resolve(url: any): any; - - static isProxyConfigList(obj: any): any; - - } - - export class QueryParam { - constructor(options: any, ...args: any[]); - - toString(): any; - - update(param: any): void; - - valueOf(): any; - - static parse(query: any): any; - - static parseSingle(param: any, idx: any, all: any): any; - - static unparse(params: any, options: any): any; - - static unparseSingle(obj: any, encode: any): any; - - } - - export class Request { - constructor(options: any, ...args: any[]); - - addHeader(header: any): void; - - addQueryParams(params: any): void; - - authorize(): void; - - authorizeUsing(type: any, options: any): void; - - clone(): any; - - forEachHeader(callback: any): any; - - getHeaders(options: any): any; - - removeHeader(toRemove: any, options: any): any; - - removeQueryParams(params: any): void; - - toJSON(): any; - - update(options: any): void; - - upsertHeader(header: any): any; - - static isRequest(obj: any): any; - - } - - export class RequestAuth { - constructor(options: any, parent: any); - - clear(type: any): void; - - current(): any; - - parameters(): any; - - update(options: any, type: any): void; - - use(type: any, options: any): void; - - static isValidType(type: any): any; - - } - - export class RequestBody { - constructor(options: any, ...args: any[]); - - isEmpty(): any; - - toString(): any; - - update(options: any): void; - - static MODES: { - file: string; - formdata: string; - raw: string; - urlencoded: string; - }; - - } - - export class Response { - constructor(options: any, ...args: any[]); - - dataURI(): any; - - details(): any; - - encoding(): any; - - json(reviver: any, strict: any): any; - - mime(contentType: any, contentDisposition: any): any; - - reason(): any; - - size(): any; - - text(): any; - - toJSON(): any; - - update(options: any): void; - - static createFromNode(response: any, cookies: any): any; - - static isResponse(obj: any): any; - - static mimeInfo(type: any, disposition: any): any; - - } - - export class Script { - constructor(options: any, ...args: any[]); - - toSource(): any; - - update(options: any): void; - - static isScript(obj: any): any; - - } - - export class Url { - constructor(options: any, ...args: any[]); - - addQueryParams(params: any): void; - - getHost(): any; - - getOAuth1BaseUrl(): any; - - getPath(options: any): any; - - getPathWithQuery(): any; - - getQueryString(options: any): any; - - getRaw(): any; - - getRemote(options: any): any; - - removeQueryParams(params: any): any; - - toString(forceProtocol: any): any; - - update(url: any): any; - - static isUrl(obj: any): any; - - static parse(url: any): any; - - } - - export class UrlMatchPattern { - constructor(options: any, ...args: any[]); - - createMatchPattern(): any; - - getProtocols(): any; - - globPatternToRegexp(pattern: any): any; - - matchAbsoluteHostPattern(matchRegexObject: any, remote: any): any; - - matchAnyHost(matchRegexObject: any): any; - - matchSuffixHostPattern(matchRegexObject: any, remote: any): any; - - test(urlStr: any): any; - - testHost(host: any): any; - - testPath(path: any): any; - - testProtocol(protocol: any): any; - - toJSON(): any; - - toString(): any; - - update(options: any): void; - - static MATCH_ALL_URLS: string; - - static PROTOCOL_DELIMITER: string; - - } - - export class UrlMatchPatternList { - constructor(parent: any, list: any); - - test(urlStr: any): any; - - } - - export class Variable { - constructor(definition: any, ...args: any[]); - - cast(value: any): any; - - castIn(value: any): any; - - castOut(value: any): any; - - get(): any; - - set(value: any): void; - - toString(): any; - - update(options: any): void; - - valueOf(value: any, ...args: any[]): any; - - valueType(typeName: any, _noCast: any): any; - - static isVariable(obj: any): any; - - } - - export class VariableList { - constructor(parent: any, populate: any); - - replace(str: any, overrides: any): any; - - substitute(obj: any, overrides: any, mutate: any): any; - - syncFromObject(obj: any, track: any, prune: any): any; - - syncToObject(obj: any): any; - - static isVariableList(obj: any): any; - - } - - export class VariableScope { - constructor(definition: any, layers: any); - - addLayer(list: any): void; - - clear(): void; - - get(key: any): any; - - has(variableName: any): any; - - set(key: any, value: any, type: any): any; - - syncVariablesFrom(obj: any, track: any): any; - - syncVariablesTo(obj: any): any; - - toJSON(): any; - - toObject(excludeDisabled: any, caseSensitive: any): any; - - unset(key: any): void; - - variables(): any; - - static isVariableScope(obj: any): any; - - } - - export class Version { - constructor(options: any); - - set(value: any): void; - - toString(): any; - - } - - export function CookieList(parent: any, cookies: any): void; - -} + findInParents(property: string, customizer?: any): any | undefined; // TODO Update customizer function def -export namespace Certificate { - namespace isCertificate { - const prototype: { - }; + findParentContaining(property: any, customizer: any): any; // TODO Update customizer function def - } + forEachParent(iterator: any): void; // TODO Update iterator function def + forEachParent(options: any | boolean, iterator: any): void; // TODO Update iterator function def - namespace prototype { - function canApplyTo(url: any): any; + meta(): any; - function describe(content: any, type: any): void; + parent(): any | undefined; - function findInParents(property: any, customizer: any): any; + setParent(parent: any): void; - function findParentContaining(property: any, customizer: any): any; + toJSON(): any; - function forEachParent(options: any, iterator: any): void; + static propertyIsMeta(value: any, key: any): any; - function meta(...args: any[]): any; + static propertyUnprefixMeta(value: any, key: any): any; - function parent(): any; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - function update(options: any): void; - } + static toJSON(obj: any): any; } -export namespace CertificateList { - namespace isCertificateList { - const prototype: { - }; +export interface PropertyDefinition { + id?: string; + name?: string; + disabled?: boolean; +} - } +export class Property extends PropertyBase implements PropertyDefinition { + auth: RequestAuth; + disabled: boolean; + id: string; + name: string; - namespace prototype { - function add(item: any, ...args: any[]): void; + constructor(definition?: PropertyDefinition); - function all(): any; + describe(content: string, type?: string): void; - function append(item: any): any; + toObjectResolved(scope: any, overrides: any, options: any): any; - function assimilate(source: any, prune: any): void; + static replaceSubstitutions(str: string, variables: VariableList | any | (VariableList | any)[]): string; - function clear(): void; - - function count(): any; - - function each(iterator: any, context: any): void; - - function eachParent(iterator: any, context: any): void; - - function filter(rule: any, context: any): any; - - function find(rule: any, context: any): any; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function get(key: any): any; - - function has(item: any, value: any, ...args: any[]): any; - - function idx(index: any): any; - - function indexOf(item: any): any; - - function insert(item: any, before: any): void; - - function insertAfter(item: any, after: any): any; - - function map(iterator: any, context: any): any; - - function meta(...args: any[]): any; - - function one(id: any): any; - - function parent(): any; - - function populate(items: any): void; - - function prepend(item: any): any; - - function remove(predicate: any, context: any, ...args: any[]): any; - - function repopulate(items: any): void; - - function resolveOne(url: any): any; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; - - function toString(): any; - - function upsert(item: any): any; - - } + static replaceSubstitutionsIn(obj: any, variables: (VariableList | any)[], mutate: boolean): any; } -export namespace Collection { - namespace isCollection { - const prototype: { - }; +export interface CertificateDefinition extends PropertyDefinition { + name?: string; + matches?: any[]; + key?: any; + cert?: any; + passphrase?: string; +} - } +export class Certificate extends Property { + cert: any; + id: string; + key: any; + matches: any; // TODO update to UrlMatchPatternList? + name: string; + passphrase: any; - namespace prototype { - function authorizeRequestsUsing(type: any, options: any): void; + constructor(options: any); - function describe(content: any, type: any): void; + canApplyTo(url: string | Url): any; - function findInParents(property: any, customizer: any): any; + toJSON(): CertificateDefinition; - function findParentContaining(property: any, customizer: any): any; + update(options: CertificateDefinition): void; - function forEachItem(callback: any): any; - - function forEachItemGroup(callback: any): void; - - function forEachParent(options: any, iterator: any): void; - - function meta(...args: any[]): any; - - function oneDeep(idOrName: any): any; - - function parent(): any; - - function setParent(parent: any): void; - - function syncVariablesFrom(obj: any, track: any): any; - - function syncVariablesTo(obj: any): any; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - } + static isCertificate(obj: any): boolean; } -export namespace Cookie { - namespace isCookie { - const prototype: { - }; - } +export class PropertyList { + constructor(type: any, parent: any, populate: any); - namespace parse { - const prototype: { - }; + add(item: any | TElement): void; - } + all(): any; - namespace prototype { - function findInParents(property: any, customizer: any): any; + append(item: TElement): any; - function findParentContaining(property: any, customizer: any): any; + assimilate(source: PropertyList | any[], prune: boolean): void; - function forEachParent(options: any, iterator: any): void; + clear(): void; - function meta(...args: any[]): any; + count(): number; - function parent(): any; + each(iterator: any, context: any): void; - function setParent(parent: any): void; + eachParent(iterator: any, context?: any): void; - function toJSON(): any; + filter(rule: any, context: any): any; - function update(options: any): void; + find(rule: any, context?: any): Item | ItemGroup; - function valueOf(): any; + get(key: string | any): TElement; - } + has(item: string | TElement, value?: any): boolean; - namespace splitParam { - const prototype: { - }; + idx(index: number): TElement; - } + indexOf(item: string | any): number; + + insert(item: TElement, before: TElement | string): void; + + insertAfter(item: TElement, after: TElement | string): any; + + map(iterator: any, context: any): any; + + one(id: string): TElement; + + populate(items: any | any[]): void; + + prepend(item: TElement): any; + + remove(predicate: any | string | TElement, context: any): any; + + repopulate(items: any | any[]): void; + + toJSON(): any; + + toObject(excludeDisabled?: any | null, caseSensitive?: any | null, multiValue?: any | null, sanitizeKeys?: any): any; + + toString(): string; + + upsert(item: TElement): boolean | null; + + static isPropertyList(obj: any): any; } -export namespace CookieList { - function isCookieList(obj: any): any; +export class CertificateList extends PropertyList { + constructor(parent: any, list: CertificateDefinition[]); - namespace isCookieList { - const prototype: { - }; + resolveOne(url: string): CertificateDefinition; - } - - namespace prototype { - function add(item: any, ...args: any[]): void; - - function all(): any; - - function append(item: any): any; - - function assimilate(source: any, prune: any): void; - - function clear(): void; - - function count(): any; - - function each(iterator: any, context: any): void; - - function eachParent(iterator: any, context: any): void; - - function filter(rule: any, context: any): any; - - function find(rule: any, context: any): any; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function get(key: any): any; - - function has(item: any, value: any, ...args: any[]): any; - - function idx(index: any): any; - - function indexOf(item: any): any; - - function insert(item: any, before: any): void; - - function insertAfter(item: any, after: any): any; - - function map(iterator: any, context: any): any; - - function meta(...args: any[]): any; - - function one(id: any): any; - - function parent(): any; - - function populate(items: any): void; - - function prepend(item: any): any; - - function remove(predicate: any, context: any, ...args: any[]): any; - - function repopulate(items: any): void; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; - - function toString(): any; - - function upsert(item: any): any; - - - } + static isCertificateList(obj: any): boolean; } -export namespace Description { - namespace format { - } +export interface ItemGroupDefinition extends PropertyDefinition { + item?: (ItemDefinition | ItemGroupDefinition)[]; + auth?: RequestAuthDefinition; + event?: EventDefinition[]; +} + +export class ItemGroup extends Property { + auth: RequestAuth; + items: PropertyList; - namespace isDescription { - const prototype: { - }; + constructor(definition?: ItemGroupDefinition); - } + authorizeRequestsUsing(type: any, options: any): void; // TODO add better types for parameters - namespace prototype { - function toJSON(): any; + forEachItem(callback: any): any; - function toString(): any; + forEachItemGroup(callback: any): void; - function update(content: any, type: any): void; + oneDeep(idOrName: string): TItem; - } + static isItemGroup(obj: any): boolean; } -export namespace Event { - namespace prototype { - function describe(content: any, type: any): void; +export interface CollectionDefinition extends ItemGroupDefinition { + info?: { + id?: string; + name?: string; + version?: string; + }; + item?: (ItemDefinition | ItemGroupDefinition)[]; + variable?: VariableDefinition; + auth?: RequestAuthDefinition; + event?: EventDefinition[]; + version?: string | Version; +} - function findInParents(property: any, customizer: any): any; +export class Collection extends ItemGroup implements CollectionDefinition { + events: EventList; + variables: VariableList; + version: Version; - function findParentContaining(property: any, customizer: any): any; + constructor(definition?: CollectionDefinition, environments?: any[]); - function forEachParent(options: any, iterator: any): void; + syncVariablesFrom(obj: any, track?: boolean): any; - function meta(...args: any[]): any; + syncVariablesTo(obj?: any): any; - function parent(): any; + toJSON(): any; - function setParent(parent: any): void; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - function update(definition: any): void; - } + static isCollection(obj: any): boolean; } -export namespace EventList { - namespace isEventList { - const prototype: { - }; - - } - - namespace prototype { - function add(item: any, ...args: any[]): void; - - function all(): any; - - function append(item: any): any; - - function assimilate(source: any, prune: any): void; - - function clear(): void; - - function count(): any; - - function each(iterator: any, context: any): void; - - function eachParent(iterator: any, context: any): void; - - function filter(rule: any, context: any): any; - - function find(rule: any, context: any): any; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function get(key: any): any; - - function has(item: any, value: any, ...args: any[]): any; - - function idx(index: any): any; - - function indexOf(item: any): any; - - function insert(item: any, before: any): void; - - function insertAfter(item: any, after: any): any; - - function listeners(name: any): any; - - function listenersOwn(name: any): any; - - function map(iterator: any, context: any): any; - - function meta(...args: any[]): any; - - function one(id: any): any; - - function parent(): any; - - function populate(items: any): void; - - function prepend(item: any): any; - - function remove(predicate: any, context: any, ...args: any[]): any; - - function repopulate(items: any): void; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; - - function toString(): any; - - function upsert(item: any): any; - } +export interface CookieDefinition { + key?: string; + value?: string; + expires?: string | Date; + maxAge?: number; + domain?: string; + path?: string; + secure?: boolean; + httpOnly?: boolean; + hostOnly?: boolean; + session?: boolean; + extensions?: {key: string; value: string}[]; } -export namespace FormParam { - namespace parse { - const prototype: { - }; +export class Cookie extends PropertyBase implements CookieDefinition { + domain: string; + expires: Date | string; + extensions: {key: string; value: string}[]; + hostOnly: any; + httpOnly: any; + maxAge: number; + name: string; + path: string; + secure: any; + session: any; + value: string; - } + constructor(options?: CookieDefinition); - namespace prototype { - function describe(content: any, type: any): void; + update(options: any): void; - function findInParents(property: any, customizer: any): any; + valueOf(): string; - function findParentContaining(property: any, customizer: any): any; + static isCookie(obj: any): boolean; - function forEachParent(options: any, iterator: any): void; + static parse(str: string): any; - function meta(...args: any[]): any; - - function parent(): any; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - function toString(): any; - - function valueOf(): any; - } + static splitParam(param: any): any; } -export namespace Header { - namespace create { - const prototype: { - }; +export class CookieList extends PropertyList { + constructor(parent: any, cookies: any[]); - } + static isCookieList(obj: any): boolean; +} - namespace isHeader { - const prototype: { - }; +export interface DescriptionDefinition { + content: string; + format: string; +} - } +export class Description implements DescriptionDefinition { + format: string; // TODO huh? + content: string; + type: string; - namespace parse { - const prototype: { - }; + constructor(definition?: DescriptionDefinition); - } + toJSON(): any; - namespace parseSingle { - const prototype: { - }; + toString(): string; - } + update(content: string | DescriptionDefinition, type?: string): void; - namespace prototype { - function describe(content: any, type: any): void; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function meta(...args: any[]): any; - - function parent(): any; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - function toString(): any; - - function update(options: any): void; - - function valueOf(): any; - } - - namespace unparse { - const prototype: { - }; - - } - - namespace unparseSingle { - const prototype: { - }; - - } + static isDescription(obj: any): boolean; } -export namespace HeaderList { - namespace isHeaderList { - const prototype: { - }; +export interface EventDefinition extends PropertyDefinition { + listen: string; + script: string | Script; +} - } +export class Event extends Property implements EventDefinition { + listen: string; + script: string; - namespace prototype { - function add(item: any, ...args: any[]): void; + constructor(definition: EventDefinition); - function all(): any; + update(definition: EventDefinition): void; +} - function append(item: any): any; +export class EventList extends PropertyList { + constructor(parent: any, populate: any[]); - function assimilate(source: any, prune: any): void; + listeners(name: string): Event[]; - function clear(): void; + listenersOwn(name: string): Event[]; - function contentSize(): any; - - function count(): any; - - function each(iterator: any, context: any): void; - - function eachParent(iterator: any, context: any): void; - - function filter(rule: any, context: any): any; - - function find(rule: any, context: any): any; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function get(key: any): any; - - function has(item: any, value: any, ...args: any[]): any; - - function idx(index: any): any; - - function indexOf(item: any): any; - - function insert(item: any, before: any): void; - - function insertAfter(item: any, after: any): any; - - function map(iterator: any, context: any): any; - - function meta(...args: any[]): any; - - function one(id: any): any; - - function parent(): any; - - function populate(items: any): void; - - function prepend(item: any): any; - - function remove(predicate: any, context: any, ...args: any[]): any; - - function repopulate(items: any): void; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; - - function toString(): any; - - function upsert(item: any): any; - } + static isEventList(obj: any): boolean; } -export namespace Item { - namespace isItem { - const prototype: { - }; +export interface FormParamDefinition extends PropertyDefinition { + key: string; + value: string; +} - } +export class FormParam extends Property implements FormParamDefinition{ + key: string; + value: string; - namespace prototype { - function authorizeRequestUsing(type: any, options: any): any; + static _postman_propertyAllowsMultipleValues: boolean; + static _postman_propertyIndex: string; - function describe(content: any, type: any): void; + constructor(options: FormParamDefinition); - function findInParents(property: any, customizer: any): any; + toString(): string; - function findParentContaining(property: any, customizer: any): any; + valueOf(): any | string; - function forEachParent(options: any, iterator: any): void; + // static parse(): void; // TODO not implemented yet +} - function getAuth(): any; +export interface HeaderDefinition extends PropertyDefinition { + key: string; + value: string; +} - function getEvents(name: any): any; +export class Header extends Property implements HeaderDefinition { + key: string; + value: string; - function meta(...args: any[]): any; + constructor(options: HeaderDefinition | string, name?: string); - function parent(): any; + toString(): string; - function setParent(parent: any): void; + update(options: any): void; - function toJSON(): any; + valueOf(): string; - function toObjectResolved(scope: any, overrides: any, options: any): any; - } + static create(value?: HeaderDefinition | string, name?: string): Header; + + static isHeader(obj: any): boolean; + + static parse(headerString: string): HeaderDefinition[]; + + static parseSingle(header: string): HeaderDefinition; + + static unparse(headers: HeaderList | any[], separator?: string): string; + + static unparseSingle(header: Header): string; +} + +export class HeaderList extends PropertyList
{ + constructor(parent: any, headers: Header[]); + + contentSize(): number; + + static isHeaderList(obj: any): boolean; +} + +export interface ItemDefinition extends PropertyDefinition { + request?: RequestDefinition; + responses?: ResponseDefinition[]; + events?: EventDefinition[]; +} + +export class Item extends Property implements ItemDefinition { + events: EventDefinition[]; + request: Request; + responses: ResponseDefinition[]; + + constructor(definition?: ItemDefinition); + + authorizeRequestUsing(type: string | RequestAuthDefinition, options?: VariableList): any; + + getAuth(): RequestAuth; + + getEvents(name: string): Event[]; + + static isItem(obj: any): boolean; } -export namespace ItemGroup { - namespace isItemGroup { - const prototype: { - }; +export interface ProxyConfigDefinition extends PropertyDefinition { + match?: string; + host?: string; + port?: number; + tunnel?: boolean; + disabled?: boolean; +} - } +export class ProxyConfig extends Property implements ProxyConfigDefinition { + static host: string; + static match: string; + static port: number; + static tunnel: boolean; - namespace prototype { - function authorizeRequestsUsing(type: any, options: any): void; + constructor(options?: ProxyConfigDefinition); - function describe(content: any, type: any): void; + getProtocols(): string[]; - function findInParents(property: any, customizer: any): any; + getProxyUrl(): string; - function findParentContaining(property: any, customizer: any): any; + test(urlStr?: string): any; - function forEachItem(callback: any): any; + update(options: ProxyConfigDefinition): void; - function forEachItemGroup(callback: any): void; + updateProtocols(protocols: string[]): void; - function forEachParent(options: any, iterator: any): void; - - function meta(...args: any[]): any; - - function oneDeep(idOrName: any): any; - - function parent(): any; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - } + static isProxyConfig(obj: any): boolean; } -export namespace Property { - namespace prototype { - function describe(content: any, type: any): void; +export class ProxyConfigList extends PropertyList { + constructor(parent: any, populate: ProxyConfig[]); - function findInParents(property: any, customizer: any): any; + resolve(url?: Url): ProxyConfigDefinition; - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function meta(...args: any[]): any; - - function parent(): any; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - } - - namespace replaceSubstitutions { - const prototype: { - }; - - } - - namespace replaceSubstitutionsIn { - const prototype: { - }; - - } + static isProxyConfigList(obj: any): boolean; } -export namespace PropertyBase { - namespace propertyIsMeta { - const prototype: { - }; - - } - - namespace propertyUnprefixMeta { - const prototype: { - }; - - } - - namespace prototype { - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function meta(...args: any[]): any; - - function parent(): any; - - function setParent(parent: any): void; - - function toJSON(): any; - } +export interface QueryParamDefinition extends PropertyDefinition { + key: string; + value: string; } -export namespace PropertyList { - namespace isPropertyList { - const prototype: { - }; +export class QueryParam extends Property implements QueryParamDefinition { + static _postman_propertyAllowsMultipleValues: boolean; + static _postman_propertyIndexKey: string; - } + key: string; + value: string; - namespace prototype { - function add(item: any, ...args: any[]): void; + constructor(options: QueryParamDefinition | string); - function all(): any; + toString(): string; - function append(item: any): any; + update(param: string | {key: string, value?: string}): void; - function assimilate(source: any, prune: any): void; + valueOf(): any; - function clear(): void; + static parse(query: string): any[]; - function count(): any; + static parseSingle(param: string, idx: number, all: string[]): any; - function each(iterator: any, context: any): void; + static unparse(params: any | any[], options?: {encode?: boolean | null, ignoreDisabled?: boolean | null}): string; - function eachParent(iterator: any, context: any): void; - - function filter(rule: any, context: any): any; - - function find(rule: any, context: any): any; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function get(key: any): any; - - function has(item: any, value: any, ...args: any[]): any; - - function idx(index: any): any; - - function indexOf(item: any): any; - - function insert(item: any, before: any): void; - - function insertAfter(item: any, after: any): any; - - function map(iterator: any, context: any): any; - - function meta(...args: any[]): any; - - function one(id: any): any; - - function parent(): any; - - function populate(items: any): void; - - function prepend(item: any): any; - - function remove(predicate: any, context: any, ...args: any[]): any; - - function repopulate(items: any): void; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; - - function toString(): any; - - function upsert(item: any): any; - } -} - -export namespace ProxyConfig { - namespace isProxyConfig { - const prototype: { - }; - - } - - namespace prototype { - function describe(content: any, type: any): void; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function getProtocols(): any; - - function getProxyUrl(): any; - - function meta(...args: any[]): any; - - function parent(): any; - - function setParent(parent: any): void; - - function test(urlStr: any): any; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - function update(options: any): void; - - function updateProtocols(protocols: any): void; - } -} - -export namespace ProxyConfigList { - namespace isProxyConfigList { - const prototype: { - }; - - } - - namespace prototype { - function add(item: any, ...args: any[]): void; - - function all(): any; - - function append(item: any): any; - - function assimilate(source: any, prune: any): void; - - function clear(): void; - - function count(): any; - - function each(iterator: any, context: any): void; - - function eachParent(iterator: any, context: any): void; - - function filter(rule: any, context: any): any; - - function find(rule: any, context: any): any; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function get(key: any): any; - - function has(item: any, value: any, ...args: any[]): any; - - function idx(index: any): any; - - function indexOf(item: any): any; - - function insert(item: any, before: any): void; - - function insertAfter(item: any, after: any): any; - - function map(iterator: any, context: any): any; - - function meta(...args: any[]): any; - - function one(id: any): any; - - function parent(): any; - - function populate(items: any): void; - - function prepend(item: any): any; - - function remove(predicate: any, context: any, ...args: any[]): any; - - function repopulate(items: any): void; - - function resolve(url: any): any; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; - - function toString(): any; - - function upsert(item: any): any; - } -} - -export namespace QueryParam { - namespace parse { - const prototype: { - }; - - } - - namespace parseSingle { - const prototype: { - }; - - } - - namespace prototype { - function describe(content: any, type: any): void; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function meta(...args: any[]): any; - - function parent(): any; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - function toString(): any; - - function update(param: any): void; - - function valueOf(): any; - } - - namespace unparse { - const prototype: { - }; - - } - - namespace unparseSingle { - const prototype: { - }; - - } -} - -export namespace Request { - namespace isRequest { - const prototype: { - }; - - } - - namespace prototype { - function addHeader(header: any): void; - - function addQueryParams(params: any): void; - - function authorize(): void; - - function authorizeUsing(type: any, options: any): void; - - function clone(): any; - - function describe(content: any, type: any): void; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachHeader(callback: any): any; - - function forEachParent(options: any, iterator: any): void; - - function getHeaders(options: any): any; - - function meta(...args: any[]): any; - - function parent(): any; - - function removeHeader(toRemove: any, options: any): any; - - function removeQueryParams(params: any): void; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - function update(options: any): void; - - function upsertHeader(header: any): any; - } -} - -export namespace RequestAuth { - namespace isValidType { - const prototype: { - }; - - } - - namespace prototype { - function clear(type: any): void; - - function current(): any; - - function describe(content: any, type: any): void; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function meta(...args: any[]): any; - - function parameters(): any; - - function parent(): any; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - function update(options: any, type: any): void; - - function use(type: any, options: any): void; - } -} - -export namespace RequestBody { - namespace prototype { - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function isEmpty(): any; - - function meta(...args: any[]): any; - - function parent(): any; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toString(): any; - - function update(options: any): void; - } -} - -export namespace Response { - namespace createFromNode { - const prototype: { - }; - - } - - namespace isResponse { - const prototype: { - }; - - } - - namespace mimeInfo { - const prototype: { - }; - - } - - namespace prototype { - function dataURI(): any; - - function describe(content: any, type: any): void; - - function details(): any; - - function encoding(): any; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function json(reviver: any, strict: any): any; - - function meta(...args: any[]): any; - - function mime(contentType: any, contentDisposition: any): any; - - function parent(): any; - - function reason(): any; - - function setParent(parent: any): void; - - function size(): any; - - function text(): any; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - function update(options: any): void; - } -} - -export namespace Script { - namespace isScript { - const prototype: { - }; - - } - - namespace prototype { - function describe(content: any, type: any): void; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function meta(...args: any[]): any; - - function parent(): any; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - function toSource(): any; - - function update(options: any): void; - } -} - -export namespace Url { - namespace isUrl { - const prototype: { - }; - - } - - namespace parse { - const prototype: { - }; - - } - - namespace prototype { - function addQueryParams(params: any): void; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function getHost(): any; - - function getOAuth1BaseUrl(): any; - - function getPath(options: any): any; - - function getPathWithQuery(): any; - - function getQueryString(options: any): any; - - function getRaw(): any; - - function getRemote(options: any): any; - - function meta(...args: any[]): any; - - function parent(): any; - - function removeQueryParams(params: any): any; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toString(forceProtocol: any): any; - - function update(url: any): any; - } -} - -export namespace UrlMatchPattern { - namespace prototype { - function createMatchPattern(): any; - - function describe(content: any, type: any): void; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function getProtocols(): any; - - function globPatternToRegexp(pattern: any): any; - - function matchAbsoluteHostPattern(matchRegexObject: any, remote: any): any; - - function matchAnyHost(matchRegexObject: any): any; - - function matchSuffixHostPattern(matchRegexObject: any, remote: any): any; - - function meta(...args: any[]): any; - - function parent(): any; - - function setParent(parent: any): void; - - function test(urlStr: any): any; - - function testHost(host: any): any; - - function testPath(path: any): any; - - function testProtocol(protocol: any): any; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - function toString(): any; - - function update(options: any): void; - } -} - -export namespace UrlMatchPatternList { - namespace prototype { - function add(item: any, ...args: any[]): void; - - function all(): any; - - function append(item: any): any; - - function assimilate(source: any, prune: any): void; - - function clear(): void; - - function count(): any; - - function each(iterator: any, context: any): void; - - function eachParent(iterator: any, context: any): void; - - function filter(rule: any, context: any): any; - - function find(rule: any, context: any): any; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function get(key: any): any; - - function has(item: any, value: any, ...args: any[]): any; - - function idx(index: any): any; - - function indexOf(item: any): any; - - function insert(item: any, before: any): void; - - function insertAfter(item: any, after: any): any; - - function map(iterator: any, context: any): any; - - function meta(...args: any[]): any; - - function one(id: any): any; - - function parent(): any; - - function populate(items: any): void; - - function prepend(item: any): any; - - function remove(predicate: any, context: any, ...args: any[]): any; - - function repopulate(items: any): void; - - function setParent(parent: any): void; - - function test(urlStr: any): any; - - function toJSON(): any; - - function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; - - function toString(): any; - - function upsert(item: any): any; - } -} - -export namespace Variable { - namespace isVariable { - const prototype: { - }; - - } - - namespace prototype { - function cast(value: any): any; - - function castIn(value: any): any; - - function castOut(value: any): any; - - function describe(content: any, type: any): void; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function get(): any; - - function meta(...args: any[]): any; - - function parent(): any; - - function set(value: any): void; - - function setParent(parent: any): void; - - function toJSON(): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - function toString(): any; - - function update(options: any): void; - - function valueOf(value: any, ...args: any[]): any; - - function valueType(typeName: any, _noCast: any): any; - - } - - namespace types { - class number { - constructor(p0: any); - - // Native method; no parameter or return type inference available - toExponential(p0: any): any; - - // Native method; no parameter or return type inference available - toFixed(p0: any): any; - - // Native method; no parameter or return type inference available - toLocaleString(): any; - - // Native method; no parameter or return type inference available - toPrecision(p0: any): any; - - // Native method; no parameter or return type inference available - toString(p0: any): any; - - // Native method; no parameter or return type inference available - valueOf(): any; - - static EPSILON: number; - - static MAX_SAFE_INTEGER: number; - - static MAX_VALUE: number; - - static MIN_SAFE_INTEGER: number; - - static MIN_VALUE: number; - - static NEGATIVE_INFINITY: number; - - static NaN: number; - - static POSITIVE_INFINITY: number; - - static isFinite(p0: any): any; - - static isInteger(p0: any): any; - - static isNaN(p0: any): any; - - static isSafeInteger(p0: any): any; - - static parseFloat(p0: any): any; - - static parseInt(p0: any, p1: any): any; - - } - - class string { - constructor(p0: any); - - // Native method; no parameter or return type inference available - anchor(p0: any): any; - - // Native method; no parameter or return type inference available - big(): any; - - // Native method; no parameter or return type inference available - blink(): any; - - // Native method; no parameter or return type inference available - bold(): any; - - // Native method; no parameter or return type inference available - charAt(p0: any): any; - - // Native method; no parameter or return type inference available - charCodeAt(p0: any): any; - - // Native method; no parameter or return type inference available - codePointAt(p0: any): any; - - // Native method; no parameter or return type inference available - concat(p0: any): any; - - // Native method; no parameter or return type inference available - endsWith(p0: any): any; - - // Native method; no parameter or return type inference available - fixed(): any; - - // Native method; no parameter or return type inference available - fontcolor(p0: any): any; - - // Native method; no parameter or return type inference available - fontsize(p0: any): any; - - // Native method; no parameter or return type inference available - includes(p0: any): any; - - // Native method; no parameter or return type inference available - indexOf(p0: any): any; - - // Native method; no parameter or return type inference available - italics(): any; - - // Native method; no parameter or return type inference available - lastIndexOf(p0: any): any; - - // Native method; no parameter or return type inference available - link(p0: any): any; - - // Native method; no parameter or return type inference available - localeCompare(p0: any): any; - - // Native method; no parameter or return type inference available - match(p0: any): any; - - // Native method; no parameter or return type inference available - normalize(): any; - - // Native method; no parameter or return type inference available - padEnd(p0: any): any; - - // Native method; no parameter or return type inference available - padStart(p0: any): any; - - // Native method; no parameter or return type inference available - repeat(p0: any): any; - - // Native method; no parameter or return type inference available - replace(p0: any, p1: any): any; - - // Native method; no parameter or return type inference available - search(p0: any): any; - - // Native method; no parameter or return type inference available - slice(p0: any, p1: any): any; - - // Native method; no parameter or return type inference available - small(): any; - - // Native method; no parameter or return type inference available - split(p0: any, p1: any): any; - - // Native method; no parameter or return type inference available - startsWith(p0: any): any; - - // Native method; no parameter or return type inference available - strike(): any; - - // Native method; no parameter or return type inference available - sub(): any; - - // Native method; no parameter or return type inference available - substr(p0: any, p1: any): any; - - // Native method; no parameter or return type inference available - substring(p0: any, p1: any): any; - - // Native method; no parameter or return type inference available - sup(): any; - - // Native method; no parameter or return type inference available - toLocaleLowerCase(): any; - - // Native method; no parameter or return type inference available - toLocaleUpperCase(): any; - - // Native method; no parameter or return type inference available - toLowerCase(): any; - - // Native method; no parameter or return type inference available - toString(): any; - - // Native method; no parameter or return type inference available - toUpperCase(): any; - - // Native method; no parameter or return type inference available - trim(): any; - - // Native method; no parameter or return type inference available - trimLeft(): any; - - // Native method; no parameter or return type inference available - trimRight(): any; - - // Native method; no parameter or return type inference available - valueOf(): any; - - static fromCharCode(p0: any): any; - - static fromCodePoint(p0: any): any; - - static raw(p0: any): any; - - } - - namespace any { - function out(val: any): any; - - namespace out { - // Too-deep object hierarchy from postman_collection.Variable.types.any.out - const prototype: any; - - } - - } - - namespace json { - function out(val: any): any; - - namespace out { - // Too-deep object hierarchy from postman_collection.Variable.types.json.out - const prototype: any; - - } - - } - } + static unparseSingle(obj: any, encode: boolean): string; } -export namespace VariableList { - namespace isVariableList { - const prototype: { - }; +export interface RequestDefinition extends PropertyDefinition { + url: string | Url; + method: string; + header?: HeaderDefinition; + body?: RequestBody; + auth: RequestAuthDefinition; + proxy: ProxyConfigDefinition; + certificate?: CertificateDefinition; +} - } +export class Request extends Property implements RequestDefinition { + auth: RequestAuth; + body?: RequestBody; + certificate?: Certificate; + headers: HeaderList; + method: string; + proxy: ProxyConfig; + url: Url; - namespace prototype { - function add(item: any, ...args: any[]): void; + constructor(options: RequestDefinition); - function all(): any; + addHeader(header: Header | HeaderDefinition): void; - function append(item: any): any; + addQueryParams(params: string | QueryParam[]): void; - function assimilate(source: any, prune: any): void; + authorize(): Request; - function clear(): void; + authorizeUsing(type: string | RequestAuthDefinition, options?: VariableList): void; - function count(): any; + clone(): Request; - function each(iterator: any, context: any): void; + forEachHeader(callback: any): void; - function eachParent(iterator: any, context: any): void; + getHeaders(options?: {ignoreCase?: boolean, enabled?: boolean}): any; - function filter(rule: any, context: any): any; + removeHeader(toRemove: string | Header, options: {ignoreCase: boolean}): any; - function find(rule: any, context: any): any; + removeQueryParams(params: string | string[]): void; - function findInParents(property: any, customizer: any): any; + toJSON(): any; - function findParentContaining(property: any, customizer: any): any; + update(options: RequestDefinition): void; - function forEachParent(options: any, iterator: any): void; + upsertHeader(header: any): void; - function get(key: any): any; - - function has(item: any, value: any, ...args: any[]): any; - - function idx(index: any): any; - - function indexOf(item: any): any; - - function insert(item: any, before: any): void; - - function insertAfter(item: any, after: any): any; - - function map(iterator: any, context: any): any; - - function meta(...args: any[]): any; - - function one(id: any): any; - - function parent(): any; - - function populate(items: any): void; - - function prepend(item: any): any; - - function remove(predicate: any, context: any, ...args: any[]): any; - - function replace(str: any, overrides: any): any; - - function repopulate(items: any): void; - - function setParent(parent: any): void; - - function substitute(obj: any, overrides: any, mutate: any): any; - - function syncFromObject(obj: any, track: any, prune: any): any; - - function syncToObject(obj: any): any; - - function toJSON(): any; - - function toObject(excludeDisabled: any, caseSensitive: any, multiValue: any, sanitizeKeys: any): any; - - function toString(): any; - - function upsert(item: any): any; - } + static isRequest(obj: any): boolean; } -export namespace VariableScope { - namespace isVariableScope { - const prototype: { - }; - - } - - namespace prototype { - function addLayer(list: any): void; - - function clear(): void; - - function describe(content: any, type: any): void; - - function findInParents(property: any, customizer: any): any; - - function findParentContaining(property: any, customizer: any): any; - - function forEachParent(options: any, iterator: any): void; - - function get(key: any): any; - - function has(variableName: any): any; - - function meta(...args: any[]): any; - - function parent(): any; - - function set(key: any, value: any, type: any): any; - - function setParent(parent: any): void; - - function syncVariablesFrom(obj: any, track: any): any; - - function syncVariablesTo(obj: any): any; - - function toJSON(): any; - - function toObject(excludeDisabled: any, caseSensitive: any): any; - - function toObjectResolved(scope: any, overrides: any, options: any): any; - - function unset(key: any): void; - - function variables(): any; - } +export interface RequestAuthDefinition extends PropertyDefinition { + type?: string; } -export namespace Version { - namespace prototype { - function findInParents(property: any, customizer: any): any; +export class RequestAuth extends Property implements RequestAuthDefinition { + type: string; - function findParentContaining(property: any, customizer: any): any; + constructor(options: RequestAuthDefinition, parent?: Property | PropertyList); - function forEachParent(options: any, iterator: any): void; + clear(type: string): void; - function meta(...args: any[]): any; + current(): any | undefined; - function parent(): any; + parameters(): VariableList; - function set(value: any): void; + update(options: VariableList | any[] | any, type?: string): void; - function setParent(parent: any): void; + use(type: string, options: VariableList): void; - function toJSON(): any; + static isValidType(type: any): boolean; - function toString(): any; - } } + +export class RequestBody extends PropertyBase { + static MODES: { + raw: string; + formadata: string; + urlencoded: string; + file: string; + }; + + file: string; + formdata: PropertyList; + mode: string; + raw: string; + urlencoded: PropertyList; + + constructor(options: any); + + isEmpty(): boolean; + + toString(): string; + + update(options: any): void; +} + +export interface ResponseDefinition extends PropertyDefinition { + code: number; + reason?: string; + header?: HeaderDefinition[]; + cookie?: CookieDefinition[]; + body?: string; + stream?: Buffer | Uint8Array; + responseTime: number; +} + +export class Response extends Property implements ResponseDefinition { + body: string; + code: number; + cookies: CookieList; + headers: HeaderList; + originalRequest: Request; + responseTime: number; + status: string; + reason?: string; + + constructor(options: ResponseDefinition); + + dataURI(): string; + + details(): any; + + encoding(): any; + + json(reviver?: any, strict?: boolean): any; + + mime(contentType: any, contentDisposition: any): any; //TODO ?? + + size(): number; + + text(): string | undefined; + + toJSON(): any; + + update(options: any): void; + + static createFromNode(response: any, cookies: any): any; + + static isResponse(obj: any): boolean; + + static mimeInfo(type: any, disposition: any): any; // TODO ?? + +} + +export class Script extends Property { + exec: string[]; + src: Url; + type: string; + + constructor(options: any); + + toSource(): string; + + update(options?: {type?: string, src?: string, exec?: string | string[]}): void; + + static isScript(obj: any): boolean; +} + +export class Url extends PropertyBase { + auth: string; + hash: string; + host: string[]; + path: string[]; + port: string; + protocol: string; + query: PropertyList; + variables: VariableList; + + constructor(options: any | string); + + addQueryParams(params: any | string): void; + + getHost(): string; + + getOAuth1BaseUrl(): any; + + getPath(options?: {unresolved: boolean}): string; + + getPathWithQuery(): any | string; + + getQueryString(options?: {encode: boolean | null, ignoredDisabled: boolean | null} | null): string; + + getRaw(): string; + + getRemote(options: {forcePort: boolean}): string; + + removeQueryParams(params: QueryParam[] | string[] | string): void; + + toString(forceProtocol?: boolean): string; + + update(url: string | any): void; + + static isUrl(obj: any): boolean; + + static parse(url: string): any; + +} + +/* No documentation for this right now? +export class UrlMatchPattern { + constructor(options: any, ...args: any[]); + + createMatchPattern(): any; + + getProtocols(): any; + + globPatternToRegexp(pattern: any): any; + + matchAbsoluteHostPattern(matchRegexObject: any, remote: any): any; + + matchAnyHost(matchRegexObject: any): any; + + matchSuffixHostPattern(matchRegexObject: any, remote: any): any; + + test(urlStr: any): any; + + testHost(host: any): any; + + testPath(path: any): any; + + testProtocol(protocol: any): any; + + toJSON(): any; + + toString(): any; + + update(options: any): void; + + static MATCH_ALL_URLS: string; + + static PROTOCOL_DELIMITER: string; + +} + +export class UrlMatchPatternList extends PropertyList { + constructor(parent: any, list: any); + + test(urlStr: any): any; + +}*/ + +export interface VariableDefinition extends PropertyDefinition { + value?: any; + type?: VariableTypes; +} + +export enum VariableTypes { + string = 'string', + boolean = 'boolean', + number = 'number', + json = 'json', + any = 'any' +} + +export class Variable extends Property implements VariableDefinition { + key: string; + type: VariableTypes; + value: any; + + constructor(definition?: VariableDefinition); + + cast(value: any): any; + + castIn(value: any): any; + + castOut(value: any): any; + + get(): any; + + set(value: any): void; + + toString(): string; + + update(options: VariableDefinition): void; + + valueOf(value?: any): any; + + valueType(typeName: string, _noCast: boolean): string; + + static isVariable(obj: any): boolean; + +} + +export class VariableList extends PropertyList { + constructor(parent: Property, populate: any); + + replace(str: string, overrides?: any): string; + + substitute(obj: any | any[], overrides?: any[] | null, mutate?: boolean): any; + + syncFromObject(obj: any, track?: boolean, prune?: boolean): any; + + syncToObject(obj?: any): any; + + static isVariableList(obj: any): boolean; + +} + +export interface VariableScopeDefinition extends PropertyDefinition { + id?: string; + name?: string; + values?: VariableDefinition[] +} + +export class VariableScope extends Property implements VariableScopeDefinition { + values?: VariableDefinition[]; + + constructor(definition: VariableScopeDefinition, layers?: VariableList[]); + + addLayer(list: any): void; + + clear(): void; + + get(key: string): any; + + has(variableName: string): boolean; + + set(key: string, value: any, type: VariableTypes): void; + + syncVariablesFrom(obj: any, track: any): any; + + syncVariablesTo(obj: any): any; + + toJSON(): any; + + toObject(excludeDisabled: boolean, caseSensitive: boolean): any; + + unset(key: string): void; + + variables(): any; + + static isVariableScope(obj: any): boolean; +} + +export class Version extends PropertyBase { + build: string; + major: string; + minor: string; + patch: string; + prerelease: string; + raw: string; + string: string; + + constructor(options: any | string); + + set(value: any | string): void; + + toString(): string; +} From 30a2c6bb27c92c5ced9261e7519fd76e820d9012 Mon Sep 17 00:00:00 2001 From: Denis Augsburger Date: Fri, 23 Feb 2018 10:43:32 +0100 Subject: [PATCH 012/177] Expand jss typings to represent SheetsRegistry --- types/jss/index.d.ts | 15 ++++++++++- types/jss/jss-tests.ts | 58 +++++++++++++++++++++++++++++++++--------- 2 files changed, 60 insertions(+), 13 deletions(-) diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index d0136216ed..dfd705710f 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -5,6 +5,10 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 +export interface toCSSOptions { + indent?: number; +} + export interface Rule { className: string; selector: string; @@ -62,7 +66,7 @@ export interface StyleSheet { /** * Convert rules to a CSS string. */ - toString(options?: { indent?: number }): string; + toString(options?: toCSSOptions): string; } export type GenerateClassName = (rule: Rule, sheet?: StyleSheet) => string; export interface Style { @@ -96,6 +100,15 @@ export interface RuleOptions { index: number; className: string; } +export declare class SheetsRegistry { + constructor(); + registry: ReadonlyArray>; + index(): number; + add(sheet: StyleSheet): void; + reset(): void; + remove(sheet: StyleSheet): void; + toString(options?: toCSSOptions): string; +} declare class JSS { constructor(options?: Partial); createStyleSheet( diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 0cf3f51350..948dca39a2 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -2,7 +2,8 @@ import { create as createJSS, - default as sharedInstance + SheetsRegistry, + default as sharedInstance, } from 'jss'; const jss = createJSS().setup({}); @@ -21,28 +22,30 @@ const styleSheet = jss.createStyleSheet( { link: true, } -).attach(); +); -styleSheet.classes.container; // $ExpectType string -styleSheet.classes.ruleWithMockObservable; // $ExpectType string +const attachedStyleSheet = styleSheet.attach(); -const rule = styleSheet.addRule('dynamicRule', { color: 'indigo' }); +attachedStyleSheet.classes.container; // $ExpectType string +attachedStyleSheet.classes.ruleWithMockObservable; // $ExpectType string + +const rule = attachedStyleSheet.addRule('dynamicRule', { color: 'indigo' }); rule.prop('border-radius', 5).prop('color'); // $ExpectType string -styleSheet.classes.dynamicRule; // $ExpectType string +attachedStyleSheet.classes.dynamicRule; // $ExpectType string -styleSheet.deleteRule('dynamicRule'); +attachedStyleSheet.deleteRule('dynamicRule'); // test that `addRule` supports the shorthand signature -const dynamicRule = styleSheet.addRule({ color: 'red' }); +const dynamicRule = attachedStyleSheet.addRule({ color: 'red' }); const div = document.createElement('div'); dynamicRule.applyTo(div); -const containerRule = styleSheet.getRule('container'); +const containerRule = attachedStyleSheet.getRule('container'); const containerJSON = containerRule.toJSON(); -const css = styleSheet.toString(); +const css = attachedStyleSheet.toString(); -styleSheet.addRules({ +attachedStyleSheet.addRules({ rule1: { fontFamily: 'Roboto', color: '#FFFFFF', @@ -53,10 +56,41 @@ styleSheet.addRules({ }, }); -styleSheet.detach(); +attachedStyleSheet.detach(); sharedInstance.createStyleSheet({ container: { background: '#000099', } }); + +/* SheetsRegistry test */ +const sheetsRegistry = new SheetsRegistry(); +sheetsRegistry.add(styleSheet); + +const secondStyleSheet = jss.createStyleSheet( + { + ruleWithMockObservable: { + subscribe() {} + }, + container2: { + display: 'flex', + width: 150, + opacity: .8, + }, + }, + { + link: true, + } +); + +sheetsRegistry.add(secondStyleSheet); +sheetsRegistry.registry.length; // $ExpectType number +sheetsRegistry.remove(secondStyleSheet); + +sheetsRegistry.index(); // $ExpectType number +sheetsRegistry.toString(); // $ExpectType string +// With css options +sheetsRegistry.toString({indent: 5}); // $ExpectType string + +sheetsRegistry.reset(); From f3e5f751b71b523783671302a3f838a26f7f143f Mon Sep 17 00:00:00 2001 From: Denis Augsburger Date: Tue, 27 Feb 2018 09:58:21 +0100 Subject: [PATCH 013/177] Rename interface --- types/jss/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index dfd705710f..e106a70c74 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -5,7 +5,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 -export interface toCSSOptions { +export interface ToCssOptions { indent?: number; } @@ -66,7 +66,7 @@ export interface StyleSheet { /** * Convert rules to a CSS string. */ - toString(options?: toCSSOptions): string; + toString(options?: ToCssOptions): string; } export type GenerateClassName = (rule: Rule, sheet?: StyleSheet) => string; export interface Style { @@ -107,7 +107,7 @@ export declare class SheetsRegistry { add(sheet: StyleSheet): void; reset(): void; remove(sheet: StyleSheet): void; - toString(options?: toCSSOptions): string; + toString(options?: ToCssOptions): string; } declare class JSS { constructor(options?: Partial); From 6b53e1fbde3df53a8c2b2feae2188e25e7e970ee Mon Sep 17 00:00:00 2001 From: Denis Augsburger Date: Tue, 27 Feb 2018 10:10:56 +0100 Subject: [PATCH 014/177] Index as a function which returns a number --- types/jss/jss-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 948dca39a2..80f4c1e94f 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -89,6 +89,7 @@ sheetsRegistry.registry.length; // $ExpectType number sheetsRegistry.remove(secondStyleSheet); sheetsRegistry.index(); // $ExpectType number +sheetsRegistry.index; // $ExpectType () => number sheetsRegistry.toString(); // $ExpectType string // With css options sheetsRegistry.toString({indent: 5}); // $ExpectType string From d70bcc668aff1d50607e94bdc73672728b7afab8 Mon Sep 17 00:00:00 2001 From: Denis Augsburger Date: Tue, 27 Feb 2018 10:48:05 +0100 Subject: [PATCH 015/177] Change to represent get index --- types/jss/index.d.ts | 2 +- types/jss/jss-tests.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/jss/index.d.ts b/types/jss/index.d.ts index e106a70c74..0f77605b2c 100644 --- a/types/jss/index.d.ts +++ b/types/jss/index.d.ts @@ -103,7 +103,7 @@ export interface RuleOptions { export declare class SheetsRegistry { constructor(); registry: ReadonlyArray>; - index(): number; + readonly index: number; add(sheet: StyleSheet): void; reset(): void; remove(sheet: StyleSheet): void; diff --git a/types/jss/jss-tests.ts b/types/jss/jss-tests.ts index 80f4c1e94f..a5c6f34126 100644 --- a/types/jss/jss-tests.ts +++ b/types/jss/jss-tests.ts @@ -88,8 +88,8 @@ sheetsRegistry.add(secondStyleSheet); sheetsRegistry.registry.length; // $ExpectType number sheetsRegistry.remove(secondStyleSheet); -sheetsRegistry.index(); // $ExpectType number -sheetsRegistry.index; // $ExpectType () => number +sheetsRegistry.index; // $ExpectType number +sheetsRegistry.index = 5; // $ExpectError sheetsRegistry.toString(); // $ExpectType string // With css options sheetsRegistry.toString({indent: 5}); // $ExpectType string From 1426182dcd3721e627298302f2862030626b806a Mon Sep 17 00:00:00 2001 From: Alex Regan Date: Tue, 27 Feb 2018 08:19:14 -0700 Subject: [PATCH 016/177] fix(bull): union callback param, not return val --- types/bull/index.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 77317c44ff..289c05d149 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -269,7 +269,7 @@ declare namespace Bull { * Errors will be passed as a second argument to the "failed" event; * results, as a second argument to the "completed" event. */ - process(callback: (job: Job, done: DoneCallback) => void | string): void; + process(callback: ((job: Job, done: DoneCallback) => void) | string): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -316,7 +316,7 @@ declare namespace Bull { * * @param concurrency Bull will then call you handler in parallel respecting this max number. */ - process(concurrency: number, callback: (job: Job, done: DoneCallback) => void | string): void; + process(concurrency: number, callback: ((job: Job, done: DoneCallback) => void) | string): void; /** * Defines a named processing function for the jobs placed into a given Queue. @@ -353,7 +353,7 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches */ // tslint:disable-next-line:unified-signatures - process(name: string, callback: (job: Job, done: DoneCallback) => void | string): void; + process(name: string, callback: ((job: Job, done: DoneCallback) => void) | string): void; /** * Defines a named processing function for the jobs placed into a given Queue. @@ -390,7 +390,7 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches * @param concurrency Bull will then call you handler in parallel respecting this max number. */ - process(name: string, concurrency: number, callback: (job: Job, done: DoneCallback) => void | string): void; + process(name: string, concurrency: number, callback: ((job: Job, done: DoneCallback) => void) | string): void; /** * Creates a new job and adds it to the queue. From c8e95cf22664e2894120a8b47a3e37d4f6e53455 Mon Sep 17 00:00:00 2001 From: Alex Regan Date: Tue, 27 Feb 2018 19:32:33 -0700 Subject: [PATCH 017/177] fix(bull): switch overload to Promise return --- types/bull/index.d.ts | 116 +++++++++++++++++++++--------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/types/bull/index.d.ts b/types/bull/index.d.ts index 289c05d149..608460b63b 100644 --- a/types/bull/index.d.ts +++ b/types/bull/index.d.ts @@ -257,45 +257,13 @@ declare namespace Bull { * * The callback is called everytime a job is placed in the queue. * It is passed an instance of the job as first argument. - * The callback can also be defined as the string path to a module - * exporting the callback function. Using a path has several advantages: - * - The process is sandboxed so if it crashes it does not affect the worker. - * - You can run blocking code without affecting the queue (jobs will not stall). - * - Much better utilization of multi-core CPUs. - * - Less connections to redis. * * The done callback can be called with an Error instance, to signal that the job did not complete successfully, * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. * Errors will be passed as a second argument to the "failed" event; * results, as a second argument to the "completed" event. */ - process(callback: ((job: Job, done: DoneCallback) => void) | string): void; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * A promise must be returned to signal job completion. - * If the promise is rejected, the error will be passed as a second argument to the "failed" event. - * If it is resolved, its value will be the "completed" event's second argument. - */ - process(callback: (job: Job) => void): Promise; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. - * - * A promise must be returned to signal job completion. - * If the promise is rejected, the error will be passed as a second argument to the "failed" event. - * If it is resolved, its value will be the "completed" event's second argument. - * - * @param concurrency Bull will then call you handler in parallel respecting this max number. - */ - process(concurrency: number, callback: (job: Job) => void): Promise; + process(callback: (job: Job, done: DoneCallback) => void): void; /** * Defines a processing function for the jobs placed into a given Queue. @@ -309,6 +277,38 @@ declare namespace Bull { * - Much better utilization of multi-core CPUs. * - Less connections to redis. * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + */ + process(callback: ((job: Job) => void) | string): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * The callback can also be defined as the string path to a module + * exporting the callback function. Using a path has several advantages: + * - The process is sandboxed so if it crashes it does not affect the worker. + * - You can run blocking code without affecting the queue (jobs will not stall). + * - Much better utilization of multi-core CPUs. + * - Less connections to redis. + * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + * + * @param concurrency Bull will then call you handler in parallel respecting this max number. + */ + process(concurrency: number, callback: ((job: Job) => void) | string): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * * The done callback can be called with an Error instance, to signal that the job did not complete successfully, * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. * Errors will be passed as a second argument to the "failed" event; @@ -316,13 +316,19 @@ declare namespace Bull { * * @param concurrency Bull will then call you handler in parallel respecting this max number. */ - process(concurrency: number, callback: ((job: Job, done: DoneCallback) => void) | string): void; + process(concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; /** * Defines a named processing function for the jobs placed into a given Queue. * * The callback is called everytime a job is placed in the queue. * It is passed an instance of the job as first argument. + * The callback can also be defined as the string path to a module + * exporting the callback function. Using a path has several advantages: + * - The process is sandboxed so if it crashes it does not affect the worker. + * - You can run blocking code without affecting the queue (jobs will not stall). + * - Much better utilization of multi-core CPUs. + * - Less connections to redis. * * A promise must be returned to signal job completion. * If the promise is rejected, the error will be passed as a second argument to the "failed" event. @@ -331,19 +337,13 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches */ // tslint:disable-next-line:unified-signatures - process(name: string, callback: (job: Job) => void): Promise; + process(name: string, callback: ((job: Job) => void) | string): Promise; /** * Defines a processing function for the jobs placed into a given Queue. * * The callback is called everytime a job is placed in the queue. * It is passed an instance of the job as first argument. - * The callback can also be defined as the string path to a module - * exporting the callback function. Using a path has several advantages: - * - The process is sandboxed so if it crashes it does not affect the worker. - * - You can run blocking code without affecting the queue (jobs will not stall). - * - Much better utilization of multi-core CPUs. - * - Less connections to redis. * * The done callback can be called with an Error instance, to signal that the job did not complete successfully, * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. @@ -353,28 +353,13 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches */ // tslint:disable-next-line:unified-signatures - process(name: string, callback: ((job: Job, done: DoneCallback) => void) | string): void; + process(name: string, callback: (job: Job, done: DoneCallback) => void): void; /** * Defines a named processing function for the jobs placed into a given Queue. * * The callback is called everytime a job is placed in the queue. * It is passed an instance of the job as first argument. - * - * A promise must be returned to signal job completion. - * If the promise is rejected, the error will be passed as a second argument to the "failed" event. - * If it is resolved, its value will be the "completed" event's second argument. - * - * @param name Bull will only call the handler if the job name matches - * @param concurrency Bull will then call you handler in parallel respecting this max number. - */ - process(name: string, concurrency: number, callback: (job: Job) => void): Promise; - - /** - * Defines a processing function for the jobs placed into a given Queue. - * - * The callback is called everytime a job is placed in the queue. - * It is passed an instance of the job as first argument. * The callback can also be defined as the string path to a module * exporting the callback function. Using a path has several advantages: * - The process is sandboxed so if it crashes it does not affect the worker. @@ -382,6 +367,21 @@ declare namespace Bull { * - Much better utilization of multi-core CPUs. * - Less connections to redis. * + * A promise must be returned to signal job completion. + * If the promise is rejected, the error will be passed as a second argument to the "failed" event. + * If it is resolved, its value will be the "completed" event's second argument. + * + * @param name Bull will only call the handler if the job name matches + * @param concurrency Bull will then call you handler in parallel respecting this max number. + */ + process(name: string, concurrency: number, callback: ((job: Job) => void) | string): Promise; + + /** + * Defines a processing function for the jobs placed into a given Queue. + * + * The callback is called everytime a job is placed in the queue. + * It is passed an instance of the job as first argument. + * * The done callback can be called with an Error instance, to signal that the job did not complete successfully, * or with a result as second argument as second argument (e.g.: done(null, result);) when the job is successful. * Errors will be passed as a second argument to the "failed" event; @@ -390,7 +390,7 @@ declare namespace Bull { * @param name Bull will only call the handler if the job name matches * @param concurrency Bull will then call you handler in parallel respecting this max number. */ - process(name: string, concurrency: number, callback: ((job: Job, done: DoneCallback) => void) | string): void; + process(name: string, concurrency: number, callback: (job: Job, done: DoneCallback) => void): void; /** * Creates a new job and adds it to the queue. From 5ad783bf51bfe9dabc59fb508858032f9defc509 Mon Sep 17 00:00:00 2001 From: Kyle Buzby Date: Tue, 27 Feb 2018 22:14:05 -0600 Subject: [PATCH 018/177] add strictFunctionTypes for dtslint --- types/postman-collection/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/types/postman-collection/tsconfig.json b/types/postman-collection/tsconfig.json index 3f176970e4..9b0b244020 100644 --- a/types/postman-collection/tsconfig.json +++ b/types/postman-collection/tsconfig.json @@ -7,6 +7,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": [ "../" From a07b4e7d1d9b361ef739c3402deb86a7a870e60b Mon Sep 17 00:00:00 2001 From: Kyle Buzby Date: Tue, 27 Feb 2018 22:14:24 -0600 Subject: [PATCH 019/177] fix tslint errors --- types/postman-collection/index.d.ts | 113 +++++++++++----------------- 1 file changed, 45 insertions(+), 68 deletions(-) diff --git a/types/postman-collection/index.d.ts b/types/postman-collection/index.d.ts index 5365b9cfaf..8ed90d8827 100644 --- a/types/postman-collection/index.d.ts +++ b/types/postman-collection/index.d.ts @@ -2,21 +2,21 @@ // Project: https://github.com/postmanlabs/postman-collection // Definitions by: Kyle Buzby // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// - +/// + export class PropertyBase { constructor(definition: any); - findInParents(property: string, customizer?: any): any | undefined; // TODO Update customizer function def + findInParents(property: string, customizer?: any): any ; // TODO Update customizer function def findParentContaining(property: any, customizer: any): any; // TODO Update customizer function def - forEachParent(iterator: any): void; // TODO Update iterator function def - forEachParent(options: any | boolean, iterator: any): void; // TODO Update iterator function def + forEachParent(iterator: (item: any) => void): void; + forEachParent(options: any /* TODO | boolean*/, iterator: (item: any) => void): void; meta(): any; - parent(): any | undefined; + parent(): any; setParent(parent: any): void; @@ -27,7 +27,6 @@ export class PropertyBase { static propertyUnprefixMeta(value: any, key: any): any; static toJSON(obj: any): any; - } export interface PropertyDefinition { @@ -48,10 +47,9 @@ export class Property extends PropertyBase implements PropertyDefinition { toObjectResolved(scope: any, overrides: any, options: any): any; - static replaceSubstitutions(str: string, variables: VariableList | any | (VariableList | any)[]): string; - - static replaceSubstitutionsIn(obj: any, variables: (VariableList | any)[], mutate: boolean): any; + static replaceSubstitutions(str: string, variables: VariableList | VariableList[]): string; + static replaceSubstitutionsIn(obj: any, variables: VariableList[], mutate: boolean): any; } export interface CertificateDefinition extends PropertyDefinition { @@ -62,13 +60,13 @@ export interface CertificateDefinition extends PropertyDefinition { passphrase?: string; } -export class Certificate extends Property { +export class Certificate extends Property implements CertificateDefinition { cert: any; id: string; key: any; - matches: any; // TODO update to UrlMatchPatternList? + matches: any[]; name: string; - passphrase: any; + passphrase: string; constructor(options: any); @@ -79,14 +77,12 @@ export class Certificate extends Property { update(options: CertificateDefinition): void; static isCertificate(obj: any): boolean; - } - export class PropertyList { constructor(type: any, parent: any, populate: any); - add(item: any | TElement): void; + add(item: TElement): void; all(): any; @@ -106,13 +102,13 @@ export class PropertyList { find(rule: any, context?: any): Item | ItemGroup; - get(key: string | any): TElement; + get(key: /*TODO string |*/ any): TElement; has(item: string | TElement, value?: any): boolean; idx(index: number): TElement; - indexOf(item: string | any): number; + indexOf(item: /*TODO string |*/ any): number; insert(item: TElement, before: TElement | string): void; @@ -122,24 +118,23 @@ export class PropertyList { one(id: string): TElement; - populate(items: any | any[]): void; + populate(items: any): void; prepend(item: TElement): any; - remove(predicate: any | string | TElement, context: any): any; + remove(predicate: any /*TODO | string | TElement*/, context: any): any; - repopulate(items: any | any[]): void; + repopulate(items: any): void; toJSON(): any; - toObject(excludeDisabled?: any | null, caseSensitive?: any | null, multiValue?: any | null, sanitizeKeys?: any): any; + toObject(excludeDisabled?: any, caseSensitive?: any, multiValue?: any, sanitizeKeys?: any): any; toString(): string; upsert(item: TElement): boolean | null; static isPropertyList(obj: any): any; - } export class CertificateList extends PropertyList { @@ -148,15 +143,14 @@ export class CertificateList extends PropertyList { resolveOne(url: string): CertificateDefinition; static isCertificateList(obj: any): boolean; - } export interface ItemGroupDefinition extends PropertyDefinition { - item?: (ItemDefinition | ItemGroupDefinition)[]; + item?: Array; auth?: RequestAuthDefinition; event?: EventDefinition[]; } - + export class ItemGroup extends Property { auth: RequestAuth; items: PropertyList; @@ -172,7 +166,6 @@ export class ItemGroup extends Property { oneDeep(idOrName: string): TItem; static isItemGroup(obj: any): boolean; - } export interface CollectionDefinition extends ItemGroupDefinition { @@ -181,7 +174,7 @@ export interface CollectionDefinition extends ItemGroupDefinition { name?: string; version?: string; }; - item?: (ItemDefinition | ItemGroupDefinition)[]; + item?: Array; variable?: VariableDefinition; auth?: RequestAuthDefinition; event?: EventDefinition[]; @@ -202,7 +195,6 @@ export class Collection extends ItemGroup implements CollectionDefiniti toJSON(): any; static isCollection(obj: any): boolean; - } export interface CookieDefinition { @@ -216,14 +208,13 @@ export interface CookieDefinition { httpOnly?: boolean; hostOnly?: boolean; session?: boolean; - extensions?: {key: string; value: string}[]; - + extensions?: Array<{key: string; value: string}>; } export class Cookie extends PropertyBase implements CookieDefinition { domain: string; expires: Date | string; - extensions: {key: string; value: string}[]; + extensions: Array<{key: string; value: string}>; hostOnly: any; httpOnly: any; maxAge: number; @@ -244,7 +235,6 @@ export class Cookie extends PropertyBase implements CookieDefinition { static parse(str: string): any; static splitParam(param: any): any; - } export class CookieList extends PropertyList { @@ -272,7 +262,6 @@ export class Description implements DescriptionDefinition { update(content: string | DescriptionDefinition, type?: string): void; static isDescription(obj: any): boolean; - } export interface EventDefinition extends PropertyDefinition { @@ -286,7 +275,7 @@ export class Event extends Property implements EventDefinition { constructor(definition: EventDefinition); - update(definition: EventDefinition): void; + update(definition: EventDefinition): void; } export class EventList extends PropertyList { @@ -297,7 +286,6 @@ export class EventList extends PropertyList { listenersOwn(name: string): Event[]; static isEventList(obj: any): boolean; - } export interface FormParamDefinition extends PropertyDefinition { @@ -305,7 +293,7 @@ export interface FormParamDefinition extends PropertyDefinition { value: string; } -export class FormParam extends Property implements FormParamDefinition{ +export class FormParam extends Property implements FormParamDefinition { key: string; value: string; @@ -316,7 +304,7 @@ export class FormParam extends Property implements FormParamDefinition{ toString(): string; - valueOf(): any | string; + valueOf(): any; // static parse(): void; // TODO not implemented yet } @@ -348,7 +336,7 @@ export class Header extends Property implements HeaderDefinition { static unparse(headers: HeaderList | any[], separator?: string): string; - static unparseSingle(header: Header): string; + static unparseSingle(header: Header): string; } export class HeaderList extends PropertyList
{ @@ -356,7 +344,7 @@ export class HeaderList extends PropertyList
{ contentSize(): number; - static isHeaderList(obj: any): boolean; + static isHeaderList(obj: any): boolean; } export interface ItemDefinition extends PropertyDefinition { @@ -379,7 +367,6 @@ export class Item extends Property implements ItemDefinition { getEvents(name: string): Event[]; static isItem(obj: any): boolean; - } export interface ProxyConfigDefinition extends PropertyDefinition { @@ -409,7 +396,6 @@ export class ProxyConfig extends Property implements ProxyConfigDefinition { updateProtocols(protocols: string[]): void; static isProxyConfig(obj: any): boolean; - } export class ProxyConfigList extends PropertyList { @@ -418,7 +404,6 @@ export class ProxyConfigList extends PropertyList { resolve(url?: Url): ProxyConfigDefinition; static isProxyConfigList(obj: any): boolean; - } export interface QueryParamDefinition extends PropertyDefinition { @@ -445,10 +430,9 @@ export class QueryParam extends Property implements QueryParamDefinition { static parseSingle(param: string, idx: number, all: string[]): any; - static unparse(params: any | any[], options?: {encode?: boolean | null, ignoreDisabled?: boolean | null}): string; + static unparse(params: any, options?: {encode?: boolean | null, ignoreDisabled?: boolean | null}): string; static unparseSingle(obj: any, encode: boolean): string; - } export interface RequestDefinition extends PropertyDefinition { @@ -497,7 +481,6 @@ export class Request extends Property implements RequestDefinition { upsertHeader(header: any): void; static isRequest(obj: any): boolean; - } export interface RequestAuthDefinition extends PropertyDefinition { @@ -511,19 +494,17 @@ export class RequestAuth extends Property implements RequestAuthDefinition { clear(type: string): void; - current(): any | undefined; + current(): any; parameters(): VariableList; - update(options: VariableList | any[] | any, type?: string): void; + update(options: /*TODO VariableList | any[] |*/ any, type?: string): void; use(type: string, options: VariableList): void; static isValidType(type: any): boolean; - } - export class RequestBody extends PropertyBase { static MODES: { raw: string; @@ -544,7 +525,7 @@ export class RequestBody extends PropertyBase { toString(): string; - update(options: any): void; + update(options: any): void; } export interface ResponseDefinition extends PropertyDefinition { @@ -577,7 +558,7 @@ export class Response extends Property implements ResponseDefinition { json(reviver?: any, strict?: boolean): any; - mime(contentType: any, contentDisposition: any): any; //TODO ?? + mime(contentType: any, contentDisposition: any): any; // TODO ?? size(): number; @@ -592,7 +573,6 @@ export class Response extends Property implements ResponseDefinition { static isResponse(obj: any): boolean; static mimeInfo(type: any, disposition: any): any; // TODO ?? - } export class Script extends Property { @@ -606,7 +586,7 @@ export class Script extends Property { update(options?: {type?: string, src?: string, exec?: string | string[]}): void; - static isScript(obj: any): boolean; + static isScript(obj: any): boolean; } export class Url extends PropertyBase { @@ -619,9 +599,9 @@ export class Url extends PropertyBase { query: PropertyList; variables: VariableList; - constructor(options: any | string); + constructor(options: any /*TODO| string*/); - addQueryParams(params: any | string): void; + addQueryParams(params: any /*TODO | string*/): void; getHost(): string; @@ -629,7 +609,7 @@ export class Url extends PropertyBase { getPath(options?: {unresolved: boolean}): string; - getPathWithQuery(): any | string; + getPathWithQuery(): any /*TODO | string*/; getQueryString(options?: {encode: boolean | null, ignoredDisabled: boolean | null} | null): string; @@ -641,12 +621,11 @@ export class Url extends PropertyBase { toString(forceProtocol?: boolean): string; - update(url: string | any): void; + update(url: /*TODO string |*/ any): void; static isUrl(obj: any): boolean; static parse(url: string): any; - } /* No documentation for this right now? @@ -731,7 +710,6 @@ export class Variable extends Property implements VariableDefinition { valueType(typeName: string, _noCast: boolean): string; static isVariable(obj: any): boolean; - } export class VariableList extends PropertyList { @@ -739,20 +717,19 @@ export class VariableList extends PropertyList { replace(str: string, overrides?: any): string; - substitute(obj: any | any[], overrides?: any[] | null, mutate?: boolean): any; + substitute(obj: any, overrides?: any[] | null, mutate?: boolean): any; syncFromObject(obj: any, track?: boolean, prune?: boolean): any; syncToObject(obj?: any): any; static isVariableList(obj: any): boolean; - } export interface VariableScopeDefinition extends PropertyDefinition { id?: string; name?: string; - values?: VariableDefinition[] + values?: VariableDefinition[]; } export class VariableScope extends Property implements VariableScopeDefinition { @@ -782,7 +759,7 @@ export class VariableScope extends Property implements VariableScopeDefinition { variables(): any; - static isVariableScope(obj: any): boolean; + static isVariableScope(obj: any): boolean; } export class Version extends PropertyBase { @@ -794,9 +771,9 @@ export class Version extends PropertyBase { raw: string; string: string; - constructor(options: any | string); + constructor(options: any /*TODO | string*/); - set(value: any | string): void; + set(value: any /*TODO | string*/): void; - toString(): string; -} + toString(): string; +} From d7629ffffac1ff973c581d2c166a229a6bc2af8b Mon Sep 17 00:00:00 2001 From: Kyle Buzby Date: Tue, 27 Feb 2018 22:26:21 -0600 Subject: [PATCH 020/177] add some function types --- types/postman-collection/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/postman-collection/index.d.ts b/types/postman-collection/index.d.ts index 8ed90d8827..e0025d9bda 100644 --- a/types/postman-collection/index.d.ts +++ b/types/postman-collection/index.d.ts @@ -7,9 +7,9 @@ export class PropertyBase { constructor(definition: any); - findInParents(property: string, customizer?: any): any ; // TODO Update customizer function def + findInParents(property: string, customizer?: (item: any) => boolean): PropertyBase ; - findParentContaining(property: any, customizer: any): any; // TODO Update customizer function def + findParentContaining(property: any, customizer: (item: any) => boolean): PropertyBase; forEachParent(iterator: (item: any) => void): void; forEachParent(options: any /* TODO | boolean*/, iterator: (item: any) => void): void; From 63ca62a96bbc16ac3bd46b6dc6f46506a20483d7 Mon Sep 17 00:00:00 2001 From: Kyle Buzby Date: Tue, 27 Feb 2018 22:26:30 -0600 Subject: [PATCH 021/177] add start of tests --- .../postman-collection-tests.ts | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/types/postman-collection/postman-collection-tests.ts b/types/postman-collection/postman-collection-tests.ts index fd65e5e3d9..9f98e7d689 100644 --- a/types/postman-collection/postman-collection-tests.ts +++ b/types/postman-collection/postman-collection-tests.ts @@ -1,7 +1,26 @@ import * as pmCollection from 'postman-collection'; -/* Example https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/base64-js/base64-js-tests.ts -base64js.byteLength(""); // $ExpectType number -base64js.toByteArray(""); // $ExpectType Uint8Array -base64js.fromByteArray(new Uint8Array(0)); // $ExpectType string -*/ +const certificate = new pmCollection.Certificate({}); +certificate.cert; // $ExpectType any +certificate.id; // $ExpectType string +certificate.key; // $ExpectType any +certificate.matches; // $ExpectType any[] +certificate.name; // $ExpectType string +certificate.passphrase; // $ExpectType string +certificate.auth; // $ExpectType RequestAuth +certificate.disabled; // $ExpectType boolean + +certificate.canApplyTo("string"); // $ExpectType any +certificate.canApplyTo(new pmCollection.Url({})); // $ExpectType any + +certificate.toJSON(); // $ExpectType CertificateDefinition +certificate.update({}); // $ExpectType void + +certificate as pmCollection.Property; // $ExpectType Property + +pmCollection.Certificate.isCertificate(certificate); // $ExpectType boolean + +let collection: pmCollection.Collection; +collection = new pmCollection.Collection(); +collection = new pmCollection.Collection({}); +collection = new pmCollection.Collection({}, []); From fa04697ee1fc62a8cbfe1c5f3998fe903812b399 Mon Sep 17 00:00:00 2001 From: ArmandoAssuncao Date: Fri, 2 Mar 2018 23:07:22 -0300 Subject: [PATCH 022/177] [react-navigation]: added types in navigate params --- types/react-navigation/index.d.ts | 5 +++-- types/react-navigation/react-navigation-tests.tsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index c4e396783f..b6897b11c8 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -14,6 +14,7 @@ // Veit Lehmann: // Roberto Huertas: // Steven Miller +// Armando Assuncao // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -396,13 +397,13 @@ export interface NavigationEventSubscription { remove: () => void; } -export interface NavigationScreenProp { +export interface NavigationScreenProp { state: S; dispatch: NavigationDispatch; goBack: (routeKey?: (string | null)) => boolean; navigate: ( routeName: string, - params?: NavigationParams, + params?: P, action?: NavigationAction ) => boolean; setParams: (newParams: NavigationParams) => boolean; diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 017a9b9153..54489ba722 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -250,7 +250,7 @@ function renderBasicDrawerNavigator(): JSX.Element { } interface CustomTransitionerProps { - navigation: NavigationScreenProp; + navigation: NavigationScreenProp; } /** * @desc Custom transitioner component. Follows react-navigation/src/views/CardStackTransitioner.js. From 8a4095b718955698a17d473eb95fc4aa31244042 Mon Sep 17 00:00:00 2001 From: Anthony Rosequist Date: Mon, 5 Mar 2018 13:00:50 -0600 Subject: [PATCH 023/177] Add Node.value to yallist types --- types/yallist/index.d.ts | 1 + types/yallist/yallist-tests.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/yallist/index.d.ts b/types/yallist/index.d.ts index 8a89697d82..11e2462a74 100644 --- a/types/yallist/index.d.ts +++ b/types/yallist/index.d.ts @@ -58,6 +58,7 @@ declare namespace Yallist { interface Node { prev: Node | null; next: Node | null; + value: T; list?: Yallist; } } diff --git a/types/yallist/yallist-tests.ts b/types/yallist/yallist-tests.ts index 69099c0da9..ffdef9ad79 100644 --- a/types/yallist/yallist-tests.ts +++ b/types/yallist/yallist-tests.ts @@ -115,3 +115,4 @@ new Yallist.Node('foo', node, node, myList); node.list; // $ExpectType Yallist | undefined node.next; // $ExpectType Node | null node.prev; // $ExpectType Node | null +node.value; // $ExpectType string From 1277b7b0b5b0b57d2c83c25d600c317f5d8ec7ee Mon Sep 17 00:00:00 2001 From: denis Date: Mon, 5 Mar 2018 21:34:42 +0100 Subject: [PATCH 024/177] Add collapse, tab and scrollspy definitions Add more definitions and use popper.js definition for offset and behavor --- types/bootstrap/bootstrap-tests.ts | 97 +++++++++++++++++++++++++++--- types/bootstrap/index.d.ts | 78 +++++++++++++++++++----- types/bootstrap/package.json | 6 ++ 3 files changed, 159 insertions(+), 22 deletions(-) create mode 100644 types/bootstrap/package.json diff --git a/types/bootstrap/bootstrap-tests.ts b/types/bootstrap/bootstrap-tests.ts index 17d6e088cf..9ab7654373 100755 --- a/types/bootstrap/bootstrap-tests.ts +++ b/types/bootstrap/bootstrap-tests.ts @@ -2,8 +2,10 @@ // Alert // -------------------------------------------------------------------------------------- +// $ExpectType JQuery $("#alert").alert(); +// $ExpectType JQuery $("#alert").alert("close"); $("#alert").on("close.bs.alert", () => {}); @@ -12,20 +14,32 @@ $("#alert").on("close.bs.alert", () => {}); // Button // -------------------------------------------------------------------------------------- -// $("#button").button(); // must fail +// $ExpectError +$("#button").button(); +// $ExpectType JQuery $("#button").button("toggle"); // -------------------------------------------------------------------------------------- // Carousel // -------------------------------------------------------------------------------------- +// $ExpectType JQuery $("#carousel").carousel(); +// $ExpectType JQuery $("#carousel").carousel("pause"); $("#carousel").carousel(100); +$("#carousel").on("slide.bs.carousel", function(ev) { + const that: HTMLElement = this; + const from: number = ev.from; + const to: number = ev.to; + const direction: string = ev.direction; + const data: undefined = ev.data; +}); + $("#carousel").carousel({ interval: 5000, keyboard: true, @@ -37,20 +51,43 @@ $("#carousel").carousel({ pause: false, }); -$("#carousel").on("slide.bs.carousel", function(ev) { - const that: HTMLElement = this; - const from: number = ev.from; - const to: number = ev.to; - const direction: string = ev.direction; - const data: undefined = ev.data; +// -------------------------------------------------------------------------------------- +// Collapse +// -------------------------------------------------------------------------------------- + +// $ExpectType JQuery +$("#collapse").collapse(); + +// $ExpectType JQuery +$("#collapse").collapse("toggle"); + +$("#collapse").on("show.bs.collapse", () => {}); + +$("#collapse").collapse({ + parent: "#parent", + toggle: true, +}); + +$("#collapse").collapse({ + parent: document.body, +}); + +$("#collapse").collapse({ + parent: $("#parent"), +}); + +$("#collapse").collapse({ + toggle: false, }); // -------------------------------------------------------------------------------------- // Dropdown // -------------------------------------------------------------------------------------- +// $ExpectType JQuery $("#dropdown").dropdown(); +// $ExpectType JQuery $("#dropdown").dropdown("update"); $("#dropdown").on("hide.bs.dropdown", () => {}); @@ -81,8 +118,10 @@ $("#dropdown").dropdown({ // Modal // -------------------------------------------------------------------------------------- +// $ExpectType JQuery $("#modal").modal(); +// $ExpectType JQuery $("#modal").modal("show"); $("#modal").on("hide.bs.modal", () => {}); @@ -98,12 +137,56 @@ $("#modal").modal({ backdrop: "static", }); +// -------------------------------------------------------------------------------------- +// Popover +// -------------------------------------------------------------------------------------- + +// $ExpectType JQuery +$("#scrollspy").popover(); + +// $ExpectType JQuery +$("#scrollspy").popover("toggle"); + +$("#scrollspy").on("activate.bs.scrollspy", () => {}); + +// TODO: test popover with options + +// -------------------------------------------------------------------------------------- +// Scrollspy +// -------------------------------------------------------------------------------------- + +// $ExpectType JQuery +$("#scrollspy").scrollspy(); + +// $ExpectType JQuery +$("#scrollspy").scrollspy("refresh"); + +$("#scrollspy").on("activate.bs.scrollspy", () => {}); + +$("#scrollspy").scrollspy({ + offset: 100, +}); + +// -------------------------------------------------------------------------------------- +// Tab +// -------------------------------------------------------------------------------------- + +// $ExpectType JQuery +$("#someListItem").tab("show"); + +$("a[data-toggle=\"list\"]").on("shown.bs.tab", (e) => { + e.target; // newly activated tab + e.relatedTarget; // previous active tab +}); + // -------------------------------------------------------------------------------------- // Tooltip // -------------------------------------------------------------------------------------- +// $ExpectType JQuery $("#tooltip").tooltip(); +// $ExpectType JQuery $("#tooltip").tooltip("show"); $("#tooltip").on("hide.bs.tooltip", () => {}); diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index c158bbd807..5e7fea80f7 100755 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -4,16 +4,16 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// TODO: collapse, tab (list-group, navs), popovers, scrollspy +// TODO: popovers options /// +/// // -------------------------------------------------------------------------- // Some Types and Interfaces // -------------------------------------------------------------------------- type BootstrapPlacement = "auto" | "top" | "bottom" | "left" | "right"; -type PopperBehavior = "flip" | "clockwise" | "counterclockwise"; interface BootstrapDelay { show: number; @@ -26,16 +26,9 @@ interface BootstrapTooltipInstance { tip: HTMLElement; } -interface BootstrapOffsetExtend { - top?: number; - left?: number; - width?: number; - height?: number; -} - interface BootstrapOffsetsExtend { - popper?: BootstrapOffsetExtend; - reference?: BootstrapOffsetExtend; + popper?: Partial; + reference?: Partial; } // -------------------------------------------------------------------------------------- @@ -75,6 +68,24 @@ interface BootstrapCarouselOption { wrap?: boolean; } +interface BootstrapCollapseOption { + /** + * If parent is provided, then all collapsible elements under the specified parent will be closed when + * this collapsible item is shown. (similar to traditional accordion behavior - this is dependent on the card class). + * The attribute has to be set on the target collapsible area. + * + * @default "" + */ + parent?: string | JQuery | Element; + + /** + * Toggles the collapsible element on invocation. + * + * @default true + */ + toggle?: boolean; +} + interface BootstrapDropdownOption { /** * Offset of the dropdown relative to its target. @@ -99,7 +110,7 @@ interface BootstrapDropdownOption { * * @default "scrollParent" */ - boundary?: "viewport" | "window" | "scrollParent" | HTMLElement; + boundary?: Popper.Boundary | HTMLElement; } interface BootstrapModalOption { @@ -133,6 +144,26 @@ interface BootstrapModalOption { show?: boolean; } +interface BootstrapPoppoverOption { + /** + * Apply a CSS fade transition to the popover. + * + * @default true + */ + animation: boolean; + + // TODO +} + +interface BootstrapScrollspyOption { + /** + * Pixels to offset from top when calculating position of scroll. + * + * @default 10 + */ + offset?: number; +} + interface BootstrapTooltipOption { /** * Apply a CSS fade transition to the tooltip. @@ -232,7 +263,7 @@ interface BootstrapTooltipOption { * * @default "flip" */ - fallbackPlacement?: PopperBehavior | PopperBehavior[]; + fallbackPlacement?: Popper.Behavior | ReadonlyArray; /** * Overflow constraint boundary of the tooltip. @@ -242,7 +273,7 @@ interface BootstrapTooltipOption { * * @default "scrollParent" */ - boundary?: "viewport" | "window" | "scrollParent" | HTMLElement; + boundary?: Popper.Boundary | HTMLElement; } // -------------------------------------------------------------------------------------- @@ -268,8 +299,12 @@ interface BootstrapCarouselEventHandler extends JQuery.Event extends Iterable carousel(action: "cycle" | "pause" | number | "prev" | "next" | "dispose"): this; carousel(options?: BootstrapCarouselOption): this; + collapse(action: "toggle" | "show" | "hide" | "dispose"): this; + collapse(options?: BootstrapCollapseOption): this; + dropdown(action: "toggle" | "update" | "dispose"): this; dropdown(options?: BootstrapDropdownOption): this; modal(action: "toggle" | "show" | "hide" | "handleUpdate" | "dispose"): this; modal(options?: BootstrapModalOption): this; + popover(action: "show" | "hide" | "toggle" | "dispose" | "enable" | "disable" | "toggleEnabled" | "update"): this; + popover(options?: BootstrapPoppoverOption): this; + + scrollspy(action: "refresh" | "dispose"): this; + scrollspy(options?: BootstrapScrollspyOption): this; + + tab(action: "show" | "dispose"): this; + tooltip(action: "show" | "hide" | "toggle" | "dispose" | "enable" | "disable" | "toggleEnabled" | "update"): this; tooltip(options?: BootstrapTooltipOption): this; on(events: BootstrapCarouselEvent, handler: JQuery.EventHandlerBase>): this; - on(events: BootstrapAlertEvent | BootstrapDropdownEvent | BootstrapModalEvent | BootstrapTooltipEvent, + on(events: + BootstrapAlertEvent | BootstrapCollapseEvent | BootstrapDropdownEvent | BootstrapModalEvent | + BootstrapPopoverEvent | BootstrapScrollspyEvent | BootstrapTapEvent | BootstrapTooltipEvent, handler: JQuery.EventHandler): this; } diff --git a/types/bootstrap/package.json b/types/bootstrap/package.json new file mode 100644 index 0000000000..7f11c30706 --- /dev/null +++ b/types/bootstrap/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "popper.js": "^1.12.9" + } +} \ No newline at end of file From a72347d6542716442681e302ba8d47b0e886ccd3 Mon Sep 17 00:00:00 2001 From: denis Date: Mon, 5 Mar 2018 22:55:57 +0100 Subject: [PATCH 025/177] Use Bootstrap namespace Use a Bootstrap namespace instead of prefixing names. --- types/bootstrap/bootstrap-tests.ts | 2 +- types/bootstrap/index.d.ts | 102 +++++++++++++++-------------- 2 files changed, 54 insertions(+), 50 deletions(-) diff --git a/types/bootstrap/bootstrap-tests.ts b/types/bootstrap/bootstrap-tests.ts index 9ab7654373..f8934ebbfc 100755 --- a/types/bootstrap/bootstrap-tests.ts +++ b/types/bootstrap/bootstrap-tests.ts @@ -103,7 +103,7 @@ $("#dropdown").dropdown({ }); $("#dropdown").dropdown({ - offset(offsets: BootstrapOffsetsExtend) { + offset(offsets: Bootstrap.OffsetsExtend) { if (!this.flip) return { popper: { left: 100 } }; return {}; diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index 5e7fea80f7..01089126fb 100755 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -6,27 +6,29 @@ // TODO: popovers options -/// /// +/// + +export as namespace Bootstrap; // -------------------------------------------------------------------------- // Some Types and Interfaces // -------------------------------------------------------------------------- -type BootstrapPlacement = "auto" | "top" | "bottom" | "left" | "right"; +export type Placement = "auto" | "top" | "bottom" | "left" | "right"; -interface BootstrapDelay { +export interface Delay { show: number; hide: number; } -interface BootstrapTooltipInstance { - config: BootstrapTooltipOption; +export interface TooltipInstance { + config: TooltipOption; element: Element; tip: HTMLElement; } -interface BootstrapOffsetsExtend { +export interface OffsetsExtend { popper?: Partial; reference?: Partial; } @@ -35,7 +37,7 @@ interface BootstrapOffsetsExtend { // Options Interfaces // -------------------------------------------------------------------------------------- -interface BootstrapCarouselOption { +export interface CarouselOption { /** * The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle. * @@ -68,7 +70,7 @@ interface BootstrapCarouselOption { wrap?: boolean; } -interface BootstrapCollapseOption { +export interface CollapseOption { /** * If parent is provided, then all collapsible elements under the specified parent will be closed when * this collapsible item is shown. (similar to traditional accordion behavior - this is dependent on the card class). @@ -86,14 +88,14 @@ interface BootstrapCollapseOption { toggle?: boolean; } -interface BootstrapDropdownOption { +export interface DropdownOption { /** * Offset of the dropdown relative to its target. * For more information refer to Popper.js's offset docs. * * @default 0 */ - offset?: number | string | ((this: BootstrapDropdownOption, offset: BootstrapOffsetsExtend) => BootstrapOffsetsExtend); + offset?: number | string | ((this: DropdownOption, offset: OffsetsExtend) => OffsetsExtend); /** * Allow Dropdown to flip in case of an overlapping on the reference element. @@ -113,7 +115,7 @@ interface BootstrapDropdownOption { boundary?: Popper.Boundary | HTMLElement; } -interface BootstrapModalOption { +export interface ModalOption { /** * Includes a modal-backdrop element. * Alternatively, specify static for a backdrop which doesn't close the modal on click. @@ -144,7 +146,7 @@ interface BootstrapModalOption { show?: boolean; } -interface BootstrapPoppoverOption { +export interface PoppoverOption { /** * Apply a CSS fade transition to the popover. * @@ -155,7 +157,7 @@ interface BootstrapPoppoverOption { // TODO } -interface BootstrapScrollspyOption { +export interface ScrollspyOption { /** * Pixels to offset from top when calculating position of scroll. * @@ -164,7 +166,7 @@ interface BootstrapScrollspyOption { offset?: number; } -interface BootstrapTooltipOption { +export interface TooltipOption { /** * Apply a CSS fade transition to the tooltip. * @@ -189,7 +191,7 @@ interface BootstrapTooltipOption { * * @default 0 */ - delay?: number | BootstrapDelay; + delay?: number | Delay; /** * Allow HTML in the tooltip. @@ -210,7 +212,7 @@ interface BootstrapTooltipOption { * * @default "top" */ - placement?: BootstrapPlacement | ((this: BootstrapTooltipInstance, tooltip: HTMLElement, trigger: Element) => BootstrapPlacement); + placement?: Placement | ((this: TooltipInstance, tooltip: HTMLElement, trigger: Element) => Placement); /** * If a selector is provided, tooltip objects will be delegated to the specified targets. @@ -280,7 +282,7 @@ interface BootstrapTooltipOption { // Events // -------------------------------------------------------------------------------------- -interface BootstrapCarouselEventHandler extends JQuery.Event { +export interface CarouselEventHandler extends JQuery.Event { /** * The direction in which the carousel is sliding. */ @@ -297,51 +299,53 @@ interface BootstrapCarouselEventHandler extends JQuery.Event extends Iterable { - alert(action?: "close" | "dispose"): this; +declare global { + interface JQuery extends Iterable { + alert(action?: "close" | "dispose"): this; - button(action: "toggle" | "dispose"): this; + button(action: "toggle" | "dispose"): this; - carousel(action: "cycle" | "pause" | number | "prev" | "next" | "dispose"): this; - carousel(options?: BootstrapCarouselOption): this; + carousel(action: "cycle" | "pause" | number | "prev" | "next" | "dispose"): this; + carousel(options?: CarouselOption): this; - collapse(action: "toggle" | "show" | "hide" | "dispose"): this; - collapse(options?: BootstrapCollapseOption): this; + collapse(action: "toggle" | "show" | "hide" | "dispose"): this; + collapse(options?: CollapseOption): this; - dropdown(action: "toggle" | "update" | "dispose"): this; - dropdown(options?: BootstrapDropdownOption): this; + dropdown(action: "toggle" | "update" | "dispose"): this; + dropdown(options?: DropdownOption): this; - modal(action: "toggle" | "show" | "hide" | "handleUpdate" | "dispose"): this; - modal(options?: BootstrapModalOption): this; + modal(action: "toggle" | "show" | "hide" | "handleUpdate" | "dispose"): this; + modal(options?: ModalOption): this; - popover(action: "show" | "hide" | "toggle" | "dispose" | "enable" | "disable" | "toggleEnabled" | "update"): this; - popover(options?: BootstrapPoppoverOption): this; + popover(action: "show" | "hide" | "toggle" | "dispose" | "enable" | "disable" | "toggleEnabled" | "update"): this; + popover(options?: PoppoverOption): this; - scrollspy(action: "refresh" | "dispose"): this; - scrollspy(options?: BootstrapScrollspyOption): this; + scrollspy(action: "refresh" | "dispose"): this; + scrollspy(options?: ScrollspyOption): this; - tab(action: "show" | "dispose"): this; + tab(action: "show" | "dispose"): this; - tooltip(action: "show" | "hide" | "toggle" | "dispose" | "enable" | "disable" | "toggleEnabled" | "update"): this; - tooltip(options?: BootstrapTooltipOption): this; + tooltip(action: "show" | "hide" | "toggle" | "dispose" | "enable" | "disable" | "toggleEnabled" | "update"): this; + tooltip(options?: TooltipOption): this; - on(events: BootstrapCarouselEvent, handler: JQuery.EventHandlerBase>): this; - on(events: - BootstrapAlertEvent | BootstrapCollapseEvent | BootstrapDropdownEvent | BootstrapModalEvent | - BootstrapPopoverEvent | BootstrapScrollspyEvent | BootstrapTapEvent | BootstrapTooltipEvent, - handler: JQuery.EventHandler): this; + on(events: CarouselEvent, handler: JQuery.EventHandlerBase>): this; + on(events: + AlertEvent | CollapseEvent | DropdownEvent | ModalEvent | + PopoverEvent | ScrollspyEvent | TapEvent | TooltipEvent, + handler: JQuery.EventHandler): this; + } } From 8d7f6a54bcdd1c4835a3e3019cc88e1c1e73bcfa Mon Sep 17 00:00:00 2001 From: Jason Dreyzehner Date: Mon, 5 Mar 2018 23:12:18 -0500 Subject: [PATCH 026/177] inquirer: array params are not required to be mutable --- types/inquirer/index.d.ts | 22 ++++++++++++++++------ types/inquirer/inquirer-tests.ts | 21 +++++++++++++++++++++ 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index 32c54fa99e..22157ecce0 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -3,7 +3,9 @@ // Definitions by: Qubo // Parvez // Jouderian +// Jason Dreyzehner // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /// @@ -12,7 +14,10 @@ import through = require('through'); declare namespace inquirer { type Prompts = { [name: string]: PromptModule }; type ChoiceType = string | objects.ChoiceOption | objects.Separator; - type Questions = Question | Question[] | Rx.Observable; + type Questions = + | Question + | ReadonlyArray + | Rx.Observable; interface Inquirer { restoreDefaultPrompts(): void; @@ -39,7 +44,7 @@ declare namespace inquirer { ui: { BottomBar: ui.BottomBar; Prompt: ui.Prompt; - } + }; } interface PromptModule { @@ -91,7 +96,9 @@ declare namespace inquirer { * Array values can be simple strings, or objects containing a name (to display) and a value properties * (to save in the answers hash). Values can also be a Separator. */ - choices?: ChoiceType[] | ((answers: Answers) => ChoiceType[]); + choices?: + | ReadonlyArray + | ((answers: Answers) => ReadonlyArray); /** * Receive the user input and should return true if the value is valid, and an error message (String) * otherwise. If false is returned, a default error message is provided. @@ -247,9 +254,12 @@ declare namespace inquirer { * @param choices All `choice` to keep in the collection */ interface Choices { - new (choices: (string | Separator | ChoiceOption)[], answers?: Answers): Choices; - choices: Choice[]; - realChoices: Choice[]; + new ( + choices: ReadonlyArray, + answers?: Answers + ): Choices; + choices: ReadonlyArray; + realChoices: ReadonlyArray; length: number; realLength: number; /** diff --git a/types/inquirer/inquirer-tests.ts b/types/inquirer/inquirer-tests.ts index 4a43dcc98e..1afce2e378 100644 --- a/types/inquirer/inquirer-tests.ts +++ b/types/inquirer/inquirer-tests.ts @@ -525,3 +525,24 @@ function likesFood ( aFood: string ) { inquirer.prompt(questions, function (answers) { console.log( JSON.stringify(answers, null, " ") ); }); + +// immutable usage +const immutableChoices: ReadonlyArray = [ + 'Order a pizza', + 'Make a reservation', + 'Ask opening hours', + 'Talk to the receptionist' +]; +inquirer.prompt( + [ + { + type: 'rawlist', + name: 'theme', + message: 'What do you want to do?', + choices: immutableChoices + } + ], + function(answers: inquirer.Answers) { + console.log(JSON.stringify(answers, null, ' ')); + } +); From 3c476312ab09e22932eb95f95dc132612bf865c3 Mon Sep 17 00:00:00 2001 From: dekster Date: Tue, 6 Mar 2018 16:46:32 +0300 Subject: [PATCH 027/177] Duplcate line --- types/react-truncate/index.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/types/react-truncate/index.d.ts b/types/react-truncate/index.d.ts index 3c21c15150..15c72616c0 100644 --- a/types/react-truncate/index.d.ts +++ b/types/react-truncate/index.d.ts @@ -11,7 +11,6 @@ export interface TruncateProps extends React.HTMLProps { ellipsis?: React.ReactNode; trimWhitespace?: boolean; onTruncate?(isTruncated: boolean): void; - trimWhitespace?: boolean; } declare class Truncate extends React.Component { } From 8ae9759111e8343b38156660ccb1aeb75b58c439 Mon Sep 17 00:00:00 2001 From: Lance Ivy Date: Tue, 6 Mar 2018 12:56:45 -0800 Subject: [PATCH 028/177] update pusher-js to 4.2.2 --- types/pusher-js/index.d.ts | 87 +++++++++++--------- types/pusher-js/pusher-js-tests.ts | 122 ++++++++++++++++++----------- 2 files changed, 125 insertions(+), 84 deletions(-) diff --git a/types/pusher-js/index.d.ts b/types/pusher-js/index.d.ts index 383277f121..9ea0b96268 100644 --- a/types/pusher-js/index.d.ts +++ b/types/pusher-js/index.d.ts @@ -1,24 +1,23 @@ -// Type definitions for pusher-js 3.0.0 +// Type definitions for pusher-js 4.2.2 // Project: https://github.com/pusher/pusher-js // Definitions by: Qubo +// Lance Ivy // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - - declare namespace pusher { interface PusherStatic { new (apiKey: string, config?: Config): Pusher; } - interface Pusher { + interface Pusher extends EventsDispatcher { + channel(name: string): Channel; + allChannels(): Channel[]; + connect(): void; + disconnect(): void; subscribe(name: string): Channel; subscribeAll(): void; unsubscribe(name: string): void; - channel(name: string): Channel; - allChannels(): Channel[]; - bind(eventName: string, callback: Function): Pusher; - bind_all(callback: Function): Pusher; - disconnect(): void; + isEncrypted(): boolean; key: string; config: Config; //TODO: add GlobalConfig typings channels: any; //TODO: Type this @@ -43,7 +42,7 @@ declare namespace pusher { * Defines how the authentication endpoint, defined using authEndpoint, will be called. * There are two options available: ajax and jsonp. */ - authTransport?: string; + authTransport?: 'ajax' | 'jsonp'; /** * Allows passing additional data to authorizers. Supports query string params and headers (AJAX only). @@ -51,15 +50,19 @@ declare namespace pusher { */ auth?: AuthConfig; + /** + * If you need custom authorization behavior you can provide your own authorizer function as follows: + */ + authorizer?: Authorizer; /** * Allows connecting to a different datacenter by setting up correct hostnames and ports for the connection. */ cluster?: string; - /** - * Disables stats collection, so that connection metrics are not submitted to Pusher’s servers. + * Disables stats collection, so that connection metrics are not submitted to Pusher’s servers. These stats + * are used for internal monitoring only and they do not affect the account stats. */ disableStats?: boolean; @@ -69,8 +72,7 @@ declare namespace pusher { * Available transports: ws, wss, xhr_streaming, xhr_polling, sockjs. * Additional transports may be added in the future and without adding them to this list, they will be disabled. */ - enabledTransports?: string[]; - + enabledTransports?: Transport[]; /** * Specified which transports must not be used by Pusher to establish a connection. @@ -78,7 +80,7 @@ declare namespace pusher { * Available transports: ws, wss, xhr_streaming, xhr_polling, sockjs. * Additional transports may be added in the future and without adding them to this list, they will be enabled. */ - disabledTransports?: string[]; + disabledTransports?: Transport[]; /** * Ignores null origin checks for HTTP fallbacks. Use with care, it should be disabled only if necessary (i.e. PhoneGap). @@ -99,6 +101,7 @@ declare namespace pusher { pongTimeout?: number; wsHost?: string; + wsPath?: string; wsPort?: number; wssPort?: number; httpHost?: string; @@ -106,20 +109,34 @@ declare namespace pusher { httpsPort?: number; } + type Transport = 'ws' | 'wss' | 'xhr_streaming' | 'xhr_polling' | 'sockjs'; + interface AuthConfig { params?: { [key: string]: any }; headers?: { [key: string]: any }; } - interface GenericEventsDispatcher extends EventsDispatcher { - bind(eventName: string, callback: Function, context?: any): Self; - bind_all(callback: Function): Self; - unbind(eventName?: string, callback?: Function, context?: any): Self; - unbind_all(eventName?: string, callback?: Function): Self; - emit(eventName: string, data?: any): Self; + interface AuthInfo { + auth: string; + channel_data?: string; } - interface Channel extends GenericEventsDispatcher { + type Authorizer = (channel: Channel, options: Config) => { + authorize: (socketId: string, callback: (errored: boolean, authInfo?: AuthInfo) => void) => void + } + + type EventCallback = (context: any, data: any) => void; + + interface EventsDispatcher { + bind(eventName: string, callback: EventCallback, context?: any): this; + bind_global(callback: EventCallback): this; + unbind(eventName?: string | null, callback?: EventCallback | null, context?: any): this; + unbind_global(callback?: EventCallback): this; + unbind_all(): this; + emit(eventName: string, data?: any): this; + } + + interface Channel extends EventsDispatcher { /** Triggers an event */ trigger(eventName: string, data?: any): boolean; pusher: Pusher; @@ -133,15 +150,7 @@ declare namespace pusher { authorize(socketId: string, callback: (data: any) => void): void; } - interface EventsDispatcher { - bind(eventName: string, callback: Function, context?: any): EventsDispatcher; - bind_all(callback: Function): EventsDispatcher; - unbind(eventName?: string, callback?: Function, context?: any): EventsDispatcher; - unbind_all(eventName?: string, callback?: Function): EventsDispatcher; - emit(eventName: string, data?: any): EventsDispatcher; - } - - interface ConnectionManager extends GenericEventsDispatcher { + interface ConnectionManager extends EventsDispatcher { key: string; options: any; //TODO: Timeline.js state: string; @@ -204,24 +213,24 @@ declare namespace pusher { * * Resulting object containts two fields - id and info. * - * @param {Number} id + * @param {String} id * @return {Object} member's info or null */ - get(id: number): T; + get(id: string): null | T; /** * Calls back for each member in unspecified order. * * @param {Function} callback */ - each(callback: (member: any) => void): void; - members: { [id: number]: UserInfo }; + each(callback: (member: Member) => void): void; + members: { [id: string]: Member }; count: number; - myID: number; - me: UserInfo; + myID: string; + me: Member; } - interface UserInfo { - id: number; + interface Member { + id: string; info: T; } } diff --git a/types/pusher-js/pusher-js-tests.ts b/types/pusher-js/pusher-js-tests.ts index b393d6cb75..1eec5ef200 100644 --- a/types/pusher-js/pusher-js-tests.ts +++ b/types/pusher-js/pusher-js-tests.ts @@ -2,39 +2,50 @@ import Pusher = require('pusher-js'); import { PresenceChannel } from "pusher-js"; -var API_KEY: string; +var APP_KEY: string; var pusher: Pusher.Pusher; // // Configuration // -pusher = new Pusher(API_KEY, { +pusher = new Pusher(APP_KEY, { authEndpoint: "http://example.com/pusher/auth" }); -pusher = new Pusher(API_KEY, { +pusher = new Pusher(APP_KEY, { auth: { params: { foo: "bar" }, headers: { baz: "boo" } } }); -pusher = new Pusher(API_KEY, { +pusher = new Pusher(APP_KEY, { auth: { params: { foo: "bar" }, headers: { "X-CSRF-Token": "SOME_CSRF_TOKEN" } } }); -pusher = new Pusher(API_KEY, { cluster: "eu" }); +pusher = new Pusher(APP_KEY, { + authorizer: function (channel, options) { + return { + authorize: function (socketId, callback) { + // Do some ajax to get the auth information + var authInformation = {"auth": "hash"}; + callback(false, authInformation); + } + }; + } +}) +pusher = new Pusher(APP_KEY, { cluster: "eu" }); -pusher = new Pusher(API_KEY, { enabledTransports: ["ws"] }); +pusher = new Pusher(APP_KEY, { enabledTransports: ["ws"] }); -pusher = new Pusher(API_KEY, { disabledTransports: ["sockjs"] }); +pusher = new Pusher(APP_KEY, { disabledTransports: ["sockjs"] }); // will only use WebSockets -pusher = new Pusher(API_KEY, { +pusher = new Pusher(APP_KEY, { enabledTransports: ["ws", "xhr_streaming"], disabledTransports: ["xhr_streaming"] }); @@ -44,47 +55,68 @@ pusher = new Pusher(API_KEY, { // var socket: Pusher.Pusher; -var my_channel: Pusher.Channel; -var channels: Pusher.Channel[]; +var channel: Pusher.Channel; + +socket = new Pusher(APP_KEY); + +socket.disconnect(); -socket = new Pusher(API_KEY); // // Subscribing to channels // -my_channel = socket.subscribe('my-channel'); +channel = socket.subscribe('my-channel'); -my_channel = socket.subscribe('private-my-channel'); +channel = socket.subscribe('private-my-channel'); -channels = socket.allChannels(); -console.group('Pusher - subscribed to:'); -for (var i = 0; i < channels.length; i++) { - var channel = channels[i]; - console.log(channel.name); -} -console.groupEnd(); +socket.allChannels().forEach(channel => console.log(channel.name)); -my_channel = socket.subscribe('my-channel'); -socket.bind('new-comment', - function(data: any) { - // add comment into page - } -); +// +// Unsubscribing from channels +// -var channel: Pusher.Channel; +socket.unsubscribe('my-channel'); -var context = { title: 'Pusher' }; -var handler = function(){ - console.log('My name is ' + this.title); -}; -channel.bind('new-comment', handler, context); +socket.unsubscribe('private-my-channel'); -channel.unbind('new-comment', handler); // removes just `handler` for the `new-comment` event -channel.unbind('new-comment'); // removes all handlers for the `new-comment` event -channel.unbind(null, handler); // removes `handler` for all events -channel.unbind(null, null, context); // removes all handlers for `context` -channel.unbind(); // removes all handlers on `channel` +// +// Binding to events +// + +channel.bind('new-message', function (data) { + console.log(data.message); +}); + +channel.bind('my-event', function () { + console.log(`hi ${this.name}`); +}, { name: 'Pusher' }); + +channel.unbind('new-comment', console.log); + +channel.unbind('new-comment'); + +channel.unbind(null, console.log); + +channel.unbind(null, null, context); + +channel.unbind(); + +channel.bind_global(function (event, data) { + console.log(`The event ${event} was triggered with data ${data}`); +}); + +channel.unbind_global(console.log); + +channel.unbind_global(); + +channel.unbind_all(); + +// +// Connection Events +// + +socket.connection.bind('connected', console.log); // @@ -110,11 +142,11 @@ var options: Pusher.Config; var channelName: string; var privateChannelName: string; var presenceChannelName: string; -var add_member: Function; -var remove_member: Function; -var update_member_count: Function; +var add_member: (ctx: any, data?: any) => void; +var remove_member: (ctx: any, data?: any) => void; +var update_member_count: (ctx: any, data?: any) => void; var eventName: string; -var callback: Function; +var callback: (ctx: any, data?: any) => void; var applicationKey: string; var log: Function; var $: any; @@ -209,12 +241,12 @@ var presenceChannel: PresenceChannel = pusher.subscribe(presenceChanne var count: number = presenceChannel.members.count; -presenceChannel.members.each(function(member: Pusher.UserInfo) { +presenceChannel.members.each(function(member) { var userId = member.id; var userInfo = member.info; }); -var some_user_id: number; +var some_user_id: string; var user = presenceChannel.members.get(some_user_id); var me = presenceChannel.members.me; @@ -239,12 +271,12 @@ channel.bind('pusher:subscription_succeeded', function(members: Pusher.Members) { +channel.bind('pusher:member_added', function(member: Pusher.Member) { // for example: add_member(member.id, member.info); }); -channel.bind('pusher:member_removed', function(member: Pusher.UserInfo) { +channel.bind('pusher:member_removed', function(member: Pusher.Member) { // for example: remove_member(member.id, member.info); }); From 143f327125a8ac208ba31727a78876c11596e448 Mon Sep 17 00:00:00 2001 From: denis Date: Tue, 6 Mar 2018 22:12:08 +0100 Subject: [PATCH 029/177] Add popover options --- types/bootstrap/bootstrap-tests.ts | 42 ++++++++++++++-- types/bootstrap/index.d.ts | 79 +++++++++++++++--------------- 2 files changed, 76 insertions(+), 45 deletions(-) diff --git a/types/bootstrap/bootstrap-tests.ts b/types/bootstrap/bootstrap-tests.ts index f8934ebbfc..f6b6246724 100755 --- a/types/bootstrap/bootstrap-tests.ts +++ b/types/bootstrap/bootstrap-tests.ts @@ -142,14 +142,38 @@ $("#modal").modal({ // -------------------------------------------------------------------------------------- // $ExpectType JQuery -$("#scrollspy").popover(); +$("#popover").popover(); // $ExpectType JQuery -$("#scrollspy").popover("toggle"); +$("#popover").popover("toggle"); -$("#scrollspy").on("activate.bs.scrollspy", () => {}); +$("#popover").on("show.bs.popover", () => {}); -// TODO: test popover with options +$("#popover").popover({}); + +$("#popover").popover({ + animation: false, + container: "#container", + delay: {show: 500, hide: 100}, + html: true, + placement: "auto", + selector: "[rel=\"popover\"]", + template: '
', + title: "Hello world", + trigger: "hover focus", + offset: 10, + fallbackPlacement: ["flip", "clockwise"], + boundary: "scrollParent", +}); + +$("#popover").popover({ + placement(this, popover, trigger) { + console.log(this.tip === popover); + console.log(this.element === trigger); + console.log(this.config.content); + return "left"; + }, +}); // -------------------------------------------------------------------------------------- // Scrollspy @@ -232,6 +256,14 @@ $("#tooltip").tooltip({ }, }); +$("#tooltip").tooltip({ + placement(this, tooltip, trigger) { + // $ExpectError + console.log(this.config.content); // only for PopoverOption, not TooltipOption + return "left"; + }, +}); + $("#tooltip").tooltip({ selector: "[rel=\"tooltip\"]", }); @@ -259,7 +291,7 @@ $("#tooltip").tooltip({ }); $("#tooltip").tooltip({ - trigger: "focus hover", + trigger: "hover focus", }); $("#tooltip").tooltip({ diff --git a/types/bootstrap/index.d.ts b/types/bootstrap/index.d.ts index 01089126fb..15ef7a5f12 100755 --- a/types/bootstrap/index.d.ts +++ b/types/bootstrap/index.d.ts @@ -4,8 +4,6 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 -// TODO: popovers options - /// /// @@ -17,13 +15,17 @@ export as namespace Bootstrap; export type Placement = "auto" | "top" | "bottom" | "left" | "right"; +export type Trigger = "click" | "hover" | "focus" | "manual" | + "click hover" | "click focus" | "hover focus" | + "click hover focus"; + export interface Delay { show: number; hide: number; } -export interface TooltipInstance { - config: TooltipOption; +export interface TooltipInstance { + config: T; element: Element; tip: HTMLElement; } @@ -146,15 +148,13 @@ export interface ModalOption { show?: boolean; } -export interface PoppoverOption { +export interface PopoverOption extends TooltipOption { /** - * Apply a CSS fade transition to the popover. - * - * @default true + * Default content value if data-content attribute isn't present. + * If a function is given, it will be called with its this reference + * set to the element that the popover is attached to. */ - animation: boolean; - - // TODO + content?: string | Element | ((this: Element) => string | Element); } export interface ScrollspyOption { @@ -168,24 +168,24 @@ export interface ScrollspyOption { export interface TooltipOption { /** - * Apply a CSS fade transition to the tooltip. + * Apply a CSS fade transition to the tooltip or popover. * * @default true */ animation?: boolean; /** - * Appends the tooltip to a specific element. Example: `container: 'body'`. - * This option is particularly useful in that it allows you to position the tooltip + * Appends the tooltip or popover to a specific element. Example: `container: 'body'`. + * This option is particularly useful in that it allows you to position the tooltip or popover * in the flow of the document near the triggering element - which will prevent - * the tooltip from floating away from the triggering element during a window resize. + * it from floating away from the triggering element during a window resize. * * @default false */ container?: string | Element | false; /** - * Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type. + * Delay showing and hiding the tooltip or popover (ms) - does not apply to manual trigger type. * If a number is supplied, delay is applied to both hide/show. * Object structure is: `delay: { "show": 500, "hide": 100 }`. * @@ -194,8 +194,8 @@ export interface TooltipOption { delay?: number | Delay; /** - * Allow HTML in the tooltip. - * If true, HTML tags in the tooltip's title will be rendered in the tooltip. + * Allow HTML in the tooltip or popover. + * If true, HTML tags will be rendered in the tooltip or popover. * If false, jQuery's text method will be used to insert content into the DOM. * Use text if you're worried about XSS attacks. * @@ -204,18 +204,18 @@ export interface TooltipOption { html?: boolean; /** - * How to position the tooltip - auto | top | bottom | left | right. - * When auto is specified, it will dynamically reorient the tooltip. + * How to position the tooltip or popover - auto | top | bottom | left | right. + * When auto is specified, it will dynamically reorient the tooltip or popover. * When a function is used to determine the placement, it is called with - * the tooltip DOM node as its first argument and the triggering element DOM node as its second. - * The this context is set to the tooltip instance. + * the tooltip or popover DOM node as its first argument and the triggering element DOM node as its second. + * The this context is set to the tooltip or popover instance. * * @default "top" */ - placement?: Placement | ((this: TooltipInstance, tooltip: HTMLElement, trigger: Element) => Placement); + placement?: Placement | ((this: TooltipInstance, node: HTMLElement, trigger: Element) => Placement); /** - * If a selector is provided, tooltip objects will be delegated to the specified targets. + * If a selector is provided, tooltip or popover objects will be delegated to the specified targets. * In practice, this is used to enable dynamic HTML content to have popovers added. * * @default false @@ -223,41 +223,40 @@ export interface TooltipOption { selector?: string | false; /** - * Base HTML to use when creating the tooltip. The tooltip's title will be injected into - * the `.tooltip-inner`. The `.arrow` will become the tooltip's arrow. - * The outermost wrapper element should have the `.tooltip` class and `role="tooltip"`. + * Base HTML to use when creating the tooltip or popover. The tooltip's (resp., popover's) title will be injected into + * the `.tooltip-inner` (resp., `.popover-header`). The `.arrow` will become the tooltip's (resp., popover's) arrow. + * The outermost wrapper element should have the `.tooltip` (resp., .popover) class and `role="tooltip"`. * * @default '' + * @default '' */ template?: string; /** * Default title value if title attribute isn't present. * If a function is given, it will be called with its this reference set to the element - * that the tooltip is attached to. + * that the tooltip or popover is attached to. * * @default "" */ - title?: string | Element | ((this: Element) => string); + title?: string | Element | ((this: Element) => string | Element); /** - * How tooltip is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space. - * 'manual' indicates that the tooltip will be triggered programmatically via the .tooltip('show'), .tooltip('hide') and - * .tooltip('toggle') methods; this value cannot be combined with any other trigger. - * 'hover' on its own will result in tooltips that cannot be triggered via the keyboard, and should only be used if - * alternative methods for conveying the same information for keyboard users is present. + * How tooltip or popover is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space. + * 'manual' indicates that the tooltip will be triggered programmatically; this value cannot be combined with any other trigger. + * 'hover' should only be used if alternative methods for conveying the same information for keyboard users is present. * - * @default "hover focus" + * @default tooltip: "hover focus", popover: "click" */ - trigger?: string; + trigger?: Trigger; /** - * Offset of the tooltip relative to its target. + * Offset of the tooltip or popover relative to its target. * For more information refer to Popper.js's offset docs. * * @default 0 */ - offset?: number | string; + offset?: number | string; /** * Allow to specify which position Popper will use on fallback. @@ -268,7 +267,7 @@ export interface TooltipOption { fallbackPlacement?: Popper.Behavior | ReadonlyArray; /** - * Overflow constraint boundary of the tooltip. + * Overflow constraint boundary of the tooltip or popover. * Accepts the values of 'viewport', 'window', 'scrollParent', * or an HTMLElement reference (JavaScript only). * For more information refer to Popper.js's preventOverflow docs. @@ -332,7 +331,7 @@ declare global { modal(options?: ModalOption): this; popover(action: "show" | "hide" | "toggle" | "dispose" | "enable" | "disable" | "toggleEnabled" | "update"): this; - popover(options?: PoppoverOption): this; + popover(options?: PopoverOption): this; scrollspy(action: "refresh" | "dispose"): this; scrollspy(options?: ScrollspyOption): this; From 42f71113be2d1e05b208ed258e850e02f83c0b3d Mon Sep 17 00:00:00 2001 From: rob Date: Tue, 6 Mar 2018 11:15:17 -0700 Subject: [PATCH 030/177] make connection config relay spec compliant: https://facebook.github.io/relay/graphql/connections.htm#sec-Node --- types/graphql-relay/index.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/types/graphql-relay/index.d.ts b/types/graphql-relay/index.d.ts index 50ed0c3b7d..fc1eb3aa1e 100644 --- a/types/graphql-relay/index.d.ts +++ b/types/graphql-relay/index.d.ts @@ -21,6 +21,9 @@ import { GraphQLOutputType, GraphQLFieldResolver, GraphQLTypeResolver, + GraphQLUnionType, + GraphQLEnumType, + GraphQLScalarType, Thunk } from "graphql"; @@ -58,9 +61,20 @@ export const backwardConnectionArgs: GraphQLFieldConfigArgumentMap & { */ export const connectionArgs: GraphQLFieldConfigArgumentMap & ForwardConnectionArgs & BackwardConnectionArgs; +export type ConnectionConfigNodeTypeNullable = + | GraphQLScalarType + | GraphQLObjectType + | GraphQLInterfaceType + | GraphQLUnionType + | GraphQLEnumType; + +export type ConnectionConfigNodeType = + | ConnectionConfigNodeTypeNullable + | GraphQLNonNull; + export interface ConnectionConfig { name?: string | null; - nodeType: GraphQLObjectType; + nodeType: ConnectionConfigNodeType; resolveNode?: GraphQLFieldResolver | null; resolveCursor?: GraphQLFieldResolver | null; edgeFields?: Thunk> | null; From c48ba02bfab614861a5a0a8abb6610b62b3d08d4 Mon Sep 17 00:00:00 2001 From: Lance Ivy Date: Tue, 6 Mar 2018 13:25:48 -0800 Subject: [PATCH 031/177] fix many lint rules not all lint rules have been fixed because these tests are copied from documentation and should remain recognizable. --- types/pusher-js/index.d.ts | 36 +++++---------- types/pusher-js/pusher-js-tests.ts | 47 ++++++++++---------- types/pusher-js/tslint.json | 70 +----------------------------- 3 files changed, 35 insertions(+), 118 deletions(-) diff --git a/types/pusher-js/index.d.ts b/types/pusher-js/index.d.ts index 9ea0b96268..a81170d09c 100644 --- a/types/pusher-js/index.d.ts +++ b/types/pusher-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for pusher-js 4.2.2 +// Type definitions for pusher-js 4.2 // Project: https://github.com/pusher/pusher-js // Definitions by: Qubo // Lance Ivy @@ -19,11 +19,11 @@ declare namespace pusher { unsubscribe(name: string): void; isEncrypted(): boolean; key: string; - config: Config; //TODO: add GlobalConfig typings - channels: any; //TODO: Type this + config: Config; // TODO: add GlobalConfig typings + channels: any; // TODO: Type this global_emitter: EventsDispatcher; sessionID: number; - timeline: any; //TODO: Type this + timeline: any; // TODO: Type this connection: ConnectionManager; } @@ -122,8 +122,8 @@ declare namespace pusher { } type Authorizer = (channel: Channel, options: Config) => { - authorize: (socketId: string, callback: (errored: boolean, authInfo?: AuthInfo) => void) => void - } + authorize: (socketId: string, callback: (errored: boolean, authInfo?: AuthInfo) => void) => void; + }; type EventCallback = (context: any, data: any) => void; @@ -144,20 +144,18 @@ declare namespace pusher { subscribed: boolean; /** * Authenticates the connection as a member of the channel. - * @param {String} socketId - * @param {Function} callback */ authorize(socketId: string, callback: (data: any) => void): void; } interface ConnectionManager extends EventsDispatcher { key: string; - options: any; //TODO: Timeline.js + options: any; // TODO: Timeline.js state: string; socket_id: string; - connection: any; //TODO: Type this + connection: any; // TODO: Type this encrypted: boolean; - timeline: any; //TODO: Type this + timeline: any; // TODO: Type this connectionCallbacks: { message: (message: string) => void; ping: () => void; @@ -176,7 +174,7 @@ declare namespace pusher { refused: () => void; backoff: () => void; retry: () => void; - connected: (handshake: any) => void; //TODO: Type this + connected: (handshake: any) => void; // TODO: Type this }; /** * Establishes a connection to Pusher. @@ -187,15 +185,10 @@ declare namespace pusher { connect(): void; /** * Sends raw data. - * @param {String} data */ send(data: string): boolean; - /** Sends an event. - * - * @param {String} name - * @param {String} data - * @param {String} [channel] - * @returns {Boolean} whether message was sent or not + /** + * Sends an event. */ send_event(name: string, data: string, channel: string): boolean; /** Closes the connection. */ @@ -212,15 +205,10 @@ declare namespace pusher { * Returns member's info for given id. * * Resulting object containts two fields - id and info. - * - * @param {String} id - * @return {Object} member's info or null */ get(id: string): null | T; /** * Calls back for each member in unspecified order. - * - * @param {Function} callback */ each(callback: (member: Member) => void): void; members: { [id: string]: Member }; diff --git a/types/pusher-js/pusher-js-tests.ts b/types/pusher-js/pusher-js-tests.ts index 1eec5ef200..dc6a9eedd7 100644 --- a/types/pusher-js/pusher-js-tests.ts +++ b/types/pusher-js/pusher-js-tests.ts @@ -1,4 +1,3 @@ - import Pusher = require('pusher-js'); import { PresenceChannel } from "pusher-js"; @@ -28,16 +27,17 @@ pusher = new Pusher(APP_KEY, { }); pusher = new Pusher(APP_KEY, { - authorizer: function (channel, options) { + authorizer: function(channel, options) { return { - authorize: function (socketId, callback) { + authorize: function(socketId, callback) { // Do some ajax to get the auth information - var authInformation = {"auth": "hash"}; + var authInformation = {auth: "hash"}; callback(false, authInformation); } }; } -}) +}); + pusher = new Pusher(APP_KEY, { cluster: "eu" }); pusher = new Pusher(APP_KEY, { enabledTransports: ["ws"] }); @@ -61,7 +61,6 @@ socket = new Pusher(APP_KEY); socket.disconnect(); - // // Subscribing to channels // @@ -84,11 +83,11 @@ socket.unsubscribe('private-my-channel'); // Binding to events // -channel.bind('new-message', function (data) { +channel.bind('new-message', function(data) { console.log(data.message); }); -channel.bind('my-event', function () { +channel.bind('my-event', function() { console.log(`hi ${this.name}`); }, { name: 'Pusher' }); @@ -102,7 +101,7 @@ channel.unbind(null, null, context); channel.unbind(); -channel.bind_global(function (event, data) { +channel.bind_global(function(event, data) { console.log(`The event ${event} was triggered with data ${data}`); }); @@ -118,7 +117,6 @@ channel.unbind_all(); socket.connection.bind('connected', console.log); - // // // Samples from Pusher Documentation @@ -148,7 +146,7 @@ var update_member_count: (ctx: any, data?: any) => void; var eventName: string; var callback: (ctx: any, data?: any) => void; var applicationKey: string; -var log: Function; +var log: (msg: string) => void; var $: any; var data: any; @@ -188,11 +186,11 @@ pusher = new Pusher('app_key', { pusher = new Pusher('app_key', { cluster: 'eu' }); -pusher = new Pusher('app_key', { encrypted: true } ); +pusher = new Pusher('app_key', { encrypted: true }); pusher = new Pusher('app_key'); -pusher.connection.bind( 'error', function( err: any ) { - if( err.data.code === 4004 ) { +pusher.connection.bind('error', function(err: any) { + if (err.data.code === 4004) { log('>>> detected limit error'); } }); @@ -211,7 +209,7 @@ pusher.connection.bind('connected', function() { pusher.connection.bind('connecting_in', function(delay: any) { alert("I haven't been able to establish a connection for this feature. " + - "I will try again in " + delay + " seconds.") + "I will try again in " + delay + " seconds."); }); pusher.connection.bind('state_change', function(states: any) { @@ -237,7 +235,7 @@ var privateChannel = pusher.subscribe(privateChannelName); // Presence channels -var presenceChannel: PresenceChannel = pusher.subscribe(presenceChannelName); +var presenceChannel = pusher.subscribe(presenceChannelName) as Pusher.PresenceChannel; var count: number = presenceChannel.members.count; @@ -252,7 +250,7 @@ var user = presenceChannel.members.get(some_user_id); var me = presenceChannel.members.me; pusher = new Pusher('app_key'); -presenceChannel = pusher.subscribe('presence-example'); +presenceChannel = pusher.subscribe('presence-example') as Pusher.PresenceChannel; presenceChannel.bind('pusher:subscription_succeeded', function() { var me = presenceChannel.members.me; var userId = me.id; @@ -294,7 +292,7 @@ channel.bind('new-price', ); var context = { title: 'Pusher' }; -var handler = function(){ +var handler = function() { console.log('My name is ' + this.title); }; channel.bind('new-comment', handler, context); @@ -333,7 +331,7 @@ channel.bind('pusher:subscription_succeeded', function() { pusher = new Pusher('APP_KEY'); channel = pusher.subscribe('private-channel'); channel.bind('pusher:subscription_error', function(status: number) { - if(status == 408 || status == 503){ + if (status === 408 || status === 503) { // retry? } }); @@ -362,23 +360,22 @@ channel = pusher.subscribe("private-mousemoves"); // this method should be bound as a 'mousemove' event listener document.body.addEventListener('mousemove', onMouseMove, false); -function onMouseMove(ev: any){ +function onMouseMove(ev: any) { ev = ev || window.event; state.currentX = ev.pageX || ev.clientX; state.currentY = ev.pageY || ev.clientY; } -setInterval(function(){ - if(state.currentX !== state.lastX || state.currentY !== state.lastY){ +setInterval(function() { + if (state.currentX !== state.lastX || state.currentY !== state.lastY) { state.lastX = state.currentX; state.lastY = state.currentY; var text = document.createTextNode( 'Triggering event due to state change: x: ' + state.currentX + ', y: ' + state.currentY ); - outputEl.replaceChild( text, outputEl.firstChild ); + outputEl.replaceChild(text, outputEl.firstChild); - channel.trigger("client-mouse-moved", {x:state.currentX, y: state.currentY}); + channel.trigger("client-mouse-moved", {x: state.currentX, y: state.currentY}); } }, 300); // send every 300 milliseconds if position has changed - diff --git a/types/pusher-js/tslint.json b/types/pusher-js/tslint.json index a41bf5d19a..2cf1b5c31e 100644 --- a/types/pusher-js/tslint.json +++ b/types/pusher-js/tslint.json @@ -1,79 +1,11 @@ { "extends": "dtslint/dt.json", "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, "only-arrow-functions": false, - "prefer-conditional-expression": false, "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false + "prefer-template": false } } From 79610aca3c393f13867fc108d731121294660d50 Mon Sep 17 00:00:00 2001 From: Aluan Haddad Date: Wed, 7 Mar 2018 04:19:52 -0500 Subject: [PATCH 032/177] add Ora.prototype.frameIndex Adds the `Ora.prototype.frameIndex` member. https://github.com/sindresorhus/ora/blob/master/index.js#L37 add Ora.prototype.frameIndex --- types/ora/index.d.ts | 2 ++ types/ora/tsconfig.json | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/ora/index.d.ts b/types/ora/index.d.ts index f5dd605073..d43a01c7cf 100644 --- a/types/ora/index.d.ts +++ b/types/ora/index.d.ts @@ -119,6 +119,8 @@ declare class Ora { text: string; color: Color; + + frameIndex: number; } interface oraFactory { diff --git a/types/ora/tsconfig.json b/types/ora/tsconfig.json index 4092876efe..d283fa111a 100644 --- a/types/ora/tsconfig.json +++ b/types/ora/tsconfig.json @@ -14,10 +14,11 @@ ], "types": [], "noEmit": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true }, "files": [ "index.d.ts", "ora-tests.ts" ] -} \ No newline at end of file +} From f81c6064cabfd50cdf9c7acf10d0e4af49440e5e Mon Sep 17 00:00:00 2001 From: Dado Date: Wed, 7 Mar 2018 13:00:33 +0100 Subject: [PATCH 033/177] Select2 options selectionAdapter and resultsAdapter --- types/select2/index.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/types/select2/index.d.ts b/types/select2/index.d.ts index e7a974f92d..51e297a9a8 100644 --- a/types/select2/index.d.ts +++ b/types/select2/index.d.ts @@ -92,6 +92,8 @@ interface Select2Options { dropdownParent?: JQuery; debug?: boolean; dropdownAdapter?: any; + selectionAdapter?: any; + resultsAdapter?: any; } interface Select2JQueryEventObject extends JQueryEventObject { From 9b0cdc63e624b9e15b38a3184506b207fee6948a Mon Sep 17 00:00:00 2001 From: Artem Nechunaev Date: Wed, 7 Mar 2018 15:31:20 +0300 Subject: [PATCH 034/177] Add inputRef prop definition --- types/react-input-mask/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/react-input-mask/index.d.ts b/types/react-input-mask/index.d.ts index 6ed7660196..2bc3bda94f 100644 --- a/types/react-input-mask/index.d.ts +++ b/types/react-input-mask/index.d.ts @@ -36,6 +36,10 @@ declare namespace reactInputMask { * Show mask even in empty input without focus. */ alwaysShowMask?: boolean; + /** + * Use inputRef instead of ref if you need input node to manage focus, selection, etc. + */ + inputRef?: React.Ref } class ReactInputMask extends React.Component { } From edf2bd560299c4033cf2e3ff19f75fd0e082655b Mon Sep 17 00:00:00 2001 From: Artem Nechunaev Date: Wed, 7 Mar 2018 15:47:14 +0300 Subject: [PATCH 035/177] Add test for inputRef prop --- types/react-input-mask/react-input-mask-tests.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/react-input-mask/react-input-mask-tests.tsx b/types/react-input-mask/react-input-mask-tests.tsx index d116b2b27a..a34b15ac99 100644 --- a/types/react-input-mask/react-input-mask-tests.tsx +++ b/types/react-input-mask/react-input-mask-tests.tsx @@ -1,10 +1,13 @@ import ReactInputMask from 'react-input-mask'; import * as React from 'react'; +let ref: HTMLInputElement | null = null; +
+ ref = node} />
; From 38998ea10a52e176d72b5055cf81647c167b682d Mon Sep 17 00:00:00 2001 From: Artem Nechunaev Date: Wed, 7 Mar 2018 15:53:35 +0300 Subject: [PATCH 036/177] Fix lint errors --- types/react-input-mask/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-input-mask/index.d.ts b/types/react-input-mask/index.d.ts index 2bc3bda94f..de3853642f 100644 --- a/types/react-input-mask/index.d.ts +++ b/types/react-input-mask/index.d.ts @@ -39,7 +39,7 @@ declare namespace reactInputMask { /** * Use inputRef instead of ref if you need input node to manage focus, selection, etc. */ - inputRef?: React.Ref + inputRef?: React.Ref; } class ReactInputMask extends React.Component { } From 3f2825672b7f9ae401ad0a32577dafe007cf4c9b Mon Sep 17 00:00:00 2001 From: Artem Nechunaev Date: Wed, 7 Mar 2018 16:07:06 +0300 Subject: [PATCH 037/177] Fix package version --- types/react-input-mask/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-input-mask/index.d.ts b/types/react-input-mask/index.d.ts index de3853642f..034c3b4f9d 100644 --- a/types/react-input-mask/index.d.ts +++ b/types/react-input-mask/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-input-mask 0.7 +// Type definitions for react-input-mask 1.2.2 // Project: https://github.com/sanniassin/react-input-mask // Definitions by: Alexandre Paré // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From bc1e2d97212935217194003ef5cc0c4ac8d5732e Mon Sep 17 00:00:00 2001 From: Artem Nechunaev Date: Wed, 7 Mar 2018 16:50:17 +0300 Subject: [PATCH 038/177] Fix package version --- types/react-input-mask/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-input-mask/index.d.ts b/types/react-input-mask/index.d.ts index 034c3b4f9d..8716cda0e6 100644 --- a/types/react-input-mask/index.d.ts +++ b/types/react-input-mask/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-input-mask 1.2.2 +// Type definitions for react-input-mask 1.2 // Project: https://github.com/sanniassin/react-input-mask // Definitions by: Alexandre Paré // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From 091f2f42713c6da7da0ebad60fbaecc5bb95ef05 Mon Sep 17 00:00:00 2001 From: Stephan Schneider Date: Wed, 7 Mar 2018 15:23:58 +0100 Subject: [PATCH 039/177] fix: allow for synchronous Hapi plugin register fn --- types/hapi/index.d.ts | 2 +- types/hapi/test/server/server-plugins.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/types/hapi/index.d.ts b/types/hapi/index.d.ts index de1542f33f..8ad9b6f4c4 100644 --- a/types/hapi/index.d.ts +++ b/types/hapi/index.d.ts @@ -120,7 +120,7 @@ export interface PluginBase { * * server - the server object with a plugin-specific server.realm. * * options - any options passed to the plugin during registration via server.register(). */ - register: (server: Server, options: T) => Promise; + register: (server: Server, options: T) => void | Promise; /** (optional) if true, allows the plugin to be registered multiple times with the same server. Defaults to false. */ multiple?: boolean; diff --git a/types/hapi/test/server/server-plugins.ts b/types/hapi/test/server/server-plugins.ts index 7f3d194f84..8de3fdc24f 100644 --- a/types/hapi/test/server/server-plugins.ts +++ b/types/hapi/test/server/server-plugins.ts @@ -13,6 +13,10 @@ interface Plugin3 { three: 3; } +interface Plugin4 { + four: 4; +} + declare module 'hapi' { interface PluginProperties { example: { @@ -42,6 +46,11 @@ const plugin3: Plugin = { register: async (server: Server, options: Plugin3) => {} }; +const plugin4: Plugin = { + name: 'plugin4', + register: (server: Server, options: Plugin4) => {} +}; + const server = new Server({ port: 8000, }); @@ -90,5 +99,9 @@ server.register([ { plugin: plugin1, options: {one: 1} + }, + { + plugin: plugin4, + options: {four: 4} } ]); From 9077dd95025ef8b49508312b10efe6d82745be29 Mon Sep 17 00:00:00 2001 From: Bram Schulting Date: Thu, 8 Mar 2018 13:07:36 +0100 Subject: [PATCH 040/177] Add onFailure prop to react-facebook-login This prop was missing: https://github.com/keppelen/react-facebook-login/blob/master/src/facebook.js#L39 --- types/react-facebook-login/index.d.ts | 10 +++++++++- .../react-facebook-login-tests.tsx | 17 ++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/types/react-facebook-login/index.d.ts b/types/react-facebook-login/index.d.ts index 3cb1c21605..1c81ffc3c8 100644 --- a/types/react-facebook-login/index.d.ts +++ b/types/react-facebook-login/index.d.ts @@ -9,6 +9,7 @@ import * as React from "react"; interface ReactFacebookLoginProps { appId: string; callback(userInfo: ReactFacebookLoginInfo): void; + onFailure?(response: ReactFacebookFailureResponse): void; autoLoad?: boolean; buttonStyle?: React.CSSProperties; @@ -33,6 +34,10 @@ interface ReactFacebookLoginProps { tag?: Node | React.Component; } +export interface ReactFacebookFailureResponse { + status?: string; +} + export interface ReactFacebookLoginInfo { id: string; name: string; @@ -43,6 +48,9 @@ interface ReactFacebookLoginState { isProcessing?: boolean; } -declare class ReactFacebookLogin extends React.Component { } +declare class ReactFacebookLogin extends React.Component< + ReactFacebookLoginProps, + ReactFacebookLoginState +> {} export default ReactFacebookLogin; diff --git a/types/react-facebook-login/react-facebook-login-tests.tsx b/types/react-facebook-login/react-facebook-login-tests.tsx index 6aab1ccd71..d7b2ebcde8 100644 --- a/types/react-facebook-login/react-facebook-login-tests.tsx +++ b/types/react-facebook-login/react-facebook-login-tests.tsx @@ -1,12 +1,16 @@ import * as React from 'react'; import * as ReactDOM from 'react-dom'; -import FacebookLogin, { ReactFacebookLoginInfo } from 'react-facebook-login'; +import FacebookLogin, { ReactFacebookLoginInfo, ReactFacebookFailureResponse } from 'react-facebook-login'; const responseFacebook = (response: ReactFacebookLoginInfo) => { console.log(response); }; +const failureResponseFacebook = (response: ReactFacebookFailureResponse) => { + console.log(response); +}; + const componentClicked = () => { console.log("component clicked"); }; @@ -21,6 +25,17 @@ ReactDOM.render( document.getElementById('demo') ); +ReactDOM.render( + , + document.getElementById('demo') +); + ReactDOM.render( Date: Thu, 8 Mar 2018 15:09:17 +0200 Subject: [PATCH 041/177] Add isMergeableObject to options --- types/deepmerge/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/deepmerge/index.d.ts b/types/deepmerge/index.d.ts index 05f5c96d2e..04313282b1 100644 --- a/types/deepmerge/index.d.ts +++ b/types/deepmerge/index.d.ts @@ -1,7 +1,8 @@ -// Type definitions for deepmerge 1.3 +// Type definitions for deepmerge 2.1 // Project: https://github.com/KyleAMathews/deepmerge // Definitions by: marvinscharle // syy1125 +// AppLover69 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 @@ -14,6 +15,7 @@ declare namespace deepmerge { interface Options { clone?: boolean; arrayMerge?(destination: any[], source: any[], options?: Options): any[]; + isMergeableObject?(value: object): boolean; } function all(objects: Array>, options?: Options): T; From 2f0902873c07893813df5c99b0259f722d1bdc95 Mon Sep 17 00:00:00 2001 From: AppLover69 <26137752+AppLover69@users.noreply.github.com> Date: Thu, 8 Mar 2018 15:26:57 +0200 Subject: [PATCH 042/177] Updated TypeScript version to 2.2 --- types/deepmerge/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/deepmerge/index.d.ts b/types/deepmerge/index.d.ts index 04313282b1..39158354de 100644 --- a/types/deepmerge/index.d.ts +++ b/types/deepmerge/index.d.ts @@ -4,7 +4,7 @@ // syy1125 // AppLover69 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.2 export = deepmerge; From 3ed377df2289b0f7aabfb92dea097fd4bbae9628 Mon Sep 17 00:00:00 2001 From: Ramon de Klein Date: Fri, 9 Mar 2018 00:17:54 +0100 Subject: [PATCH 043/177] Fix typing of Model.createTable --- types/dynogels/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/dynogels/index.d.ts b/types/dynogels/index.d.ts index 2e4c5acbf4..4742af5a04 100644 --- a/types/dynogels/index.d.ts +++ b/types/dynogels/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for dynogels 8.0 // Project: https://github.com/clarkie/dynogels#readme // Definitions by: Spartan Labs +// Ramon de Klein // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -76,7 +77,7 @@ export interface Model { getItems(items: string[] | Array<{ [key: string]: string }>, options: GetItemOptions, callback: (err: Error, items: any[]) => void): void; batchGetItems(items: string[] | Array<{ [key: string]: string }>, callback: (err: Error, items: any[]) => void): void; batchGetItems(items: string[] | Array<{ [key: string]: string }>, options: GetItemOptions, callback: (err: Error, items: any[]) => void): void; - createTable(options: { [key: string]: CreateTablesOptions } | DynogelsGlobalOptions, callback: (err: Error, data: AWS.DynamoDB.CreateTableOutput) => void): void; + createTable(options: CreateTablesOptions, callback: (err: Error, data: AWS.DynamoDB.CreateTableOutput) => void): void; createTable(callback: (err: Error, data: AWS.DynamoDB.CreateTableOutput) => void): void; updateTable(throughput: Throughput, callback: (err: Error, data: AWS.DynamoDB.UpdateTableOutput) => void): void; updateTable(callback: (err: Error, data: AWS.DynamoDB.UpdateTableOutput) => void): void; From b21ecf8eecd7864233bd6e7c4dcc9c8eae51181f Mon Sep 17 00:00:00 2001 From: Rahul Raina Date: Thu, 8 Mar 2018 23:16:57 -0800 Subject: [PATCH 044/177] Updated to pull from H.History --- types/react-router/index.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/types/react-router/index.d.ts b/types/react-router/index.d.ts index 47274d71e2..01654c8304 100644 --- a/types/react-router/index.d.ts +++ b/types/react-router/index.d.ts @@ -15,6 +15,7 @@ // Daniel Roth // Egor Shulga // Youen Toupin +// Rahul Raina // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.6 @@ -76,7 +77,7 @@ export interface RouteProps { export class Route extends React.Component { } export interface RouterProps { - history: any; + history: H.History; } export class Router extends React.Component { } From c96aea88fe331b610471dd436c8de36844f3aecd Mon Sep 17 00:00:00 2001 From: Divyendu Singh Date: Fri, 9 Mar 2018 13:45:28 +0530 Subject: [PATCH 045/177] make graphql typing for getDescription conform with graphql-js --- types/graphql/index.d.ts | 4 ++++ types/graphql/utilities/buildASTSchema.d.ts | 13 +++++++++++-- types/graphql/utilities/index.d.ts | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/types/graphql/index.d.ts b/types/graphql/index.d.ts index a8bead58fd..49185e11a1 100644 --- a/types/graphql/index.d.ts +++ b/types/graphql/index.d.ts @@ -12,6 +12,7 @@ // Tim Griesser // Dylan Stewart // Alessio Dionisi +// Divyendu Singh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -100,6 +101,9 @@ export { // Build a GraphQLSchema from a GraphQL schema language document. buildSchema, + // Get the description of an AST node + getDescription, + // Extends an existing GraphQLSchema from a parsed GraphQL Schema // language AST. extendSchema, diff --git a/types/graphql/utilities/buildASTSchema.d.ts b/types/graphql/utilities/buildASTSchema.d.ts index b20c8fc856..8ba2fcc9e9 100644 --- a/types/graphql/utilities/buildASTSchema.d.ts +++ b/types/graphql/utilities/buildASTSchema.d.ts @@ -1,7 +1,13 @@ -import { DocumentNode, Location } from '../language/ast'; +import { DocumentNode, Location, StringValueNode } from '../language/ast'; import { Source } from '../language/source'; import { GraphQLSchema } from '../type/schema'; +type BuildSchemaOptions = { + assumeValid?: boolean; + allowedLegacyNames?: ReadonlyArray; + commentDescriptions?: boolean; +}; + /** * This takes the ast of a schema document produced by the parse function in * src/language/parser.js. @@ -18,7 +24,10 @@ export function buildASTSchema(ast: DocumentNode): GraphQLSchema; * Given an ast node, returns its string description based on a contiguous * block full-line of comments preceding it. */ -export function getDescription(node: { loc?: Location }): string; +export function getDescription( + node: { description?: StringValueNode; loc?: Location }, + options: BuildSchemaOptions + ): string; /** * A helper function to build a GraphQLSchema directly from a source diff --git a/types/graphql/utilities/index.d.ts b/types/graphql/utilities/index.d.ts index cd0e23948f..c2b2c182ff 100644 --- a/types/graphql/utilities/index.d.ts +++ b/types/graphql/utilities/index.d.ts @@ -27,7 +27,7 @@ export { getOperationAST } from './getOperationAST'; export { buildClientSchema } from './buildClientSchema'; // Build a GraphQLSchema from GraphQL Schema language. -export { buildASTSchema, buildSchema } from './buildASTSchema'; +export { buildASTSchema, buildSchema, getDescription } from './buildASTSchema'; // Extends an existing GraphQLSchema from a parsed GraphQL Schema language AST. export { extendSchema } from './extendSchema'; From 439ab93ba59e1f30bcd157a6417a9f930655ffee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81rni=20Benedikt=20=C3=81rnason?= Date: Fri, 9 Mar 2018 11:46:25 +0100 Subject: [PATCH 046/177] Added pop and popToTop NavigationActions for react-navigation --- types/react-navigation/index.d.ts | 27 ++++++++++++++++++- .../react-navigation-tests.tsx | 12 +++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index c4e396783f..2fdde0448e 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -247,6 +247,25 @@ export interface NavigationUriAction extends NavigationUriActionPayload { type: 'Navigation/URI'; } +export interface NavigationPopActionPayload { + // n: the number of routes to pop of the stack + n?: number; + immediate?: boolean; +} + +export interface NavigationPopAction extends NavigationPopActionPayload { + type: 'Navigation/POP'; +} + +export interface NavigationPopToTopActionPayload { + key?: string; + immediate?: boolean; +} + +export interface NavigationPopToTopAction extends NavigationPopToTopActionPayload { + type: 'Navigation/POP_TO_TOP'; +} + export interface NavigationStackViewConfig { mode?: 'card' | 'modal'; headerMode?: HeaderMode; @@ -287,7 +306,9 @@ export type NavigationStackAction = | NavigationNavigateAction | NavigationBackAction | NavigationSetParamsAction - | NavigationResetAction; + | NavigationResetAction + | NavigationPopAction + | NavigationPopToTopAction; export type NavigationTabAction = NavigationInitAction @@ -718,12 +739,16 @@ export namespace NavigationActions { const RESET: 'Navigation/RESET'; const SET_PARAMS: 'Navigation/SET_PARAMS'; const URI: 'Navigation/URI'; + const POP: 'Navigation/POP'; + const POP_TO_TOP: 'Navigation/POP_TO_TOP'; function init(options?: NavigationInitActionPayload): NavigationInitAction; function navigate(options: NavigationNavigateActionPayload): NavigationNavigateAction; function reset(options: NavigationResetActionPayload): NavigationResetAction; function back(options?: NavigationBackActionPayload): NavigationBackAction; function setParams(options: NavigationSetParamsActionPayload): NavigationSetParamsAction; + function pop(options: NavigationPopActionPayload): NavigationPopAction; + function popToTop(options: NavigationPopToTopActionPayload): NavigationPopToTopAction; } /** diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 017a9b9153..49e216a35a 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -32,6 +32,8 @@ import { HeaderBackButton, Header, NavigationParams, + NavigationPopAction, + NavigationPopToTopAction, } from 'react-navigation'; // Constants @@ -337,3 +339,13 @@ const setParamsAction: NavigationSetParamsAction = NavigationActions.setParams({ foo: "bar" } }); + +const popAction: NavigationPopAction = NavigationActions.pop({ + n: 1, + immediate: true +}); + +const popToTopAction: NavigationPopToTopAction = NavigationActions.popToTop({ + key: "foo", + immediate: true +}) \ No newline at end of file From 43ffb4e259323ad45add91a98c70502dd683c1ce Mon Sep 17 00:00:00 2001 From: kenji_imamura Date: Fri, 9 Mar 2018 19:48:42 +0900 Subject: [PATCH 047/177] fix: export lory --- types/lory.js/index.d.ts | 2 +- types/lory.js/lory.js-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/lory.js/index.d.ts b/types/lory.js/index.d.ts index 37ff46d4be..dd37fb8efa 100644 --- a/types/lory.js/index.d.ts +++ b/types/lory.js/index.d.ts @@ -4,7 +4,7 @@ // philip bulley // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare var lory: LoryStatic; +export declare var lory: LoryStatic; interface LoryStatic { (element: Element, options?: LoryOptions): LoryStatic; diff --git a/types/lory.js/lory.js-tests.ts b/types/lory.js/lory.js-tests.ts index bad97dadf3..616073f180 100644 --- a/types/lory.js/lory.js-tests.ts +++ b/types/lory.js/lory.js-tests.ts @@ -1,4 +1,4 @@ - +import { lory } from 'lory.js'; (function() { var elm = document.querySelector('.js-foo'); From 7a1603d26fe51ec29158609a1333a9f8ff098a3e Mon Sep 17 00:00:00 2001 From: Arnaud Duforat Date: Fri, 9 Mar 2018 12:00:59 +0100 Subject: [PATCH 048/177] [react-table] original property duplicated in RowInfo After the merge https://github.com/DefinitelyTyped/DefinitelyTyped/commit/87d4d9cd52c84c1fc36f7545ff541899b7e6421e#diff-7f4f664c8c5ea0cb3bbb70b9a68ef166 RowInfo has two "original" property definition. This PR delete one of them. I tried using the @types/react-table package and had problems. I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript Mention the authors so they can respond: @royxue @psakalo @Havret --- types/react-table/index.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/types/react-table/index.d.ts b/types/react-table/index.d.ts index 20a1c5a1fb..503b5f4e02 100644 --- a/types/react-table/index.d.ts +++ b/types/react-table/index.d.ts @@ -613,9 +613,6 @@ export interface RowInfo { /** Materialized row of data */ row: any; - /** Original row from your data */ - original: any; - /** The post-accessed values from the original row */ rowValues: any; From e5ef9ecef2e6abdf86a6ad9ef53f72136ab11bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81rni=20Benedikt=20=C3=81rnason?= Date: Fri, 9 Mar 2018 12:01:51 +0100 Subject: [PATCH 049/177] Fixed lint errors --- types/react-navigation/react-navigation-tests.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 49e216a35a..0f68b653b1 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -348,4 +348,4 @@ const popAction: NavigationPopAction = NavigationActions.pop({ const popToTopAction: NavigationPopToTopAction = NavigationActions.popToTop({ key: "foo", immediate: true -}) \ No newline at end of file +}); From 93fb187bf1930e131ca710695f3f3246508b5258 Mon Sep 17 00:00:00 2001 From: maksis Date: Fri, 9 Mar 2018 17:17:12 +0200 Subject: [PATCH 050/177] react-select: export ReactAsyncCreatableSelectProps, fix incorrect ReactAsyncSelectProps --- types/react-select/index.d.ts | 45 ++++------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/types/react-select/index.d.ts b/types/react-select/index.d.ts index d256bb437e..7adf0d0750 100644 --- a/types/react-select/index.d.ts +++ b/types/react-select/index.d.ts @@ -22,7 +22,7 @@ export default class ReactSelectClass extends React.Compo // Other components export class Creatable extends React.Component> { } export class Async extends React.Component> { } -export class AsyncCreatable extends React.Component & ReactCreatableSelectProps> { } +export class AsyncCreatable extends React.Component> { } export type HandlerRendererResult = JSX.Element | null | false; @@ -591,21 +591,6 @@ export interface ReactAsyncSelectProps extends ReactSelec */ cache?: { [key: string]: any } | boolean; - /** - * whether to strip diacritics when filtering (shared with Select) - */ - ignoreAccents?: boolean; - - /** - * whether to perform case-insensitive filtering (shared with Select) - */ - ignoreCase?: boolean; - - /** - * overrides the isLoading state when set to true - */ - isLoading?: boolean; - /** * function to call to load options asynchronously */ @@ -614,29 +599,7 @@ export interface ReactAsyncSelectProps extends ReactSelec /** * replaces the placeholder while options are loading */ - loadingPlaceholder?: string; - - /** - * the minimum number of characters that trigger loadOptions - */ - minimumInput?: number; - - /** - * placeholder displayed when there are no matching search results (shared with Select) - */ - noResultsText?: string | JSX.Element; - /** - * field placeholder; displayed when there's no value (shared with Select) - */ - placeholder?: string; - - /** - * label to prompt for search input - */ - searchPromptText?: string; - - /** - * message to display while options are loading - */ - searchingText?: string; + loadingPlaceholder?: string | JSX.Element; } + +export type ReactAsyncCreatableSelectProps = ReactAsyncSelectProps & ReactCreatableSelectProps; From 6325442ec9055c14715742ba5178006d8d392796 Mon Sep 17 00:00:00 2001 From: Jeremy Hon Date: Fri, 9 Mar 2018 23:59:04 +0800 Subject: [PATCH 051/177] replace overloaded array and dictionary params with union collection --- types/async/index.d.ts | 60 +++++++++++++----------------------------- 1 file changed, 19 insertions(+), 41 deletions(-) diff --git a/types/async/index.d.ts b/types/async/index.d.ts index 17fecb467b..e2ecb522bc 100644 --- a/types/async/index.d.ts +++ b/types/async/index.d.ts @@ -7,6 +7,7 @@ export as namespace async; export interface Dictionary { [key: string]: T; } +export type IterableCollection = T[] | IterableIterator | Dictionary export interface ErrorCallback { (err?: T): void; } export interface AsyncBooleanResultCallback { (err?: E, truthValue?: boolean): void; } @@ -36,11 +37,9 @@ export interface AsyncQueue { running(): number; idle(): boolean; concurrency: number; - push(task: T, callback?: ErrorCallback): void; + push(task: T | T[], callback?: ErrorCallback): void; push(task: T, callback?: AsyncResultCallback): void; - push(task: T[], callback?: ErrorCallback): void; - unshift(task: T, callback?: ErrorCallback): void; - unshift(task: T[], callback?: ErrorCallback): void; + unshift(task: T | T[], callback?: ErrorCallback): void; saturated: () => any; empty: () => any; drain: () => any; @@ -62,8 +61,7 @@ export interface AsyncPriorityQueue { concurrency: number; started: boolean; paused: boolean; - push(task: T, priority: number, callback?: AsyncResultArrayCallback): void; - push(task: T[], priority: number, callback?: AsyncResultArrayCallback): void; + push(task: T | T[], priority: number, callback?: AsyncResultArrayCallback): void; saturated: () => any; empty: () => any; drain: () => any; @@ -86,7 +84,6 @@ export interface AsyncCargo { length(): number; payload?: number; push(task: any, callback? : Function): void; - push(task: any[], callback? : Function): void; saturated(): void; empty(): void; drain(): void; @@ -97,39 +94,28 @@ export interface AsyncCargo { } // Collections -export function each(arr: T[] | IterableIterator, iterator: AsyncIterator, callback?: ErrorCallback): void; -export function each(arr: Dictionary, iterator: AsyncIterator, callback?: ErrorCallback): void; +export function each(arr: IterableCollection, iterator: AsyncIterator, callback?: ErrorCallback): void; export const eachSeries: typeof each; -export function eachLimit(arr: T[] | IterableIterator, limit: number, iterator: AsyncIterator, callback?: ErrorCallback): void; -export function eachLimit(arr: Dictionary, limit: number, iterator: AsyncIterator, callback?: ErrorCallback): void; +export function eachLimit(arr: IterableCollection, limit: number, iterator: AsyncIterator, callback?: ErrorCallback): void; export const forEach: typeof each; export const forEachSeries: typeof each; export const forEachLimit: typeof eachLimit; -export function forEachOf(obj: T[] | IterableIterator, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; -export function forEachOf(obj: Dictionary, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; +export function forEachOf(obj: IterableCollection, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; export const forEachOfSeries: typeof forEachOf; -export function forEachOfLimit(obj: T[] | IterableIterator, limit: number, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; -export function forEachOfLimit(obj: Dictionary, limit: number, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; +export function forEachOfLimit(obj: IterableCollection, limit: number, iterator: AsyncForEachOfIterator, callback?: ErrorCallback): void; export const eachOf: typeof forEachOf; export const eachOfSeries: typeof forEachOf; export const eachOfLimit: typeof forEachOfLimit; export function map(arr: T[] | IterableIterator, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; export function map(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; export const mapSeries: typeof map; -export function mapLimit( - arr: T[] | Dictionary | IterableIterator, - limit: number, - iterator: AsyncResultIterator, - callback?: AsyncResultArrayCallback -): void; +export function mapLimit(arr: IterableCollection, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; export function mapValuesLimit(obj: Dictionary, limit: number, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; export function mapValues(obj: Dictionary, iteratee: (value: T, key: string, callback: AsyncResultCallback) => void, callback: AsyncResultObjectCallback): void; export const mapValuesSeries: typeof mapValues; -export function filter(arr: T[] | IterableIterator, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; -export function filter(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; +export function filter(arr: IterableCollection, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; export const filterSeries: typeof filter; -export function filterLimit(arr: T[] | IterableIterator, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; -export function filterLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; +export function filterLimit(arr: IterableCollection, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultArrayCallback): void; export const select: typeof filter; export const selectSeries: typeof filter; export const selectLimit: typeof filterLimit; @@ -141,36 +127,28 @@ export const inject: typeof reduce; export const foldl: typeof reduce; export const reduceRight: typeof reduce; export const foldr: typeof reduce; -export function detect(arr: T[] | IterableIterator, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; -export function detect(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; +export function detect(arr: IterableCollection, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; export const detectSeries: typeof detect; -export function detectLimit(arr: T[] | IterableIterator, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; -export function detectLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; +export function detectLimit(arr: IterableCollection, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncResultCallback): void; export const find: typeof detect; export const findSeries: typeof detect; export const findLimit: typeof detectLimit; export function sortBy(arr: T[] | IterableIterator, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; -export function some(arr: T[] | IterableIterator, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; -export function some(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; +export function some(arr: IterableCollection, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; export const someSeries: typeof some; -export function someLimit(arr: T[] | IterableIterator, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; -export function someLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; +export function someLimit(arr: IterableCollection, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; export const any: typeof some; export const anySeries: typeof someSeries; export const anyLimit: typeof someLimit; -export function every(arr: T[] | IterableIterator, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; -export function every(arr: Dictionary, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; +export function every(arr: IterableCollection, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; export const everySeries: typeof every; -export function everyLimit(arr: T[] | IterableIterator, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; -export function everyLimit(arr: Dictionary, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; +export function everyLimit(arr: IterableCollection, limit: number, iterator: AsyncBooleanIterator, callback?: AsyncBooleanResultCallback): void; export const all: typeof every; export const allSeries: typeof every; export const allLimit: typeof everyLimit; -export function concat(arr: T[] | IterableIterator, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; -export function concat(arr: Dictionary, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; -export function concatLimit(arr: T[] | IterableIterator, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; -export function concatLimit(arr: Dictionary, limit: number,iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; +export function concat(arr: IterableCollection, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; +export function concatLimit(arr: IterableCollection, limit: number, iterator: AsyncResultIterator, callback?: AsyncResultArrayCallback): void; export const concatSeries: typeof concat; // Control Flow From 94a484cff48cc620df26c5625bf6545361160fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81rni=20Benedikt=20=C3=81rnason?= Date: Fri, 9 Mar 2018 17:20:33 +0100 Subject: [PATCH 052/177] Overloaded navigate method to handle new navigation options parameters --- types/react-navigation/index.d.ts | 16 +++++++++++----- .../react-navigation/react-navigation-tests.tsx | 8 ++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 2fdde0448e..50f384c34e 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -420,12 +420,18 @@ export interface NavigationEventSubscription { export interface NavigationScreenProp { state: S; dispatch: NavigationDispatch; - goBack: (routeKey?: (string | null)) => boolean; - navigate: ( - routeName: string, + goBack: (routeKey?: string | null) => boolean; + navigate(options: { + routeName: string; + params?: NavigationParams; + action?: NavigationAction; + key?: string; + }): boolean; + navigate( + routeNameOrOptions: string, params?: NavigationParams, - action?: NavigationAction - ) => boolean; + action?: NavigationAction, + ): boolean; setParams: (newParams: NavigationParams) => boolean; addListener: ( eventName: string, diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 0f68b653b1..2fcec1c53c 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -60,6 +60,7 @@ class StartScreen extends React.Component { return ( + ); } @@ -70,6 +71,13 @@ class StartScreen extends React.Component { }; this.props.navigation.navigate(ROUTE_NAME_NEXT_SCREEN, params); } + private readonly navigateDifferentlyToNextScreen = (): void => { + const params = { + id: this.props.navigation.state.params && this.props.navigation.state.params.id, + name: this.props.navigation.state.params && this.props.navigation.state.params.s, + }; + this.props.navigation.navigate({routeName: ROUTE_NAME_NEXT_SCREEN, params}); + } } const ROUTE_NAME_NEXT_SCREEN = "NextScreen"; From 994f2993af4742a8e67ff15f08236b7c1f0ad7cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81rni=20Benedikt=20=C3=81rnason?= Date: Fri, 9 Mar 2018 17:26:15 +0100 Subject: [PATCH 053/177] Revert "Overloaded navigate method to handle new navigation options parameters" This reverts commit 94a484cff48cc620df26c5625bf6545361160fce. --- types/react-navigation/index.d.ts | 16 +++++----------- .../react-navigation/react-navigation-tests.tsx | 8 -------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index 50f384c34e..2fdde0448e 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -420,18 +420,12 @@ export interface NavigationEventSubscription { export interface NavigationScreenProp { state: S; dispatch: NavigationDispatch; - goBack: (routeKey?: string | null) => boolean; - navigate(options: { - routeName: string; - params?: NavigationParams; - action?: NavigationAction; - key?: string; - }): boolean; - navigate( - routeNameOrOptions: string, + goBack: (routeKey?: (string | null)) => boolean; + navigate: ( + routeName: string, params?: NavigationParams, - action?: NavigationAction, - ): boolean; + action?: NavigationAction + ) => boolean; setParams: (newParams: NavigationParams) => boolean; addListener: ( eventName: string, diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 2fcec1c53c..0f68b653b1 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -60,7 +60,6 @@ class StartScreen extends React.Component { return ( - ); } @@ -71,13 +70,6 @@ class StartScreen extends React.Component { }; this.props.navigation.navigate(ROUTE_NAME_NEXT_SCREEN, params); } - private readonly navigateDifferentlyToNextScreen = (): void => { - const params = { - id: this.props.navigation.state.params && this.props.navigation.state.params.id, - name: this.props.navigation.state.params && this.props.navigation.state.params.s, - }; - this.props.navigation.navigate({routeName: ROUTE_NAME_NEXT_SCREEN, params}); - } } const ROUTE_NAME_NEXT_SCREEN = "NextScreen"; From 15545cb2981172ae287168ea1b6ab26a9902dbe7 Mon Sep 17 00:00:00 2001 From: Lance Ivy Date: Fri, 9 Mar 2018 08:52:04 -0800 Subject: [PATCH 054/177] add PusherStatic members --- types/pusher-js/index.d.ts | 2 ++ types/pusher-js/pusher-js-tests.ts | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/types/pusher-js/index.d.ts b/types/pusher-js/index.d.ts index a81170d09c..f73a84ee52 100644 --- a/types/pusher-js/index.d.ts +++ b/types/pusher-js/index.d.ts @@ -6,6 +6,8 @@ declare namespace pusher { interface PusherStatic { + logToConsole: boolean; + log: (msg: string) => void; new (apiKey: string, config?: Config): Pusher; } diff --git a/types/pusher-js/pusher-js-tests.ts b/types/pusher-js/pusher-js-tests.ts index dc6a9eedd7..7381c48e73 100644 --- a/types/pusher-js/pusher-js-tests.ts +++ b/types/pusher-js/pusher-js-tests.ts @@ -4,6 +4,20 @@ import { PresenceChannel } from "pusher-js"; var APP_KEY: string; var pusher: Pusher.Pusher; +/* + * samples from https://github.com/pusher/pusher-js + */ + +// +// Global Configuration +// + +Pusher.logToConsole = true; + +Pusher.log = (msg) => { + console.log(msg); +}; + // // Configuration // From 09d92860f8d6c27f4c18d6135514bb834b8bbd28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81rni=20Benedikt=20=C3=81rnason?= Date: Fri, 9 Mar 2018 17:20:33 +0100 Subject: [PATCH 055/177] Overloaded navigate method to handle new navigation options parameters --- types/react-navigation/index.d.ts | 16 +++++++++++----- .../react-navigation/react-navigation-tests.tsx | 8 ++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index c4e396783f..52b54819f6 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -399,12 +399,18 @@ export interface NavigationEventSubscription { export interface NavigationScreenProp { state: S; dispatch: NavigationDispatch; - goBack: (routeKey?: (string | null)) => boolean; - navigate: ( - routeName: string, + goBack: (routeKey?: string | null) => boolean; + navigate(options: { + routeName: string; + params?: NavigationParams; + action?: NavigationAction; + key?: string; + }): boolean; + navigate( + routeNameOrOptions: string, params?: NavigationParams, - action?: NavigationAction - ) => boolean; + action?: NavigationAction, + ): boolean; setParams: (newParams: NavigationParams) => boolean; addListener: ( eventName: string, diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index 017a9b9153..dabf0a95f5 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -58,6 +58,7 @@ class StartScreen extends React.Component { return ( + ); } @@ -68,6 +69,13 @@ class StartScreen extends React.Component { }; this.props.navigation.navigate(ROUTE_NAME_NEXT_SCREEN, params); } + private readonly navigateDifferentlyToNextScreen = (): void => { + const params = { + id: this.props.navigation.state.params && this.props.navigation.state.params.id, + name: this.props.navigation.state.params && this.props.navigation.state.params.s, + }; + this.props.navigation.navigate({routeName: ROUTE_NAME_NEXT_SCREEN, params}); + } } const ROUTE_NAME_NEXT_SCREEN = "NextScreen"; From 55ece10c58c449a6a274194119881a1484258ba6 Mon Sep 17 00:00:00 2001 From: Alexander Wilczewski Date: Fri, 9 Mar 2018 17:47:42 +0000 Subject: [PATCH 056/177] Updated otherwise to accept a string --- types/angular-route/angular-route-tests.ts | 3 ++- types/angular-route/index.d.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/types/angular-route/angular-route-tests.ts b/types/angular-route/angular-route-tests.ts index 4d596cdfdf..677c1589ed 100644 --- a/types/angular-route/angular-route-tests.ts +++ b/types/angular-route/angular-route-tests.ts @@ -40,7 +40,8 @@ $routeProvider } }) .otherwise({ redirectTo: '/' }) - .otherwise({ redirectTo: ($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) => "" }); + .otherwise({ redirectTo: ($routeParams?: ng.route.IRouteParamsService, $locationPath?: string, $locationSearch?: any) => "" }) + .otherwise("/"); var current: ng.route.ICurrentRoute; diff --git a/types/angular-route/index.d.ts b/types/angular-route/index.d.ts index 29c59f955c..56bd3f2263 100644 --- a/types/angular-route/index.d.ts +++ b/types/angular-route/index.d.ts @@ -138,7 +138,7 @@ declare module 'angular' { * * @params Mapping information to be assigned to $route.current. */ - otherwise(params: IRoute): IRouteProvider; + otherwise(params: IRoute | string): IRouteProvider; /** * Adds a new route definition to the $route service. * From 8570f5b439539e02f963db22058325e9ecf63919 Mon Sep 17 00:00:00 2001 From: Blayze Wilhelm Date: Fri, 9 Mar 2018 11:34:13 -0800 Subject: [PATCH 057/177] Sync from main repository --- types/paper/index.d.ts | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/types/paper/index.d.ts b/types/paper/index.d.ts index 3f57526a19..73e8d36636 100644 --- a/types/paper/index.d.ts +++ b/types/paper/index.d.ts @@ -1369,7 +1369,7 @@ declare module paper { * Rasterizes the item into a newly created Raster object. The item itself is not removed after rasterization. * @param resolution [optional] - the resolution of the raster in pixels per inch (DPI). If not specified, the value of view.resolution is used. default: view.resolution */ - rasterize(resolution: number): Raster; + rasterize(resolution?: number): Raster; /** * Checks whether the item's geometry contains the given point. @@ -3359,99 +3359,99 @@ declare module paper { * The view that this style belongs to. * Read only. */ - view: View; + view?: View; /** * The color of the stroke. */ - strokeColor: Color | string; + strokeColor?: Color | string; /** * The width of the stroke. */ - strokeWidth: number; + strokeWidth?: number; /** * The shape to be used at the beginning and end of open Path items, when they have a stroke. * String('round', 'square', 'butt' */ - strokeCap: string; + strokeCap?: string; /** * The shape to be used at the segments and corners of Path items when they have a stroke. * String('miter', 'round', 'bevel') */ - strokeJoin: string; + strokeJoin?: string; /** * Specifies whether the stroke is to be drawn taking the current affine transformation into account (the default behavior), or whether it should appear as a non-scaling stroke. */ - strokeScaling: boolean; + strokeScaling?: boolean; /** * The dash offset of the stroke. */ - dashOffset: number; + dashOffset?: number; /** * Specifies an array containing the dash and gap lengths of the stroke. */ - dashArray: number[]; + dashArray?: number[]; /** * The miter limit of the stroke. When two line segments meet at a sharp angle and miter joins have been specified for strokeJoin, it is possible for the miter to extend far beyond the strokeWidth of the path. The miterLimit imposes a limit on the ratio of the miter length to the strokeWidth. */ - miterLimit: number; + miterLimit?: number; /** * The fill color. */ - fillColor: Color | string; + fillColor?: Color | string; /** * The shadow color. */ - shadowColor: Color | string; + shadowColor?: Color | string; /** * The shadow's blur radius. */ - shadowBlur: number; + shadowBlur?: number; /** * The shadow's offset. */ - shadowOffset: Point; + shadowOffset?: Point; /** * The color the item is highlighted with when selected. If the item does not specify its own color, the color defined by its layer is used instead. */ - selectedColor: Color | string; + selectedColor?: Color | string; /** * The font-family to be used in text content. default 'sans-serif' */ - fontFamily: string; + fontFamily?: string; /** * The font-weight to be used in text content. */ - fontWeight: string | number; + fontWeight?: string | number; /** * The font size of text content, as {@Number} in pixels, or as {@String} with optional units 'px', 'pt' and 'em'. */ - fontSize: string | number; + fontSize?: string | number; /** * The text leading of text content. */ - leading: number | string; + leading?: number | string; /** * The justification of text paragraphs. default "left" */ - justification: string; + justification?: string; } export interface IHSBColor { From e712c102ad69f5f49875719e22bc5261cfa68122 Mon Sep 17 00:00:00 2001 From: John Barela Date: Fri, 9 Mar 2018 14:31:21 -0700 Subject: [PATCH 058/177] Update signature to enable responses to be used in the middleware. --- types/express-graphql/express-graphql-tests.ts | 4 ++-- types/express-graphql/index.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/express-graphql/express-graphql-tests.ts b/types/express-graphql/express-graphql-tests.ts index 482b15c186..6fdfc0d945 100644 --- a/types/express-graphql/express-graphql-tests.ts +++ b/types/express-graphql/express-graphql-tests.ts @@ -14,13 +14,13 @@ const graphqlOption: graphqlHTTP.OptionsObj = { extensions: (args) => { } }; -const graphqlOptionRequest = (request: express.Request): graphqlHTTP.OptionsObj => ({ +const graphqlOptionRequest = (request: express.Request, response: express.Response): graphqlHTTP.OptionsObj => ({ graphiql: true, schema: schema, context: request.session }); -const graphqlOptionRequestAsync = async (request: express.Request): Promise => { +const graphqlOptionRequestAsync = async (request: express.Request, response: express.Response): Promise => { return { graphiql: true, schema: await Promise.resolve(schema), diff --git a/types/express-graphql/index.d.ts b/types/express-graphql/index.d.ts index 166bdae6e7..ade08f1729 100644 --- a/types/express-graphql/index.d.ts +++ b/types/express-graphql/index.d.ts @@ -16,7 +16,7 @@ declare namespace graphqlHTTP { * Used to configure the graphQLHTTP middleware by providing a schema * and other configuration options. */ - export type Options = ((req: Request) => OptionsObj) | ((req: Request) => Promise) | OptionsObj + export type Options = ((req: Request, res: Response) => OptionsObj) | ((req: Request, res: Response) => Promise) | OptionsObj export type OptionsObj = { /** * A GraphQL schema from graphql-js. From 8832145d26522e154185d3af5672e1ba4c9c99b7 Mon Sep 17 00:00:00 2001 From: Jared Szechy Date: Fri, 9 Mar 2018 17:03:48 -0500 Subject: [PATCH 059/177] [plotly.js] Add several missing interfaces from latest version --- types/plotly.js/index.d.ts | 422 ++++++++++++++++++++++++++++++------- 1 file changed, 342 insertions(+), 80 deletions(-) diff --git a/types/plotly.js/index.d.ts b/types/plotly.js/index.d.ts index 97d439c504..225afd8c38 100644 --- a/types/plotly.js/index.d.ts +++ b/types/plotly.js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for plotly.js 1.28 +// Type definitions for plotly.js 1.35 // Project: https://plot.ly/javascript/ // Definitions by: Chris Gervang // Martin Duparc @@ -25,9 +25,14 @@ export interface Point { } export interface PlotScatterDataPoint { - pointNumber: number; - curveNumber: number; - data: ScatterData; + curveNumber: number; + data: ScatterData; + pointIndex: number; + pointNumber: number; + x: number; + xaxis: LayoutAxis; + y: number; + yaxis: LayoutAxis; } export interface PlotMouseEvent { @@ -106,6 +111,7 @@ export function extendTraces(root: Root, update: Data | Data[], indices: number export function prependTraces(root: Root, update: Data | Data[], indices: number | number[]): Promise; export function toImage(root: Root, opts: ToImgopts): Promise; export function downloadImage(root: Root, opts: DownloadImgopts): Promise; +export function react(root: Root, data: Data[], layout?: Partial, config?: Partial): Promise; // Layout export interface Layout { @@ -113,7 +119,7 @@ export interface Layout { titlefont: Partial; autosize: boolean; showlegend: boolean; - paper_bgcolor: Color; + paper_bgcolor: Color; plot_bgcolor: Color; separators: string; hidesources: boolean; @@ -132,7 +138,7 @@ export interface Layout { width: number; hovermode: 'closest' | 'x' | 'y' | false; hoverlabel: Partial
). Tags , , + * are also supported. + */ + text: string; + + /** Sets the angle at which the `text` is drawn with respect to the horizontal. */ + textangle: string; + + /** + * Sets an explicit width for the text box. null (default) lets the + * text set the box width. Wider text will be clipped. + * There is no automatic wrapping; use
to start a new line. + */ + width: number; + + /** + * Sets an explicit height for the text box. null (default) lets the + * text set the box height. Taller text will be clipped. + */ + height: number; + + /** Sets the opacity of the annotation (text + arrow). */ + opacity: number; + + /** + * Sets the horizontal alignment of the `text` within the box. + * Has an effect only if `text` spans more two or more lines + * (i.e. `text` contains one or more
HTML tags) or if an + * explicit width is set to override the text width. + */ + align: 'left' | 'center' | 'right'; + + /** + * Sets the vertical alignment of the `text` within the box. + * Has an effect only if an explicit height is set to override the text height. + */ + valign: 'top' | 'middle' | 'bottom'; + + /** Sets the padding (in px) between the `text` and the enclosing border. */ + borderpad: number; + + /** Sets the width (in px) of the border enclosing the annotation `text`. */ + borderwidth: number; + + /** + * Determines whether or not the annotation is drawn with an arrow. + * If *true*, `text` is placed near the arrow's tail. + * If *false*, `text` lines up with the `x` and `y` provided. + */ + showarrow: boolean; + + /** Sets the color of the annotation arrow. */ + arrowcolor: string; + + /** Sets the end annotation arrow head style. */ + arrowhead: number; + + /** Sets the start annotation arrow head style. */ + startarrowhead: number; + + /** Sets the annotation arrow head position. */ + arrowside: 'end' | 'start'; + + /** + * Sets the size of the end annotation arrow head, relative to `arrowwidth`. + * A value of 1 (default) gives a head about 3x as wide as the line. + */ + arrowsize: number; + + /** + * Sets the size of the start annotation arrow head, relative to `arrowwidth`. + * A value of 1 (default) gives a head about 3x as wide as the line. + */ + startarrowsize: number; + + /** Sets the width (in px) of annotation arrow line. */ + arrowwidth: number; + + /** + * Sets a distance, in pixels, to move the end arrowhead away from the + * position it is pointing at, for example to point at the edge of + * a marker independent of zoom. Note that this shortens the arrow + * from the `ax` / `ay` vector, in contrast to `xshift` / `yshift` + * which moves everything by this amount. + */ + standoff: number; + + /** + * Sets a distance, in pixels, to move the start arrowhead away from the + * position it is pointing at, for example to point at the edge of + * a marker independent of zoom. Note that this shortens the arrow + * from the `ax` / `ay` vector, in contrast to `xshift` / `yshift` + * which moves everything by this amount. + */ + startstandoff: number; + + /** + * Sets the x component of the arrow tail about the arrow head. + * If `axref` is `pixel`, a positive (negative) + * component corresponds to an arrow pointing + * from right to left (left to right). + * If `axref` is an axis, this is an absolute value on that axis, + * like `x`, NOT a relative value. + */ + ax: number; + + /** + * Sets the y component of the arrow tail about the arrow head. + * If `ayref` is `pixel`, a positive (negative) + * component corresponds to an arrow pointing + * from bottom to top (top to bottom). + * If `ayref` is an axis, this is an absolute value on that axis, + * like `y`, NOT a relative value. + */ + ay: number; + + /** + * Indicates in what terms the tail of the annotation (ax,ay) + * is specified. If `pixel`, `ax` is a relative offset in pixels + * from `x`. If set to an x axis id (e.g. *x* or *x2*), `ax` is + * specified in the same terms as that axis. This is useful + * for trendline annotations which should continue to indicate + * the correct trend when zoomed. + */ + axref: 'pixel'; + + /** + * Indicates in what terms the tail of the annotation (ax,ay) + * is specified. If `pixel`, `ay` is a relative offset in pixels + * from `y`. If set to a y axis id (e.g. *y* or *y2*), `ay` is + * specified in the same terms as that axis. This is useful + * for trendline annotations which should continue to indicate + * the correct trend when zoomed. + */ + ayref: 'pixel'; + + /** + * Sets the annotation's x coordinate axis. + * If set to an x axis id (e.g. *x* or *x2*), the `x` position refers to an x coordinate + * If set to *paper*, the `x` position refers to the distance from + * the left side of the plotting area in normalized coordinates + * where 0 (1) corresponds to the left (right) side. + */ + xref: 'paper' | 'x'; + + /** + * Sets the annotation's x position. + * If the axis `type` is *log*, then you must take the log of your desired range. + * If the axis `type` is *date*, it should be date strings, like date data, + * though Date objects and unix milliseconds will be accepted and converted to strings. + * If the axis `type` is *category*, it should be numbers, using the scale where each + * category is assigned a serial number from zero in the order it appears. + */ + x: number | string; + + /** + * Sets the text box's horizontal position anchor + * This anchor binds the `x` position to the *left*, *center* or *right* of the annotation. + * For example, if `x` is set to 1, `xref` to *paper* and `xanchor` to *right* then the + * right-most portion of the annotation lines up with the right-most edge of the plotting area. + * If *auto*, the anchor is equivalent to *center* for data-referenced annotations or if there + * is an arrow, whereas for paper-referenced with no arrow, the anchor picked corresponds to the closest side. + */ + xanchor: 'auto' | 'left' | 'center' | 'right'; + + /** + * Shifts the position of the whole annotation and arrow to the + * right (positive) or left (negative) by this many pixels. + */ + xshift: number; + + /** + * Sets the annotation's y coordinate axis. + * If set to an y axis id (e.g. *y* or *y2*), the `y` position refers to an y coordinate + * If set to *paper*, the `y` position refers to the distance from + * the bottom of the plotting area in normalized coordinates + * where 0 (1) corresponds to the bottom (top). + */ + yref: 'paper' | 'y'; + + /** + * Sets the annotation's y position. + * If the axis `type` is *log*, then you must take the log of your desired range. + * If the axis `type` is *date*, it should be date strings, like date data, + * though Date objects and unix milliseconds will be accepted and converted to strings. + * If the axis `type` is *category*, it should be numbers, using the scale where each + * category is assigned a serial number from zero in the order it appears. + */ + y: number | string; + + /** + * Sets the text box's vertical position anchor + * This anchor binds the `y` position to the *top*, *middle* or *bottom* of the annotation. + * For example, if `y` is set to 1, `yref` to *paper* and `yanchor` to *top* then the + * top-most portion of the annotation lines up with the top-most edge of the plotting area. + * If *auto*, the anchor is equivalent to *middle* for data-referenced annotations or if + * there is an arrow, whereas for paper-referenced with no arrow, the anchor picked + * corresponds to the closest side. + */ + yanchor: 'auto' | 'top' | 'middle' | 'bottom'; + + /** + * Shifts the position of the whole annotation and arrow up + * (positive) or down (negative) by this many pixels. + */ + yshift: number; + + /** + * Makes this annotation respond to clicks on the plot. + * If you click a data point that exactly matches the `x` and `y` values of this annotation, + * and it is hidden (visible: false), it will appear. In *onoff* mode, you must click the same + * point again to make it disappear, so if you click multiple points, you can show multiple + * annotations. In *onout* mode, a click anywhere else in the plot (on another data point or not) + * will hide this annotation. If you need to show/hide this annotation in response to different + * `x` or `y` values, you can set `xclick` and/or `yclick`. This is useful for example to label + * the side of a bar. To label markers though, `standoff` is preferred over `xclick` and `yclick`. + */ + clicktoshow: false | 'onoff' | 'onout'; + + /** + * Toggle this annotation when clicking a data point whose `x` value + * is `xclick` rather than the annotation's `x` value. + */ + xclick: any; + + /** + * Toggle this annotation when clicking a data point whose `y` value + * is `yclick` rather than the annotation's `y` value. + */ + yclick: any; + + /** + * Sets text to appear when hovering over this annotation. + * If omitted or blank, no hover label will appear. + */ + hovertext: string; + + hoverlabel: Partial