Merge remote-tracking branch 'root/master'

This commit is contained in:
Jacob Gardner
2019-02-27 10:26:46 -06:00
457 changed files with 17188 additions and 10986 deletions
+42
View File
@@ -396,6 +396,12 @@
"sourceRepoURL": "https://github.com/date-fns/date-fns",
"asOfVersion": "2.6.0"
},
{
"libraryName": "dd-trace",
"typingsPackageName": "dd-trace",
"sourceRepoURL": "https://github.com/DataDog/dd-trace-js",
"asOfVersion": "0.9.0"
},
{
"libraryName": "decimal.js",
"typingsPackageName": "decimal.js",
@@ -414,6 +420,12 @@
"sourceRepoURL": "https://github.com/sindresorhus/delay",
"asOfVersion": "3.1.0"
},
{
"libraryName": "detect-browser",
"typingsPackageName": "detect-browser",
"sourceRepoURL": "https://github.com/DamonOehlman/detect-browser",
"asOfVersion": "4.0.0"
},
{
"libraryName": "DevExtreme",
"typingsPackageName": "devextreme",
@@ -726,6 +738,12 @@
"sourceRepoURL": "https://github.com/prettymuchbryce/node-http-status",
"asOfVersion": "1.2.0"
},
{
"libraryName": "i18next-browser-languagedetector",
"typingsPackageName": "i18next-browser-languagedetector",
"sourceRepoURL": "https://github.com/i18next/i18next-browser-languagedetector",
"asOfVersion": "3.0.0"
},
{
"libraryName": "i18next-xhr-backend",
"typingsPackageName": "i18next-xhr-backend",
@@ -762,6 +780,12 @@
"sourceRepoURL": "https://github.com/taye/interact.js",
"asOfVersion": "1.3.0"
},
{
"libraryName": "internal-ip",
"typingsPackageName": "internal-ip",
"sourceRepoURL": "https://github.com/sindresorhus/internal-ip",
"asOfVersion": "4.1.0"
},
{
"libraryName": "inversify",
"typingsPackageName": "inversify",
@@ -1116,6 +1140,18 @@
"sourceRepoURL": "http://onsen.io",
"asOfVersion": "2.0.0"
},
{
"libraryName": "p-map",
"typingsPackageName": "p-map",
"sourceRepoURL": "https://github.com/sindresorhus/p-map",
"asOfVersion": "2.0.0"
},
{
"libraryName": "p-throttle",
"typingsPackageName": "p-throttle",
"sourceRepoURL": "https://github.com/sindresorhus/p-throttle",
"asOfVersion": "2.1.0"
},
{
"libraryName": "param-case",
"typingsPackageName": "param-case",
@@ -1644,6 +1680,12 @@
"sourceRepoURL": "http://gcanti.github.io/tcomb/guide/index.html",
"asOfVersion": "2.6.0"
},
{
"libraryName": "terser",
"typingsPackageName": "terser",
"sourceRepoURL": "https://github.com/terser-js/terser",
"asOfVersion": "3.12.0"
},
{
"libraryName": "timezonecomplete",
"typingsPackageName": "timezonecomplete",
+1 -1
View File
@@ -21,7 +21,7 @@
"lint": "dtslint types"
},
"devDependencies": {
"dtslint": "github:Microsoft/dtslint#production",
"dtslint": "latest",
"types-publisher": "github:Microsoft/types-publisher#production"
},
"dependencies": {}
@@ -97,6 +97,7 @@ let _algoliaIndexSettings: IndexSettings = {
minProximity: 0,
placeholders: { '': [''] },
camelCaseAttributes: [''],
sortFacetValuesBy: 'count',
};
let _algoliaQueryParameters: QueryParameters = {
@@ -150,6 +151,7 @@ let _algoliaQueryParameters: QueryParameters = {
synonyms: true,
replaceSynonymsInHighlight: false,
minProximity: 0,
sortFacetValuesBy: 'alpha',
};
let client: Client = algoliasearch('', '');
+19 -11
View File
@@ -5,6 +5,7 @@
// Aurélien Hervé <https://github.com/aherve>
// Samuel Vaillant <https://github.com/samouss>
// Kai Eichinger <https://github.com/keichinger>
// Nery Ortez <https://github.com/neryortez>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -24,25 +25,25 @@ declare namespace algoliasearch {
* Query on multiple index
* https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries
*/
search(
search<T=any>(
queries: {
indexName: string;
query: string;
params: QueryParameters;
}[],
cb: (err: Error, res: MultiResponse) => void
cb: (err: Error, res: MultiResponse<T>) => void
): void;
/**
* Query on multiple index
* https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries
*/
search(
search<T=any>(
queries: {
indexName: string;
query: string;
params: QueryParameters;
}[]
): Promise<MultiResponse>;
): Promise<MultiResponse<T>>;
/**
* Query for facet values of a specific facet
*/
@@ -590,14 +591,14 @@ declare namespace algoliasearch {
* Search in an index
* https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search
*/
search(params: QueryParameters): Promise<Response>;
search<T=any>(params: QueryParameters): Promise<Response<T>>;
/**
* Search in an index
* https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search
*/
search(
search<T=any>(
params: QueryParameters,
cb: (err: Error, res: Response) => void
cb: (err: Error, res: Response<T>) => void
): void;
/**
* Search in an index
@@ -1451,6 +1452,11 @@ declare namespace algoliasearch {
nbShards?: number;
userData?: string | object;
/**
* https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/
*/
sortFacetValuesBy?: 'count' | 'alpha';
}
namespace SearchForFacetValues {
@@ -1776,14 +1782,16 @@ declare namespace algoliasearch {
https://www.algolia.com/doc/api-reference/api-parameters/camelCaseAttributes/
*/
camelCaseAttributes?: string[];
sortFacetValuesBy?: 'count' | 'alpha';
}
interface Response {
interface Response<T=any> {
/**
* Contains all the hits matching the query
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
*/
hits: any[];
hits: T[];
/**
* Current page
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
@@ -1842,8 +1850,8 @@ declare namespace algoliasearch {
cursor?: string;
}
interface MultiResponse {
results: Response[];
interface MultiResponse<T=any> {
results: Response<T>[];
}
}
+17 -11
View File
@@ -6,6 +6,7 @@
// Samuel Vaillant <https://github.com/samouss>
// Claas Brüggemann <https://github.com/ClaasBrueggemann>
// Kai Eichinger <https://github.com/keichinger>
// Nery Ortez <https://github.com/neryortez>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
@@ -25,25 +26,25 @@ declare namespace algoliasearch {
* Query on multiple index
* https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries
*/
search(
search<T=any>(
queries: {
indexName: string;
query: string;
params: QueryParameters;
}[],
cb: (err: Error, res: MultiResponse) => void
cb: (err: Error, res: MultiResponse<T>) => void
): void;
/**
* Query on multiple index
* https://github.com/algolia/algoliasearch-client-js#multiple-queries---multiplequeries
*/
search(
search<T=any>(
queries: {
indexName: string;
query: string;
params: QueryParameters;
}[]
): Promise<MultiResponse>;
): Promise<MultiResponse<T>>;
/**
* Query for facet values of a specific facet
*/
@@ -109,15 +110,15 @@ declare namespace algoliasearch {
* Search in an index
* https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search
*/
search(
search<T=any>(
params: QueryParameters,
cb: (err: Error, res: Response) => void
cb: (err: Error, res: Response<T>) => void
): void;
/**
* Search in an index
* https://github.com/algolia/algoliasearch-client-js#search-in-an-index---search
*/
search(params: QueryParameters): Promise<Response>;
search<T=any>(params: QueryParameters): Promise<Response<T>>;
/**
* Search in an index
* https://www.algolia.com/doc/api-reference/api-methods/search-for-facet-values/
@@ -531,6 +532,11 @@ declare namespace algoliasearch {
nbShards?: number;
userData?: string | object;
/**
* https://www.algolia.com/doc/api-reference/api-parameters/sortFacetValuesBy/
*/
sortFacetValuesBy?: 'count' | 'alpha';
}
namespace SearchForFacetValues {
@@ -552,12 +558,12 @@ declare namespace algoliasearch {
}
}
interface Response {
interface Response<T=any> {
/**
* Contains all the hits matching the query
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
*/
hits: any[];
hits: T[];
/**
* Current page
* https://www.algolia.com/doc/api-reference/api-methods/search/?language=javascript#response
@@ -616,8 +622,8 @@ declare namespace algoliasearch {
cursor?: string;
}
interface MultiResponse {
results: Response[];
interface MultiResponse<T=any> {
results: Response<T>[];
}
}
+1 -1
View File
@@ -346,7 +346,7 @@ declare module 'angular' {
interface IMenuService {
close(): void;
hide(response?: any, options?: any): IPromise<any>;
open(event?: MouseEvent): void;
open(event?: MouseEvent | JQueryEventObject): void;
}
interface IColorPalette {
+30 -1
View File
@@ -1,6 +1,12 @@
// near copy of each of the tests from https://github.com/nodeca/argparse/tree/master/examples
import { ArgumentParser, RawDescriptionHelpFormatter } from 'argparse';
import {
ArgumentParser,
RawDescriptionHelpFormatter,
Action,
ActionConstructorOptions,
Namespace,
} from 'argparse';
let args: any;
const simpleExample = new ArgumentParser({
@@ -276,3 +282,26 @@ group.addArgument(['--bar'], {
help: 'bar help'
});
formatterExample.printHelp();
class CustomAction1 extends Action {
constructor(options: ActionConstructorOptions) {
super(options);
}
call(parser: ArgumentParser, namespace: Namespace, values: string | string[], optionString: string | null) {
console.log('custom action 1');
}
}
class CustomAction2 extends Action {
call(parser: ArgumentParser, namespace: Namespace, values: string | string[], optionString: string | null) {
console.log('custom action 2');
}
}
const customActionExample = new ArgumentParser({ addHelp: false });
customActionExample.addArgument('--abc', {
action: CustomAction1,
});
customActionExample.addArgument('--def', {
action: CustomAction2,
});
+13 -1
View File
@@ -3,6 +3,7 @@
// Definitions by: Andrew Schurman <https://github.com/arcticwaters>
// Tomasz Łaziuk <https://github.com/tlaziuk>
// Sebastian Silbermann <https://github.com/eps1lon>
// Kannan Goundan <https://github.com/cakoose>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -79,13 +80,24 @@ export interface ArgumentGroupOptions {
description?: string;
}
export abstract class Action {
protected dest: string;
constructor(options: ActionConstructorOptions);
abstract call(parser: ArgumentParser, namespace: Namespace, values: string | string[], optionString: string | null): void;
}
// Passed to the Action constructor. Subclasses are just expected to relay this to
// the super() constructor, so using an "opaque type" pattern is probably fine.
// Someone may want to fill this out in the future.
export type ActionConstructorOptions = number & {_: 'ActionConstructorOptions'};
export class HelpFormatter { }
export class ArgumentDefaultsHelpFormatter { }
export class RawDescriptionHelpFormatter { }
export class RawTextHelpFormatter { }
export interface ArgumentOptions {
action?: string;
action?: string | { new(options: ActionConstructorOptions): Action };
optionStrings?: string[];
dest?: string;
nargs?: string | number;
+1 -1
View File
@@ -21,4 +21,4 @@
"index.d.ts",
"argparse-tests.ts"
]
}
}
@@ -101,3 +101,50 @@ const thingShadows = new awsIot.thingShadow({
thingShadows.on("timeout", function(thingName: string, clientToken: string) {
});
const jobs = new awsIot.jobs({
keyPath: "",
certPath: "",
caPath: "",
clientId: "",
region: "",
baseReconnectTimeMs: 1000,
protocol: "wss",
port: 443,
host: "",
debug: false
});
jobs.subscribeToJobs("thingname", "operationname", (err, job) => {
console.error("Error", err);
if (err || !job) {
return;
}
console.log("job id", job.id);
console.log("job info", job.document);
console.log("job op", job.operation);
console.log("job status", job.status);
console.log("job status details", job.status.statusDetails);
console.log(
"job status details progress",
job.status.statusDetails.progress
);
job.inProgress({ progress: "1" }, err =>
console.error("Job progress error", err)
);
job.failed({ progress: "2" }, err =>
console.error("Job failed error", err)
);
job.succeeded({ progress: "3" }, err =>
console.error("Job failed error", err)
);
});
jobs.startJobNotifications("thingname", err =>
console.error("Start job notification error", err)
);
jobs.unsubscribeFromJobs("thingname", "operationame", err =>
console.error("Unsubscribe from jobs error", err)
);
+113 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for aws-iot-device-sdk 2.1.0
// Type definitions for aws-iot-device-sdk 2.2.0
// Project: https://github.com/aws/aws-iot-device-sdk-js
// Definitions by: Markus Olsson <https://github.com/niik>
// Margus Lamp <https://github.com/mlamp>
@@ -391,3 +391,115 @@ export class thingShadow extends NodeJS.EventEmitter {
/** Emitted when a different client"s update or delete operation is accepted on the shadow. */
on(event: "foreignStateChange", listener: (thingName: string, operation: "update" | "delete", stateObject: any) => void): this;
}
export interface statusDetails {
progress: string;
}
export interface jobStatus {
status: string;
statusDetails: statusDetails;
}
export interface jobDocument {
[key: string]: any
}
export interface job {
/** Object that contains job execution information and functions for updating job execution status. */
/** Returns the job id. */
id: string;
/**
* The JSON document describing details of the job to be executed eg.
* {
* "operation": "install",
* "otherProperty": "value",
* ...
* }
*/
document: jobDocument;
/**
* Returns the job operation from the job document. Eg. 'install', 'reboot', etc.
*/
operation: string;
/**
* Returns the current job status according to AWS Orchestra.
*/
status: jobStatus;
/**
* Update the status of the job execution to be IN_PROGRESS for the thing associated with the job.
*
* @param statusDetails - optional document describing the status details of the in progress job
* @param callback - function(err) optional callback for when the operation completes, err is null if no error occurred
*/
inProgress(statusDetails?: statusDetails, callback?: (err: Error) => void): void;
/**
* Update the status of the job execution to be FAILED for the thing associated with the job.
*
* @param statusDetails - optional document describing the status details of the in progress job e.g.
* @param callback - function(err) optional callback for when the operation completes, err is null if no error occurred
*/
failed(statusDetails?: statusDetails, callback?: (err: Error) => void): void;
/**
* Update the status of the job execution to be SUCCESS for the thing associated with the job.
*
* @param statusDetails - optional document describing the status details of the in progress job e.g.
* @param callback - function(err) optional callback for when the operation completes, err is null if no error occurred
*/
succeeded(statusDetails?: statusDetails, callback?: (err: Error) => void): void;
}
export class jobs extends device {
/**
* The `jobs` class wraps an instance of the `device` class with additional functionality to
* handle job execution management through the AWS IoT Jobs platform. Arguments in `deviceOptions`
* are the same as those in the device class and the `jobs` class supports all of the
* same events and functions as the `device` class.
*/
constructor(options?: DeviceOptions);
/**
* Subscribes to job execution notifications for the thing named `thingName`. If
* `operationName` is specified then the callback will only be called when a job
* ready for execution contains a property called `operation` in its job document with
* a value matching `operationName`. If `operationName` is omitted then the callback
* will be called for every job ready for execution that does not match another
* `subscribeToJobs` subscription.
*
* @param thingName - name of the Thing to receive job execution notifications
* @param operationName - optionally filter job execution notifications to jobs with a value
* for the `operation` property that matches `operationName
* @param callback - function (err, job) callback for when a job execution is ready for processing or an error occurs
* - `err` a subscription error or an error that occurs when client is disconnecting
* - `job` an object that contains job execution information and functions for updating job execution status.
*/
subscribeToJobs(thingName: string, operationName: string, callback?: (err: Error, job: job) => void): void;
/**
* Causes any existing queued job executions for the given thing to be published
* to the appropriate subscribeToJobs handler. Only needs to be called once per thing.
*
* @param thingName - name of the Thing to cancel job execution notifications for
* @param callback - function (err) callback for when the startJobNotifications operation completes
*/
startJobNotifications(thingName: string, callback: (error: Error) => void): mqtt.Client;
/**
* Unsubscribes from job execution notifications for the thing named `thingName` having
* operations with a value of the given `operationName`. If `operationName` is omitted then
* the default handler for the thing with the given name is unsubscribed.
*
* @param thingName - name of the Thing to cancel job execution notifications for
* @param operationName - optional name of previously subscribed operation names
* @param callback - function (err) callback for when the unsubscribe operation completes
*/
unsubscribeFromJobs(thingName: string, operationName: string, callback: (err: Error) => void): void;
}
+6
View File
@@ -53,6 +53,12 @@ traverse(ast, {
}
});
// Node type checks
t.isIdentifier(t.identifier("id"));
t.isIdentifier(exp);
t.isIdentifier(null);
t.isIdentifier(undefined);
// TypeScript Types
// TODO: Test all variants of these functions' signatures
+464 -464
View File
@@ -1514,246 +1514,246 @@ export function TSUndefinedKeyword(): TSUndefinedKeyword;
export function TSUnionType(types: TSType[]): TSUnionType;
export function TSVoidKeyword(): TSVoidKeyword;
export function isArrayExpression(node: object, opts?: object): node is ArrayExpression;
export function isAssignmentExpression(node: object, opts?: object): node is AssignmentExpression;
export function isBinaryExpression(node: object, opts?: object): node is BinaryExpression;
export function isDirective(node: object, opts?: object): node is Directive;
export function isDirectiveLiteral(node: object, opts?: object): node is DirectiveLiteral;
export function isBlockStatement(node: object, opts?: object): node is BlockStatement;
export function isBreakStatement(node: object, opts?: object): node is BreakStatement;
export function isCallExpression(node: object, opts?: object): node is CallExpression;
export function isCatchClause(node: object, opts?: object): node is CatchClause;
export function isConditionalExpression(node: object, opts?: object): node is ConditionalExpression;
export function isContinueStatement(node: object, opts?: object): node is ContinueStatement;
export function isDebuggerStatement(node: object, opts?: object): node is DebuggerStatement;
export function isDoWhileStatement(node: object, opts?: object): node is DoWhileStatement;
export function isEmptyStatement(node: object, opts?: object): node is EmptyStatement;
export function isExpressionStatement(node: object, opts?: object): node is ExpressionStatement;
export function isFile(node: object, opts?: object): node is File;
export function isForInStatement(node: object, opts?: object): node is ForInStatement;
export function isForStatement(node: object, opts?: object): node is ForStatement;
export function isFunctionDeclaration(node: object, opts?: object): node is FunctionDeclaration;
export function isFunctionExpression(node: object, opts?: object): node is FunctionExpression;
export function isIdentifier(node: object, opts?: object): node is Identifier;
export function isIfStatement(node: object, opts?: object): node is IfStatement;
export function isLabeledStatement(node: object, opts?: object): node is LabeledStatement;
export function isStringLiteral(node: object, opts?: object): node is StringLiteral;
export function isNumericLiteral(node: object, opts?: object): node is NumericLiteral;
export function isNullLiteral(node: object, opts?: object): node is NullLiteral;
export function isBooleanLiteral(node: object, opts?: object): node is BooleanLiteral;
export function isRegExpLiteral(node: object, opts?: object): node is RegExpLiteral;
export function isLogicalExpression(node: object, opts?: object): node is LogicalExpression;
export function isMemberExpression(node: object, opts?: object): node is MemberExpression;
export function isNewExpression(node: object, opts?: object): node is NewExpression;
export function isProgram(node: object, opts?: object): node is Program;
export function isObjectExpression(node: object, opts?: object): node is ObjectExpression;
export function isObjectMethod(node: object, opts?: object): node is ObjectMethod;
export function isObjectProperty(node: object, opts?: object): node is ObjectProperty;
export function isRestElement(node: object, opts?: object): node is RestElement;
export function isReturnStatement(node: object, opts?: object): node is ReturnStatement;
export function isSequenceExpression(node: object, opts?: object): node is SequenceExpression;
export function isSwitchCase(node: object, opts?: object): node is SwitchCase;
export function isSwitchStatement(node: object, opts?: object): node is SwitchStatement;
export function isThisExpression(node: object, opts?: object): node is ThisExpression;
export function isThrowStatement(node: object, opts?: object): node is ThrowStatement;
export function isTryStatement(node: object, opts?: object): node is TryStatement;
export function isUnaryExpression(node: object, opts?: object): node is UnaryExpression;
export function isUpdateExpression(node: object, opts?: object): node is UpdateExpression;
export function isVariableDeclaration(node: object, opts?: object): node is VariableDeclaration;
export function isVariableDeclarator(node: object, opts?: object): node is VariableDeclarator;
export function isWhileStatement(node: object, opts?: object): node is WhileStatement;
export function isWithStatement(node: object, opts?: object): node is WithStatement;
export function isAssignmentPattern(node: object, opts?: object): node is AssignmentPattern;
export function isArrayPattern(node: object, opts?: object): node is ArrayPattern;
export function isArrowFunctionExpression(node: object, opts?: object): node is ArrowFunctionExpression;
export function isClassBody(node: object, opts?: object): node is ClassBody;
export function isClassDeclaration(node: object, opts?: object): node is ClassDeclaration;
export function isClassExpression(node: object, opts?: object): node is ClassExpression;
export function isExportAllDeclaration(node: object, opts?: object): node is ExportAllDeclaration;
export function isExportDefaultDeclaration(node: object, opts?: object): node is ExportDefaultDeclaration;
export function isExportNamedDeclaration(node: object, opts?: object): node is ExportNamedDeclaration;
export function isExportSpecifier(node: object, opts?: object): node is ExportSpecifier;
export function isForOfStatement(node: object, opts?: object): node is ForOfStatement;
export function isImportDeclaration(node: object, opts?: object): node is ImportDeclaration;
export function isImportDefaultSpecifier(node: object, opts?: object): node is ImportDefaultSpecifier;
export function isImportNamespaceSpecifier(node: object, opts?: object): node is ImportNamespaceSpecifier;
export function isImportSpecifier(node: object, opts?: object): node is ImportSpecifier;
export function isMetaProperty(node: object, opts?: object): node is MetaProperty;
export function isClassMethod(node: object, opts?: object): node is ClassMethod;
export function isObjectPattern(node: object, opts?: object): node is ObjectPattern;
export function isSpreadElement(node: object, opts?: object): node is SpreadElement;
export function isSuper(node: object, opts?: object): node is Super;
export function isTaggedTemplateExpression(node: object, opts?: object): node is TaggedTemplateExpression;
export function isTemplateElement(node: object, opts?: object): node is TemplateElement;
export function isTemplateLiteral(node: object, opts?: object): node is TemplateLiteral;
export function isYieldExpression(node: object, opts?: object): node is YieldExpression;
export function isAnyTypeAnnotation(node: object, opts?: object): node is AnyTypeAnnotation;
export function isArrayTypeAnnotation(node: object, opts?: object): node is ArrayTypeAnnotation;
export function isBooleanTypeAnnotation(node: object, opts?: object): node is BooleanTypeAnnotation;
export function isBooleanLiteralTypeAnnotation(node: object, opts?: object): node is BooleanLiteralTypeAnnotation;
export function isNullLiteralTypeAnnotation(node: object, opts?: object): node is NullLiteralTypeAnnotation;
export function isClassImplements(node: object, opts?: object): node is ClassImplements;
export function isClassProperty(node: object, opts?: object): node is ClassProperty;
export function isDeclareClass(node: object, opts?: object): node is DeclareClass;
export function isDeclareFunction(node: object, opts?: object): node is DeclareFunction;
export function isDeclareInterface(node: object, opts?: object): node is DeclareInterface;
export function isDeclareModule(node: object, opts?: object): node is DeclareModule;
export function isDeclareTypeAlias(node: object, opts?: object): node is DeclareTypeAlias;
export function isDeclareVariable(node: object, opts?: object): node is DeclareVariable;
export function isExistentialTypeParam(node: object, opts?: object): node is ExistentialTypeParam;
export function isFunctionTypeAnnotation(node: object, opts?: object): node is FunctionTypeAnnotation;
export function isFunctionTypeParam(node: object, opts?: object): node is FunctionTypeParam;
export function isGenericTypeAnnotation(node: object, opts?: object): node is GenericTypeAnnotation;
export function isInterfaceExtends(node: object, opts?: object): node is InterfaceExtends;
export function isInterfaceDeclaration(node: object, opts?: object): node is InterfaceDeclaration;
export function isIntersectionTypeAnnotation(node: object, opts?: object): node is IntersectionTypeAnnotation;
export function isMixedTypeAnnotation(node: object, opts?: object): node is MixedTypeAnnotation;
export function isNullableTypeAnnotation(node: object, opts?: object): node is NullableTypeAnnotation;
export function isNumericLiteralTypeAnnotation(node: object, opts?: object): node is NumericLiteralTypeAnnotation;
export function isNumberTypeAnnotation(node: object, opts?: object): node is NumberTypeAnnotation;
export function isStringLiteralTypeAnnotation(node: object, opts?: object): node is StringLiteralTypeAnnotation;
export function isStringTypeAnnotation(node: object, opts?: object): node is StringTypeAnnotation;
export function isThisTypeAnnotation(node: object, opts?: object): node is ThisTypeAnnotation;
export function isTupleTypeAnnotation(node: object, opts?: object): node is TupleTypeAnnotation;
export function isTypeofTypeAnnotation(node: object, opts?: object): node is TypeofTypeAnnotation;
export function isTypeAlias(node: object, opts?: object): node is TypeAlias;
export function isTypeAnnotation(node: object, opts?: object): node is TypeAnnotation;
export function isTypeCastExpression(node: object, opts?: object): node is TypeCastExpression;
export function isTypeParameter(node: object, opts?: object): node is TypeParameter;
export function isTypeParameterDeclaration(node: object, opts?: object): node is TypeParameterDeclaration;
export function isTypeParameterInstantiation(node: object, opts?: object): node is TypeParameterInstantiation;
export function isObjectTypeAnnotation(node: object, opts?: object): node is ObjectTypeAnnotation;
export function isObjectTypeCallProperty(node: object, opts?: object): node is ObjectTypeCallProperty;
export function isObjectTypeIndexer(node: object, opts?: object): node is ObjectTypeIndexer;
export function isObjectTypeProperty(node: object, opts?: object): node is ObjectTypeProperty;
export function isQualifiedTypeIdentifier(node: object, opts?: object): node is QualifiedTypeIdentifier;
export function isUnionTypeAnnotation(node: object, opts?: object): node is UnionTypeAnnotation;
export function isVoidTypeAnnotation(node: object, opts?: object): node is VoidTypeAnnotation;
export function isJSXAttribute(node: object, opts?: object): node is JSXAttribute;
export function isJSXClosingElement(node: object, opts?: object): node is JSXClosingElement;
export function isJSXElement(node: object, opts?: object): node is JSXElement;
export function isJSXEmptyExpression(node: object, opts?: object): node is JSXEmptyExpression;
export function isJSXExpressionContainer(node: object, opts?: object): node is JSXExpressionContainer;
export function isJSXIdentifier(node: object, opts?: object): node is JSXIdentifier;
export function isJSXMemberExpression(node: object, opts?: object): node is JSXMemberExpression;
export function isJSXNamespacedName(node: object, opts?: object): node is JSXNamespacedName;
export function isJSXOpeningElement(node: object, opts?: object): node is JSXOpeningElement;
export function isJSXSpreadAttribute(node: object, opts?: object): node is JSXSpreadAttribute;
export function isJSXText(node: object, opts?: object): node is JSXText;
export function isNoop(node: object, opts?: object): node is Noop;
export function isParenthesizedExpression(node: object, opts?: object): node is ParenthesizedExpression;
export function isAwaitExpression(node: object, opts?: object): node is AwaitExpression;
export function isBindExpression(node: object, opts?: object): node is BindExpression;
export function isDecorator(node: object, opts?: object): node is Decorator;
export function isDoExpression(node: object, opts?: object): node is DoExpression;
export function isExportDefaultSpecifier(node: object, opts?: object): node is ExportDefaultSpecifier;
export function isExportNamespaceSpecifier(node: object, opts?: object): node is ExportNamespaceSpecifier;
export function isRestProperty(node: object, opts?: object): node is RestProperty;
export function isSpreadProperty(node: object, opts?: object): node is SpreadProperty;
export function isExpression(node: object, opts?: object): node is Expression;
export function isBinary(node: object, opts?: object): node is Binary;
export function isScopable(node: object, opts?: object): node is Scopable;
export function isBlockParent(node: object, opts?: object): node is BlockParent;
export function isBlock(node: object, opts?: object): node is Block;
export function isStatement(node: object, opts?: object): node is Statement;
export function isTerminatorless(node: object, opts?: object): node is Terminatorless;
export function isCompletionStatement(node: object, opts?: object): node is CompletionStatement;
export function isConditional(node: object, opts?: object): node is Conditional;
export function isLoop(node: object, opts?: object): node is Loop;
export function isWhile(node: object, opts?: object): node is While;
export function isExpressionWrapper(node: object, opts?: object): node is ExpressionWrapper;
export function isFor(node: object, opts?: object): node is For;
export function isForXStatement(node: object, opts?: object): node is ForXStatement;
export function isArrayExpression(node: object | null | undefined, opts?: object): node is ArrayExpression;
export function isAssignmentExpression(node: object | null | undefined, opts?: object): node is AssignmentExpression;
export function isBinaryExpression(node: object | null | undefined, opts?: object): node is BinaryExpression;
export function isDirective(node: object | null | undefined, opts?: object): node is Directive;
export function isDirectiveLiteral(node: object | null | undefined, opts?: object): node is DirectiveLiteral;
export function isBlockStatement(node: object | null | undefined, opts?: object): node is BlockStatement;
export function isBreakStatement(node: object | null | undefined, opts?: object): node is BreakStatement;
export function isCallExpression(node: object | null | undefined, opts?: object): node is CallExpression;
export function isCatchClause(node: object | null | undefined, opts?: object): node is CatchClause;
export function isConditionalExpression(node: object | null | undefined, opts?: object): node is ConditionalExpression;
export function isContinueStatement(node: object | null | undefined, opts?: object): node is ContinueStatement;
export function isDebuggerStatement(node: object | null | undefined, opts?: object): node is DebuggerStatement;
export function isDoWhileStatement(node: object | null | undefined, opts?: object): node is DoWhileStatement;
export function isEmptyStatement(node: object | null | undefined, opts?: object): node is EmptyStatement;
export function isExpressionStatement(node: object | null | undefined, opts?: object): node is ExpressionStatement;
export function isFile(node: object | null | undefined, opts?: object): node is File;
export function isForInStatement(node: object | null | undefined, opts?: object): node is ForInStatement;
export function isForStatement(node: object | null | undefined, opts?: object): node is ForStatement;
export function isFunctionDeclaration(node: object | null | undefined, opts?: object): node is FunctionDeclaration;
export function isFunctionExpression(node: object | null | undefined, opts?: object): node is FunctionExpression;
export function isIdentifier(node: object | null | undefined, opts?: object): node is Identifier;
export function isIfStatement(node: object | null | undefined, opts?: object): node is IfStatement;
export function isLabeledStatement(node: object | null | undefined, opts?: object): node is LabeledStatement;
export function isStringLiteral(node: object | null | undefined, opts?: object): node is StringLiteral;
export function isNumericLiteral(node: object | null | undefined, opts?: object): node is NumericLiteral;
export function isNullLiteral(node: object | null | undefined, opts?: object): node is NullLiteral;
export function isBooleanLiteral(node: object | null | undefined, opts?: object): node is BooleanLiteral;
export function isRegExpLiteral(node: object | null | undefined, opts?: object): node is RegExpLiteral;
export function isLogicalExpression(node: object | null | undefined, opts?: object): node is LogicalExpression;
export function isMemberExpression(node: object | null | undefined, opts?: object): node is MemberExpression;
export function isNewExpression(node: object | null | undefined, opts?: object): node is NewExpression;
export function isProgram(node: object | null | undefined, opts?: object): node is Program;
export function isObjectExpression(node: object | null | undefined, opts?: object): node is ObjectExpression;
export function isObjectMethod(node: object | null | undefined, opts?: object): node is ObjectMethod;
export function isObjectProperty(node: object | null | undefined, opts?: object): node is ObjectProperty;
export function isRestElement(node: object | null | undefined, opts?: object): node is RestElement;
export function isReturnStatement(node: object | null | undefined, opts?: object): node is ReturnStatement;
export function isSequenceExpression(node: object | null | undefined, opts?: object): node is SequenceExpression;
export function isSwitchCase(node: object | null | undefined, opts?: object): node is SwitchCase;
export function isSwitchStatement(node: object | null | undefined, opts?: object): node is SwitchStatement;
export function isThisExpression(node: object | null | undefined, opts?: object): node is ThisExpression;
export function isThrowStatement(node: object | null | undefined, opts?: object): node is ThrowStatement;
export function isTryStatement(node: object | null | undefined, opts?: object): node is TryStatement;
export function isUnaryExpression(node: object | null | undefined, opts?: object): node is UnaryExpression;
export function isUpdateExpression(node: object | null | undefined, opts?: object): node is UpdateExpression;
export function isVariableDeclaration(node: object | null | undefined, opts?: object): node is VariableDeclaration;
export function isVariableDeclarator(node: object | null | undefined, opts?: object): node is VariableDeclarator;
export function isWhileStatement(node: object | null | undefined, opts?: object): node is WhileStatement;
export function isWithStatement(node: object | null | undefined, opts?: object): node is WithStatement;
export function isAssignmentPattern(node: object | null | undefined, opts?: object): node is AssignmentPattern;
export function isArrayPattern(node: object | null | undefined, opts?: object): node is ArrayPattern;
export function isArrowFunctionExpression(node: object | null | undefined, opts?: object): node is ArrowFunctionExpression;
export function isClassBody(node: object | null | undefined, opts?: object): node is ClassBody;
export function isClassDeclaration(node: object | null | undefined, opts?: object): node is ClassDeclaration;
export function isClassExpression(node: object | null | undefined, opts?: object): node is ClassExpression;
export function isExportAllDeclaration(node: object | null | undefined, opts?: object): node is ExportAllDeclaration;
export function isExportDefaultDeclaration(node: object | null | undefined, opts?: object): node is ExportDefaultDeclaration;
export function isExportNamedDeclaration(node: object | null | undefined, opts?: object): node is ExportNamedDeclaration;
export function isExportSpecifier(node: object | null | undefined, opts?: object): node is ExportSpecifier;
export function isForOfStatement(node: object | null | undefined, opts?: object): node is ForOfStatement;
export function isImportDeclaration(node: object | null | undefined, opts?: object): node is ImportDeclaration;
export function isImportDefaultSpecifier(node: object | null | undefined, opts?: object): node is ImportDefaultSpecifier;
export function isImportNamespaceSpecifier(node: object | null | undefined, opts?: object): node is ImportNamespaceSpecifier;
export function isImportSpecifier(node: object | null | undefined, opts?: object): node is ImportSpecifier;
export function isMetaProperty(node: object | null | undefined, opts?: object): node is MetaProperty;
export function isClassMethod(node: object | null | undefined, opts?: object): node is ClassMethod;
export function isObjectPattern(node: object | null | undefined, opts?: object): node is ObjectPattern;
export function isSpreadElement(node: object | null | undefined, opts?: object): node is SpreadElement;
export function isSuper(node: object | null | undefined, opts?: object): node is Super;
export function isTaggedTemplateExpression(node: object | null | undefined, opts?: object): node is TaggedTemplateExpression;
export function isTemplateElement(node: object | null | undefined, opts?: object): node is TemplateElement;
export function isTemplateLiteral(node: object | null | undefined, opts?: object): node is TemplateLiteral;
export function isYieldExpression(node: object | null | undefined, opts?: object): node is YieldExpression;
export function isAnyTypeAnnotation(node: object | null | undefined, opts?: object): node is AnyTypeAnnotation;
export function isArrayTypeAnnotation(node: object | null | undefined, opts?: object): node is ArrayTypeAnnotation;
export function isBooleanTypeAnnotation(node: object | null | undefined, opts?: object): node is BooleanTypeAnnotation;
export function isBooleanLiteralTypeAnnotation(node: object | null | undefined, opts?: object): node is BooleanLiteralTypeAnnotation;
export function isNullLiteralTypeAnnotation(node: object | null | undefined, opts?: object): node is NullLiteralTypeAnnotation;
export function isClassImplements(node: object | null | undefined, opts?: object): node is ClassImplements;
export function isClassProperty(node: object | null | undefined, opts?: object): node is ClassProperty;
export function isDeclareClass(node: object | null | undefined, opts?: object): node is DeclareClass;
export function isDeclareFunction(node: object | null | undefined, opts?: object): node is DeclareFunction;
export function isDeclareInterface(node: object | null | undefined, opts?: object): node is DeclareInterface;
export function isDeclareModule(node: object | null | undefined, opts?: object): node is DeclareModule;
export function isDeclareTypeAlias(node: object | null | undefined, opts?: object): node is DeclareTypeAlias;
export function isDeclareVariable(node: object | null | undefined, opts?: object): node is DeclareVariable;
export function isExistentialTypeParam(node: object | null | undefined, opts?: object): node is ExistentialTypeParam;
export function isFunctionTypeAnnotation(node: object | null | undefined, opts?: object): node is FunctionTypeAnnotation;
export function isFunctionTypeParam(node: object | null | undefined, opts?: object): node is FunctionTypeParam;
export function isGenericTypeAnnotation(node: object | null | undefined, opts?: object): node is GenericTypeAnnotation;
export function isInterfaceExtends(node: object | null | undefined, opts?: object): node is InterfaceExtends;
export function isInterfaceDeclaration(node: object | null | undefined, opts?: object): node is InterfaceDeclaration;
export function isIntersectionTypeAnnotation(node: object | null | undefined, opts?: object): node is IntersectionTypeAnnotation;
export function isMixedTypeAnnotation(node: object | null | undefined, opts?: object): node is MixedTypeAnnotation;
export function isNullableTypeAnnotation(node: object | null | undefined, opts?: object): node is NullableTypeAnnotation;
export function isNumericLiteralTypeAnnotation(node: object | null | undefined, opts?: object): node is NumericLiteralTypeAnnotation;
export function isNumberTypeAnnotation(node: object | null | undefined, opts?: object): node is NumberTypeAnnotation;
export function isStringLiteralTypeAnnotation(node: object | null | undefined, opts?: object): node is StringLiteralTypeAnnotation;
export function isStringTypeAnnotation(node: object | null | undefined, opts?: object): node is StringTypeAnnotation;
export function isThisTypeAnnotation(node: object | null | undefined, opts?: object): node is ThisTypeAnnotation;
export function isTupleTypeAnnotation(node: object | null | undefined, opts?: object): node is TupleTypeAnnotation;
export function isTypeofTypeAnnotation(node: object | null | undefined, opts?: object): node is TypeofTypeAnnotation;
export function isTypeAlias(node: object | null | undefined, opts?: object): node is TypeAlias;
export function isTypeAnnotation(node: object | null | undefined, opts?: object): node is TypeAnnotation;
export function isTypeCastExpression(node: object | null | undefined, opts?: object): node is TypeCastExpression;
export function isTypeParameter(node: object | null | undefined, opts?: object): node is TypeParameter;
export function isTypeParameterDeclaration(node: object | null | undefined, opts?: object): node is TypeParameterDeclaration;
export function isTypeParameterInstantiation(node: object | null | undefined, opts?: object): node is TypeParameterInstantiation;
export function isObjectTypeAnnotation(node: object | null | undefined, opts?: object): node is ObjectTypeAnnotation;
export function isObjectTypeCallProperty(node: object | null | undefined, opts?: object): node is ObjectTypeCallProperty;
export function isObjectTypeIndexer(node: object | null | undefined, opts?: object): node is ObjectTypeIndexer;
export function isObjectTypeProperty(node: object | null | undefined, opts?: object): node is ObjectTypeProperty;
export function isQualifiedTypeIdentifier(node: object | null | undefined, opts?: object): node is QualifiedTypeIdentifier;
export function isUnionTypeAnnotation(node: object | null | undefined, opts?: object): node is UnionTypeAnnotation;
export function isVoidTypeAnnotation(node: object | null | undefined, opts?: object): node is VoidTypeAnnotation;
export function isJSXAttribute(node: object | null | undefined, opts?: object): node is JSXAttribute;
export function isJSXClosingElement(node: object | null | undefined, opts?: object): node is JSXClosingElement;
export function isJSXElement(node: object | null | undefined, opts?: object): node is JSXElement;
export function isJSXEmptyExpression(node: object | null | undefined, opts?: object): node is JSXEmptyExpression;
export function isJSXExpressionContainer(node: object | null | undefined, opts?: object): node is JSXExpressionContainer;
export function isJSXIdentifier(node: object | null | undefined, opts?: object): node is JSXIdentifier;
export function isJSXMemberExpression(node: object | null | undefined, opts?: object): node is JSXMemberExpression;
export function isJSXNamespacedName(node: object | null | undefined, opts?: object): node is JSXNamespacedName;
export function isJSXOpeningElement(node: object | null | undefined, opts?: object): node is JSXOpeningElement;
export function isJSXSpreadAttribute(node: object | null | undefined, opts?: object): node is JSXSpreadAttribute;
export function isJSXText(node: object | null | undefined, opts?: object): node is JSXText;
export function isNoop(node: object | null | undefined, opts?: object): node is Noop;
export function isParenthesizedExpression(node: object | null | undefined, opts?: object): node is ParenthesizedExpression;
export function isAwaitExpression(node: object | null | undefined, opts?: object): node is AwaitExpression;
export function isBindExpression(node: object | null | undefined, opts?: object): node is BindExpression;
export function isDecorator(node: object | null | undefined, opts?: object): node is Decorator;
export function isDoExpression(node: object | null | undefined, opts?: object): node is DoExpression;
export function isExportDefaultSpecifier(node: object | null | undefined, opts?: object): node is ExportDefaultSpecifier;
export function isExportNamespaceSpecifier(node: object | null | undefined, opts?: object): node is ExportNamespaceSpecifier;
export function isRestProperty(node: object | null | undefined, opts?: object): node is RestProperty;
export function isSpreadProperty(node: object | null | undefined, opts?: object): node is SpreadProperty;
export function isExpression(node: object | null | undefined, opts?: object): node is Expression;
export function isBinary(node: object | null | undefined, opts?: object): node is Binary;
export function isScopable(node: object | null | undefined, opts?: object): node is Scopable;
export function isBlockParent(node: object | null | undefined, opts?: object): node is BlockParent;
export function isBlock(node: object | null | undefined, opts?: object): node is Block;
export function isStatement(node: object | null | undefined, opts?: object): node is Statement;
export function isTerminatorless(node: object | null | undefined, opts?: object): node is Terminatorless;
export function isCompletionStatement(node: object | null | undefined, opts?: object): node is CompletionStatement;
export function isConditional(node: object | null | undefined, opts?: object): node is Conditional;
export function isLoop(node: object | null | undefined, opts?: object): node is Loop;
export function isWhile(node: object | null | undefined, opts?: object): node is While;
export function isExpressionWrapper(node: object | null | undefined, opts?: object): node is ExpressionWrapper;
export function isFor(node: object | null | undefined, opts?: object): node is For;
export function isForXStatement(node: object | null | undefined, opts?: object): node is ForXStatement;
// tslint:disable-next-line ban-types
export function isFunction(node: object, opts?: object): node is Function;
export function isFunctionParent(node: object, opts?: object): node is FunctionParent;
export function isPureish(node: object, opts?: object): node is Pureish;
export function isDeclaration(node: object, opts?: object): node is Declaration;
export function isLVal(node: object, opts?: object): node is LVal;
export function isLiteral(node: object, opts?: object): node is Literal;
export function isImmutable(node: object, opts?: object): node is Immutable;
export function isUserWhitespacable(node: object, opts?: object): node is UserWhitespacable;
export function isMethod(node: object, opts?: object): node is Method;
export function isObjectMember(node: object, opts?: object): node is ObjectMember;
export function isProperty(node: object, opts?: object): node is Property;
export function isUnaryLike(node: object, opts?: object): node is UnaryLike;
export function isPattern(node: object, opts?: object): node is Pattern;
export function isClass(node: object, opts?: object): node is Class;
export function isModuleDeclaration(node: object, opts?: object): node is ModuleDeclaration;
export function isExportDeclaration(node: object, opts?: object): node is ExportDeclaration;
export function isModuleSpecifier(node: object, opts?: object): node is ModuleSpecifier;
export function isFlow(node: object, opts?: object): node is Flow;
export function isFlowBaseAnnotation(node: object, opts?: object): node is FlowBaseAnnotation;
export function isFlowDeclaration(node: object, opts?: object): node is FlowDeclaration;
export function isJSX(node: object, opts?: object): node is JSX;
export function isNumberLiteral(node: object, opts?: object): node is NumericLiteral;
export function isRegexLiteral(node: object, opts?: object): node is RegExpLiteral;
export function isFunction(node: object | null | undefined, opts?: object): node is Function;
export function isFunctionParent(node: object | null | undefined, opts?: object): node is FunctionParent;
export function isPureish(node: object | null | undefined, opts?: object): node is Pureish;
export function isDeclaration(node: object | null | undefined, opts?: object): node is Declaration;
export function isLVal(node: object | null | undefined, opts?: object): node is LVal;
export function isLiteral(node: object | null | undefined, opts?: object): node is Literal;
export function isImmutable(node: object | null | undefined, opts?: object): node is Immutable;
export function isUserWhitespacable(node: object | null | undefined, opts?: object): node is UserWhitespacable;
export function isMethod(node: object | null | undefined, opts?: object): node is Method;
export function isObjectMember(node: object | null | undefined, opts?: object): node is ObjectMember;
export function isProperty(node: object | null | undefined, opts?: object): node is Property;
export function isUnaryLike(node: object | null | undefined, opts?: object): node is UnaryLike;
export function isPattern(node: object | null | undefined, opts?: object): node is Pattern;
export function isClass(node: object | null | undefined, opts?: object): node is Class;
export function isModuleDeclaration(node: object | null | undefined, opts?: object): node is ModuleDeclaration;
export function isExportDeclaration(node: object | null | undefined, opts?: object): node is ExportDeclaration;
export function isModuleSpecifier(node: object | null | undefined, opts?: object): node is ModuleSpecifier;
export function isFlow(node: object | null | undefined, opts?: object): node is Flow;
export function isFlowBaseAnnotation(node: object | null | undefined, opts?: object): node is FlowBaseAnnotation;
export function isFlowDeclaration(node: object | null | undefined, opts?: object): node is FlowDeclaration;
export function isJSX(node: object | null | undefined, opts?: object): node is JSX;
export function isNumberLiteral(node: object | null | undefined, opts?: object): node is NumericLiteral;
export function isRegexLiteral(node: object | null | undefined, opts?: object): node is RegExpLiteral;
export function isReferencedIdentifier(node: object, opts?: object): node is Identifier | JSXIdentifier;
export function isReferencedMemberExpression(node: object, opts?: object): node is MemberExpression;
export function isBindingIdentifier(node: object, opts?: object): node is Identifier;
export function isScope(node: object, opts?: object): node is Scopable;
export function isReferenced(node: object, opts?: object): boolean;
export function isBlockScoped(node: object, opts?: object): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration;
export function isVar(node: object, opts?: object): node is VariableDeclaration;
export function isUser(node: object, opts?: object): boolean;
export function isGenerated(node: object, opts?: object): boolean;
export function isPure(node: object, opts?: object): boolean;
export function isReferencedIdentifier(node: object | null | undefined, opts?: object): node is Identifier | JSXIdentifier;
export function isReferencedMemberExpression(node: object | null | undefined, opts?: object): node is MemberExpression;
export function isBindingIdentifier(node: object | null | undefined, opts?: object): node is Identifier;
export function isScope(node: object | null | undefined, opts?: object): node is Scopable;
export function isReferenced(node: object | null | undefined, opts?: object): boolean;
export function isBlockScoped(node: object | null | undefined, opts?: object): node is FunctionDeclaration | ClassDeclaration | VariableDeclaration;
export function isVar(node: object | null | undefined, opts?: object): node is VariableDeclaration;
export function isUser(node: object | null | undefined, opts?: object): boolean;
export function isGenerated(node: object | null | undefined, opts?: object): boolean;
export function isPure(node: object | null | undefined, opts?: object): boolean;
export function isTSAnyKeyword(node: object, opts?: object): node is TSAnyKeyword;
export function isTSArrayType(node: object, opts?: object): node is TSArrayType;
export function isTSAsExpression(node: object, opts?: object): node is TSAsExpression;
export function isTSBooleanKeyword(node: object, opts?: object): node is TSBooleanKeyword;
export function isTSCallSignatureDeclaration(node: object, opts?: object): node is TSCallSignatureDeclaration;
export function isTSConstructSignatureDeclaration(node: object, opts?: object): node is TSTypeElement;
export function isTSConstructorType(node: object, opts?: object): node is TSConstructorType;
export function isTSDeclareFunction(node: object, opts?: object): node is TSDeclareFunction;
export function isTSDeclareMethod(node: object, opts?: object): node is TSDeclareMethod;
export function isTSEnumDeclaration(node: object, opts?: object): node is TSEnumDeclaration;
export function isTSEnumMember(node: object, opts?: object): node is TSEnumMember;
export function isTSExportAssignment(node: object, opts?: object): node is TSExportAssignment;
export function isTSExpressionWithTypeArguments(node: object, opts?: object): node is TSExpressionWithTypeArguments;
export function isTSExternalModuleReference(node: object, opts?: object): node is TSExternalModuleReference;
export function isTSFunctionType(node: object, opts?: object): node is TSFunctionType;
export function isTSImportEqualsDeclaration(node: object, opts?: object): node is TSImportEqualsDeclaration;
export function isTSIndexSignature(node: object, opts?: object): node is TSIndexSignature;
export function isTSIndexedAccessType(node: object, opts?: object): node is TSIndexedAccessType;
export function isTSInterfaceBody(node: object, opts?: object): node is TSInterfaceBody;
export function isTSInterfaceDeclaration(node: object, opts?: object): node is TSInterfaceDeclaration;
export function isTSIntersectionType(node: object, opts?: object): node is TSIntersectionType;
export function isTSLiteralType(node: object, opts?: object): node is TSLiteralType;
export function isTSMappedType(node: object, opts?: object): node is TSMappedType;
export function isTSMethodSignature(node: object, opts?: object): node is TSMethodSignature;
export function isTSModuleBlock(node: object, opts?: object): node is TSModuleBlock;
export function isTSModuleDeclaration(node: object, opts?: object): node is TSModuleDeclaration;
export function isTSNamespaceExportDeclaration(node: object, opts?: object): node is TSNamespaceExportDeclaration;
export function isTSNeverKeyword(node: object, opts?: object): node is TSNeverKeyword;
export function isTSNonNullExpression(node: object, opts?: object): node is TSNonNullExpression;
export function isTSNullKeyword(node: object, opts?: object): node is TSNullKeyword;
export function isTSNumberKeyword(node: object, opts?: object): node is TSNumberKeyword;
export function isTSObjectKeyword(node: object, opts?: object): node is TSObjectKeyword;
export function isTSParameterProperty(node: object, opts?: object): node is TSParameterProperty;
export function isTSParenthesizedType(node: object, opts?: object): node is TSParenthesizedType;
export function isTSPropertySignature(node: object, opts?: object): node is TSPropertySignature;
export function isTSQualifiedName(node: object, opts?: object): node is TSQualifiedName;
export function isTSStringKeyword(node: object, opts?: object): node is TSStringKeyword;
export function isTSSymbolKeyword(node: object, opts?: object): node is TSSymbolKeyword;
export function isTSThisType(node: object, opts?: object): node is TSThisType;
export function isTSTupleType(node: object, opts?: object): node is TSTupleType;
export function isTSTypeAliasDeclaration(node: object, opts?: object): node is TSTypeAliasDeclaration;
export function isTSTypeAnnotation(node: object, opts?: object): node is TSTypeAnnotation;
export function isTSTypeAssertion(node: object, opts?: object): node is TSTypeAssertion;
export function isTSTypeLiteral(node: object, opts?: object): node is TSTypeLiteral;
export function isTSTypeOperator(node: object, opts?: object): node is TSTypeOperator;
export function isTSTypeParameter(node: object, opts?: object): node is TSTypeParameter;
export function isTSTypeParameterDeclaration(node: object, opts?: object): node is TSTypeParameterDeclaration;
export function isTSTypeParameterInstantiation(node: object, opts?: object): node is TSTypeParameterInstantiation;
export function isTSTypePredicate(node: object, opts?: object): node is TSTypePredicate;
export function isTSTypeQuery(node: object, opts?: object): node is TSTypeQuery;
export function isTSTypeReference(node: object, opts?: object): node is TSTypeReference;
export function isTSUndefinedKeyword(node: object, opts?: object): node is TSUndefinedKeyword;
export function isTSUnionType(node: object, opts?: object): node is TSUnionType;
export function isTSVoidKeyword(node: object, opts?: object): node is TSVoidKeyword;
export function isTSAnyKeyword(node: object | null | undefined, opts?: object): node is TSAnyKeyword;
export function isTSArrayType(node: object | null | undefined, opts?: object): node is TSArrayType;
export function isTSAsExpression(node: object | null | undefined, opts?: object): node is TSAsExpression;
export function isTSBooleanKeyword(node: object | null | undefined, opts?: object): node is TSBooleanKeyword;
export function isTSCallSignatureDeclaration(node: object | null | undefined, opts?: object): node is TSCallSignatureDeclaration;
export function isTSConstructSignatureDeclaration(node: object | null | undefined, opts?: object): node is TSTypeElement;
export function isTSConstructorType(node: object | null | undefined, opts?: object): node is TSConstructorType;
export function isTSDeclareFunction(node: object | null | undefined, opts?: object): node is TSDeclareFunction;
export function isTSDeclareMethod(node: object | null | undefined, opts?: object): node is TSDeclareMethod;
export function isTSEnumDeclaration(node: object | null | undefined, opts?: object): node is TSEnumDeclaration;
export function isTSEnumMember(node: object | null | undefined, opts?: object): node is TSEnumMember;
export function isTSExportAssignment(node: object | null | undefined, opts?: object): node is TSExportAssignment;
export function isTSExpressionWithTypeArguments(node: object | null | undefined, opts?: object): node is TSExpressionWithTypeArguments;
export function isTSExternalModuleReference(node: object | null | undefined, opts?: object): node is TSExternalModuleReference;
export function isTSFunctionType(node: object | null | undefined, opts?: object): node is TSFunctionType;
export function isTSImportEqualsDeclaration(node: object | null | undefined, opts?: object): node is TSImportEqualsDeclaration;
export function isTSIndexSignature(node: object | null | undefined, opts?: object): node is TSIndexSignature;
export function isTSIndexedAccessType(node: object | null | undefined, opts?: object): node is TSIndexedAccessType;
export function isTSInterfaceBody(node: object | null | undefined, opts?: object): node is TSInterfaceBody;
export function isTSInterfaceDeclaration(node: object | null | undefined, opts?: object): node is TSInterfaceDeclaration;
export function isTSIntersectionType(node: object | null | undefined, opts?: object): node is TSIntersectionType;
export function isTSLiteralType(node: object | null | undefined, opts?: object): node is TSLiteralType;
export function isTSMappedType(node: object | null | undefined, opts?: object): node is TSMappedType;
export function isTSMethodSignature(node: object | null | undefined, opts?: object): node is TSMethodSignature;
export function isTSModuleBlock(node: object | null | undefined, opts?: object): node is TSModuleBlock;
export function isTSModuleDeclaration(node: object | null | undefined, opts?: object): node is TSModuleDeclaration;
export function isTSNamespaceExportDeclaration(node: object | null | undefined, opts?: object): node is TSNamespaceExportDeclaration;
export function isTSNeverKeyword(node: object | null | undefined, opts?: object): node is TSNeverKeyword;
export function isTSNonNullExpression(node: object | null | undefined, opts?: object): node is TSNonNullExpression;
export function isTSNullKeyword(node: object | null | undefined, opts?: object): node is TSNullKeyword;
export function isTSNumberKeyword(node: object | null | undefined, opts?: object): node is TSNumberKeyword;
export function isTSObjectKeyword(node: object | null | undefined, opts?: object): node is TSObjectKeyword;
export function isTSParameterProperty(node: object | null | undefined, opts?: object): node is TSParameterProperty;
export function isTSParenthesizedType(node: object | null | undefined, opts?: object): node is TSParenthesizedType;
export function isTSPropertySignature(node: object | null | undefined, opts?: object): node is TSPropertySignature;
export function isTSQualifiedName(node: object | null | undefined, opts?: object): node is TSQualifiedName;
export function isTSStringKeyword(node: object | null | undefined, opts?: object): node is TSStringKeyword;
export function isTSSymbolKeyword(node: object | null | undefined, opts?: object): node is TSSymbolKeyword;
export function isTSThisType(node: object | null | undefined, opts?: object): node is TSThisType;
export function isTSTupleType(node: object | null | undefined, opts?: object): node is TSTupleType;
export function isTSTypeAliasDeclaration(node: object | null | undefined, opts?: object): node is TSTypeAliasDeclaration;
export function isTSTypeAnnotation(node: object | null | undefined, opts?: object): node is TSTypeAnnotation;
export function isTSTypeAssertion(node: object | null | undefined, opts?: object): node is TSTypeAssertion;
export function isTSTypeLiteral(node: object | null | undefined, opts?: object): node is TSTypeLiteral;
export function isTSTypeOperator(node: object | null | undefined, opts?: object): node is TSTypeOperator;
export function isTSTypeParameter(node: object | null | undefined, opts?: object): node is TSTypeParameter;
export function isTSTypeParameterDeclaration(node: object | null | undefined, opts?: object): node is TSTypeParameterDeclaration;
export function isTSTypeParameterInstantiation(node: object | null | undefined, opts?: object): node is TSTypeParameterInstantiation;
export function isTSTypePredicate(node: object | null | undefined, opts?: object): node is TSTypePredicate;
export function isTSTypeQuery(node: object | null | undefined, opts?: object): node is TSTypeQuery;
export function isTSTypeReference(node: object | null | undefined, opts?: object): node is TSTypeReference;
export function isTSUndefinedKeyword(node: object | null | undefined, opts?: object): node is TSUndefinedKeyword;
export function isTSUnionType(node: object | null | undefined, opts?: object): node is TSUnionType;
export function isTSVoidKeyword(node: object | null | undefined, opts?: object): node is TSVoidKeyword;
// React specific
export interface ReactHelpers {
@@ -1762,231 +1762,231 @@ export interface ReactHelpers {
}
export const react: ReactHelpers;
export function assertArrayExpression(node: object, opts?: object): void;
export function assertAssignmentExpression(node: object, opts?: object): void;
export function assertBinaryExpression(node: object, opts?: object): void;
export function assertDirective(node: object, opts?: object): void;
export function assertDirectiveLiteral(node: object, opts?: object): void;
export function assertBlockStatement(node: object, opts?: object): void;
export function assertBreakStatement(node: object, opts?: object): void;
export function assertCallExpression(node: object, opts?: object): void;
export function assertCatchClause(node: object, opts?: object): void;
export function assertConditionalExpression(node: object, opts?: object): void;
export function assertContinueStatement(node: object, opts?: object): void;
export function assertDebuggerStatement(node: object, opts?: object): void;
export function assertDoWhileStatement(node: object, opts?: object): void;
export function assertEmptyStatement(node: object, opts?: object): void;
export function assertExpressionStatement(node: object, opts?: object): void;
export function assertFile(node: object, opts?: object): void;
export function assertForInStatement(node: object, opts?: object): void;
export function assertForStatement(node: object, opts?: object): void;
export function assertFunctionDeclaration(node: object, opts?: object): void;
export function assertFunctionExpression(node: object, opts?: object): void;
export function assertIdentifier(node: object, opts?: object): void;
export function assertIfStatement(node: object, opts?: object): void;
export function assertLabeledStatement(node: object, opts?: object): void;
export function assertStringLiteral(node: object, opts?: object): void;
export function assertNumericLiteral(node: object, opts?: object): void;
export function assertNullLiteral(node: object, opts?: object): void;
export function assertBooleanLiteral(node: object, opts?: object): void;
export function assertRegExpLiteral(node: object, opts?: object): void;
export function assertLogicalExpression(node: object, opts?: object): void;
export function assertMemberExpression(node: object, opts?: object): void;
export function assertNewExpression(node: object, opts?: object): void;
export function assertProgram(node: object, opts?: object): void;
export function assertObjectExpression(node: object, opts?: object): void;
export function assertObjectMethod(node: object, opts?: object): void;
export function assertObjectProperty(node: object, opts?: object): void;
export function assertRestElement(node: object, opts?: object): void;
export function assertReturnStatement(node: object, opts?: object): void;
export function assertSequenceExpression(node: object, opts?: object): void;
export function assertSwitchCase(node: object, opts?: object): void;
export function assertSwitchStatement(node: object, opts?: object): void;
export function assertThisExpression(node: object, opts?: object): void;
export function assertThrowStatement(node: object, opts?: object): void;
export function assertTryStatement(node: object, opts?: object): void;
export function assertUnaryExpression(node: object, opts?: object): void;
export function assertUpdateExpression(node: object, opts?: object): void;
export function assertVariableDeclaration(node: object, opts?: object): void;
export function assertVariableDeclarator(node: object, opts?: object): void;
export function assertWhileStatement(node: object, opts?: object): void;
export function assertWithStatement(node: object, opts?: object): void;
export function assertAssignmentPattern(node: object, opts?: object): void;
export function assertArrayPattern(node: object, opts?: object): void;
export function assertArrowFunctionExpression(node: object, opts?: object): void;
export function assertClassBody(node: object, opts?: object): void;
export function assertClassDeclaration(node: object, opts?: object): void;
export function assertClassExpression(node: object, opts?: object): void;
export function assertExportAllDeclaration(node: object, opts?: object): void;
export function assertExportDefaultDeclaration(node: object, opts?: object): void;
export function assertExportNamedDeclaration(node: object, opts?: object): void;
export function assertExportSpecifier(node: object, opts?: object): void;
export function assertForOfStatement(node: object, opts?: object): void;
export function assertImportDeclaration(node: object, opts?: object): void;
export function assertImportDefaultSpecifier(node: object, opts?: object): void;
export function assertImportNamespaceSpecifier(node: object, opts?: object): void;
export function assertImportSpecifier(node: object, opts?: object): void;
export function assertMetaProperty(node: object, opts?: object): void;
export function assertClassMethod(node: object, opts?: object): void;
export function assertObjectPattern(node: object, opts?: object): void;
export function assertSpreadElement(node: object, opts?: object): void;
export function assertSuper(node: object, opts?: object): void;
export function assertTaggedTemplateExpression(node: object, opts?: object): void;
export function assertTemplateElement(node: object, opts?: object): void;
export function assertTemplateLiteral(node: object, opts?: object): void;
export function assertYieldExpression(node: object, opts?: object): void;
export function assertAnyTypeAnnotation(node: object, opts?: object): void;
export function assertArrayTypeAnnotation(node: object, opts?: object): void;
export function assertBooleanTypeAnnotation(node: object, opts?: object): void;
export function assertBooleanLiteralTypeAnnotation(node: object, opts?: object): void;
export function assertNullLiteralTypeAnnotation(node: object, opts?: object): void;
export function assertClassImplements(node: object, opts?: object): void;
export function assertClassProperty(node: object, opts?: object): void;
export function assertDeclareClass(node: object, opts?: object): void;
export function assertDeclareFunction(node: object, opts?: object): void;
export function assertDeclareInterface(node: object, opts?: object): void;
export function assertDeclareModule(node: object, opts?: object): void;
export function assertDeclareTypeAlias(node: object, opts?: object): void;
export function assertDeclareVariable(node: object, opts?: object): void;
export function assertExistentialTypeParam(node: object, opts?: object): void;
export function assertFunctionTypeAnnotation(node: object, opts?: object): void;
export function assertFunctionTypeParam(node: object, opts?: object): void;
export function assertGenericTypeAnnotation(node: object, opts?: object): void;
export function assertInterfaceExtends(node: object, opts?: object): void;
export function assertInterfaceDeclaration(node: object, opts?: object): void;
export function assertIntersectionTypeAnnotation(node: object, opts?: object): void;
export function assertMixedTypeAnnotation(node: object, opts?: object): void;
export function assertNullableTypeAnnotation(node: object, opts?: object): void;
export function assertNumericLiteralTypeAnnotation(node: object, opts?: object): void;
export function assertNumberTypeAnnotation(node: object, opts?: object): void;
export function assertStringLiteralTypeAnnotation(node: object, opts?: object): void;
export function assertStringTypeAnnotation(node: object, opts?: object): void;
export function assertThisTypeAnnotation(node: object, opts?: object): void;
export function assertTupleTypeAnnotation(node: object, opts?: object): void;
export function assertTypeofTypeAnnotation(node: object, opts?: object): void;
export function assertTypeAlias(node: object, opts?: object): void;
export function assertTypeAnnotation(node: object, opts?: object): void;
export function assertTypeCastExpression(node: object, opts?: object): void;
export function assertTypeParameter(node: object, opts?: object): void;
export function assertTypeParameterDeclaration(node: object, opts?: object): void;
export function assertTypeParameterInstantiation(node: object, opts?: object): void;
export function assertObjectTypeAnnotation(node: object, opts?: object): void;
export function assertObjectTypeCallProperty(node: object, opts?: object): void;
export function assertObjectTypeIndexer(node: object, opts?: object): void;
export function assertObjectTypeProperty(node: object, opts?: object): void;
export function assertQualifiedTypeIdentifier(node: object, opts?: object): void;
export function assertUnionTypeAnnotation(node: object, opts?: object): void;
export function assertVoidTypeAnnotation(node: object, opts?: object): void;
export function assertJSXAttribute(node: object, opts?: object): void;
export function assertJSXClosingElement(node: object, opts?: object): void;
export function assertJSXElement(node: object, opts?: object): void;
export function assertJSXEmptyExpression(node: object, opts?: object): void;
export function assertJSXExpressionContainer(node: object, opts?: object): void;
export function assertJSXIdentifier(node: object, opts?: object): void;
export function assertJSXMemberExpression(node: object, opts?: object): void;
export function assertJSXNamespacedName(node: object, opts?: object): void;
export function assertJSXOpeningElement(node: object, opts?: object): void;
export function assertJSXSpreadAttribute(node: object, opts?: object): void;
export function assertJSXText(node: object, opts?: object): void;
export function assertNoop(node: object, opts?: object): void;
export function assertParenthesizedExpression(node: object, opts?: object): void;
export function assertAwaitExpression(node: object, opts?: object): void;
export function assertBindExpression(node: object, opts?: object): void;
export function assertDecorator(node: object, opts?: object): void;
export function assertDoExpression(node: object, opts?: object): void;
export function assertExportDefaultSpecifier(node: object, opts?: object): void;
export function assertExportNamespaceSpecifier(node: object, opts?: object): void;
export function assertRestProperty(node: object, opts?: object): void;
export function assertSpreadProperty(node: object, opts?: object): void;
export function assertExpression(node: object, opts?: object): void;
export function assertBinary(node: object, opts?: object): void;
export function assertScopable(node: object, opts?: object): void;
export function assertBlockParent(node: object, opts?: object): void;
export function assertBlock(node: object, opts?: object): void;
export function assertStatement(node: object, opts?: object): void;
export function assertTerminatorless(node: object, opts?: object): void;
export function assertCompletionStatement(node: object, opts?: object): void;
export function assertConditional(node: object, opts?: object): void;
export function assertLoop(node: object, opts?: object): void;
export function assertWhile(node: object, opts?: object): void;
export function assertExpressionWrapper(node: object, opts?: object): void;
export function assertFor(node: object, opts?: object): void;
export function assertForXStatement(node: object, opts?: object): void;
export function assertFunction(node: object, opts?: object): void;
export function assertFunctionParent(node: object, opts?: object): void;
export function assertPureish(node: object, opts?: object): void;
export function assertDeclaration(node: object, opts?: object): void;
export function assertLVal(node: object, opts?: object): void;
export function assertLiteral(node: object, opts?: object): void;
export function assertImmutable(node: object, opts?: object): void;
export function assertUserWhitespacable(node: object, opts?: object): void;
export function assertMethod(node: object, opts?: object): void;
export function assertObjectMember(node: object, opts?: object): void;
export function assertProperty(node: object, opts?: object): void;
export function assertUnaryLike(node: object, opts?: object): void;
export function assertPattern(node: object, opts?: object): void;
export function assertClass(node: object, opts?: object): void;
export function assertModuleDeclaration(node: object, opts?: object): void;
export function assertExportDeclaration(node: object, opts?: object): void;
export function assertModuleSpecifier(node: object, opts?: object): void;
export function assertFlow(node: object, opts?: object): void;
export function assertFlowBaseAnnotation(node: object, opts?: object): void;
export function assertFlowDeclaration(node: object, opts?: object): void;
export function assertJSX(node: object, opts?: object): void;
export function assertNumberLiteral(node: object, opts?: object): void;
export function assertRegexLiteral(node: object, opts?: object): void;
export function assertArrayExpression(node: object | null | undefined, opts?: object): void;
export function assertAssignmentExpression(node: object | null | undefined, opts?: object): void;
export function assertBinaryExpression(node: object | null | undefined, opts?: object): void;
export function assertDirective(node: object | null | undefined, opts?: object): void;
export function assertDirectiveLiteral(node: object | null | undefined, opts?: object): void;
export function assertBlockStatement(node: object | null | undefined, opts?: object): void;
export function assertBreakStatement(node: object | null | undefined, opts?: object): void;
export function assertCallExpression(node: object | null | undefined, opts?: object): void;
export function assertCatchClause(node: object | null | undefined, opts?: object): void;
export function assertConditionalExpression(node: object | null | undefined, opts?: object): void;
export function assertContinueStatement(node: object | null | undefined, opts?: object): void;
export function assertDebuggerStatement(node: object | null | undefined, opts?: object): void;
export function assertDoWhileStatement(node: object | null | undefined, opts?: object): void;
export function assertEmptyStatement(node: object | null | undefined, opts?: object): void;
export function assertExpressionStatement(node: object | null | undefined, opts?: object): void;
export function assertFile(node: object | null | undefined, opts?: object): void;
export function assertForInStatement(node: object | null | undefined, opts?: object): void;
export function assertForStatement(node: object | null | undefined, opts?: object): void;
export function assertFunctionDeclaration(node: object | null | undefined, opts?: object): void;
export function assertFunctionExpression(node: object | null | undefined, opts?: object): void;
export function assertIdentifier(node: object | null | undefined, opts?: object): void;
export function assertIfStatement(node: object | null | undefined, opts?: object): void;
export function assertLabeledStatement(node: object | null | undefined, opts?: object): void;
export function assertStringLiteral(node: object | null | undefined, opts?: object): void;
export function assertNumericLiteral(node: object | null | undefined, opts?: object): void;
export function assertNullLiteral(node: object | null | undefined, opts?: object): void;
export function assertBooleanLiteral(node: object | null | undefined, opts?: object): void;
export function assertRegExpLiteral(node: object | null | undefined, opts?: object): void;
export function assertLogicalExpression(node: object | null | undefined, opts?: object): void;
export function assertMemberExpression(node: object | null | undefined, opts?: object): void;
export function assertNewExpression(node: object | null | undefined, opts?: object): void;
export function assertProgram(node: object | null | undefined, opts?: object): void;
export function assertObjectExpression(node: object | null | undefined, opts?: object): void;
export function assertObjectMethod(node: object | null | undefined, opts?: object): void;
export function assertObjectProperty(node: object | null | undefined, opts?: object): void;
export function assertRestElement(node: object | null | undefined, opts?: object): void;
export function assertReturnStatement(node: object | null | undefined, opts?: object): void;
export function assertSequenceExpression(node: object | null | undefined, opts?: object): void;
export function assertSwitchCase(node: object | null | undefined, opts?: object): void;
export function assertSwitchStatement(node: object | null | undefined, opts?: object): void;
export function assertThisExpression(node: object | null | undefined, opts?: object): void;
export function assertThrowStatement(node: object | null | undefined, opts?: object): void;
export function assertTryStatement(node: object | null | undefined, opts?: object): void;
export function assertUnaryExpression(node: object | null | undefined, opts?: object): void;
export function assertUpdateExpression(node: object | null | undefined, opts?: object): void;
export function assertVariableDeclaration(node: object | null | undefined, opts?: object): void;
export function assertVariableDeclarator(node: object | null | undefined, opts?: object): void;
export function assertWhileStatement(node: object | null | undefined, opts?: object): void;
export function assertWithStatement(node: object | null | undefined, opts?: object): void;
export function assertAssignmentPattern(node: object | null | undefined, opts?: object): void;
export function assertArrayPattern(node: object | null | undefined, opts?: object): void;
export function assertArrowFunctionExpression(node: object | null | undefined, opts?: object): void;
export function assertClassBody(node: object | null | undefined, opts?: object): void;
export function assertClassDeclaration(node: object | null | undefined, opts?: object): void;
export function assertClassExpression(node: object | null | undefined, opts?: object): void;
export function assertExportAllDeclaration(node: object | null | undefined, opts?: object): void;
export function assertExportDefaultDeclaration(node: object | null | undefined, opts?: object): void;
export function assertExportNamedDeclaration(node: object | null | undefined, opts?: object): void;
export function assertExportSpecifier(node: object | null | undefined, opts?: object): void;
export function assertForOfStatement(node: object | null | undefined, opts?: object): void;
export function assertImportDeclaration(node: object | null | undefined, opts?: object): void;
export function assertImportDefaultSpecifier(node: object | null | undefined, opts?: object): void;
export function assertImportNamespaceSpecifier(node: object | null | undefined, opts?: object): void;
export function assertImportSpecifier(node: object | null | undefined, opts?: object): void;
export function assertMetaProperty(node: object | null | undefined, opts?: object): void;
export function assertClassMethod(node: object | null | undefined, opts?: object): void;
export function assertObjectPattern(node: object | null | undefined, opts?: object): void;
export function assertSpreadElement(node: object | null | undefined, opts?: object): void;
export function assertSuper(node: object | null | undefined, opts?: object): void;
export function assertTaggedTemplateExpression(node: object | null | undefined, opts?: object): void;
export function assertTemplateElement(node: object | null | undefined, opts?: object): void;
export function assertTemplateLiteral(node: object | null | undefined, opts?: object): void;
export function assertYieldExpression(node: object | null | undefined, opts?: object): void;
export function assertAnyTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertArrayTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertBooleanTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertBooleanLiteralTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertNullLiteralTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertClassImplements(node: object | null | undefined, opts?: object): void;
export function assertClassProperty(node: object | null | undefined, opts?: object): void;
export function assertDeclareClass(node: object | null | undefined, opts?: object): void;
export function assertDeclareFunction(node: object | null | undefined, opts?: object): void;
export function assertDeclareInterface(node: object | null | undefined, opts?: object): void;
export function assertDeclareModule(node: object | null | undefined, opts?: object): void;
export function assertDeclareTypeAlias(node: object | null | undefined, opts?: object): void;
export function assertDeclareVariable(node: object | null | undefined, opts?: object): void;
export function assertExistentialTypeParam(node: object | null | undefined, opts?: object): void;
export function assertFunctionTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertFunctionTypeParam(node: object | null | undefined, opts?: object): void;
export function assertGenericTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertInterfaceExtends(node: object | null | undefined, opts?: object): void;
export function assertInterfaceDeclaration(node: object | null | undefined, opts?: object): void;
export function assertIntersectionTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertMixedTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertNullableTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertNumericLiteralTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertNumberTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertStringLiteralTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertStringTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertThisTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertTupleTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertTypeofTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertTypeAlias(node: object | null | undefined, opts?: object): void;
export function assertTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertTypeCastExpression(node: object | null | undefined, opts?: object): void;
export function assertTypeParameter(node: object | null | undefined, opts?: object): void;
export function assertTypeParameterDeclaration(node: object | null | undefined, opts?: object): void;
export function assertTypeParameterInstantiation(node: object | null | undefined, opts?: object): void;
export function assertObjectTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertObjectTypeCallProperty(node: object | null | undefined, opts?: object): void;
export function assertObjectTypeIndexer(node: object | null | undefined, opts?: object): void;
export function assertObjectTypeProperty(node: object | null | undefined, opts?: object): void;
export function assertQualifiedTypeIdentifier(node: object | null | undefined, opts?: object): void;
export function assertUnionTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertVoidTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertJSXAttribute(node: object | null | undefined, opts?: object): void;
export function assertJSXClosingElement(node: object | null | undefined, opts?: object): void;
export function assertJSXElement(node: object | null | undefined, opts?: object): void;
export function assertJSXEmptyExpression(node: object | null | undefined, opts?: object): void;
export function assertJSXExpressionContainer(node: object | null | undefined, opts?: object): void;
export function assertJSXIdentifier(node: object | null | undefined, opts?: object): void;
export function assertJSXMemberExpression(node: object | null | undefined, opts?: object): void;
export function assertJSXNamespacedName(node: object | null | undefined, opts?: object): void;
export function assertJSXOpeningElement(node: object | null | undefined, opts?: object): void;
export function assertJSXSpreadAttribute(node: object | null | undefined, opts?: object): void;
export function assertJSXText(node: object | null | undefined, opts?: object): void;
export function assertNoop(node: object | null | undefined, opts?: object): void;
export function assertParenthesizedExpression(node: object | null | undefined, opts?: object): void;
export function assertAwaitExpression(node: object | null | undefined, opts?: object): void;
export function assertBindExpression(node: object | null | undefined, opts?: object): void;
export function assertDecorator(node: object | null | undefined, opts?: object): void;
export function assertDoExpression(node: object | null | undefined, opts?: object): void;
export function assertExportDefaultSpecifier(node: object | null | undefined, opts?: object): void;
export function assertExportNamespaceSpecifier(node: object | null | undefined, opts?: object): void;
export function assertRestProperty(node: object | null | undefined, opts?: object): void;
export function assertSpreadProperty(node: object | null | undefined, opts?: object): void;
export function assertExpression(node: object | null | undefined, opts?: object): void;
export function assertBinary(node: object | null | undefined, opts?: object): void;
export function assertScopable(node: object | null | undefined, opts?: object): void;
export function assertBlockParent(node: object | null | undefined, opts?: object): void;
export function assertBlock(node: object | null | undefined, opts?: object): void;
export function assertStatement(node: object | null | undefined, opts?: object): void;
export function assertTerminatorless(node: object | null | undefined, opts?: object): void;
export function assertCompletionStatement(node: object | null | undefined, opts?: object): void;
export function assertConditional(node: object | null | undefined, opts?: object): void;
export function assertLoop(node: object | null | undefined, opts?: object): void;
export function assertWhile(node: object | null | undefined, opts?: object): void;
export function assertExpressionWrapper(node: object | null | undefined, opts?: object): void;
export function assertFor(node: object | null | undefined, opts?: object): void;
export function assertForXStatement(node: object | null | undefined, opts?: object): void;
export function assertFunction(node: object | null | undefined, opts?: object): void;
export function assertFunctionParent(node: object | null | undefined, opts?: object): void;
export function assertPureish(node: object | null | undefined, opts?: object): void;
export function assertDeclaration(node: object | null | undefined, opts?: object): void;
export function assertLVal(node: object | null | undefined, opts?: object): void;
export function assertLiteral(node: object | null | undefined, opts?: object): void;
export function assertImmutable(node: object | null | undefined, opts?: object): void;
export function assertUserWhitespacable(node: object | null | undefined, opts?: object): void;
export function assertMethod(node: object | null | undefined, opts?: object): void;
export function assertObjectMember(node: object | null | undefined, opts?: object): void;
export function assertProperty(node: object | null | undefined, opts?: object): void;
export function assertUnaryLike(node: object | null | undefined, opts?: object): void;
export function assertPattern(node: object | null | undefined, opts?: object): void;
export function assertClass(node: object | null | undefined, opts?: object): void;
export function assertModuleDeclaration(node: object | null | undefined, opts?: object): void;
export function assertExportDeclaration(node: object | null | undefined, opts?: object): void;
export function assertModuleSpecifier(node: object | null | undefined, opts?: object): void;
export function assertFlow(node: object | null | undefined, opts?: object): void;
export function assertFlowBaseAnnotation(node: object | null | undefined, opts?: object): void;
export function assertFlowDeclaration(node: object | null | undefined, opts?: object): void;
export function assertJSX(node: object | null | undefined, opts?: object): void;
export function assertNumberLiteral(node: object | null | undefined, opts?: object): void;
export function assertRegexLiteral(node: object | null | undefined, opts?: object): void;
export function assertTSAnyKeyword(node: object, opts?: object): void;
export function assertTSArrayType(node: object, opts?: object): void;
export function assertTSAsExpression(node: object, opts?: object): void;
export function assertTSBooleanKeyword(node: object, opts?: object): void;
export function assertTSCallSignatureDeclaration(node: object, opts?: object): void;
export function assertTSConstructSignatureDeclaration(node: object, opts?: object): void;
export function assertTSConstructorType(node: object, opts?: object): void;
export function assertTSDeclareFunction(node: object, opts?: object): void;
export function assertTSDeclareMethod(node: object, opts?: object): void;
export function assertTSEnumDeclaration(node: object, opts?: object): void;
export function assertTSEnumMember(node: object, opts?: object): void;
export function assertTSExportAssignment(node: object, opts?: object): void;
export function assertTSExpressionWithTypeArguments(node: object, opts?: object): void;
export function assertTSExternalModuleReference(node: object, opts?: object): void;
export function assertTSFunctionType(node: object, opts?: object): void;
export function assertTSImportEqualsDeclaration(node: object, opts?: object): void;
export function assertTSIndexSignature(node: object, opts?: object): void;
export function assertTSIndexedAccessType(node: object, opts?: object): void;
export function assertTSInterfaceBody(node: object, opts?: object): void;
export function assertTSInterfaceDeclaration(node: object, opts?: object): void;
export function assertTSIntersectionType(node: object, opts?: object): void;
export function assertTSLiteralType(node: object, opts?: object): void;
export function assertTSMappedType(node: object, opts?: object): void;
export function assertTSMethodSignature(node: object, opts?: object): void;
export function assertTSModuleBlock(node: object, opts?: object): void;
export function assertTSModuleDeclaration(node: object, opts?: object): void;
export function assertTSNamespaceExportDeclaration(node: object, opts?: object): void;
export function assertTSNeverKeyword(node: object, opts?: object): void;
export function assertTSNonNullExpression(node: object, opts?: object): void;
export function assertTSNullKeyword(node: object, opts?: object): void;
export function assertTSNumberKeyword(node: object, opts?: object): void;
export function assertTSObjectKeyword(node: object, opts?: object): void;
export function assertTSParameterProperty(node: object, opts?: object): void;
export function assertTSParenthesizedType(node: object, opts?: object): void;
export function assertTSPropertySignature(node: object, opts?: object): void;
export function assertTSQualifiedName(node: object, opts?: object): void;
export function assertTSStringKeyword(node: object, opts?: object): void;
export function assertTSSymbolKeyword(node: object, opts?: object): void;
export function assertTSThisType(node: object, opts?: object): void;
export function assertTSTupleType(node: object, opts?: object): void;
export function assertTSTypeAliasDeclaration(node: object, opts?: object): void;
export function assertTSTypeAnnotation(node: object, opts?: object): void;
export function assertTSTypeAssertion(node: object, opts?: object): void;
export function assertTSTypeLiteral(node: object, opts?: object): void;
export function assertTSTypeOperator(node: object, opts?: object): void;
export function assertTSTypeParameter(node: object, opts?: object): void;
export function assertTSTypeParameterDeclaration(node: object, opts?: object): void;
export function assertTSTypeParameterInstantiation(node: object, opts?: object): void;
export function assertTSTypePredicate(node: object, opts?: object): void;
export function assertTSTypeQuery(node: object, opts?: object): void;
export function assertTSTypeReference(node: object, opts?: object): void;
export function assertTSUndefinedKeyword(node: object, opts?: object): void;
export function assertTSUnionType(node: object, opts?: object): void;
export function assertTSVoidKeyword(node: object, opts?: object): void;
export function assertTSAnyKeyword(node: object | null | undefined, opts?: object): void;
export function assertTSArrayType(node: object | null | undefined, opts?: object): void;
export function assertTSAsExpression(node: object | null | undefined, opts?: object): void;
export function assertTSBooleanKeyword(node: object | null | undefined, opts?: object): void;
export function assertTSCallSignatureDeclaration(node: object | null | undefined, opts?: object): void;
export function assertTSConstructSignatureDeclaration(node: object | null | undefined, opts?: object): void;
export function assertTSConstructorType(node: object | null | undefined, opts?: object): void;
export function assertTSDeclareFunction(node: object | null | undefined, opts?: object): void;
export function assertTSDeclareMethod(node: object | null | undefined, opts?: object): void;
export function assertTSEnumDeclaration(node: object | null | undefined, opts?: object): void;
export function assertTSEnumMember(node: object | null | undefined, opts?: object): void;
export function assertTSExportAssignment(node: object | null | undefined, opts?: object): void;
export function assertTSExpressionWithTypeArguments(node: object | null | undefined, opts?: object): void;
export function assertTSExternalModuleReference(node: object | null | undefined, opts?: object): void;
export function assertTSFunctionType(node: object | null | undefined, opts?: object): void;
export function assertTSImportEqualsDeclaration(node: object | null | undefined, opts?: object): void;
export function assertTSIndexSignature(node: object | null | undefined, opts?: object): void;
export function assertTSIndexedAccessType(node: object | null | undefined, opts?: object): void;
export function assertTSInterfaceBody(node: object | null | undefined, opts?: object): void;
export function assertTSInterfaceDeclaration(node: object | null | undefined, opts?: object): void;
export function assertTSIntersectionType(node: object | null | undefined, opts?: object): void;
export function assertTSLiteralType(node: object | null | undefined, opts?: object): void;
export function assertTSMappedType(node: object | null | undefined, opts?: object): void;
export function assertTSMethodSignature(node: object | null | undefined, opts?: object): void;
export function assertTSModuleBlock(node: object | null | undefined, opts?: object): void;
export function assertTSModuleDeclaration(node: object | null | undefined, opts?: object): void;
export function assertTSNamespaceExportDeclaration(node: object | null | undefined, opts?: object): void;
export function assertTSNeverKeyword(node: object | null | undefined, opts?: object): void;
export function assertTSNonNullExpression(node: object | null | undefined, opts?: object): void;
export function assertTSNullKeyword(node: object | null | undefined, opts?: object): void;
export function assertTSNumberKeyword(node: object | null | undefined, opts?: object): void;
export function assertTSObjectKeyword(node: object | null | undefined, opts?: object): void;
export function assertTSParameterProperty(node: object | null | undefined, opts?: object): void;
export function assertTSParenthesizedType(node: object | null | undefined, opts?: object): void;
export function assertTSPropertySignature(node: object | null | undefined, opts?: object): void;
export function assertTSQualifiedName(node: object | null | undefined, opts?: object): void;
export function assertTSStringKeyword(node: object | null | undefined, opts?: object): void;
export function assertTSSymbolKeyword(node: object | null | undefined, opts?: object): void;
export function assertTSThisType(node: object | null | undefined, opts?: object): void;
export function assertTSTupleType(node: object | null | undefined, opts?: object): void;
export function assertTSTypeAliasDeclaration(node: object | null | undefined, opts?: object): void;
export function assertTSTypeAnnotation(node: object | null | undefined, opts?: object): void;
export function assertTSTypeAssertion(node: object | null | undefined, opts?: object): void;
export function assertTSTypeLiteral(node: object | null | undefined, opts?: object): void;
export function assertTSTypeOperator(node: object | null | undefined, opts?: object): void;
export function assertTSTypeParameter(node: object | null | undefined, opts?: object): void;
export function assertTSTypeParameterDeclaration(node: object | null | undefined, opts?: object): void;
export function assertTSTypeParameterInstantiation(node: object | null | undefined, opts?: object): void;
export function assertTSTypePredicate(node: object | null | undefined, opts?: object): void;
export function assertTSTypeQuery(node: object | null | undefined, opts?: object): void;
export function assertTSTypeReference(node: object | null | undefined, opts?: object): void;
export function assertTSUndefinedKeyword(node: object | null | undefined, opts?: object): void;
export function assertTSUnionType(node: object | null | undefined, opts?: object): void;
export function assertTSVoidKeyword(node: object | null | undefined, opts?: object): void;
+1 -1
View File
@@ -6,7 +6,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
+56
View File
@@ -39,3 +39,59 @@ babel.transformFromAstAsync(parsedAst!, sourceCode, options).then(transformFromA
const { code, map, ast } = transformFromAstAsyncResult!;
const { body } = ast!.program;
});
function checkOptions(_options: babel.TransformOptions) {}
function checkConfigFunction(_config: babel.ConfigFunction) {}
checkOptions({ envName: 'banana' });
// babel uses object destructuring default to provide the envName fallback so null is not allowed
// $ExpectError
checkOptions({ envName: null });
checkOptions({ caller: { name: '@babel/register' } });
checkOptions({ caller: { name: 'babel-jest', supportsStaticESM: false } });
// don't add an index signature; users should augment the interface instead if they need to
// $ExpectError
checkOptions({ caller: { name: '', tomato: true } });
checkOptions({ rootMode: 'upward-optional' });
// $ExpectError
checkOptions({ rootMode: 'potato' });
// $ExpectError
checkConfigFunction(() => {});
// you technically can do that though you probably shouldn't
checkConfigFunction(() => ({}));
checkConfigFunction(api => {
api.assertVersion(7);
api.assertVersion("^7.2");
api.cache.forever();
api.cache.never();
api.cache.using(() => true);
api.cache.using(() => 1);
api.cache.using(() => '1');
api.cache.using(() => null);
api.cache.using(() => undefined);
// $ExpectError
api.cache.using(() => ({}));
api.cache.invalidate(() => 2);
// $ExpectType string
api.env();
api.env('development');
api.env(['production', 'test']);
// $ExpectType 42
api.env(name => 42);
// $ExpectType string
api.version;
return {
shouldPrintComment(comment) {
// $ExpectType string
comment;
return true;
}
};
});
+153 -2
View File
@@ -1,8 +1,9 @@
// Type definitions for @babel/core 7.0
// Type definitions for @babel/core 7.1
// Project: https://github.com/babel/babel/tree/master/packages/babel-core, https://babeljs.io
// Definitions by: Troy Gerwien <https://github.com/yortus>
// Marvin Hagemeister <https://github.com/marvinhagemeister>
// Melvin Groenhoff <https://github.com/mgroenhoff>
// Jessica Franco <https://github.com/Jessidhia>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
@@ -54,6 +55,15 @@ export interface TransformOptions {
*/
root?: string | null;
/**
* This option, combined with the "root" value, defines how Babel chooses its project root.
* The different modes define different ways that Babel can process the "root" value to get
* the final project root.
*
* @see https://babeljs.io/docs/en/next/options#rootmode
*/
rootMode?: 'root' | 'upward' | 'upward-optional';
/**
* The config file to load Babel's config from. Defaults to searching for "babel.config.js" inside the "root" folder. `false` will disable searching for config files.
*
@@ -82,7 +92,7 @@ export interface TransformOptions {
*
* Default: env vars
*/
envName?: string | null;
envName?: string;
/**
* Enable code generation
@@ -112,6 +122,14 @@ export interface TransformOptions {
*/
cwd?: string | null;
/**
* Utilities may pass a caller object to identify themselves to Babel and
* pass capability-related flags for use by configs, presets and plugins.
*
* @see https://babeljs.io/docs/en/next/options#caller
*/
caller?: TransformCaller;
/**
* This is an object of keys that represent different environments. For example, you may have: `{ env: { production: { \/* specific options *\/ } } }`
* which will use those options when the `envName` is `production`
@@ -284,6 +302,14 @@ export interface TransformOptions {
wrapPluginVisitorMethod?: ((pluginAlias: string, visitorType: "enter" | "exit", callback: (path: NodePath, state: any) => void) => (path: NodePath, state: any) => void) | null;
}
export interface TransformCaller {
// the only required property
name: string;
// e.g. set to true by `babel-loader` and false by `babel-jest`
supportsStaticESM?: boolean;
// augment this with a "declare module '@babel/core' { ... }" if you need more keys
}
export type FileResultCallback = (err: Error | null, result: BabelFileResult | null) => any;
/**
@@ -528,4 +554,129 @@ export interface CreateConfigItemOptions {
*/
export function createConfigItem(value: PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined], options?: CreateConfigItemOptions): ConfigItem;
// NOTE: the documentation says the ConfigAPI also exposes @babel/core's exports, but it actually doesn't
/**
* @see https://babeljs.io/docs/en/next/config-files#config-function-api
*/
export interface ConfigAPI {
/**
* The version string for the Babel version that is loading the config file.
*
* @see https://babeljs.io/docs/en/next/config-files#apiversion
*/
version: string;
/**
* @see https://babeljs.io/docs/en/next/config-files#apicache
*/
cache: SimpleCacheConfigurator;
/**
* @see https://babeljs.io/docs/en/next/config-files#apienv
*/
env: EnvFunction;
// undocumented; currently hardcoded to return 'false'
// async(): boolean
/**
* This API is used as a way to access the `caller` data that has been passed to Babel.
* Since many instances of Babel may be running in the same process with different `caller` values,
* this API is designed to automatically configure `api.cache`, the same way `api.env()` does.
*
* The `caller` value is available as the first parameter of the callback function.
* It is best used with something like this to toggle configuration behavior
* based on a specific environment:
*
* @example
* function isBabelRegister(caller?: { name: string }) {
* return !!(caller && caller.name === "@babel/register")
* }
* api.caller(isBabelRegister)
*
* @see https://babeljs.io/docs/en/next/config-files#apicallercb
*/
caller<T extends SimpleCacheKey>(callerCallback: (caller: TransformOptions['caller']) => T): T;
/**
* While `api.version` can be useful in general, it's sometimes nice to just declare your version.
* This API exposes a simple way to do that with:
*
* @example
* api.assertVersion(7) // major version only
* api.assertVersion("^7.2")
*
* @see https://babeljs.io/docs/en/next/config-files#apiassertversionrange
*/
assertVersion(versionRange: number | string): boolean;
// NOTE: this is an undocumented reexport from "@babel/parser" but it's missing from its types
// tokTypes: typeof tokTypes
}
/**
* JS configs are great because they can compute a config on the fly,
* but the downside there is that it makes caching harder.
* Babel wants to avoid re-executing the config function every time a file is compiled,
* because then it would also need to re-execute any plugin and preset functions
* referenced in that config.
*
* To avoid this, Babel expects users of config functions to tell it how to manage caching
* within a config file.
*
* @see https://babeljs.io/docs/en/next/config-files#apicache
*/
export interface SimpleCacheConfigurator {
// there is an undocumented call signature that is a shorthand for forever()/never()/using().
// (ever: boolean): void
// <T extends SimpleCacheKey>(callback: CacheCallback<T>): T
/**
* Permacache the computed config and never call the function again.
*/
forever(): void;
/**
* Do not cache this config, and re-execute the function every time.
*/
never(): void;
/**
* Any time the using callback returns a value other than the one that was expected,
* the overall config function will be called again and a new entry will be added to the cache.
*
* @example
* api.cache.using(() => process.env.NODE_ENV)
*/
using<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
/**
* Any time the using callback returns a value other than the one that was expected,
* the overall config function will be called again and all entries in the cache will
* be replaced with the result.
*
* @example
* api.cache.invalidate(() => process.env.NODE_ENV)
*/
invalidate<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
}
// https://github.com/babel/babel/blob/v7.3.3/packages/babel-core/src/config/caching.js#L231
export type SimpleCacheKey = string | boolean | number | null | undefined;
export type SimpleCacheCallback<T extends SimpleCacheKey> = () => T;
/**
* Since `NODE_ENV` is a fairly common way to toggle behavior, Babel also includes an API function
* meant specifically for that. This API is used as a quick way to check the `"envName"` that Babel
* was loaded with, which takes `NODE_ENV` into account if no other overriding environment is set.
*
* @see https://babeljs.io/docs/en/next/config-files#apienv
*/
export interface EnvFunction {
/**
* @returns the current `envName` string
*/
(): string;
/**
* @returns `true` if the `envName` is `===` any of the given strings
*/
(envName: string | ReadonlyArray<string>): boolean;
// the official documentation is misleading for this one...
// this just passes the callback to `cache.using` but with an additional argument.
// it returns its result instead of necessarily returning a boolean.
<T extends SimpleCacheKey>(envCallback: (envName: NonNullable<TransformOptions['envName']>) => T): T;
}
export type ConfigFunction = (api: ConfigAPI) => TransformOptions;
export as namespace babel;
+1 -1
View File
@@ -1,5 +1,5 @@
// Type definitions for Backbone-associations 0.6.4
// Project: https://github.com/dhruvaray/backbone-associations/
// Project: http://dhruvaray.github.io/backbone-associations
// Definitions by: Craig Brett <https://github.com/craigbrett17>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
+120 -137
View File
@@ -7,180 +7,163 @@
/// <reference types="jquery" />
import { Events, EventsHash, Model as BModel, Collection } from 'backbone';
import { EventsMixin, Events, Model as BModel, Collection } from 'backbone';
declare module 'backbone-relational' {
class Model extends BModel {
/**
* Do not use, prefer TypeScript's extend functionality.
**/
//private static extend(properties:any, classProperties?:any):any;
export class Model extends BModel {
/**
* Do not use, prefer TypeScript's extend functionality.
**/
//private static extend(properties:any, classProperties?:any):any;
relations:any;
subModelTypes:any;
subModelTypeAttribute:any;
relations:any;
subModelTypes:any;
subModelTypeAttribute:any;
initializeRelations(options:any):void;
initializeRelations(options:any):void;
updateRelations(options:any):void;
updateRelations(options:any):void;
queue(func:any):void;
queue(func:any):void;
processQueue():void;
processQueue():void;
getRelation(name:string):Relation;
getRelation(name:string):Relation;
getRelations():Relation[];
getRelations():Relation[];
fetchRelated(key:string, options?:any, update?:boolean):any;
fetchRelated(key:string, options?:any, update?:boolean):any;
toJSON(options?: any):any;
toJSON(options?: any):any;
static setup();
static setup();
static build(attributes:any, options?:any);
static build(attributes:any, options?:any);
static findOrCreate(attributes:string, options?:any);
static findOrCreate(attributes:string, options?:any);
static findOrCreate(attributes:number, options?:any);
static findOrCreate(attributes:number, options?:any);
static findOrCreate(attributes:any, options?:any);
}
static findOrCreate(attributes:any, options?:any);
}
export class Relation extends BModel {
export class Relation extends BModel {
options:any;
instance:any;
key:any;
keyContents:any;
relatedModel:any;
relatedCollection:any;
reverseRelation:any;
related:any;
options:any;
instance:any;
key:any;
keyContents:any;
relatedModel:any;
relatedCollection:any;
reverseRelation:any;
related:any;
checkPreconditions():boolean;
checkPreconditions():boolean;
setRelated(related:BModel):void;
setRelated(related:BModel):void;
setRelated(related:Collection<BModel>):void;
setRelated(related:Collection<BModel>):void;
getReverseRelations(model:Model):Relation;
getReverseRelations(model:Model):Relation;
destroy():void;
}
destroy():void;
}
export class HasOne extends Relation {
collectionType:any;
export class HasOne extends Relation {
collectionType:any;
findRelated(options:any):BModel;
findRelated(options:any):BModel;
setKeyContents(keyContents:string):void;
setKeyContents(keyContents:string):void;
setKeyContents(keyContents:string[]):void;
setKeyContents(keyContents:string[]):void;
setKeyContents(keyContents:number):void;
setKeyContents(keyContents:number):void;
setKeyContents(keyContents:number[]):void;
setKeyContents(keyContents:number[]):void;
setKeyContents(keyContents:Collection<BModel>):void;
setKeyContents(keyContents:Collection<BModel>):void;
onChange(model:BModel, attr:any, options:any):void;
onChange(model:BModel, attr:any, options:any):void;
handleAddition(model:BModel, coll:Collection<BModel>, options:any):void;
handleAddition(model:BModel, coll:Collection<BModel>, options:any):void;
handleRemoval(model:BModel, coll:Collection<BModel>, options:any):void;
handleRemoval(model:BModel, coll:Collection<BModel>, options:any):void;
handleReset(coll:Collection<BModel>, options:any):void;
handleReset(coll:Collection<BModel>, options:any):void;
tryAddRelated(model:BModel, coll:any, options:any):void;
tryAddRelated(model:BModel, coll:any, options:any):void;
addRelated(model:BModel, options:any):void;
addRelated(model:BModel, options:any):void;
removeRelated(model:BModel, coll:any, options:any):void;
}
export class HasMany extends Relation {
collectionType:any;
findRelated(options:any):BModel;
setKeyContents(keyContents:string):void;
setKeyContents(keyContents:number):void;
setKeyContents(keyContents:BModel):void;
onChange(model:BModel, attr:any, options:any):void;
tryAddRelated(model:BModel, coll:any, options:any):void;
addRelated(model:BModel, options:any):void;
removeRelated(model:BModel, coll:any, options:any):void;
}
export class Store implements Events {
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
on(eventMap: EventsHash): any;
on(eventName: any, callback?: any, context?: any): any;
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
trigger(eventName: string, ...args: any[]): any;
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
once(events: string, callback: (...args: any[]) => void, context?: any): any;
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
initializeRelation(model, relation, options);
addModelScope(scope:any):void;
removeModelScope(scope):void;
addSubModels(subModelTypes:Model, superModelType:Model):void;
setupSuperModel(modelType:Model):void;
addReverseRelation(relation:any):void;
addOrphanRelation(relation:any):void;
processOrphanRelations():void;
retroFitRelation(relation:Model, create:boolean):Collection<BModel>;
getCollection(type:Model, create:boolean):Collection<BModel>;
getObjectByName(name:string):any;
resolveIdForItem(type:any, item:any):any;
static find(type:any, item:string):Model;
static find(type:any, item:number):Model;
static find(type:any, item:Model):Model;
static find(type:any, item:any):Model;
register(model:Model):void;
checkId(model:Model, id:any):void;
update(model:Model):void;
unregister(model:Model, collection:Collection<BModel>, options:any):void;
reset():void;
}
removeRelated(model:BModel, coll:any, options:any):void;
}
export class HasMany extends Relation {
collectionType:any;
findRelated(options:any):BModel;
setKeyContents(keyContents:string):void;
setKeyContents(keyContents:number):void;
setKeyContents(keyContents:BModel):void;
onChange(model:BModel, attr:any, options:any):void;
tryAddRelated(model:BModel, coll:any, options:any):void;
addRelated(model:BModel, options:any):void;
removeRelated(model:BModel, coll:any, options:any):void;
}
export class Store extends EventsMixin implements Events {
initializeRelation(model, relation, options);
addModelScope(scope:any):void;
removeModelScope(scope):void;
addSubModels(subModelTypes:Model, superModelType:Model):void;
setupSuperModel(modelType:Model):void;
addReverseRelation(relation:any):void;
addOrphanRelation(relation:any):void;
processOrphanRelations():void;
retroFitRelation(relation:Model, create:boolean):Collection<BModel>;
getCollection(type:Model, create:boolean):Collection<BModel>;
getObjectByName(name:string):any;
resolveIdForItem(type:any, item:any):any;
static find(type:any, item:string):Model;
static find(type:any, item:number):Model;
static find(type:any, item:Model):Model;
static find(type:any, item:any):Model;
register(model:Model):void;
checkId(model:Model, id:any):void;
update(model:Model):void;
unregister(model:Model, collection:Collection<BModel>, options:any):void;
reset():void;
}
-55
View File
@@ -1,79 +1,24 @@
{
"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
}
}
+6 -11
View File
@@ -6,6 +6,7 @@
// Volker Nauruhn <https://github.com/razorness>,
// Ard Timmerman <https://github.com/confususs>,
// J. Joe Koullas <https://github.com/jjoekoullas>
// Julian Gonggrijp <https://github.com/jgonggrijp>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -407,20 +408,14 @@ export interface ObjectOptions extends RadioMixinOptions {
* A base class which other classes can extend from. Object incorporates many
* backbone conventions and utilities like initialize and Backbone.Events.
*/
export class Object implements CommonMixin, RadioMixin, Backbone.Events {
export class Object extends Backbone.EventsMixin implements CommonMixin, RadioMixin, Backbone.Events {
constructor(options?: ObjectOptions);
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
on(eventMap: EventsHash): any;
/**
* Faulty overgeneralization of Backbone.Events.on, for historical
* reasons.
*/
on(eventName: any, callback?: any, context?: any): any;
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
trigger(eventName: string, ...args: any[]): any;
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
once(events: string, callback: (...args: any[]) => void, context?: any): any;
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
/**
* Receives a hash of event names and functions and/or function names,
+6 -11
View File
@@ -1,6 +1,7 @@
// Type definitions for Backbone.Radio v0.8.3
// Project: https://github.com/marionettejs/backbone.radio
// Definitions by: Peter Palotas <https://github.com/alphaleonis>
// Julian Gonggrijp <https://github.com/jgonggrijp>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -71,18 +72,12 @@ declare module "backbone" {
stopReplying(commandName?: string, callback?: (...args: any[]) => any, context?: any): Requests;
}
class Channel implements Commands, Requests, Backbone.Events {
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
on(eventMap: EventsHash): any;
class Channel extends Backbone.EventsMixin implements Commands, Requests, Backbone.Events {
/**
* Faulty overgeneralization of Backbone.Events.on, for historical
* reasons.
*/
on(eventName: any, callback?: any, context?: any): any;
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
trigger(eventName: string, ...args: any[]): any;
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
once(events: string, callback: (...args: any[]) => void, context?: any): any;
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
channelName: string;
reset(): Channel;
+49 -1
View File
@@ -15,6 +15,50 @@ function test_events() {
object.off();
}
class PubSub implements Backbone.Events {
on: Backbone.Events_On<PubSub>;
off: Backbone.Events_Off<PubSub>;
trigger: Backbone.Events_Trigger<PubSub>;
bind: Backbone.Events_On<PubSub>;
unbind: Backbone.Events_Off<PubSub>;
once: Backbone.Events_On<PubSub>;
listenTo: Backbone.Events_Listen<PubSub>;
listenToOnce: Backbone.Events_Listen<PubSub>;
stopListening: Backbone.Events_Stop<PubSub>;
}
Object.assign(PubSub.prototype, Backbone.Events);
function test_events_shorthands() {
let channel1 = new PubSub();
let channel2 = new PubSub();
let onChange = () => alert('whatever');
channel1.on("alert", (eventName: string) => alert("Triggered " + eventName));
channel1.trigger("alert", "an event");
channel1.once('invalid', () => { }, this);
channel1.once('invalid', () => { });
channel1.once({invalid: () => { }, success: () => { }}, this);
channel1.once({invalid: () => { }, success: () => { }});
channel1.off("change", onChange);
channel1.off("change");
channel1.off(null, onChange);
channel1.off(null, null, this);
channel1.off();
channel2.listenTo(channel1, 'invalid', () => { });
channel2.listenTo(channel1, {invalid: () => { }, success: () => { }});
channel2.listenToOnce(channel1, 'invalid', () => { });
channel2.listenToOnce(channel1, {invalid: () => { }, success: () => { }});
channel2.stopListening(channel1, 'invalid', () => { });
channel2.stopListening(channel1, 'invalid');
channel2.stopListening(channel1);
}
class SettingDefaults extends Backbone.Model {
// 'defaults' could be set in one of the following ways:
@@ -272,18 +316,22 @@ namespace v1Changes {
var model = new Employee;
model.once('invalid', () => { }, this);
model.once('invalid', () => { });
model.once({invalid: () => { }, success: () => { }}, this);
model.once({invalid: () => { }, success: () => { }});
}
function test_listenTo() {
var model = new Employee;
var view = new Backbone.View<Employee>();
view.listenTo(model, 'invalid', () => { });
view.listenTo(model, {invalid: () => { }, success: () => { }});
}
function test_listenToOnce() {
var model = new Employee;
var view = new Backbone.View<Employee>();
view.listenToOnce(model, 'invalid', () => { });
view.listenToOnce(model, {invalid: () => { }, success: () => { }});
}
function test_stopListening() {
@@ -398,7 +446,7 @@ namespace v1Changes {
namespace Collection {
function test_fetch() {
var collection = new EmployeeCollection;
collection.fetch({
collection.fetch({
reset: true,
remove: false
});
+101 -48
View File
@@ -1,9 +1,11 @@
// Type definitions for Backbone 1.3.3
// Project: http://backbonejs.org/
// https://github.com/jashkenas/backbone
// Definitions by: Boris Yankov <https://github.com/borisyankov>
// Natan Vivo <https://github.com/nvivo>
// kenjiru <https://github.com/kenjiru>
// jjoekoullas <https://github.com/jjoekoullas>
// Julian Gonggrijp <https://github.com/jgonggrijp>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -91,44 +93,113 @@ declare namespace Backbone {
[routePattern: string]: string | {(...urlParts: string[]): void};
}
/**
* DOM events (used in the events property of a View)
*/
interface EventsHash {
[selector: string]: string | {(eventObject: JQuery.TriggeredEvent): void};
}
export const Events: Events;
interface Events {
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
on(eventMap: EventsHash): any;
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
trigger(eventName: string, ...args: any[]): any;
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
once(events: string, callback: (...args: any[]) => void, context?: any): any;
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
/**
* JavaScript events (used in the methods of the Events interface)
*/
interface EventHandler {
(...args: any[]): void;
}
interface EventMap {
[event: string]: EventHandler;
}
class ModelBase implements Events {
on(eventName: string, callback?: Function, context?: any): any;
on(eventMap: EventsHash): any;
on(eventName: any, callback?: any, context?: any): any
off(eventName?: string, callback?: Function, context?: any): any
trigger(eventName: string, ...args: any[]): any
bind(eventName: string, callback: Function, context?: any): any
unbind(eventName?: string, callback?: Function, context?: any): any
once(events: string, callback: Function, context?: any): any
listenTo(object: any, events: string, callback: Function):any
listenToOnce(object: any, events: string, callback: Function): any
stopListening(object?: any, events?: string, callback?: Function): any
export const Events: Events;
interface Events extends EventsMixin { }
/**
* Helper shorthands for classes that implement the Events interface.
* Define your class like this:
*
* import {
* Events,
* Events_On,
* Events_Off,
* Events_Trigger,
* Events_Listen,
* Events_Stop,
* } from 'backbone';
*
* class YourClass implements Events {
* on: Events_On<YourClass>;
* off: Events_Off<YourClass>;
* trigger: Events_Trigger<YourClass>;
* bind: Events_On<YourClass>;
* unbind: Events_Off<YourClass>;
*
* once: Events_On<YourClass>;
* listenTo: Events_Listen<YourClass>;
* listenToOnce: Events_Listen<YourClass>;
* stopListening: Events_Stop<YourClass>;
*
* // ... (other methods)
* }
*
* Object.assign(YourClass.prototype, Events); // can also use _.extend
*
* If you are just writing a class type declaration that doesn't already
* extend some other base class, you can use the EventsMixin instead;
* see below.
*/
interface Events_On<BaseT> {
<T extends BaseT>(this: T, eventName: string, callback: EventHandler, context?: any): T;
<T extends BaseT>(this: T, eventMap: EventMap, context?: any): T;
}
interface Events_Off<BaseT> {
<T extends BaseT>(this: T, eventName?: string, callback?: EventHandler, context?: any): T;
}
interface Events_Trigger<BaseT> {
<T extends BaseT>(this: T, eventName: string, ...args: any[]): T;
}
interface Events_Listen<BaseT> {
<T extends BaseT>(this: T, object: any, events: string, callback: EventHandler): T;
<T extends BaseT>(this: T, object: any, eventMap: EventMap): T;
}
interface Events_Stop<BaseT> {
<T extends BaseT>(this: T, object?: any, events?: string, callback?: EventHandler): T;
}
/**
* Helper to avoid code repetition in type declarations.
* Backbone.Events cannot be extended, hence a separate abstract
* class with a different name. Both classes and interfaces can
* extend from this helper class to reuse the signatures.
*
* For class type declarations that already extend another base
* class, and for actual class definitions, please see the
* Events_* interfaces above.
*/
abstract class EventsMixin implements Events {
on(eventName: string, callback: EventHandler, context?: any): this;
on(eventMap: EventMap, context?: any): this;
off(eventName?: string, callback?: EventHandler, context?: any): this;
trigger(eventName: string, ...args: any[]): this;
bind(eventName: string, callback: EventHandler, context?: any): this;
bind(eventMap: EventMap, context?: any): this;
unbind(eventName?: string, callback?: EventHandler, context?: any): this;
once(events: string, callback: EventHandler, context?: any): this;
once(eventMap: EventMap, context?: any): this;
listenTo(object: any, events: string, callback: EventHandler): this;
listenTo(object: any, eventMap: EventMap): this;
listenToOnce(object: any, events: string, callback: EventHandler): this;
listenToOnce(object: any, eventMap: EventMap): this;
stopListening(object?: any, events?: string, callback?: EventHandler): this;
}
class ModelBase extends EventsMixin {
parse(response: any, options?: any): any;
toJSON(options?: any): any;
sync(...arg: any[]): JQueryXHR;
}
class Model extends ModelBase {
class Model extends ModelBase implements Events {
/**
* Do not use, prefer TypeScript's extend functionality.
@@ -229,7 +300,7 @@ declare namespace Backbone {
matches(attrs: any): boolean;
}
class Collection<TModel extends Model> extends ModelBase {
class Collection<TModel extends Model> extends ModelBase implements Events {
/**
* Do not use, prefer TypeScript's extend functionality.
@@ -367,7 +438,7 @@ declare namespace Backbone {
without(...values: TModel[]): TModel[];
}
class Router extends EventSignatures {
class Router extends EventsMixin implements Events {
/**
* Do not use, prefer TypeScript's extend functionality.
@@ -396,7 +467,7 @@ declare namespace Backbone {
var history: History;
class History extends EventSignatures {
class History extends EventsMixin implements Events {
handlers: any[];
interval: number;
@@ -433,7 +504,7 @@ declare namespace Backbone {
attributes?: {[id: string]: any};
}
class View<TModel extends Model> extends EventSignatures {
class View<TModel extends Model> extends EventsMixin implements Events {
/**
* Do not use, prefer TypeScript's extend functionality.
@@ -485,21 +556,3 @@ declare namespace Backbone {
function noConflict(): typeof Backbone;
var $: JQueryStatic;
}
/**
* This is not for external use and is only here as a convenient way to
* specify signatures for internal implementers of Backbone.Events
*/
declare abstract class EventSignatures implements Backbone.Events {
on(eventName: string, callback?: (...args: any[]) => void, context?: any): any;
on(eventMap: Backbone.EventsHash): any;
off(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
trigger(eventName: string, ...args: any[]): any;
bind(eventName: string, callback: (...args: any[]) => void, context?: any): any;
unbind(eventName?: string, callback?: (...args: any[]) => void, context?: any): any;
once(events: string, callback: (...args: any[]) => void, context?: any): any;
listenTo(object: any, events: string, callback: (...args: any[]) => void): any;
listenToOnce(object: any, events: string, callback: (...args: any[]) => void): any;
stopListening(object?: any, events?: string, callback?: (...args: any[]) => void): any;
}
-38
View File
@@ -8,73 +8,35 @@
"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-angle-bracket-type-assertion": 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
}
}
+1 -1
View File
@@ -4287,7 +4287,7 @@ declare namespace swan {
Methods,
Props
> = object &
ComponentOptions<V, Data | ((this: V) => Data), Methods, Props> &
ComponentOptions<V, Data, Methods, Props> &
ThisType<CombinedInstance<V, Data, Methods, Readonly<Props>>>;
interface ComponentRelation<D = any, P = any> {
+23
View File
@@ -0,0 +1,23 @@
import * as bitTwiddle from "bit-twiddle";
bitTwiddle.INT_BITS;
bitTwiddle.INT_MAX;
bitTwiddle.INT_MIN;
bitTwiddle.sign(5);
bitTwiddle.abs(-5);
bitTwiddle.min(1, 6);
bitTwiddle.max(6, 1);
bitTwiddle.isPow2(3);
bitTwiddle.log2(3);
bitTwiddle.log10(3);
bitTwiddle.popCount(4);
bitTwiddle.countTrailingZeros(3.0000003);
bitTwiddle.nextPow2(31.315);
bitTwiddle.prevPow2(31.315);
bitTwiddle.parity(123);
bitTwiddle.interleave2(12, 24);
bitTwiddle.deinterleave2(24, 12);
bitTwiddle.interleave3(24, 12, 6);
bitTwiddle.deinterleave3(24, 12);
bitTwiddle.nextCombination(41.935);
+101
View File
@@ -0,0 +1,101 @@
// Type definitions for bit-twiddle 1.0
// Project: https://github.com/mikolalysenko/bit-twiddle
// Definitions by: Adam Zerella <https://github.com/adamzerella>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.3
export const INT_BITS: number;
export const INT_MAX: number;
export const INT_MIN: number;
/**
* Computes the sign of the integer.
*/
export function sign(value: number): number;
/**
* Returns the absolute value of the integer.
*/
export function abs(value: number): number;
/**
* Computes the minimum of integers x and y.
*/
export function min(x: number, y: number): number;
/**
* Computes the maximum of integers x and y.
*/
export function max(x: number, y: number): number;
/**
* Returns true if value is a power of 2, otherwise false.
*/
export function isPow2(value: number): boolean;
/**
* Returns an integer approximation of the log-base 2 of value.
*/
export function log2(value: number): number;
/**
* Returns an integer approximation of the log-base 10 of value.
*/
export function log10(value: number): number;
/**
* Counts the number of bits set in value.
*/
export function popCount(value: number): number;
/**
* Counts the number of trailing zeros.
*/
export function countTrailingZeros(value: number): number;
/**
* Rounds value up to the next power of 2.
*/
export function nextPow2(value: number): number;
/**
* Rounds value down to the previous power of 2.
*/
export function prevPow2(value: number): number;
/**
* Computes the parity of the bits in value.
*/
export function parity(value: number): number;
/**
* Reverses the bits of value.
*/
export function reverse(value: number): number;
/**
* Interleaves a pair of 16 bit integers. Useful for fast quadtree style indexing.
* @see http://en.wikipedia.org/wiki/Z-order_curve
*/
export function interleave2(x: number, y: number): number;
/**
* Deinterleaves the bits of value, returns the nth part.
* If both x and y are 16 bit.
*/
export function deinterleave2(x: number, y: number): number;
/**
* Interleaves a triple of 10 bit integers. Useful for fast octree indexing.
*/
export function interleave3(x: number, y: number, z: number): number;
/**
* Same deal as deinterleave2, only for triples instead of pairs.
*/
export function deinterleave3(x: number, y: number): number;
/**
* Returns next combination ordered colexicographically.
*/
export function nextCombination(x: number): number;
+25
View File
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [
],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"bit-twiddle-tests.ts"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}
+14 -10
View File
@@ -113,12 +113,15 @@
import Bluebird = require("bluebird");
declare global {
type IterateFunction<T, R> = (item: T, index: number, arrayLength: number) => (R | PromiseLike<R>);
/*
* Patch all instance method
*/
interface Promise<T> {
all: Bluebird<T>["all"];
any: Bluebird<T>["any"];
all(this: Promise<Iterable<{}>>): Bluebird<T>;
all(): Bluebird<never>;
any<Q>(this: Promise<T & Iterable<Q>>): Bluebird<Q>;
any(): Bluebird<never>;
asCallback: Bluebird<T>["asCallback"];
bind: Bluebird<T>["bind"];
call: Bluebird<T>["call"];
@@ -128,9 +131,9 @@ declare global {
delay: Bluebird<T>["delay"];
disposer: Bluebird<T>["disposer"];
done: Bluebird<T>["done"];
each: Bluebird<T>["each"];
each<Q>(this: Promise<T & Iterable<Q>>, iterator: IterateFunction<Q, any>): Bluebird<T>;
error: Bluebird<T>["error"];
filter: Bluebird<T>["filter"];
filter<Q>(this: Promise<T & Iterable<Q>>, filterer: IterateFunction<Q, boolean>, options?: Bluebird.ConcurrencyOption): Bluebird<T>;
// finally: Bluebird<T>["finally"]; // Provided by lib.es2018.promise.d.ts
get: Bluebird<T>["get"];
isCancelled: Bluebird<T>["isCancelled"];
@@ -139,17 +142,18 @@ declare global {
isRejected: Bluebird<T>["isRejected"];
isResolved: Bluebird<T>["isResolved"];
lastly: Bluebird<T>["lastly"];
map: Bluebird<T>["map"];
mapSeries: Bluebird<T>["mapSeries"];
map<U, Q>(this: Promise<T & Iterable<Q>>, mapper: IterateFunction<Q, U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
mapSeries<U, Q>(this: Promise<T & Iterable<Q>>, iterator: IterateFunction<Q, U>): Bluebird<U[]>;
nodeify: Bluebird<T>["nodeify"];
props: Bluebird<T>["props"];
race: Bluebird<T>["race"];
race<Q>(this: Promise<T & Iterable<Q>>): Bluebird<Q>;
race(): Bluebird<never>;
reason: Bluebird<T>["reason"];
reduce: Bluebird<T>["reduce"];
reduce<U, Q>(this: Promise<T & Iterable<Q>>, reducer: (memo: U, item: Q, index: number, arrayLength: number) => (U | PromiseLike<U>), initialValue?: U): Bluebird<U>;
reflect: Bluebird<T>["reflect"];
return: Bluebird<T>["return"];
some: Bluebird<T>["some"];
spread: Bluebird<T>["spread"];
some(this: Promise<Iterable<{}>>, count: number): Bluebird<T>;
spread<U, Q>(this: Bluebird<T & Iterable<Q>>, fulfilledHandler: (...values: Q[]) => (U | PromiseLike<U>)): Bluebird<U>;
suppressUnhandledRejections: Bluebird<T>["suppressUnhandledRejections"];
tap: Bluebird<T>["tap"];
tapCatch: Bluebird<T>["tapCatch"];
+33 -13
View File
@@ -37,8 +37,6 @@
type Constructor<E> = new (...args: any[]) => E;
type CatchFilter<E> = ((error: E) => boolean) | (object & E);
type IterableItem<R> = R extends Iterable<infer U> ? U : never;
type IterableOrNever<R> = Extract<R, Iterable<any>>;
type Resolvable<R> = R | PromiseLike<R>;
type IterateFunction<T, R> = (item: T, index: number, arrayLength: number) => Resolvable<R>;
@@ -352,7 +350,7 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
* });
* </code>
*/
call<U extends keyof R>(propertyName: U, ...args: any[]): Bluebird<R[U] extends (...args: any[]) => any ? ReturnType<R[U]> : never>;
call<U extends keyof Q, Q>(this: Bluebird<Q>, propertyName: U, ...args: any[]): Bluebird<Q[U] extends (...args: any[]) => any ? ReturnType<Q[U]> : never>;
/**
* This is a convenience method for doing:
@@ -562,12 +560,17 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
/**
* Like calling `.then`, but the fulfillment value or rejection reason is assumed to be an array, which is flattened to the formal parameters of the handlers.
*/
spread<U>(fulfilledHandler: (...values: Array<IterableItem<R>>) => Resolvable<U>): Bluebird<U>;
spread<U, Q>(this: Bluebird<R & Iterable<Q>>, fulfilledHandler: (...values: Q[]) => Resolvable<U>): Bluebird<U>;
/**
* Same as calling `Promise.all(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
all(): Bluebird<IterableOrNever<R>>;
all(this: Bluebird<Iterable<{}>>): Bluebird<R>;
/**
* Same as calling `Promise.all(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
all(): Bluebird<never>;
/**
* Same as calling `Promise.props(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
@@ -578,42 +581,59 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
/**
* Same as calling `Promise.any(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
any(): Bluebird<IterableItem<R>>;
any<Q>(this: Bluebird<R & Iterable<Q>>): Bluebird<Q>;
/**
* Same as calling `Promise.any(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
any(): Bluebird<never>;
/**
* Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
* Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
some(count: number): Bluebird<IterableOrNever<R>>;
some(this: Bluebird<Iterable<{}>>, count: number): Bluebird<R>;
/**
* Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
* Same as calling `Promise.some(thisPromise)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
some(count: number): Bluebird<never>;
/**
* Same as calling `Promise.race(thisPromise, count)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
race(): Bluebird<IterableItem<R>>;
race<Q>(this: Bluebird<R & Iterable<Q>>): Bluebird<Q>;
/**
* Same as calling `Promise.race(thisPromise, count)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
race(): Bluebird<never>;
/**
* Same as calling `Bluebird.map(thisPromise, mapper)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
map<U>(mapper: IterateFunction<IterableItem<R>, U>, options?: Bluebird.ConcurrencyOption): Bluebird<R extends Iterable<any> ? U[] : never>;
map<U, Q>(this: Bluebird<R & Iterable<Q>>, mapper: IterateFunction<Q, U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
/**
* Same as calling `Promise.reduce(thisPromise, Function reducer, initialValue)`. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
reduce<U>(reducer: (memo: U, item: IterableItem<R>, index: number, arrayLength: number) => Resolvable<U>, initialValue?: U): Bluebird<R extends Iterable<any> ? U : never>;
reduce<U, Q>(this: Bluebird<R & Iterable<Q>>, reducer: (memo: U, item: Q, index: number, arrayLength: number) => Resolvable<U>, initialValue?: U): Bluebird<U>;
/**
* Same as calling ``Promise.filter(thisPromise, filterer)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
filter(filterer: IterateFunction<IterableItem<R>, boolean>, options?: Bluebird.ConcurrencyOption): Bluebird<IterableOrNever<R>>;
filter<Q>(this: Bluebird<R & Iterable<Q>>, filterer: IterateFunction<Q, boolean>, options?: Bluebird.ConcurrencyOption): Bluebird<R>;
/**
* Same as calling ``Bluebird.each(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
each(iterator: IterateFunction<IterableItem<R>, any>): Bluebird<IterableOrNever<R>>;
each<Q>(this: Bluebird<R & Iterable<Q>>, iterator: IterateFunction<Q, any>): Bluebird<R>;
/**
* Same as calling ``Bluebird.mapSeries(thisPromise, iterator)``. With the exception that if this promise is bound to a value, the returned promise is bound to that value too.
*/
mapSeries<U>(iterator: IterateFunction<IterableItem<R>, U>): Bluebird<R extends Iterable<any> ? U[] : never>;
mapSeries<U, Q>(this: Bluebird<R & Iterable<Q>>, iterator: IterateFunction<Q, U>): Bluebird<U[]>;
/**
* Cancel this `promise`. Will not do anything if this promise is already settled or if the cancellation feature has not been enabled
+2
View File
@@ -143,6 +143,8 @@ pdfQueue
.on('drained', () => undefined)
.on('removed', (job: Queue.Job) => undefined);
pdfQueue.setMaxListeners(42);
// test different process methods
const profileQueue = new Queue('profile');
+2 -1
View File
@@ -17,6 +17,7 @@
// TypeScript Version: 2.8
import * as Redis from "ioredis";
import { EventEmitter } from "events";
/**
* This is the Queue constructor.
@@ -384,7 +385,7 @@ declare namespace Bull {
next: number;
}
interface Queue<T = any> {
interface Queue<T = any> extends EventEmitter {
/**
* The name of the queue
*/
+35 -1
View File
@@ -1,4 +1,4 @@
import CamlBuilder from 'camljs'
var caml = new CamlBuilder().Where()
.Any(
@@ -53,3 +53,37 @@ caml = CamlBuilder.Expression()
.ToString();
caml = new CamlBuilder().Where().DateTimeField("Created").GreaterThan(new Date(Date.UTC(2013,0,1))).ToString();
// Aggregations and extended syntax of GroupBy
var query = new CamlBuilder()
.View(["Category", { count: "ID" }, { sum: "Amount" }])
.Query()
.GroupBy("Category", true, 100)
.ToString();
// ContentTypeId field
var query = new CamlBuilder()
.Where()
.TextField("Title").EqualTo("Document")
.And()
.ContentTypeIdField().BeginsWith("0x101")
.ToString();
// joins
var query = new CamlBuilder()
.View(["Title", "Country", "Population"])
.LeftJoin("Country", "Country").Select("y4r6", "Population")
.Query()
.Where()
.NumberField("Population").LessThan(10)
.ToString();
// RowLimit & Scope
var camlBuilder1 = new CamlBuilder()
.View(["ID", "Created"])
.RowLimit(20, true)
.Scope(CamlBuilder.ViewScope.RecursiveAll)
.Query()
.Where()
.TextField("Title").BeginsWith("A")
.ToString();
+60 -17
View File
@@ -1,8 +1,8 @@
// Type definitions for camljs
// Project: http://camljs.codeplex.com
// Definitions by: Andrey Markeev <http://markeev.com>
// Project: https://github.com/andrei-markeev/camljs
// Definitions by: Andrey Markeev <https://github.com/andrei-markeev>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.7
declare class CamlBuilder {
constructor();
@@ -10,25 +10,43 @@ declare class CamlBuilder {
Where(): CamlBuilder.IFieldExpression;
/** Generate <View> tag for SP.CamlQuery
@param viewFields If omitted, default view fields are requested; otherwise, only values for the fields with the specified internal names are returned.
Specifying view fields is a good practice, as it decreases traffic between server and client. */
View(viewFields?: string[]): CamlBuilder.IView;
Specifying view fields is a good practice, as it decreases traffic between server and client.
Additionally you can specify aggregated fields, e.g. { count: "<field name>" }, { sum: "<field name>" }, etc.. */
View(viewFields?: CamlBuilder.ViewField[]): CamlBuilder.IView;
/** Generate <ViewFields> tag for SPServices */
ViewFields(viewFields: string[]): CamlBuilder.IFinalizableToString;
/** Use for:
1. SPServices CAMLQuery attribute
2. Creating partial expressions
3. In conjunction with Any & All clauses
*/
*/
static Expression(): CamlBuilder.IFieldExpression;
static FromXml(xml: string): CamlBuilder.IRawQuery;
}
declare namespace CamlBuilder {
interface IView extends IJoinable, IFinalizable {
declare module CamlBuilder {
type Aggregation = {
count: string;
} | {
sum: string;
} | {
avg: string;
} | {
max: string;
} | {
min: string;
} | {
stdev: string;
} | {
var: string;
};
type ViewField = string | Aggregation;
interface IView extends IFinalizable {
/** Define query */
Query(): IQuery;
/** Define maximum amount of returned records */
RowLimit(limit: number, paged?: boolean): IView;
/** Define view scope */
Scope(scope: ViewScope): IView;
}
interface IJoinable {
/** Join the list you're querying with another list.
Joins are only allowed through a lookup field relation.
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
@@ -40,22 +58,39 @@ declare namespace CamlBuilder {
@alias alias for the joined list */
LeftJoin(lookupFieldInternalName: string, alias: string): IJoin;
}
interface IJoinable {
/** Join the list you're querying with another list.
Joins are only allowed through a lookup field relation.
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
@param alias Alias for the joined list
@param fromList (optional) List where the lookup column resides - use it only for nested joins */
InnerJoin(lookupFieldInternalName: string, alias: string, fromList?: string): IJoin;
/** Join the list you're querying with another list.
Joins are only allowed through a lookup field relation.
@param lookupFieldInternalName Internal name of the lookup field, that points to the list you're going to join in.
@param alias Alias for the joined list
@param fromList (optional) List where the lookup column resides - use it only for nested joins */
LeftJoin(lookupFieldInternalName: string, alias: string, fromList?: string): IJoin;
}
interface IJoin extends IJoinable {
/** Select projected field for using in the main Query body
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView;
}
interface IProjectableView extends IView {
interface IProjectableView extends IJoinable {
/** Define query */
Query(): IQuery;
/** Define maximum amount of returned records */
RowLimit(limit: number, paged?: boolean): IView;
/** Define view scope */
Scope(scope: ViewScope): IView;
/** Select projected field for using in the main Query body
@param remoteFieldAlias By this alias, the field can be used in the main Query body. */
Select(remoteFieldInternalName: string, remoteFieldAlias: string): IProjectableView;
}
enum ViewScope {
/** */
Recursive = 0,
/** */
RecursiveAll = 1,
/** */
FilesOnly = 2,
}
interface IQuery extends IGroupable {
@@ -85,8 +120,9 @@ declare namespace CamlBuilder {
}
interface IGroupable extends ISortable {
/** Adds GroupBy clause to the query.
@param collapse If true, only information about the groups is retrieved, otherwise items are also retrieved. */
GroupBy(fieldInternalName: any): IGroupedQuery;
@param collapse If true, only information about the groups is retrieved, otherwise items are also retrieved.
@param groupLimit Return only first N groups */
GroupBy(fieldInternalName: any, collapse?: boolean, groupLimit?: number): IGroupedQuery;
}
interface IExpression extends IGroupable {
/** Adds And clause to the query. */
@@ -113,6 +149,12 @@ declare namespace CamlBuilder {
Any(conditions: IExpression[]): IExpression;
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Text */
TextField(internalName: string): ITextFieldExpression;
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is ContentTypeId */
ContentTypeIdField(internalName?: string): ITextFieldExpression;
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Choice */
ChoiceField(internalName: string): ITextFieldExpression;
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Computed */
ComputedField(internalName: string): ITextFieldExpression;
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is Boolean */
BooleanField(internalName: string): IBooleanFieldExpression;
/** Specifies that a condition will be tested against the field with the specified internal name, and the type of this field is URL */
@@ -360,7 +402,7 @@ declare namespace CamlBuilder {
Year = 4,
}
class Internal {
static createView(viewFields?: string[]): IView;
static createView(viewFields?: ViewField[]): IView;
static createViewFields(viewFields: string[]): IFinalizableToString;
static createWhere(): IFieldExpression;
static createExpression(): IFieldExpression;
@@ -401,3 +443,4 @@ declare namespace CamlBuilder {
};
}
}
export = CamlBuilder;
+2 -1
View File
@@ -14,7 +14,8 @@
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true
},
"files": [
"index.d.ts",
@@ -43,3 +43,12 @@ confetti({
y: 0.6
}
});
const canvas = document.createElement('canvas');
const myConfetti = confetti.create(canvas);
myConfetti();
myConfetti({
particleCount: 150
});
+9 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for canvas-confetti 0.0
// Type definitions for canvas-confetti 0.1
// Project: https://github.com/catdad/canvas-confetti#readme
// Definitions by: Martin Tracey <https://github.com/matracey>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -81,6 +81,14 @@ declare namespace confetti {
*/
y?: number;
}
interface GlobalOptions {
resize: boolean;
}
function create(
canvas: HTMLCanvasElement,
options?: GlobalOptions
): (options?: Options) => Promise<null> | null;
}
export = confetti;
+2 -1
View File
@@ -2,7 +2,8 @@
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
+4 -3
View File
@@ -87,7 +87,8 @@ export namespace policies {
interface DecisionInfo {
decision: number;
consistency: number;
consistency?: number;
useCurrentHost?: boolean;
}
interface RequestInfo {
@@ -115,8 +116,8 @@ export namespace policies {
onReadTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, isDataPresent: boolean): DecisionInfo;
onUnavailable(requestInfo: RequestInfo, consistency: types.consistencies, required: number, alive: number): DecisionInfo;
onWriteTimeout(requestInfo: RequestInfo, consistency: types.consistencies, received: number, blockFor: number, writeType: string): DecisionInfo;
rethrowResult(): { decision: retryDecision };
retryResult(): { decision: retryDecision, consistency: types.consistencies, useCurrentHost: boolean };
rethrowResult(): DecisionInfo;
retryResult(consistency?: types.consistencies, useCurrentHost?: boolean): DecisionInfo;
}
}
+3
View File
@@ -18,6 +18,9 @@ const Memory: EnginePrototypeOrObject = {
const client = new Client<string>(Memory, { partition: 'cache' });
client.start().then(() => {});
client.stop().then(() => {});
const cache = new Policy({
expiresIn: 5000,
}, client, 'cache');
+1 -1
View File
@@ -23,7 +23,7 @@ export class Client<T> implements ClientApi<T> {
/** start() - creates a connection to the cache server. Must be called before any other method is available. */
start(): Promise<void>;
/** stop() - terminates the connection to the cache server. */
stop(): void;
stop(): Promise<void>;
/**
* get(key, callback) - retrieve an item from the cache engine if found where:
* * key - a cache key object (see [ICacheKey]).
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/producthunt/chai-enzyme
// Definitions by: Alexey Svetliakov <https://github.com/asvetliakov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// TypeScript Version: 3.1
/// <reference types="enzyme" />
+1 -1
View File
@@ -5246,7 +5246,7 @@ declare namespace chrome.runtime {
export interface PortMessageEvent extends chrome.events.Event<(message: any, port: Port) => void> { }
export interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response: any) => void) => void> { }
export interface ExtensionMessageEvent extends chrome.events.Event<(message: any, sender: MessageSender, sendResponse: (response?: any) => void) => void> { }
export interface ExtensionConnectEvent extends chrome.events.Event<(port: Port) => void> { }
@@ -1441,6 +1441,12 @@ export interface MediaInformation {
* The media tracks.
*/
tracks?: Track[];
/**
* VMAP ad request configuration. Used if breaks and breakClips are not
* provided.
*/
vmapAdsRequest?: VastAdsRequest;
}
/**
+30
View File
@@ -0,0 +1,30 @@
import co = require('co');
function* gen(num: number, str: string, arr: number[], obj: object, fun: () => void) {
return num;
}
co(gen, 42, 'forty-two', [42], { value: 42 }, () => {})
.then((num: number) => {}, (err: Error) => {})
.catch((err: Error) => {});
co.default(gen, 42, 'forty-two', [42], { value: 42 }, () => {})
.then((num: number) => {}, (err: Error) => {})
.catch((err: Error) => {});
co.co(gen, 42, 'forty-two', [42], { value: 42 }, () => {})
.then((num: number) => {}, (err: Error) => {})
.catch((err: Error) => {});
co.wrap(gen)(42, 'forty-two', [42], { value: 42 }, () => {})
.then((num: number) => {}, (err: Error) => {})
.catch((err: Error) => {});
// $ExpectError
co(gen, 42, 'forty-two', [42], { value: 42 }, () => {}).then((str: string) => {});
// $ExpectError
co.wrap(gen)();
// $ExpectError
co.wrap(gen)('forty-two');
+18
View File
@@ -0,0 +1,18 @@
// Type definitions for co 4.6
// Project: https://github.com/tj/co#readme
// Definitions by: Doniyor Aliyev <https://github.com/doniyor2109>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.1
type ExtractType<T> = T extends IterableIterator<infer R> ? R : never;
interface Co {
<F extends (...args: any[]) => Generator>(fn: F, ...args: Parameters<F>): Promise<ExtractType<ReturnType<F>>>;
default: Co;
co: Co;
wrap: <F extends (...args: any[]) => Generator>(fn: F) => (...args: Parameters<F>) => Promise<ExtractType<ReturnType<F>>>;
}
declare const co: Co;
export = co;
@@ -18,6 +18,6 @@
},
"files": [
"index.d.ts",
"terser-tests.ts"
"co-tests.ts"
]
}
+12
View File
@@ -0,0 +1,12 @@
import * as m from '..';
declare class AckExtension implements m.Extension {
constructor();
incoming: m.Listener;
outgoing: m.Listener;
registered: (name: string, cometd: m.CometD) => void;
unregistered: () => void;
}
export default AckExtension;
+40
View File
@@ -0,0 +1,40 @@
import * as m from '..';
declare class TimeSyncExtension implements m.Extension {
constructor();
incoming: m.Listener;
outgoing: m.Listener;
registered: (name: string, cometd: m.CometD) => void;
unregistered: () => void;
/**
* Get the estimated offset in ms from the clients clock to the
* servers clock. The server time is the client time plus the offset.
*/
getTimeOffset: () => number;
/**
* Get an array of multiple offset samples used to calculate
* the offset.
*/
getTimeOffsetSamples: () => [number];
/**
* Get the estimated network lag in ms from the client to the server.
*/
getNetworkLag: () => number;
/**
* Get the estimated server time in ms since the epoch.
*/
getServerTime: () => number;
/**
*
* Get the estimated server time as a Date object
*/
getServerDate: () => Date;
}
export default TimeSyncExtension;
+19 -1
View File
@@ -1,4 +1,6 @@
import { CometD, Listener, Message, SubscriptionHandle } from "cometd";
import TimeSyncExtension from 'cometd/TimeSyncExtension';
import AckExtension from 'cometd/AckExtension';
const cometd = new CometD();
@@ -11,7 +13,23 @@ cometd.configure({
url: "http://localhost:8080/cometd"
});
cometd.registerExtension("ack", { incoming: () => {}, outgoing: () => {} });
cometd.registerExtension("ack", new AckExtension());
const timesync = new TimeSyncExtension();
cometd.registerExtension("timesync", timesync);
const timeSyncSubscription = cometd.addListener("/foo/bar", () => {
if (timesync.getNetworkLag() > 1000) {
cometd.publish("/mychannel", { timesyncStats: {
lag: timesync.getNetworkLag(),
serverTime: timesync.getServerTime(),
serverDate: timesync.getServerDate(),
timeOffset: timesync.getTimeOffset(),
timeOffsetSamples: timesync.getTimeOffsetSamples()
}
});
}
});
cometd.unregisterTransport("websocket");
+6 -1
View File
@@ -1,6 +1,9 @@
// Type definitions for CometD 4.0
// Project: https://cometd.org
// Definitions by: Derek Cicerone <https://github.com/derekcicerone>, Daniel Perez Alvarez <https://github.com/unindented>, Alex Henry <https://github.com/alxHenry>
// Definitions by: Derek Cicerone <https://github.com/derekcicerone>
// Daniel Perez Alvarez <https://github.com/unindented>
// Alex Henry <https://github.com/alxHenry>
// Harald Gliebe <https://github.com/hagl>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -88,6 +91,8 @@ export interface SubscriptionHandle {
export interface Extension {
incoming?: Listener;
outgoing?: Listener;
registered?: (name: string, cometd: CometD) => void;
unregistered?: () => void;
}
export class CometD {
+4 -2
View File
@@ -18,6 +18,8 @@
},
"files": [
"index.d.ts",
"cometd-tests.ts"
"cometd-tests.ts",
"AckExtension/index.d.ts",
"TimeSyncExtension/index.d.ts"
]
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/commercetools/enzyme-extensions
// Definitions by: Christian Rackerseder <https://github.com/screendriver>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// TypeScript Version: 3.1
import * as enzyme from 'enzyme';
+1 -1
View File
@@ -1,5 +1,5 @@
// Type definitions for connect-datadog 0.0
// Project: https://github.com/AppPress/node-connect-datadog
// Project: https://github.com/datadog/node-connect-datadog
// Definitions by: Moshe Good <https://github.com/moshegood>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
+1 -1
View File
@@ -1,5 +1,5 @@
// Type definitions for cordova-sqlite-storage 1.5
// Project: https://github.com/litehelpers/Cordova-sqlite-storage
// Project: https://github.com/xpbrew/cordova-sqlite-storage
// Definitions by: rafw87 <https://github.com/rafw87>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+35
View File
@@ -0,0 +1,35 @@
import cssesc = require("cssesc");
// $ExpectType string
cssesc('Ich ♥ Bücher');
// $ExpectType string
cssesc('123a2b', {
isIdentifier: true
});
// $ExpectType string
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
quotes: 'single'
});
// $ExpectType string
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
quotes: 'double'
});
// $ExpectType string
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
quotes: 'single',
wrap: true
});
// $ExpectType string
cssesc('lolwat"foo\'bar', {
escapeEverything: true
});
cssesc.options.escapeEverything = false;
// $ExpectType string
cssesc.version;
+22
View File
@@ -0,0 +1,22 @@
// Type definitions for cssesc 3.0
// Project: https://mths.be/cssesc
// Definitions by: Daniel Cassidy <https://github.com/djcsdy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
export = cssesc;
declare function cssesc(string: string, options?: Readonly<Partial<cssesc.Options>>): string;
declare namespace cssesc {
interface Options {
escapeEverything: boolean;
isIdentifier: boolean;
quotes: string;
wrap: boolean;
}
const options: Options;
const version: string;
}
@@ -18,6 +18,6 @@
},
"files": [
"index.d.ts",
"internal-ip-tests.ts"
"cssesc-tests.ts"
]
}
+22 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for Cytoscape.js 3.2
// Type definitions for Cytoscape.js 3.3
// Project: http://js.cytoscape.org/
// Definitions by: Fabian Schmidt and Fred Eisele <https://github.com/phreed>
// Shenghan Gao <https://github.com/wy193777>
@@ -464,6 +464,27 @@ declare namespace cytoscape {
*/
endBatch(): void;
/**
* Attaches the instance to the specified container for visualisation.
* http://js.cytoscape.org/#cy.mount
*
* If the core instance is headless prior to calling cy.mount(), then
* the instance will no longer be headless and the visualisation will
* be shown in the specified container. If the core instance is
* non-headless prior to calling cy.mount(), then the visualisation
* is swapped from the prior container to the specified container.
*/
mount(element: Element): void;
/**
* Remove the instance from its current container.
* http://js.cytoscape.org/#cy.unmount
*
* This function sets the instance to be headless after unmounting from
* the current container.
*/
unmount(): void;
/**
* A convenience function to explicitly destroy the Core.
* http://js.cytoscape.org/#cy.destroy
+2 -1
View File
@@ -608,7 +608,8 @@ const testObject = {
};
const p1: Array<number | string | Date | number[]> = d3Array.permute(testObject, ['name', 'val', 'when', 'more']);
const p2: Array<Date | number[]> = d3Array.permute(testObject, ['when', 'more']);
// $ExpectType: Array<Date | number[]>
const p2 = d3Array.permute(testObject, ['when', 'more']);
// $ExpectError
const p3 = d3Array.permute(testObject, ['when', 'unknown']);
-56
View File
@@ -1,56 +0,0 @@
import * as tracer from "dd-trace";
import SpanContext = require("dd-trace/src/opentracing/span_context");
tracer.init({
enabled: true,
service: "MyLovelyService",
hostname: "localhost",
port: 8126,
env: "dev",
logger: {
debug: msg => {},
error: err => {},
}
});
function useWebFrameworkPlugin(plugin: "express" | "hapi" | "koa" | "restify") {
tracer.use(plugin, {
service: "incoming-request",
headers: ["User-Agent"],
validateStatus: code => code !== 418,
});
}
tracer.use("graphql", {
depth: 1,
// Cant use spread operator here due to https://github.com/Microsoft/TypeScript/issues/10727
// tslint:disable-next-line:prefer-object-spread
variables: variables => Object.assign({}, variables, { password: "REDACTED" }),
});
tracer.use("http", {
splitByDomain: true,
});
tracer
.trace("web.request", {
service: "my_service",
childOf: new SpanContext({ traceId: 1337, spanId: 42 }), // childOf must be an instance of this type. See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99
tags: {
env: "dev",
},
})
.then(span => {
span.setTag("my_tag", "my_value");
span.finish();
});
const parentScope = tracer.scopeManager().active();
const span = tracer.startSpan("memcached", {
childOf: parentScope && parentScope.span(),
tags: {
"service.name": "my-memcached",
"resource.name": "get",
"span.type": "memcached",
},
});
-275
View File
@@ -1,275 +0,0 @@
// Type definitions for dd-trace-js 0.7
// Project: https://github.com/DataDog/dd-trace-js
// Definitions by: Colin Bradley <https://github.com/ColinBradley>
// Eloy Durán <https://github.com/alloy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
// Prettified with:
// $ prettier --parser typescript --tab-width 4 --semi --trailing-comma es5 --write --print-width 120 types/dd-trace/{,*}/*.ts*
import { Tracer, Span, SpanContext } from "opentracing";
import DatadogSpanContext = require("./src/opentracing/span_context");
declare var trace: TraceProxy;
export = trace;
declare class TraceProxy extends Tracer {
/**
* Initializes the tracer. This should be called before importing other libraries.
*/
init(options?: TracerOptions): this;
/**
* Enable and optionally configure a plugin.
* @param plugin The name of a built-in plugin.
* @param config Configuration options.
*/
use<P extends Plugin>(plugin: P, config: PluginConfiguration[P]): this;
/**
* Initiate a trace and creates a new span.
* @param operationName The operation name to be used for this span.
* @param options Configuration options. These will take precedence over environment variables.
*/
trace(operationName: string, options: TraceOptions): Promise<Span>;
/**
* Initiate a trace and creates a new span.
* @param operationName The operation name to be used for this span.
* @param options Configuration options. These will take precedence over environment variables.
*/
trace(operationName: string, options: TraceOptions, callback: (span: Span) => void): void;
/**
* Get the span from the current context.
* @returns The current span or null if outside a trace context.
*/
currentSpan(): Span | null;
/**
* Get the scope manager to manager context propagation for the tracer.
*/
scopeManager(): ScopeManager;
}
interface TracerOptions {
/**
* Whether to enable the tracer.
* @default true
*/
enabled?: boolean;
/**
* Enable debug logging in the tracer.
* @default false
*/
debug?: boolean;
/**
* The service name to be used for this program.
*/
service?: string;
/**
* The address of the trace agent that the tracer will submit to.
* @default 'localhost'
*/
hostname?: string;
/**
* The port of the trace agent that the tracer will submit to.
* @default 8126
*/
port?: number | string;
/**
* Set an applications environment e.g. prod, pre-prod, stage.
*/
env?: string;
/**
* Percentage of spans to sample as a float between 0 and 1.
* @default 1
*/
sampleRate?: number;
/**
* Interval in milliseconds at which the tracer will submit traces to the agent.
* @default 2000
*/
flushInterval?: number;
/**
* Experimental features can be enabled all at once by using true or individually using key / value pairs.
* @default {}
*/
experimental?: ExperimentalOptions | boolean;
/**
* Whether to load all built-in plugins.
* @default true
*/
plugins?: boolean;
/**
* Custom logger to be used by the tracer (if debug = true),
* should support debug() and error() methods
* see https://datadog.github.io/dd-trace-js/#custom-logging__anchor
*/
logger?: {
debug: (message: string) => void;
error: (err: Error) => void;
};
/**
* Global tags that should be assigned to every span.
*/
tags?: { [key: string]: any };
}
interface ExperimentalOptions {}
interface TraceOptions {
/**
* The service name to be used for this span.
* The service name from the tracer will be used if this is not provided.
*/
service?: string;
/**
* The resource name to be used for this span.
* The operation name will be used if this is not provided.
*/
resource?: string;
/**
* The span type to be used for this span.
*/
type?: string;
/**
* The parent span or span context for the new span. Generally this is not needed as it will be
* fetched from the current context.
* If creating your own, this must be an instance of DatadogSpanContext from ./src/opentracing/span_context
* See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99
*/
childOf?: Span | SpanContext | DatadogSpanContext;
/**
* Global tags that should be assigned to every span.
*/
tags?: { [key: string]: any } | string;
}
declare class ScopeManager {
/**
* Get the current active scope or null if there is none.
*
* @todo The dd-trace source returns null, but opentracing's childOf span
* option is typed as taking undefined or a scope, so using undefined
* here instead.
*/
active(): Scope | undefined;
/**
* Activate a new scope wrapping the provided span.
*
* @param span The span for which to activate the new scope.
* @param finishSpanOnClose Whether to automatically finish the span when the scope is closed.
*/
activate(span: Span, finishSpanOnClose?: boolean): Scope;
}
declare class Scope {
/**
* Get the span wrapped by this scope.
*/
span(): Span;
/**
* Close the scope, and finish the span if the scope was created with `finishSpanOnClose` set to true.
*/
close(): void;
}
type Plugin =
| "amqp10"
| "amqplib"
| "bluebird"
| "elasticsearch"
| "express"
| "graphql"
| "hapi"
| "http"
| "ioredis"
| "koa"
| "memcached"
| "mongodb-core"
| "mysql"
| "mysql2"
| "pg"
| "q"
| "redis"
| "restify"
| "when";
interface BasePluginOptions {
/**
* The service name to be used for this plugin.
*/
service?: string;
}
interface BaseWebFrameworkPluginOptions extends BasePluginOptions {
/**
* An array of headers to include in the span metadata.
*/
headers?: string[];
/**
* Callback function to determine if there was an error. It should take a
* status code as its only parameter and return `true` for success or `false`
* for errors.
*/
validateStatus?: (code: number) => boolean;
}
interface ExpressPluginOptions extends BaseWebFrameworkPluginOptions {}
interface HapiPluginOptions extends BaseWebFrameworkPluginOptions {}
interface KoaPluginOptions extends BaseWebFrameworkPluginOptions {}
interface RestifyPluginOptions extends BaseWebFrameworkPluginOptions {}
interface GraphQLPluginOptions extends BasePluginOptions {
/**
* The maximum depth of fields/resolvers to instrument. Set to `0` to only
* instrument the operation or to -1 to instrument all fields/resolvers.
*/
depth?: number;
/**
* A callback to enable recording of variables. By default, no variables are
* recorded. For example, using `variables => variables` would record all
* variables.
*/
variables?: <T extends { [key: string]: any }>(variables: T) => Partial<T>;
}
interface HTTPPluginOptions extends BasePluginOptions {
/**
* Use the remote endpoint host as the service name instead of the default.
*/
splitByDomain?: boolean;
}
type PluginConfiguration = { [K in Plugin]: BasePluginOptions } & {
express: ExpressPluginOptions;
graphql: GraphQLPluginOptions;
hapi: HapiPluginOptions;
http: HTTPPluginOptions;
koa: KoaPluginOptions;
restify: RestifyPluginOptions;
};
-28
View File
@@ -1,28 +0,0 @@
import { SpanContext } from 'opentracing';
declare class DatadogSpanContext extends SpanContext {
/**
* Used to create references to parent spans.
* See: https://github.com/DataDog/dd-trace-js/blob/master/src/opentracing/tracer.js#L99
*/
constructor(props: SpanContextLike);
}
interface SpanContextLike {
traceId: number;
spanId: number;
parentId?: number | null;
sampled?: boolean;
baggageItems?: { [key: string]: string };
trace?: {
started: number[],
finished: number[]
};
}
export = DatadogSpanContext;
+1 -1
View File
@@ -38,7 +38,7 @@ declare namespace debug {
(formatter: any, ...args: any[]): void;
enabled: boolean;
log: (v: any) => string;
log: (...args: any[]) => any;
namespace: string;
extend: (namespace: string, delimiter?: string) => Debugger;
}
@@ -1,64 +0,0 @@
import { BrowserName, BrowserInfo, detect } from 'detect-browser';
const browser = detect();
if (browser) {
const name: string | undefined = browser.name;
const version: string | undefined = browser.version;
const os: string | undefined | null = browser.os;
const bot: true | undefined = browser.bot;
}
const browserInfos: BrowserInfo[] = [];
// Those that can happen when 'detect' hits on a browser
browserInfos.push(
{
name: "chrome",
version: "1.2.3",
os: null
}
);
browserInfos.push(
{
name: "edge",
version: "24.5.3",
os: "Sun OS"
}
);
browserInfos.push(
{
name: "edge",
version: "13.0",
os: "Windows 10",
bot: true
}
);
// Those that could be returned when it's a bot
browserInfos.push(
{
name: "facebook",
version: "1.0.2",
os: "Linux",
bot: true
}
);
browserInfos.push(
{
name: "crios",
version: "2.9.4",
os: undefined,
bot: true
}
);
browserInfos.push(
{
bot: true
}
);
-42
View File
@@ -1,42 +0,0 @@
// Type definitions for detect-browser 3.0
// Project: https://github.com/DamonOehlman/detect-browser
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
// Brian Caruso <https://github.com/carusology>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export {};
export type BrowserName =
"aol" |
"android" |
"bb10" |
"chrome" |
"crios" |
"edge" |
"facebook" |
"firefox" |
"fxios" |
"ie" |
"instagram" |
"ios" |
"ios-webview" |
"kakaotalk" |
"node" |
"opera" |
"phantomjs" |
"safari" |
"samsung" |
"vivaldi" |
"yandexbrowser";
export interface BrowserInfo {
name?: string;
version?: string;
os?: string | null;
bot?: true;
}
export function detect(): null | false | BrowserInfo;
export function detectOS(userAgentString: string): null | string;
export function parseUserAgent(userAgentString: string): null | BrowserInfo;
export function getNodeVersion(): false | BrowserInfo;
-10
View File
@@ -1,10 +0,0 @@
{
"extends": "dtslint/dt.json",
"rules": {
"indent": [
true,
"spaces",
4
]
}
}
+7 -5
View File
@@ -5,6 +5,7 @@
// TypeScript Version: 2.3
/// <reference types="jquery"/>
/// <reference types="knockout"/>
/**
* A client-side counterpart of the DashboardViewer extension.
@@ -34356,7 +34357,7 @@ interface ASPxDesignerNavigateTab {
* Provides access to a report opened in the current tab.
* Value: A knockout observable object that specifies a report opened in the current tab.
*/
report: any;
report: KnockoutObservable<Object>;
/**
* Provides access to an engine that manages undo and redo operations in the Web Report Designer.
* Value: An object that specifies an undo/redo engine.
@@ -34889,6 +34890,9 @@ interface ASPxClientMenuAction {
* Value: A string that specifies the name of the CSS class.
*/
imageClassName: string;
/**
* Knockout template, where you can specify a required SVG icon and write logic to color it.
*/
imageTemplateName: string;
/**
* Provides access to the action performed when a button is clicked.
@@ -34897,9 +34901,8 @@ interface ASPxClientMenuAction {
clickAction: Function;
/**
* Provides access to the value that specifies whether or not the command is disabled by default.
* Value: true, if the command is disabled by default; otherwise, false.
*/
disabled: boolean;
disabled: KnockoutObservable<boolean>;
/**
* Provides access to the value that specifies whether or not the command is visible in the user interface.
* Value: true if the command is visible; otherwise false.
@@ -38912,5 +38915,4 @@ declare var ASPxClientReportDocumentMap: ASPxClientReportDocumentMapStatic;
declare var ASPxClientReportParametersPanel: ASPxClientReportParametersPanelStatic;
declare var ASPxClientReportToolbar: ASPxClientReportToolbarStatic;
declare var ASPxClientReportViewer: ASPxClientReportViewerStatic;
declare var ASPxClientWebDocumentViewer: ASPxClientWebDocumentViewerStatic;
declare var ASPxClientWebDocumentViewer: ASPxClientWebDocumentViewerStatic;
+5
View File
@@ -1,6 +1,7 @@
// Type definitions for discord-rpc 3.0
// Project: https://github.com/discordjs/RPC#readme
// Definitions by: Jason Bothell <https://github.com/jasonhaxstuff>
// Jack Baron <https://github.com/lolPants>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import { EventEmitter } from 'events';
@@ -66,6 +67,10 @@ export class Client extends EventEmitter {
subscribe(event: string, args: any, callback: (data: any) => void): Promise<Subscription>;
destroy(): Promise<void>;
on(event: 'ready' | 'connected', listener: () => void): this;
once(event: 'ready' | 'connected', listener: () => void): this;
off(event: 'ready' | 'connected', listener: () => void): this;
}
export interface RPCClientOptions {
+1 -1
View File
@@ -1,5 +1,5 @@
// Type definitions for drivelist 6.4
// Project: https://github.com/resin-io-modules/drivelist
// Project: https://github.com/balena-io-modules/drivelist
// Definitions by: Xiao Deng <https://github.com/WholeMilk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+2 -2
View File
@@ -8,8 +8,8 @@
/*!
* filename: ej.web.all.d.ts
* version : 16.4.0.42
* Copyright Syncfusion Inc. 2001 - 2018. All rights reserved.
* version : 16.4.0.52
* Copyright Syncfusion Inc. 2001 - 2019. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
+4 -1
View File
@@ -12,6 +12,9 @@
"typeRoots": [
"../"
],
"paths": {
"lru-cache": ["lru-cache/v4"]
},
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
@@ -20,4 +23,4 @@
"index.d.ts",
"ejs-tests.ts"
]
}
}
+1 -1
View File
@@ -187,7 +187,7 @@ export class ec {
export namespace ec {
interface GenKeyPairOptions {
pers: any;
pers?: any;
entropy: any;
persEnc?: string;
entropyEnc?: string;
+1 -1
View File
@@ -1,5 +1,5 @@
// Type definitions for emojione 2.2
// Project: https://github.com/Ranks/emojione, http://www.emojione.com
// Project: https://github.com/Ranks/emojione, https://www.emojione.com
// Definitions by: Danilo Bargen <https://github.com/dbrgn>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: http://airbnb.io/enzyme/
// Definitions by: Nabeelah Ali <https://github.com/nali>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// TypeScript Version: 3.1
import { EnzymeAdapter } from 'enzyme';
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/airbnb/enzyme, http://airbnb.io/enzyme
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// TypeScript Version: 3.1
import { EnzymeAdapter } from 'enzyme';
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/airbnb/enzyme, http://airbnb.io/enzyme
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// TypeScript Version: 3.1
import { EnzymeAdapter } from 'enzyme';
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/zth/enzyme-async-helpers
// Definitions by: Kim Ehrenpohl <https://github.com/kimehrenpohl>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// TypeScript Version: 3.1
import { ReactWrapper, EnzymeSelector } from 'enzyme';
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/Knegusen/enzyme-redux#readme
// Definitions by: Dennis Axelsson <https://github.com/knegusen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// TypeScript Version: 3.1
import { ReactWrapper, ShallowWrapper } from 'enzyme';
import { ReactElement } from 'react';
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/adriantoine/enzyme-to-json#readme
// Definitions by: Joscha Feth <https://github.com/joscha>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// TypeScript Version: 3.1
import { ReactWrapper, ShallowWrapper } from 'enzyme';
+12 -1
View File
@@ -10,7 +10,7 @@ import {
ShallowRendererProps,
ComponentClass as EnzymeComponentClass
} from "enzyme";
import { Component, ReactElement, HTMLAttributes, ComponentClass, StatelessComponent } from "react";
import { Component, ReactElement, ReactNode, HTMLAttributes, ComponentClass, StatelessComponent } from "react";
// Help classes/interfaces
interface MyComponentProps {
@@ -35,6 +35,10 @@ interface MyComponentState {
stateProperty: string;
}
interface MyRenderPropProps {
children: (params: string) => ReactNode;
}
function toComponentType<T>(Component: ComponentClass<T> | StatelessComponent<T>): ComponentClass<T> | StatelessComponent<T> {
return Component;
}
@@ -59,6 +63,8 @@ class AnotherComponent extends Component<AnotherComponentProps> {
}
}
class MyRenderPropComponent extends Component<MyRenderPropProps> {}
const MyStatelessComponent = (props: StatelessProps) => <span />;
const AnotherStatelessComponent = (props: AnotherStatelessProps) => <span />;
@@ -477,6 +483,11 @@ function ShallowWrapperTest() {
shallowWrapper = new ShallowWrapper<MyComponentProps, MyComponentState>(<MyComponent stringProp="1" numberProp={1} />, undefined, { lifecycleExperimental: true });
shallowWrapper = new ShallowWrapper<MyComponentProps, MyComponentState>(<MyComponent stringProp="1" numberProp={1} />, shallowWrapper, { lifecycleExperimental: true });
}
function test_renderProp() {
let shallowWrapper = new ShallowWrapper<MyRenderPropProps>(<MyRenderPropComponent children={(params) => <div className={params} />} />);
shallowWrapper = shallowWrapper.renderProp('children')('test');
}
}
// ReactWrapper
+10 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for Enzyme 3.1
// Type definitions for Enzyme 3.9
// Project: https://github.com/airbnb/enzyme
// Definitions by: Marian Palkus <https://github.com/MarianPalkus>
// Cap3 <http://www.cap3.de>
@@ -8,8 +8,9 @@
// MartynasZilinskas <https://github.com/MartynasZilinskas>
// Torgeir Hovden <https://github.com/thovden>
// Martin Hochel <https://github.com/hotell>
// Christian Rackerseder <https://github.com/screendriver>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// TypeScript Version: 3.1
/// <reference types="cheerio" />
import { ReactElement, Component, AllHTMLAttributes as ReactHTMLAttributes, SVGAttributes as ReactSVGAttributes } from "react";
@@ -363,6 +364,8 @@ export interface CommonWrapper<P = {}, S = {}, C = Component<P, S>> {
length: number;
}
export type Parameters<T> = T extends (...args: infer A) => any ? A : never;
// tslint:disable-next-line no-empty-interface
export interface ShallowWrapper<P = {}, S = {}, C = Component> extends CommonWrapper<P, S, C> { }
export class ShallowWrapper<P = {}, S = {}, C = Component> {
@@ -447,6 +450,11 @@ export class ShallowWrapper<P = {}, S = {}, C = Component> {
* Returns a wrapper with the direct parent of the node in the current wrapper.
*/
parent(): ShallowWrapper<any, any>;
/**
* Returns a wrapper of the node rendered by the provided render prop.
*/
renderProp<PropName extends keyof P>(prop: PropName): (...params: Parameters<P[PropName]>) => ShallowWrapper<any, never>;
}
// tslint:disable-next-line no-empty-interface
+98
View File
@@ -0,0 +1,98 @@
import * as util from 'eth-sig-util';
const hex32 = '1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef';
const buffer32 = Buffer.from(hex32, 'hex');
util.concatSig(28, buffer32, buffer32);
util.normalize(hex32);
util.normalize(42);
////////////////////////////////////////////////////////////////////////////////
// Personal message signing utils
const messageSig = util.personalSign(buffer32, { data: 'test data' });
util.recoverPersonalSignature({ data: 'test data', sig: messageSig });
util.extractPublicKey({ data: 'test data', sig: messageSig });
////////////////////////////////////////////////////////////////////////////////
// EIP-712 legacy draft utils
const legacyTypedData = [{
type: 'uint32',
name: 'testValue',
value: 42,
}, {
type: 'string',
name: 'testName',
value: 'test value',
}];
util.typedSignatureHash(legacyTypedData);
const typedSigLegacy = util.signTypedDataLegacy(buffer32, { data: legacyTypedData });
util.recoverTypedSignatureLegacy({ data: legacyTypedData, sig: typedSigLegacy });
////////////////////////////////////////////////////////////////////////////////
// Elliptic curve encryption utils
util.getEncryptionPublicKey(hex32);
const encPubkey = util.getEncryptionPublicKey(buffer32);
const encMessage = util.encrypt(encPubkey, { data: 'test data' }, 'x25519-xsalsa20-poly1305');
util.decrypt(encMessage, buffer32);
util.decrypt(encMessage, hex32);
const encData = util.encryptSafely(encPubkey, { data: legacyTypedData }, 'x25519-xsalsa20-poly1305');
util.decryptSafely(encData, buffer32);
util.decryptSafely(encData, hex32);
////////////////////////////////////////////////////////////////////////////////
// EIP-712 current draft utils
// Sample data from the official EIP-712 example:
// https://github.com/ethereum/EIPs/blob/master/assets/eip-712/Example.js
const typedData = {
types: {
EIP712Domain: [
{ name: 'name', type: 'string' },
{ name: 'version', type: 'string' },
{ name: 'chainId', type: 'uint256' },
{ name: 'verifyingContract', type: 'address' },
],
Person: [
{ name: 'name', type: 'string' },
{ name: 'wallet', type: 'address' }
],
Mail: [
{ name: 'from', type: 'Person' },
{ name: 'to', type: 'Person' },
{ name: 'contents', type: 'string' }
],
},
primaryType: 'Mail',
domain: {
name: 'Ether Mail',
version: '1',
chainId: 1,
verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
},
message: {
from: {
name: 'Cow',
wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',
},
to: {
name: 'Bob',
wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
},
contents: 'Hello, Bob!',
},
};
const typedMessage = typedData.message;
const types = typedData.types;
const primaryType = typedData.primaryType;
util.TypedDataUtils.encodeData(primaryType, typedMessage, types);
util.TypedDataUtils.encodeType(primaryType, types);
util.TypedDataUtils.findTypeDependencies(primaryType, types);
util.TypedDataUtils.hashStruct(primaryType, typedMessage, types);
util.TypedDataUtils.hashType(primaryType, types);
util.TypedDataUtils.sanitizeData(typedData);
util.TypedDataUtils.sign(typedData);
const typedSig = util.signTypedData(buffer32, { data: typedData });
util.recoverTypedSignature({ data: typedData, sig: typedSig });
+184
View File
@@ -0,0 +1,184 @@
// Type definitions for eth-sig-util 2.1
// Project: https://github.com/MetaMask/eth-sig-util#readme
// Definitions by: Artur Kozak <https://github.com/quezak>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="node" />
/**
* @returns a 0x-prefixed 130-byte signature.
*/
export function concatSig(v: number, r: Buffer, s: Buffer): string;
/**
* @param input a number or a hex string (either 0x-prefixed or not).
* @returns a 0x-prefixed hex string.
*/
export function normalize(input: string | number): string;
////////////////////////////////////////////////////////////////////////////////
// Personal message signing utils
export interface MessageData<T = any> { data: T; }
export interface SignedMessageData<T = any> extends MessageData<T> { sig: string; }
export function personalSign(privateKey: Buffer, message: MessageData): string;
export function recoverPersonalSignature(message: SignedMessageData): string;
export function extractPublicKey(message: SignedMessageData): string;
////////////////////////////////////////////////////////////////////////////////
// EIP-712 legacy draft utils
export interface EIP712LegacyField {
type: string;
name: string;
value: any;
}
export type EIP712LegacyData = ReadonlyArray<EIP712LegacyField>;
export function typedSignatureHash(data: EIP712LegacyData): string;
export function signTypedDataLegacy(
privateKey: Buffer,
message: MessageData<EIP712LegacyData>,
): string;
export function recoverTypedSignatureLegacy(
message: SignedMessageData<EIP712LegacyData>,
): string;
////////////////////////////////////////////////////////////////////////////////
// Elliptic curve encryption utils
export type EncryptionType = 'x25519-xsalsa20-poly1305';
export interface EncryptedData {
version: EncryptionType;
nonce: string;
ephemPublicKey: string;
ciphertext: string;
}
/**
* @param receiverPublicKey a 32-byte base64 string, e.g. from @see `getEncryptionPublicKey`
* @param data a utf-8 string to be encrypted
* @param version one of the supported encryption schemes, @see `EncryptionType`
*/
export function encrypt(
receiverPublicKey: string,
data: MessageData<string>,
version: EncryptionType,
): EncryptedData;
/**
* Same as @see `encrypt`, but encrypts a JSON object.
*/
export function encryptSafely(
receiverPublicKey: string,
data: MessageData,
version: EncryptionType,
): EncryptedData;
/**
* @param encryptedData result of @see `encrypt`.
* @param receiverPrivateKey should be a 32-byte Buffer or *not* 0x-prefixed hex string.
*/
export function decrypt(
encryptedData: EncryptedData,
receiverPrivateKey: string | Buffer,
): string;
/**
* @param encryptedData result of @see `encryptSafely`.
* @param receiverPrivateKey should be a 32-byte Buffer or *not* 0x-prefixed hex string.
*/
export function decryptSafely(
encryptedData: EncryptedData,
receiverPrivateKey: string | Buffer,
): any;
/**
* @param privateKey should be a 32-byte Buffer or *not* 0x-prefixed hex string.
* @returns a 32-byte public key as a base64 string.
*/
export function getEncryptionPublicKey(privateKey: string | Buffer): string;
////////////////////////////////////////////////////////////////////////////////
// EIP-712 current draft utils
export interface EIP712TypeProperty {
name: string;
type: string;
}
/**
* Maps type name to an array describing its properties' types.
* Should include the `EIP712Domain` struct description.
*/
export interface EIP712Types {
[name: string]: ReadonlyArray<EIP712TypeProperty>;
}
export interface EIP712Message {
[key: string]: any;
}
/**
* The standard requires to use at least one of these fields.
* @see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#definition-of-domainseparator
*/
export interface EIP712Domain {
name?: string;
version?: string;
chainId?: string | number;
verifyingContract?: string;
salt?: string;
}
export interface EIP712TypedData {
types: EIP712Types;
primaryType: string;
domain: EIP712Domain;
message: EIP712Message;
}
export namespace TypedDataUtils {
function encodeData(primaryType: string, data: EIP712Message, types: EIP712Types): Buffer;
function encodeType(primaryType: string, types: EIP712Types): string;
function findTypeDependencies(
primaryType: string, types: EIP712Types,
): string[];
function hashStruct(primaryType: string, data: EIP712Message, types: EIP712Types): Buffer;
function hashType(primaryType: string, types: EIP712Types): Buffer;
function sanitizeData(data: EIP712TypedData): EIP712TypedData;
/**
* @returns hash of the typed data as defined by EIP712 (contrary to the function's name)
* @see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md#specification
*/
function sign(data: EIP712TypedData): Buffer;
}
/**
* A JSON Schema object equivalent to the EIP712Message type.
*/
export const TYPED_MESSAGE_SCHEMA: any;
export function signTypedData(
privateKey: Buffer,
msgParams: MessageData<EIP712TypedData>,
): string;
export function recoverTypedSignature(
msgParams: SignedMessageData<EIP712TypedData>,
): string;
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"eth-sig-util-tests.ts"
]
}
+16 -4
View File
@@ -1,5 +1,17 @@
import { methodID, soliditySHA256, soliditySHA3 } from 'ethereumjs-abi';
import * as abi from 'ethereumjs-abi';
methodID('foo', ['uint256', 'string']);
soliditySHA3(['uint256', 'string'], [0, 'Alice']);
soliditySHA256(['uint256', 'string'], [0, 'Alice']);
const types = ['uint256', 'string'];
const values = [0, 'Alice'];
const signature = 'foo(uint256,string):(uint256)';
abi.eventID('foo', types);
abi.methodID('foo', types);
abi.soliditySHA3(types, values);
abi.soliditySHA256(types, values);
abi.solidityRIPEMD160(types, values);
const simpleEncoded = abi.simpleEncode(signature, ...values);
abi.simpleDecode(signature, simpleEncoded);
const rawEncoded = abi.rawEncode(types, values);
abi.rawDecode(types, rawEncoded);
abi.solidityPack(types, values);
const serpentSig = abi.toSerpent(['int256', 'bytes']);
abi.fromSerpent(serpentSig);
+10 -1
View File
@@ -1,12 +1,21 @@
// Type definitions for ethereumjs-abi 0.6
// Project: https://github.com/ethereumjs/ethereumjs-abi, https://github.com/axic/ethereumjs-abi
// Definitions by: Leonid Logvinov <https://github.com/LogvinovLeon>
// Artur Kozak <https://github.com/quezak>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
export function soliditySHA3(argTypes: string[], args: any[]): Buffer;
export function soliditySHA256(argTypes: string[], args: any[]): Buffer;
export function solidityRIPEMD160(argTypes: string[], args: any[]): Buffer;
export function eventID(name: string, types: string[]): Buffer;
export function methodID(name: string, types: string[]): Buffer;
export function simpleEncode(signature: string, ...args: any[]): Buffer;
export function rawDecode(signature: string[], data: Buffer): any[];
export function simpleDecode(signature: string, data: Buffer): any[];
export function rawEncode(types: string[], values: any[]): Buffer;
export function rawDecode(types: string[], data: Buffer): any[];
export function stringify(types: string[], values: any[]): string;
export function solidityPack(types: string[], values: any[]): Buffer;
export function fromSerpent(signature: string): string[];
export function toSerpent(types: string[]): string;
@@ -10,13 +10,13 @@ const client = new Eureka({
port: 8080,
vipAddress: 'jq.test.something.com',
dataCenterInfo: {
name: 'MyOwn',
},
name: 'MyOwn'
}
},
eureka: {
// eureka server host / port
host: '192.168.99.100',
port: 32768,
port: 32768
}
});
@@ -34,13 +34,13 @@ const newerClient = new Eureka({
vipAddress: 'jq.test.something.com',
dataCenterInfo: {
'@class': 'com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo',
name: 'MyOwn',
},
name: 'MyOwn'
}
},
eureka: {
// eureka server host / port
host: '192.168.99.100',
port: 32768,
port: 32768
}
});
@@ -49,6 +49,17 @@ const ymlInitClient = new Eureka({
filename: 'eureka-config'
});
// example using middleware to set-up HTTP authentication (https://www.npmjs.com/package/eureka-js-client#providing-custom-request-middleware)
const middlewareClient = new Eureka({
requestMiddleware: (requestOpts, done) => {
requestOpts.auth = {
user: 'username',
password: 'somepassword'
};
done(requestOpts);
}
});
// Test callbacks
newerClient.start((err: Error) => {});
newerClient.start(() => {});
+7 -2
View File
@@ -3,10 +3,11 @@
// Definitions by: Ilko Hoffmann <https://github.com/Schnillz>
// Karl O. <https://github.com/karl-run>
// Tom Barton <https://github.com/tombarton>
// Josh Sullivan <https://github.com/jpsullivan>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export class Eureka {
constructor(config: EurekaClient.EurekaConfig | EurekaClient.EurekaYmlConfig)
constructor(config: EurekaClient.EurekaConfig | EurekaClient.EurekaYmlConfig | EurekaClient.EurekaMiddlewareConfig);
start(cb?: (err: Error, ...rest: any[]) => void): void;
stop(cb?: (err: Error, ...rest: any[]) => void): void;
getInstancesByAppId(appId: string): EurekaClient.EurekaInstanceConfig[];
@@ -19,6 +20,7 @@ export namespace EurekaClient {
type DataCenterName = 'Netflix' | 'Amazon' | 'MyOwn';
interface EurekaConfig {
requestMiddleware?: EurekaMiddlewareConfig;
instance: EurekaInstanceConfig;
eureka: EurekaClientConfig;
}
@@ -80,8 +82,11 @@ export namespace EurekaClient {
cwd: string;
filename?: string;
}
interface EurekaMiddlewareConfig {
requestMiddleware: (requestOpts: any, done: (opts: any) => void) => void;
}
interface LegacyPortWrapper {
'$': number;
$: number;
'@enabled': boolean;
}
interface PortWrapper {
+1
View File
@@ -412,6 +412,7 @@ async () => {
{ resize: { width: 300 } },
{ resize: { height: 300 } },
{ resize: { height: 300, width: 300 } },
{ crop: { originX: 0, originY: 0, height: 300, width: 300 } }
], {
compress: 0.75
});
+7 -5
View File
@@ -1952,14 +1952,16 @@ export namespace ImageManipulator {
}
interface Flip {
flip?: { vertical?: boolean; horizontal?: boolean };
flip: { vertical?: boolean; horizontal?: boolean };
}
interface Crop {
originX: number;
originY: number;
width: number;
height: number;
crop: {
originX: number;
originY: number;
width: number;
height: number;
};
}
interface ImageResult {
@@ -0,0 +1,22 @@
import * as express from "express";
import rewrite = require("express-urlrewrite");
declare const app: express.Application;
app.use(rewrite(/^\/i(\w+)/, "/items/$1"));
app.use(rewrite("/:src..:dst", "/commits/$1/to/$2"));
app.use(rewrite("/:src..:dst", "/commits/:src/to/:dst"));
app.use(rewrite("/js/*", "/public/assets/js/$1"));
app.use(rewrite("/file\\?param=:param", "/file/:param"));
app.use(rewrite("/path", "/anotherpath?param=some"));
app.get("/route/:var", rewrite("/rewritten/:var"));
declare const someMw: express.Handler;
app.get("/rewritten/:var", someMw);
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for express-urlrewrite 1.2
// Project: https://github.com/kapouer/express-urlrewrite
// Definitions by: Melvin Groenhoff <https://github.com/mgroenhoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import * as express from "express";
declare function rewrite(s: string): express.Handler;
declare function rewrite(s: string | RegExp, t: string): express.Handler;
export = rewrite;
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"express-urlrewrite-tests.ts"
]
}
+7 -5
View File
@@ -9,7 +9,7 @@
import { Duplex } from "stream";
declare namespace favicons {
interface Configuration {
interface Configuration {
/** Path for overriding default icons path @default "/" */
path: string;
/** Your application's name @default null */
@@ -38,6 +38,8 @@ declare namespace favicons {
version: string;
/** Print logs to console? @default false */
logging: boolean;
/** Use nearest neighbor resampling to preserve hard edges on pixel art @default false */
pixel_art: boolean;
/**
* Platform Options:
* - offset - offset in percentage
@@ -66,18 +68,18 @@ declare namespace favicons {
}>;
}
interface FavIconResponse {
interface FavIconResponse {
images: Array<{ name: string; contents: Buffer }>;
files: Array<{ name: string; contents: Buffer }>;
html: string[];
}
type Callback = (error: Error | null, response: FavIconResponse) => void;
type Callback = (error: Error | null, response: FavIconResponse) => void;
/** You can programmatically access Favicons configuration (icon filenames, HTML, manifest files, etc) with this export */
const config: Configuration;
const config: Configuration;
function stream(configuration?: Configuration): Duplex;
function stream(configuration?: Configuration): Duplex;
}
/**
* Generate favicons

Some files were not shown because too many files have changed in this diff Show More