mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
@@ -0,0 +1,13 @@
|
||||
import ansiRegex = require("ansi-regex");
|
||||
|
||||
ansiRegex(); // $ExpectType RegExp
|
||||
|
||||
// From the ansi-regex README.md
|
||||
ansiRegex().test('\u001B[4mcake\u001B[0m'); // $ExpectType boolean
|
||||
// => true
|
||||
|
||||
ansiRegex().test('cake'); // $ExpectType boolean
|
||||
// => false
|
||||
|
||||
'\u001B[4mcake\u001B[0m'.match(ansiRegex()); // $ExpectType RegExpMatchArray | null
|
||||
// => ['\u001B[4m', '\u001B[0m']
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
// Type definitions for ansi-regex 3.0
|
||||
// Project: https://github.com/chalk/ansi-regex#readme
|
||||
// Definitions by: Manish Vachharajani <https://github.com/mvachhar>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function r(): RegExp;
|
||||
export = r;
|
||||
@@ -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",
|
||||
"ansi-regex-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+2
-1
@@ -1,6 +1,6 @@
|
||||
// Type definitions for AutobahnJS v0.9.7
|
||||
// Project: http://autobahn.ws/js/
|
||||
// Definitions by: Elad Zelingher <https://github.com/darkl>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>, Wladimir Totino <https://github.com/valepu>
|
||||
// Definitions by: Elad Zelingher <https://github.com/darkl>, Andy Hawkins <https://github.com/a904guy/,http://a904guy.com/,http://www.bmbsqd.com>, Wladimir Totino <https://github.com/valepu>, Mathias Teier <https://github.com/glenroy37/,http://kagent.at>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="when" />
|
||||
@@ -179,6 +179,7 @@ declare namespace autobahn {
|
||||
|
||||
interface ISubscribeOptions {
|
||||
match?: string;
|
||||
get_retained?: boolean;
|
||||
}
|
||||
|
||||
interface IRegisterOptions {
|
||||
|
||||
Vendored
+178
-178
@@ -600,185 +600,185 @@ export class NodePath<T = Node> {
|
||||
addComments(type: string, comments: any[]): void;
|
||||
|
||||
// ------------------------- isXXX -------------------------
|
||||
isArrayExpression(opts?: object): boolean;
|
||||
isAssignmentExpression(opts?: object): boolean;
|
||||
isBinaryExpression(opts?: object): boolean;
|
||||
isDirective(opts?: object): boolean;
|
||||
isDirectiveLiteral(opts?: object): boolean;
|
||||
isBlockStatement(opts?: object): boolean;
|
||||
isBreakStatement(opts?: object): boolean;
|
||||
isCallExpression(opts?: object): boolean;
|
||||
isCatchClause(opts?: object): boolean;
|
||||
isConditionalExpression(opts?: object): boolean;
|
||||
isContinueStatement(opts?: object): boolean;
|
||||
isDebuggerStatement(opts?: object): boolean;
|
||||
isDoWhileStatement(opts?: object): boolean;
|
||||
isEmptyStatement(opts?: object): boolean;
|
||||
isExpressionStatement(opts?: object): boolean;
|
||||
isFile(opts?: object): boolean;
|
||||
isForInStatement(opts?: object): boolean;
|
||||
isForStatement(opts?: object): boolean;
|
||||
isFunctionDeclaration(opts?: object): boolean;
|
||||
isFunctionExpression(opts?: object): boolean;
|
||||
isIdentifier(opts?: object): boolean;
|
||||
isIfStatement(opts?: object): boolean;
|
||||
isLabeledStatement(opts?: object): boolean;
|
||||
isStringLiteral(opts?: object): boolean;
|
||||
isNumericLiteral(opts?: object): boolean;
|
||||
isNullLiteral(opts?: object): boolean;
|
||||
isBooleanLiteral(opts?: object): boolean;
|
||||
isRegExpLiteral(opts?: object): boolean;
|
||||
isLogicalExpression(opts?: object): boolean;
|
||||
isMemberExpression(opts?: object): boolean;
|
||||
isNewExpression(opts?: object): boolean;
|
||||
isProgram(opts?: object): boolean;
|
||||
isObjectExpression(opts?: object): boolean;
|
||||
isObjectMethod(opts?: object): boolean;
|
||||
isObjectProperty(opts?: object): boolean;
|
||||
isRestElement(opts?: object): boolean;
|
||||
isReturnStatement(opts?: object): boolean;
|
||||
isSequenceExpression(opts?: object): boolean;
|
||||
isSwitchCase(opts?: object): boolean;
|
||||
isSwitchStatement(opts?: object): boolean;
|
||||
isThisExpression(opts?: object): boolean;
|
||||
isThrowStatement(opts?: object): boolean;
|
||||
isTryStatement(opts?: object): boolean;
|
||||
isUnaryExpression(opts?: object): boolean;
|
||||
isUpdateExpression(opts?: object): boolean;
|
||||
isVariableDeclaration(opts?: object): boolean;
|
||||
isVariableDeclarator(opts?: object): boolean;
|
||||
isWhileStatement(opts?: object): boolean;
|
||||
isWithStatement(opts?: object): boolean;
|
||||
isAssignmentPattern(opts?: object): boolean;
|
||||
isArrayPattern(opts?: object): boolean;
|
||||
isArrowFunctionExpression(opts?: object): boolean;
|
||||
isClassBody(opts?: object): boolean;
|
||||
isClassDeclaration(opts?: object): boolean;
|
||||
isClassExpression(opts?: object): boolean;
|
||||
isExportAllDeclaration(opts?: object): boolean;
|
||||
isExportDefaultDeclaration(opts?: object): boolean;
|
||||
isExportNamedDeclaration(opts?: object): boolean;
|
||||
isExportSpecifier(opts?: object): boolean;
|
||||
isForOfStatement(opts?: object): boolean;
|
||||
isImportDeclaration(opts?: object): boolean;
|
||||
isImportDefaultSpecifier(opts?: object): boolean;
|
||||
isImportNamespaceSpecifier(opts?: object): boolean;
|
||||
isImportSpecifier(opts?: object): boolean;
|
||||
isMetaProperty(opts?: object): boolean;
|
||||
isClassMethod(opts?: object): boolean;
|
||||
isObjectPattern(opts?: object): boolean;
|
||||
isSpreadElement(opts?: object): boolean;
|
||||
isSuper(opts?: object): boolean;
|
||||
isTaggedTemplateExpression(opts?: object): boolean;
|
||||
isTemplateElement(opts?: object): boolean;
|
||||
isTemplateLiteral(opts?: object): boolean;
|
||||
isYieldExpression(opts?: object): boolean;
|
||||
isAnyTypeAnnotation(opts?: object): boolean;
|
||||
isArrayTypeAnnotation(opts?: object): boolean;
|
||||
isBooleanTypeAnnotation(opts?: object): boolean;
|
||||
isBooleanLiteralTypeAnnotation(opts?: object): boolean;
|
||||
isNullLiteralTypeAnnotation(opts?: object): boolean;
|
||||
isClassImplements(opts?: object): boolean;
|
||||
isClassProperty(opts?: object): boolean;
|
||||
isDeclareClass(opts?: object): boolean;
|
||||
isDeclareFunction(opts?: object): boolean;
|
||||
isDeclareInterface(opts?: object): boolean;
|
||||
isDeclareModule(opts?: object): boolean;
|
||||
isDeclareTypeAlias(opts?: object): boolean;
|
||||
isDeclareVariable(opts?: object): boolean;
|
||||
isExistentialTypeParam(opts?: object): boolean;
|
||||
isFunctionTypeAnnotation(opts?: object): boolean;
|
||||
isFunctionTypeParam(opts?: object): boolean;
|
||||
isGenericTypeAnnotation(opts?: object): boolean;
|
||||
isInterfaceExtends(opts?: object): boolean;
|
||||
isInterfaceDeclaration(opts?: object): boolean;
|
||||
isIntersectionTypeAnnotation(opts?: object): boolean;
|
||||
isMixedTypeAnnotation(opts?: object): boolean;
|
||||
isNullableTypeAnnotation(opts?: object): boolean;
|
||||
isNumericLiteralTypeAnnotation(opts?: object): boolean;
|
||||
isNumberTypeAnnotation(opts?: object): boolean;
|
||||
isStringLiteralTypeAnnotation(opts?: object): boolean;
|
||||
isStringTypeAnnotation(opts?: object): boolean;
|
||||
isThisTypeAnnotation(opts?: object): boolean;
|
||||
isTupleTypeAnnotation(opts?: object): boolean;
|
||||
isTypeofTypeAnnotation(opts?: object): boolean;
|
||||
isTypeAlias(opts?: object): boolean;
|
||||
isTypeAnnotation(opts?: object): boolean;
|
||||
isTypeCastExpression(opts?: object): boolean;
|
||||
isTypeParameterDeclaration(opts?: object): boolean;
|
||||
isTypeParameterInstantiation(opts?: object): boolean;
|
||||
isObjectTypeAnnotation(opts?: object): boolean;
|
||||
isObjectTypeCallProperty(opts?: object): boolean;
|
||||
isObjectTypeIndexer(opts?: object): boolean;
|
||||
isObjectTypeProperty(opts?: object): boolean;
|
||||
isQualifiedTypeIdentifier(opts?: object): boolean;
|
||||
isUnionTypeAnnotation(opts?: object): boolean;
|
||||
isVoidTypeAnnotation(opts?: object): boolean;
|
||||
isJSXAttribute(opts?: object): boolean;
|
||||
isJSXClosingElement(opts?: object): boolean;
|
||||
isJSXElement(opts?: object): boolean;
|
||||
isJSXEmptyExpression(opts?: object): boolean;
|
||||
isJSXExpressionContainer(opts?: object): boolean;
|
||||
isJSXIdentifier(opts?: object): boolean;
|
||||
isJSXMemberExpression(opts?: object): boolean;
|
||||
isJSXNamespacedName(opts?: object): boolean;
|
||||
isJSXOpeningElement(opts?: object): boolean;
|
||||
isJSXSpreadAttribute(opts?: object): boolean;
|
||||
isJSXText(opts?: object): boolean;
|
||||
isNoop(opts?: object): boolean;
|
||||
isParenthesizedExpression(opts?: object): boolean;
|
||||
isAwaitExpression(opts?: object): boolean;
|
||||
isBindExpression(opts?: object): boolean;
|
||||
isDecorator(opts?: object): boolean;
|
||||
isDoExpression(opts?: object): boolean;
|
||||
isExportDefaultSpecifier(opts?: object): boolean;
|
||||
isExportNamespaceSpecifier(opts?: object): boolean;
|
||||
isRestProperty(opts?: object): boolean;
|
||||
isSpreadProperty(opts?: object): boolean;
|
||||
isExpression(opts?: object): boolean;
|
||||
isBinary(opts?: object): boolean;
|
||||
isScopable(opts?: object): boolean;
|
||||
isBlockParent(opts?: object): boolean;
|
||||
isBlock(opts?: object): boolean;
|
||||
isStatement(opts?: object): boolean;
|
||||
isTerminatorless(opts?: object): boolean;
|
||||
isCompletionStatement(opts?: object): boolean;
|
||||
isConditional(opts?: object): boolean;
|
||||
isLoop(opts?: object): boolean;
|
||||
isWhile(opts?: object): boolean;
|
||||
isExpressionWrapper(opts?: object): boolean;
|
||||
isFor(opts?: object): boolean;
|
||||
isForXStatement(opts?: object): boolean;
|
||||
isFunction(opts?: object): boolean;
|
||||
isFunctionParent(opts?: object): boolean;
|
||||
isPureish(opts?: object): boolean;
|
||||
isDeclaration(opts?: object): boolean;
|
||||
isLVal(opts?: object): boolean;
|
||||
isLiteral(opts?: object): boolean;
|
||||
isImmutable(opts?: object): boolean;
|
||||
isUserWhitespacable(opts?: object): boolean;
|
||||
isMethod(opts?: object): boolean;
|
||||
isObjectMember(opts?: object): boolean;
|
||||
isProperty(opts?: object): boolean;
|
||||
isUnaryLike(opts?: object): boolean;
|
||||
isPattern(opts?: object): boolean;
|
||||
isClass(opts?: object): boolean;
|
||||
isModuleDeclaration(opts?: object): boolean;
|
||||
isExportDeclaration(opts?: object): boolean;
|
||||
isModuleSpecifier(opts?: object): boolean;
|
||||
isFlow(opts?: object): boolean;
|
||||
isFlowBaseAnnotation(opts?: object): boolean;
|
||||
isFlowDeclaration(opts?: object): boolean;
|
||||
isJSX(opts?: object): boolean;
|
||||
isNumberLiteral(opts?: object): boolean;
|
||||
isRegexLiteral(opts?: object): boolean;
|
||||
isReferencedIdentifier(opts?: object): boolean;
|
||||
isReferencedMemberExpression(opts?: object): boolean;
|
||||
isBindingIdentifier(opts?: object): boolean;
|
||||
isScope(opts?: object): boolean;
|
||||
isArrayExpression(opts?: object): this is NodePath<t.ArrayExpression> ;
|
||||
isAssignmentExpression(opts?: object): this is NodePath<t.AssignmentExpression>;
|
||||
isBinaryExpression(opts?: object): this is NodePath<t.BinaryExpression>;
|
||||
isDirective(opts?: object): this is NodePath<t.Directive>;
|
||||
isDirectiveLiteral(opts?: object): this is NodePath<t.DirectiveLiteral>;
|
||||
isBlockStatement(opts?: object): this is NodePath<t.BlockStatement>;
|
||||
isBreakStatement(opts?: object): this is NodePath<t.BreakStatement>;
|
||||
isCallExpression(opts?: object): this is NodePath<t.CallExpression>;
|
||||
isCatchClause(opts?: object): this is NodePath<t.CatchClause>;
|
||||
isConditionalExpression(opts?: object): this is NodePath<t.ConditionalExpression>;
|
||||
isContinueStatement(opts?: object): this is NodePath<t.ContinueStatement>;
|
||||
isDebuggerStatement(opts?: object): this is NodePath<t.DebuggerStatement>;
|
||||
isDoWhileStatement(opts?: object): this is NodePath<t.DoWhileStatement>;
|
||||
isEmptyStatement(opts?: object): this is NodePath<t.EmptyStatement>;
|
||||
isExpressionStatement(opts?: object): this is NodePath<t.ExpressionStatement>;
|
||||
isFile(opts?: object): this is NodePath<t.File>;
|
||||
isForInStatement(opts?: object): this is NodePath<t.ForInStatement>;
|
||||
isForStatement(opts?: object): this is NodePath<t.ForStatement>;
|
||||
isFunctionDeclaration(opts?: object): this is NodePath<t.FunctionDeclaration>;
|
||||
isFunctionExpression(opts?: object): this is NodePath<t.FunctionExpression>;
|
||||
isIdentifier(opts?: object): this is NodePath<t.Identifier>;
|
||||
isIfStatement(opts?: object): this is NodePath<t.IfStatement>;
|
||||
isLabeledStatement(opts?: object): this is NodePath<t.LabeledStatement>;
|
||||
isStringLiteral(opts?: object): this is NodePath<t.StringLiteral>;
|
||||
isNumericLiteral(opts?: object): this is NodePath<t.NumericLiteral>;
|
||||
isNullLiteral(opts?: object): this is NodePath<t.NullLiteral>;
|
||||
isBooleanLiteral(opts?: object): this is NodePath<t.BooleanLiteral>;
|
||||
isRegExpLiteral(opts?: object): this is NodePath<t.RegExpLiteral>;
|
||||
isLogicalExpression(opts?: object): this is NodePath<t.LogicalExpression>;
|
||||
isMemberExpression(opts?: object): this is NodePath<t.MemberExpression>;
|
||||
isNewExpression(opts?: object): this is NodePath<t.NewExpression>;
|
||||
isProgram(opts?: object): this is NodePath<t.Program>;
|
||||
isObjectExpression(opts?: object): this is NodePath<t.ObjectExpression>;
|
||||
isObjectMethod(opts?: object): this is NodePath<t.ObjectMethod>;
|
||||
isObjectProperty(opts?: object): this is NodePath<t.ObjectProperty>;
|
||||
isRestElement(opts?: object): this is NodePath<t.RestElement>;
|
||||
isReturnStatement(opts?: object): this is NodePath<t.ReturnStatement>;
|
||||
isSequenceExpression(opts?: object): this is NodePath<t.SequenceExpression>;
|
||||
isSwitchCase(opts?: object): this is NodePath<t.SwitchCase>;
|
||||
isSwitchStatement(opts?: object): this is NodePath<t.SwitchStatement>;
|
||||
isThisExpression(opts?: object): this is NodePath<t.ThisExpression>;
|
||||
isThrowStatement(opts?: object): this is NodePath<t.ThrowStatement>;
|
||||
isTryStatement(opts?: object): this is NodePath<t.TryStatement>;
|
||||
isUnaryExpression(opts?: object): this is NodePath<t.UnaryExpression>;
|
||||
isUpdateExpression(opts?: object): this is NodePath<t.UpdateExpression>;
|
||||
isVariableDeclaration(opts?: object): this is NodePath<t.VariableDeclaration>;
|
||||
isVariableDeclarator(opts?: object): this is NodePath<t.VariableDeclarator>;
|
||||
isWhileStatement(opts?: object): this is NodePath<t.WhileStatement>;
|
||||
isWithStatement(opts?: object): this is NodePath<t.WithStatement>;
|
||||
isAssignmentPattern(opts?: object): this is NodePath<t.AssignmentPattern>;
|
||||
isArrayPattern(opts?: object): this is NodePath<t.ArrayPattern>;
|
||||
isArrowFunctionExpression(opts?: object): this is NodePath<t.ArrowFunctionExpression>;
|
||||
isClassBody(opts?: object): this is NodePath<t.ClassBody>;
|
||||
isClassDeclaration(opts?: object): this is NodePath<t.ClassDeclaration>;
|
||||
isClassExpression(opts?: object): this is NodePath<t.ClassExpression>;
|
||||
isExportAllDeclaration(opts?: object): this is NodePath<t.ExportAllDeclaration>;
|
||||
isExportDefaultDeclaration(opts?: object): this is NodePath<t.ExportDefaultDeclaration>;
|
||||
isExportNamedDeclaration(opts?: object): this is NodePath<t.ExportNamedDeclaration>;
|
||||
isExportSpecifier(opts?: object): this is NodePath<t.ExportSpecifier>;
|
||||
isForOfStatement(opts?: object): this is NodePath<t.ForOfStatement>;
|
||||
isImportDeclaration(opts?: object): this is NodePath<t.ImportDeclaration>;
|
||||
isImportDefaultSpecifier(opts?: object): this is NodePath<t.ImportDefaultSpecifier>;
|
||||
isImportNamespaceSpecifier(opts?: object): this is NodePath<t.ImportNamespaceSpecifier>;
|
||||
isImportSpecifier(opts?: object): this is NodePath<t.ImportSpecifier>;
|
||||
isMetaProperty(opts?: object): this is NodePath<t.MetaProperty>;
|
||||
isClassMethod(opts?: object): this is NodePath<t.ClassMethod>;
|
||||
isObjectPattern(opts?: object): this is NodePath<t.ObjectPattern>;
|
||||
isSpreadElement(opts?: object): this is NodePath<t.SpreadElement>;
|
||||
isSuper(opts?: object): this is NodePath<t.Super>;
|
||||
isTaggedTemplateExpression(opts?: object): this is NodePath<t.TaggedTemplateExpression>;
|
||||
isTemplateElement(opts?: object): this is NodePath<t.TemplateElement>;
|
||||
isTemplateLiteral(opts?: object): this is NodePath<t.TemplateLiteral>;
|
||||
isYieldExpression(opts?: object): this is NodePath<t.YieldExpression>;
|
||||
isAnyTypeAnnotation(opts?: object): this is NodePath<t.AnyTypeAnnotation>;
|
||||
isArrayTypeAnnotation(opts?: object): this is NodePath<t.ArrayTypeAnnotation>;
|
||||
isBooleanTypeAnnotation(opts?: object): this is NodePath<t.BooleanTypeAnnotation>;
|
||||
isBooleanLiteralTypeAnnotation(opts?: object): this is NodePath<t.BooleanLiteralTypeAnnotation>;
|
||||
isNullLiteralTypeAnnotation(opts?: object): this is NodePath<t.NullLiteralTypeAnnotation>;
|
||||
isClassImplements(opts?: object): this is NodePath<t.ClassImplements>;
|
||||
isClassProperty(opts?: object): this is NodePath<t.ClassProperty>;
|
||||
isDeclareClass(opts?: object): this is NodePath<t.DeclareClass>;
|
||||
isDeclareFunction(opts?: object): this is NodePath<t.DeclareFunction>;
|
||||
isDeclareInterface(opts?: object): this is NodePath<t.DeclareInterface>;
|
||||
isDeclareModule(opts?: object): this is NodePath<t.DeclareModule>;
|
||||
isDeclareTypeAlias(opts?: object): this is NodePath<t.DeclareTypeAlias>;
|
||||
isDeclareVariable(opts?: object): this is NodePath<t.DeclareVariable>;
|
||||
isExistentialTypeParam(opts?: object): this is NodePath<t.ExistentialTypeParam>;
|
||||
isFunctionTypeAnnotation(opts?: object): this is NodePath<t.FunctionTypeAnnotation>;
|
||||
isFunctionTypeParam(opts?: object): this is NodePath<t.FunctionTypeParam>;
|
||||
isGenericTypeAnnotation(opts?: object): this is NodePath<t.GenericTypeAnnotation>;
|
||||
isInterfaceExtends(opts?: object): this is NodePath<t.InterfaceExtends>;
|
||||
isInterfaceDeclaration(opts?: object): this is NodePath<t.InterfaceDeclaration>;
|
||||
isIntersectionTypeAnnotation(opts?: object): this is NodePath<t.IntersectionTypeAnnotation>;
|
||||
isMixedTypeAnnotation(opts?: object): this is NodePath<t.MixedTypeAnnotation>;
|
||||
isNullableTypeAnnotation(opts?: object): this is NodePath<t.NullableTypeAnnotation>;
|
||||
isNumericLiteralTypeAnnotation(opts?: object): this is NodePath<t.NumericLiteralTypeAnnotation>;
|
||||
isNumberTypeAnnotation(opts?: object): this is NodePath<t.NumberTypeAnnotation>;
|
||||
isStringLiteralTypeAnnotation(opts?: object): this is NodePath<t.StringLiteralTypeAnnotation>;
|
||||
isStringTypeAnnotation(opts?: object): this is NodePath<t.StringTypeAnnotation>;
|
||||
isThisTypeAnnotation(opts?: object): this is NodePath<t.ThisTypeAnnotation>;
|
||||
isTupleTypeAnnotation(opts?: object): this is NodePath<t.TupleTypeAnnotation>;
|
||||
isTypeofTypeAnnotation(opts?: object): this is NodePath<t.TypeofTypeAnnotation>;
|
||||
isTypeAlias(opts?: object): this is NodePath<t.TypeAlias>;
|
||||
isTypeAnnotation(opts?: object): this is NodePath<t.TypeAnnotation>;
|
||||
isTypeCastExpression(opts?: object): this is NodePath<t.TypeCastExpression>;
|
||||
isTypeParameterDeclaration(opts?: object): this is NodePath<t.TypeParameterDeclaration>;
|
||||
isTypeParameterInstantiation(opts?: object): this is NodePath<t.TypeParameterInstantiation>;
|
||||
isObjectTypeAnnotation(opts?: object): this is NodePath<t.ObjectTypeAnnotation>;
|
||||
isObjectTypeCallProperty(opts?: object): this is NodePath<t.ObjectTypeCallProperty>;
|
||||
isObjectTypeIndexer(opts?: object): this is NodePath<t.ObjectTypeIndexer>;
|
||||
isObjectTypeProperty(opts?: object): this is NodePath<t.ObjectTypeProperty>;
|
||||
isQualifiedTypeIdentifier(opts?: object): this is NodePath<t.QualifiedTypeIdentifier>;
|
||||
isUnionTypeAnnotation(opts?: object): this is NodePath<t.UnionTypeAnnotation>;
|
||||
isVoidTypeAnnotation(opts?: object): this is NodePath<t.VoidTypeAnnotation>;
|
||||
isJSXAttribute(opts?: object): this is NodePath<t.JSXAttribute>;
|
||||
isJSXClosingElement(opts?: object): this is NodePath<t.JSXClosingElement>;
|
||||
isJSXElement(opts?: object): this is NodePath<t.JSXElement>;
|
||||
isJSXEmptyExpression(opts?: object): this is NodePath<t.JSXEmptyExpression>;
|
||||
isJSXExpressionContainer(opts?: object): this is NodePath<t.JSXExpressionContainer>;
|
||||
isJSXIdentifier(opts?: object): this is NodePath<t.JSXIdentifier>;
|
||||
isJSXMemberExpression(opts?: object): this is NodePath<t.JSXMemberExpression>;
|
||||
isJSXNamespacedName(opts?: object): this is NodePath<t.JSXNamespacedName>;
|
||||
isJSXOpeningElement(opts?: object): this is NodePath<t.JSXOpeningElement>;
|
||||
isJSXSpreadAttribute(opts?: object): this is NodePath<t.JSXSpreadAttribute>;
|
||||
isJSXText(opts?: object): this is NodePath<t.JSXText>;
|
||||
isNoop(opts?: object): this is NodePath<t.Noop>;
|
||||
isParenthesizedExpression(opts?: object): this is NodePath<t.ParenthesizedExpression>;
|
||||
isAwaitExpression(opts?: object): this is NodePath<t.AwaitExpression>;
|
||||
isBindExpression(opts?: object): this is NodePath<t.BindExpression>;
|
||||
isDecorator(opts?: object): this is NodePath<t.Decorator>;
|
||||
isDoExpression(opts?: object): this is NodePath<t.DoExpression>;
|
||||
isExportDefaultSpecifier(opts?: object): this is NodePath<t.ExportDefaultSpecifier>;
|
||||
isExportNamespaceSpecifier(opts?: object): this is NodePath<t.ExportNamespaceSpecifier>;
|
||||
isRestProperty(opts?: object): this is NodePath<t.RestProperty>;
|
||||
isSpreadProperty(opts?: object): this is NodePath<t.SpreadProperty>;
|
||||
isExpression(opts?: object): this is NodePath<t.Expression>;
|
||||
isBinary(opts?: object): this is NodePath<t.Binary>;
|
||||
isScopable(opts?: object): this is NodePath<t.Scopable>;
|
||||
isBlockParent(opts?: object): this is NodePath<t.BlockParent>;
|
||||
isBlock(opts?: object): this is NodePath<t.Block>;
|
||||
isStatement(opts?: object): this is NodePath<t.Statement>;
|
||||
isTerminatorless(opts?: object): this is NodePath<t.Terminatorless>;
|
||||
isCompletionStatement(opts?: object): this is NodePath<t.CompletionStatement>;
|
||||
isConditional(opts?: object): this is NodePath<t.Conditional>;
|
||||
isLoop(opts?: object): this is NodePath<t.Loop>;
|
||||
isWhile(opts?: object): this is NodePath<t.While>;
|
||||
isExpressionWrapper(opts?: object): this is NodePath<t.ExpressionWrapper>;
|
||||
isFor(opts?: object): this is NodePath<t.For>;
|
||||
isForXStatement(opts?: object): this is NodePath<t.ForXStatement>;
|
||||
isFunction(opts?: object): this is NodePath<t.Function>;
|
||||
isFunctionParent(opts?: object): this is NodePath<t.FunctionParent>;
|
||||
isPureish(opts?: object): this is NodePath<t.Pureish>;
|
||||
isDeclaration(opts?: object): this is NodePath<t.Declaration>;
|
||||
isLVal(opts?: object): this is NodePath<t.LVal>;
|
||||
isLiteral(opts?: object): this is NodePath<t.Literal>;
|
||||
isImmutable(opts?: object): this is NodePath<t.Immutable>;
|
||||
isUserWhitespacable(opts?: object): this is NodePath<t.UserWhitespacable>;
|
||||
isMethod(opts?: object): this is NodePath<t.Method>;
|
||||
isObjectMember(opts?: object): this is NodePath<t.ObjectMember>;
|
||||
isProperty(opts?: object): this is NodePath<t.Property>;
|
||||
isUnaryLike(opts?: object): this is NodePath<t.UnaryLike>;
|
||||
isPattern(opts?: object): this is NodePath<t.Pattern>;
|
||||
isClass(opts?: object): this is NodePath<t.Class>;
|
||||
isModuleDeclaration(opts?: object): this is NodePath<t.ModuleDeclaration>;
|
||||
isExportDeclaration(opts?: object): this is NodePath<t.ExportDeclaration>;
|
||||
isModuleSpecifier(opts?: object): this is NodePath<t.ModuleSpecifier>;
|
||||
isFlow(opts?: object): this is NodePath<t.Flow>;
|
||||
isFlowBaseAnnotation(opts?: object): this is NodePath<t.FlowBaseAnnotation>;
|
||||
isFlowDeclaration(opts?: object): this is NodePath<t.FlowDeclaration>;
|
||||
isJSX(opts?: object): this is NodePath<t.JSX>;
|
||||
isNumberLiteral(opts?: object): this is NodePath<t.NumericLiteral>;
|
||||
isRegexLiteral(opts?: object): this is NodePath<t.RegExpLiteral>;
|
||||
isReferencedIdentifier(opts?: object): this is NodePath<t.Identifier | t.JSXIdentifier>;
|
||||
isReferencedMemberExpression(opts?: object): this is NodePath<t.MemberExpression>;
|
||||
isBindingIdentifier(opts?: object): this is NodePath<t.Identifier>;
|
||||
isScope(opts?: object): this is NodePath<t.Scopable>;
|
||||
isReferenced(opts?: object): boolean;
|
||||
isBlockScoped(opts?: object): boolean;
|
||||
isVar(opts?: object): boolean;
|
||||
isBlockScoped(opts?: object): this is NodePath<t.FunctionDeclaration | t.ClassDeclaration | t.VariableDeclaration>;
|
||||
isVar(opts?: object): this is NodePath<t.VariableDeclaration>;
|
||||
isUser(opts?: object): boolean;
|
||||
isGenerated(opts?: object): boolean;
|
||||
isPure(opts?: object): boolean;
|
||||
|
||||
Vendored
+6
-6
@@ -1265,13 +1265,13 @@ 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 isReferencedIdentifier(node: object, opts?: object): boolean;
|
||||
export function isReferencedMemberExpression(node: object, opts?: object): boolean;
|
||||
export function isBindingIdentifier(node: object, opts?: object): boolean;
|
||||
export function isScope(node: object, opts?: object): boolean;
|
||||
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): boolean;
|
||||
export function isVar(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;
|
||||
|
||||
Vendored
+3
@@ -39,6 +39,9 @@ export class Binary {
|
||||
|
||||
constructor(buffer: Buffer, subType?: number);
|
||||
|
||||
/** The underlying Buffer which stores the binary data. */
|
||||
readonly buffer: Buffer;
|
||||
|
||||
/** The length of the binary. */
|
||||
length(): number;
|
||||
/** Updates this binary with byte_value */
|
||||
|
||||
@@ -1357,6 +1357,56 @@ suite('assert', () => {
|
||||
assert.notInclude(undefined, 'bar');
|
||||
});
|
||||
|
||||
test('deepInclude', () => {
|
||||
assert.deepInclude('foobar', 'bar');
|
||||
assert.deepInclude([1, 2, 3], 3);
|
||||
assert.deepInclude('foobar', 'baz');
|
||||
assert.deepInclude(undefined, 'bar');
|
||||
});
|
||||
|
||||
test('notDeepInclude', () => {
|
||||
assert.notDeepInclude('foobar', 'baz');
|
||||
assert.notDeepInclude([1, 2, 3], 4);
|
||||
assert.notDeepInclude('foobar', 'bar');
|
||||
assert.notDeepInclude(undefined, 'bar');
|
||||
});
|
||||
|
||||
test('nestedInclude', () => {
|
||||
assert.nestedInclude({'.a': {'b': 'x'}}, {'\\.a.[b]': 'x'});
|
||||
assert.nestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'x'});
|
||||
});
|
||||
|
||||
test('notNestedInclude', () => {
|
||||
assert.notNestedInclude({'.a': {'b': 'x'}}, {'\\.a.b': 'y'});
|
||||
assert.notNestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'y'});
|
||||
});
|
||||
|
||||
test('deepNestedInclude', () => {
|
||||
assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}});
|
||||
assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {x: 1}});
|
||||
});
|
||||
|
||||
test('notDeepNestedInclude', () => {
|
||||
assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}})
|
||||
assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}});
|
||||
});
|
||||
|
||||
test('ownInclude', () => {
|
||||
assert.ownInclude({ a: 1 }, { a: 1 });
|
||||
});
|
||||
|
||||
test('notOwnInclude', () => {
|
||||
assert.notOwnInclude({ a: 1 }, { a: 1 });
|
||||
});
|
||||
|
||||
test('deepOwnInclude', () => {
|
||||
assert.deepOwnInclude({a: {b: 2}}, {a: {b: 2}});
|
||||
});
|
||||
|
||||
test('notDeepOwnInclude', () => {
|
||||
assert.notDeepOwnInclude({a: {b: 2}}, {a: {c: 3}});
|
||||
});
|
||||
|
||||
test('lengthOf', () => {
|
||||
assert.lengthOf([1, 2, 3], 3);
|
||||
assert.lengthOf('foobar', 6);
|
||||
|
||||
Vendored
+134
-1
@@ -7,6 +7,7 @@
|
||||
// Matt Wistrand <https://github.com/mwistrand>,
|
||||
// Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Shaun Luttin <https://github.com/shaunluttin>
|
||||
// Gintautas Miselis <https://github.com/Naktibalda>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// <reference types="assertion-error"/>
|
||||
@@ -706,13 +707,145 @@ declare namespace Chai {
|
||||
/**
|
||||
* Asserts that haystack does not include needle.
|
||||
*
|
||||
* @type T Type of values in haystack.
|
||||
* @param haystack Container array.
|
||||
* @param needle Potential value contained in haystack.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notInclude(haystack: any[], needle: any, message?: string): void;
|
||||
|
||||
|
||||
/**
|
||||
* Asserts that haystack includes needle. Can be used to assert the inclusion of a value in an array or a subset of properties in an object. Deep equality is used.
|
||||
*
|
||||
* @param haystack Container string.
|
||||
* @param needle Potential expected substring of haystack.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
deepInclude(haystack: string, needle: string, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that haystack includes needle. Can be used to assert the inclusion of a value in an array or a subset of properties in an object. Deep equality is used.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
deepInclude<T>(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that haystack does not include needle. Can be used to assert the absence of a value in an array or a subset of properties in an object. Deep equality is used.
|
||||
*
|
||||
* @param haystack Container string.
|
||||
* @param needle Potential expected substring of haystack.
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notDeepInclude(haystack: string, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that haystack does not include needle. Can be used to assert the absence of a value in an array or a subset of properties in an object. Deep equality is used.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notDeepInclude(haystack: any[], needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object.
|
||||
*
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’.
|
||||
* Can be used to assert the inclusion of a subset of properties in an object.
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
nestedInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ does not include ‘needle’. Can be used to assert the absence of a subset of properties in an object.
|
||||
*
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’.
|
||||
* Can be used to assert the inclusion of a subset of properties in an object.
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notNestedInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object while checking for deep equality
|
||||
*
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’.
|
||||
* Can be used to assert the inclusion of a subset of properties in an object.
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
deepNestedInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ does not include ‘needle’. Can be used to assert the absence of a subset of properties in an object while checking for deep equality.
|
||||
*
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’.
|
||||
* Can be used to assert the inclusion of a subset of properties in an object.
|
||||
* Enables the use of dot- and bracket-notation for referencing nested properties.
|
||||
* ‘[]’ and ‘.’ in property names can be escaped using double backslashes.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notDeepNestedInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object while ignoring inherited properties.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
ownInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the absence of a subset of properties in an object while ignoring inherited properties.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notOwnInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object while ignoring inherited properties and checking for deep
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
deepOwnInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the absence of a subset of properties in an object while ignoring inherited properties and checking for deep equality.
|
||||
*
|
||||
* @param haystack
|
||||
* @param needle
|
||||
* @param message Message to display on error.
|
||||
*/
|
||||
notDeepOwnInclude(haystack: any, needle: any, message?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that value matches the regular expression regexp.
|
||||
*
|
||||
|
||||
Vendored
+1
@@ -159,6 +159,7 @@ declare namespace Chart {
|
||||
interface ChartOptions {
|
||||
responsive?: boolean;
|
||||
responsiveAnimationDuration?: number;
|
||||
aspectRatio?: number;
|
||||
maintainAspectRatio?: boolean;
|
||||
events?: string[];
|
||||
onClick?(event?: MouseEvent, activeElements?: Array<{}>): any;
|
||||
|
||||
Vendored
+1
@@ -263,6 +263,7 @@ interface CheerioElement {
|
||||
parent: CheerioElement;
|
||||
parentNode: CheerioElement;
|
||||
nodeValue: string;
|
||||
data?: string;
|
||||
}
|
||||
|
||||
interface CheerioAPI extends CheerioSelector, CheerioStatic {
|
||||
|
||||
Vendored
+17
-11
@@ -105,9 +105,9 @@ declare namespace CodeMirror {
|
||||
function signal(target: any, name: string, ...args: any[]): void;
|
||||
|
||||
type DOMEvent = 'mousedown' | 'dblclick' | 'touchstart' | 'contextmenu' | 'keydown' | 'keypress' | 'keyup' | 'cut' | 'copy' | 'paste' | 'dragstart' | 'dragenter' | 'dragover' | 'dragleave' | 'drop';
|
||||
|
||||
|
||||
type CoordsMode = 'window' | 'page' | 'local';
|
||||
|
||||
|
||||
interface Token {
|
||||
/** The character(on the given line) at which the token starts. */
|
||||
start: number;
|
||||
@@ -202,10 +202,10 @@ declare namespace CodeMirror {
|
||||
/** Compute the line at the given pixel height. mode is the relative element
|
||||
to use to compute this line, it may be "window", "page" (the default), or "local" */
|
||||
lineAtHeight(height: number, mode?: CoordsMode): number;
|
||||
|
||||
/** Computes the height of the top of a line, in the coordinate system specified by mode, it may be "window",
|
||||
"page" (the default), or "local". When a line below the bottom of the document is specified, the returned value
|
||||
is the bottom of the last line in the document. By default, the position of the actual text is returned.
|
||||
|
||||
/** Computes the height of the top of a line, in the coordinate system specified by mode, it may be "window",
|
||||
"page" (the default), or "local". When a line below the bottom of the document is specified, the returned value
|
||||
is the bottom of the last line in the document. By default, the position of the actual text is returned.
|
||||
If includeWidgets is true and the line has line widgets, the position above the first line widget is returned. */
|
||||
heightAtLine(line: any, mode?: CoordsMode, includeWidgets?: boolean): number;
|
||||
|
||||
@@ -292,7 +292,7 @@ declare namespace CodeMirror {
|
||||
charCoords(pos: CodeMirror.Position, mode?: CoordsMode): { left: number; right: number; top: number; bottom: number; };
|
||||
|
||||
/** Given an { left , top } object , returns the { line , ch } position that corresponds to it.
|
||||
The optional mode parameter determines relative to what the coordinates are interpreted.
|
||||
The optional mode parameter determines relative to what the coordinates are interpreted.
|
||||
It may be "window", "page" (the default), or "local". */
|
||||
coordsChar(object: { left: number; top: number; }, mode?: CoordsMode): CodeMirror.Position;
|
||||
|
||||
@@ -512,7 +512,7 @@ declare namespace CodeMirror {
|
||||
|
||||
/** Get the currently selected code. */
|
||||
getSelection(): string;
|
||||
|
||||
|
||||
/** Returns an array containing a string for each selection, representing the content of the selections. */
|
||||
getSelections(lineSep?: string): Array<string>;
|
||||
|
||||
@@ -535,8 +535,14 @@ declare namespace CodeMirror {
|
||||
/** Set the cursor position.You can either pass a single { line , ch } object , or the line and the character as two separate parameters. */
|
||||
setCursor(pos: CodeMirror.Position): void;
|
||||
|
||||
/** Set the selection range.anchor and head should be { line , ch } objects.head defaults to anchor when not given. */
|
||||
setSelection(anchor: CodeMirror.Position, head: CodeMirror.Position): void;
|
||||
/** Set a single selection range. anchor and head should be {line, ch} objects. head defaults to anchor when not given. */
|
||||
setSelection(anchor: CodeMirror.Position, head: CodeMirror.Position, options?: { bias?: number, origin?: string, scroll?: boolean }): void;
|
||||
|
||||
/** Sets a new set of selections. There must be at least one selection in the given array. When primary is a
|
||||
number, it determines which selection is the primary one. When it is not given, the primary index is taken from
|
||||
the previous selection, or set to the last range if the previous selection had less ranges than the new one.
|
||||
Supports the same options as setSelection. */
|
||||
setSelections(ranges: Array<{ anchor: CodeMirror.Position, head: CodeMirror.Position }>, primary?: number, options?: { bias?: number, origin?: string, scroll?: boolean }): void;
|
||||
|
||||
/** Similar to setSelection , but will, if shift is held or the extending flag is set,
|
||||
move the head of the selection while leaving the anchor at its current place.
|
||||
@@ -779,7 +785,7 @@ declare namespace CodeMirror {
|
||||
/** Determines whether the gutter scrolls along with the content horizontally (false)
|
||||
or whether it stays fixed during horizontal scrolling (true, the default). */
|
||||
fixedGutter?: boolean;
|
||||
|
||||
|
||||
/**
|
||||
* Chooses a scrollbar implementation. The default is "native", showing native scrollbars. The core library also
|
||||
* provides the "null" style, which completely hides the scrollbars. Addons can implement additional scrollbar models.
|
||||
|
||||
@@ -1,23 +1,31 @@
|
||||
Keyboard.shrinkView(true);
|
||||
Keyboard.shrinkView(false);
|
||||
Keyboard.shrinkView(null, (currentValue) => console.log(currentValue));
|
||||
|
||||
Keyboard.hideFormAccessoryBar(true);
|
||||
Keyboard.hideFormAccessoryBar(false);
|
||||
Keyboard.hideFormAccessoryBar(null, (currentValue) => console.log(currentValue));
|
||||
|
||||
Keyboard.disableScrollingInShrinkView(true);
|
||||
Keyboard.disableScrollingInShrinkView(false);
|
||||
Keyboard.disableScrollingInShrinkView(null, (currentValue) => console.log(currentValue));
|
||||
|
||||
Keyboard.hide();
|
||||
|
||||
Keyboard.show();
|
||||
|
||||
if (Keyboard.isVisible) {
|
||||
console.log('Keyboard is visible');
|
||||
}
|
||||
Keyboard.automaticScrollToTopOnHiding = true;
|
||||
Keyboard.onshow = function () {
|
||||
console.log('onshow');
|
||||
};
|
||||
Keyboard.onhide = function () {
|
||||
console.log('onhide');
|
||||
};
|
||||
Keyboard.onshowing = function () {
|
||||
console.log('onshowing');
|
||||
};
|
||||
Keyboard.onhiding= function () {
|
||||
console.log('onhiding');
|
||||
};
|
||||
|
||||
Keyboard.automaticScrollToTopOnHiding = true;
|
||||
|
||||
window.addEventListener('keyboardDidShow', () => console.log('keyboardDidShow'));
|
||||
|
||||
window.addEventListener('keyboardDidHide', () => console.log('keyboardDidHide'));
|
||||
|
||||
window.addEventListener('keyboardWillShow', () => console.log('keyboardWillShow'));
|
||||
|
||||
window.addEventListener('keyboardWillHide', () => console.log('keyboardWillHide'));
|
||||
|
||||
window.addEventListener('keyboardHeightWillChange', (event: CordovaKeyboardEvent) => console.log(`keyboardHeightWillChange - keyboard height: ${event.keyboardHeight}`));
|
||||
|
||||
+99
-88
@@ -1,32 +1,9 @@
|
||||
// Type definitions for Apache Cordova Keyboard plugin v0.1.2
|
||||
// Project: https://github.com/apache/cordova-plugins/tree/master/keyboard
|
||||
// Definitions by: Dan Manastireanu <https://github.com/danmana>
|
||||
// Type definitions for Apache Cordova Keyboard plugin v1.2.0
|
||||
// Project: https://github.com/cjpearson/cordova-plugin-keyboard
|
||||
// Definitions by: Dan Manastireanu <https://github.com/danmana>
|
||||
// Jochen Becker <https://github.com/jkfb>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* The Keyboard object provides some functions to customize the iOS keyboard.
|
||||
*
|
||||
* <i>Supported Platforms: iOS</i>
|
||||
*
|
||||
* This plugin has only been tested in Cordova 3.2 or greater,
|
||||
* and its use in previous Cordova versions is not recommended
|
||||
* (potential conflict with keyboard customization code present in the core in previous Cordova versions).
|
||||
*
|
||||
* If you do use this plugin in an older Cordova version (again, not recommended),
|
||||
* you have to make sure the HideKeyboardFormAccessoryBar and KeyboardShrinksView preference values are always false,
|
||||
* and only use the API functions to turn things on/off.
|
||||
*
|
||||
* This plugin supports the HideKeyboardFormAccessoryBar (boolean)
|
||||
* and KeyboardShrinksView (boolean) preferences in config.xml.
|
||||
*
|
||||
* Permissions in config.xml
|
||||
* <code>
|
||||
* <feature name="Keyboard">
|
||||
* <param name="ios-package" value="CDVKeyboard" onload="true" />
|
||||
* </feature>
|
||||
* </code>
|
||||
*
|
||||
*/
|
||||
interface Keyboard {
|
||||
|
||||
// Methods
|
||||
@@ -39,15 +16,20 @@ interface Keyboard {
|
||||
* This applies to apps that position their elements relative to the bottom of the WebView.
|
||||
* This is the default behaviour on Android, and makes a lot of sense when building apps as opposed to webpages.
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - iOS
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.shrinkView(true);
|
||||
* Keyboard.shrinkView(false);
|
||||
* Keyboard.shrinkView(null, function (currentValue) { console.log(currentValue); });
|
||||
* </code>
|
||||
*
|
||||
* @param shrink
|
||||
* @param successCallback A success callbackfunction
|
||||
*/
|
||||
shrinkView(shrink:boolean): void,
|
||||
shrinkView(shrink: boolean, successCallback?: (currentValue: any) => void): void,
|
||||
|
||||
/**
|
||||
* Hide the keyboard toolbar.
|
||||
@@ -55,21 +37,29 @@ interface Keyboard {
|
||||
* Set to true to hide the additional toolbar that is on top of the keyboard.
|
||||
* This toolbar features the Prev, Next, and Done buttons.
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - iOS
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.hideFormAccessoryBar(true);
|
||||
* Keyboard.hideFormAccessoryBar(false);
|
||||
* Keyboard.hideFormAccessoryBar(null, function (currentValue) { console.log(currentValue); });
|
||||
* </code>
|
||||
*
|
||||
* @param hide
|
||||
* @param successCallback A success callbackfunction
|
||||
*/
|
||||
hideFormAccessoryBar(hide:boolean): void,
|
||||
hideFormAccessoryBar(hide: boolean, successCallback?: (currentValue: any) => void): void,
|
||||
|
||||
/**
|
||||
* Disable scrolling when the the WebView is shrunk.
|
||||
*
|
||||
* Set to true to disable scrolling when the WebView is shrunk.
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - iOS
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.disableScrollingInShrinkView(true);
|
||||
@@ -77,8 +67,40 @@ interface Keyboard {
|
||||
* </code>
|
||||
*
|
||||
* @param disable
|
||||
* @param successCallback A success callbackfunction
|
||||
*/
|
||||
disableScrollingInShrinkView(disable:boolean): void,
|
||||
disableScrollingInShrinkView(disable: boolean, successCallback?: (currentValue: any) => void): void,
|
||||
|
||||
/**
|
||||
* Hide the keyboard
|
||||
*
|
||||
* Call this method to hide the keyboard
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - iOS
|
||||
* - Android
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.hide();
|
||||
* </code>
|
||||
*/
|
||||
hide(): void,
|
||||
|
||||
/**
|
||||
* Show the keyboard
|
||||
*
|
||||
* Call this method to show the keyboard.
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - Android
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.show();
|
||||
* </code>
|
||||
*/
|
||||
show(): void,
|
||||
|
||||
// Properties
|
||||
|
||||
@@ -87,6 +109,9 @@ interface Keyboard {
|
||||
*
|
||||
* Read this property to determine if the keyboard is visible.
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - iOS
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* if (Keyboard.isVisible) {
|
||||
@@ -102,6 +127,9 @@ interface Keyboard {
|
||||
* Set this to true if you need that page scroll to beginning when keyboard is hiding.
|
||||
* This is allows to fix issue with elements declared with position: fixed, after keyboard is hiding.
|
||||
*
|
||||
* Supported Platforms:
|
||||
* - iOS
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.automaticScrollToTopOnHiding = true;
|
||||
@@ -110,65 +138,48 @@ interface Keyboard {
|
||||
*/
|
||||
automaticScrollToTopOnHiding: boolean,
|
||||
|
||||
// Events
|
||||
/**
|
||||
* Deprecated Events
|
||||
*/
|
||||
onshow(): void,
|
||||
|
||||
/**
|
||||
* If defined, this function is fired when keyboard fully shown.
|
||||
*
|
||||
* Attach handler to this event to be able to receive notification when keyboard is shown.
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.onshow = function () {
|
||||
* // Describe your logic which will be run each time keyboard is shown.
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
*/
|
||||
onshow():void,
|
||||
/**
|
||||
* If defined, this function is fired when keyboard fully closed.
|
||||
*
|
||||
* Attach handler to this event to be able to receive notification when keyboard is closed.
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.onhide = function () {
|
||||
* // Describe your logic which will be run each time keyboard is closed.
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
*/
|
||||
onhide():void,
|
||||
/**
|
||||
* If defined, this function is fired before keyboard will be shown.
|
||||
*
|
||||
* Attach handler to this event to be able to receive notification when keyboard is about to be shown on the screen.
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.onshowing = function () {
|
||||
* // Describe your logic which will be run each time when keyboard is about to be shown.
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
*/
|
||||
onshowing():void,
|
||||
/**
|
||||
* If defined, this function is fired when keyboard is about to be closed.
|
||||
*
|
||||
* Attach handler to this event to be able to receive notification when keyboard is about to be closed.
|
||||
*
|
||||
* Example:
|
||||
* <code>
|
||||
* Keyboard.onhiding = function () {
|
||||
* // Describe your logic which will be run each time when keyboard is about to be closed.
|
||||
* }
|
||||
* </code>
|
||||
*
|
||||
*/
|
||||
onhiding():void,
|
||||
onhide(): void,
|
||||
|
||||
onhiding(): void,
|
||||
|
||||
onshowing(): void
|
||||
}
|
||||
|
||||
declare var Keyboard:Keyboard;
|
||||
interface CordovaKeyboardEvent extends Event {
|
||||
/** The height of the keyboard */
|
||||
keyboardHeight: number;
|
||||
}
|
||||
|
||||
interface WindowEventMap {
|
||||
/**
|
||||
* This event is fired when keyboard fully shown.
|
||||
*/
|
||||
'keyboardDidShow': Event,
|
||||
|
||||
/**
|
||||
* This event is fired when the keyboard is fully closed.
|
||||
*/
|
||||
'keyboardDidHide': Event,
|
||||
|
||||
/**
|
||||
* This event fires before keyboard will be shown.
|
||||
*/
|
||||
'keyboardWillShow': Event,
|
||||
|
||||
/**
|
||||
* This event is fired when the keyboard is fully closed.
|
||||
*/
|
||||
'keyboardWillHide': Event,
|
||||
|
||||
/**
|
||||
* This event is fired when the keyboard is fully closed.
|
||||
*/
|
||||
'keyboardHeightWillChange': CordovaKeyboardEvent
|
||||
}
|
||||
|
||||
declare var Keyboard: Keyboard;
|
||||
|
||||
Vendored
+23
-18
@@ -112,7 +112,7 @@ export interface Comment extends Node {
|
||||
/**
|
||||
* The @charset at-rule.
|
||||
*/
|
||||
export interface Charset {
|
||||
export interface Charset extends Node {
|
||||
/** The part following @charset. */
|
||||
charset?: string;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ export interface Charset {
|
||||
/**
|
||||
* The @custom-media at-rule
|
||||
*/
|
||||
export interface CustomMedia {
|
||||
export interface CustomMedia extends Node {
|
||||
/** The ---prefixed name. */
|
||||
name?: string;
|
||||
/** The part following the name. */
|
||||
@@ -130,7 +130,7 @@ export interface CustomMedia {
|
||||
/**
|
||||
* The @document at-rule.
|
||||
*/
|
||||
export interface Document {
|
||||
export interface Document extends Node {
|
||||
/** The part following @document. */
|
||||
document?: string;
|
||||
/** The vendor prefix in @document, or undefined if there is none. */
|
||||
@@ -142,7 +142,7 @@ export interface Document {
|
||||
/**
|
||||
* The @font-face at-rule.
|
||||
*/
|
||||
export interface FontFace {
|
||||
export interface FontFace extends Node {
|
||||
/** Array of nodes with the types declaration and comment. */
|
||||
declarations?: Array<Declaration | Comment>;
|
||||
}
|
||||
@@ -150,7 +150,7 @@ export interface FontFace {
|
||||
/**
|
||||
* The @host at-rule.
|
||||
*/
|
||||
export interface Host {
|
||||
export interface Host extends Node {
|
||||
/** Array of nodes with the types rule, comment and any of the at-rule types. */
|
||||
rules?: Array<Rule | Comment | AtRule>;
|
||||
}
|
||||
@@ -158,7 +158,7 @@ export interface Host {
|
||||
/**
|
||||
* The @import at-rule.
|
||||
*/
|
||||
export interface Import {
|
||||
export interface Import extends Node {
|
||||
/** The part following @import. */
|
||||
import?: string;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ export interface Import {
|
||||
/**
|
||||
* The @keyframes at-rule.
|
||||
*/
|
||||
export interface KeyFrames {
|
||||
export interface KeyFrames extends Node {
|
||||
/** The name of the keyframes rule. */
|
||||
name?: string;
|
||||
/** The vendor prefix in @keyframes, or undefined if there is none. */
|
||||
@@ -175,7 +175,7 @@ export interface KeyFrames {
|
||||
keyframes?: Array<KeyFrame | Comment>;
|
||||
}
|
||||
|
||||
export interface KeyFrame {
|
||||
export interface KeyFrame extends Node {
|
||||
/** The list of "selectors" of the keyframe rule, split on commas. Each “selector” is trimmed from whitespace. */
|
||||
values?: Array<string>;
|
||||
/** Array of nodes with the types declaration and comment. */
|
||||
@@ -185,7 +185,7 @@ export interface KeyFrame {
|
||||
/**
|
||||
* The @media at-rule.
|
||||
*/
|
||||
export interface Media {
|
||||
export interface Media extends Node {
|
||||
/** The part following @media. */
|
||||
media?: string;
|
||||
/** Array of nodes with the types rule, comment and any of the at-rule types. */
|
||||
@@ -195,7 +195,7 @@ export interface Media {
|
||||
/**
|
||||
* The @namespace at-rule.
|
||||
*/
|
||||
export interface Namespace {
|
||||
export interface Namespace extends Node {
|
||||
/** The part following @namespace. */
|
||||
namespace?: string;
|
||||
}
|
||||
@@ -203,7 +203,7 @@ export interface Namespace {
|
||||
/**
|
||||
* The @page at-rule.
|
||||
*/
|
||||
export interface Page {
|
||||
export interface Page extends Node {
|
||||
/** The list of selectors of the rule, split on commas. Each selector is trimmed from whitespace and comments. */
|
||||
selectors?: Array<string>;
|
||||
/** Array of nodes with the types declaration and comment. */
|
||||
@@ -213,7 +213,7 @@ export interface Page {
|
||||
/**
|
||||
* The @supports at-rule.
|
||||
*/
|
||||
export interface Supports {
|
||||
export interface Supports extends Node {
|
||||
/** The part following @supports. */
|
||||
supports?: string;
|
||||
/** Array of nodes with the types rule, comment and any of the at-rule types. */
|
||||
@@ -223,16 +223,21 @@ export interface Supports {
|
||||
/** All at-rules. */
|
||||
export type AtRule = Charset | CustomMedia | Document | FontFace | Host | Import | KeyFrames | Media | Namespace | Page | Supports;
|
||||
|
||||
/**
|
||||
* A collection of rules
|
||||
*/
|
||||
export interface StyleRules {
|
||||
/** Array of nodes with the types rule, comment and any of the at-rule types. */
|
||||
rules: Array<Rule | Comment | AtRule>;
|
||||
/** Array of Errors. Errors collected during parsing when option silent is true. */
|
||||
parsingErrors?: Array<ParserError>
|
||||
}
|
||||
|
||||
/**
|
||||
* The root node returned by css.parse.
|
||||
*/
|
||||
export interface Stylesheet extends Node {
|
||||
stylesheet?: {
|
||||
/** Array of nodes with the types rule, comment and any of the at-rule types. */
|
||||
rules?: Array<Rule | Comment | AtRule>;
|
||||
/** Array of Errors. Errors collected during parsing when option silent is true. */
|
||||
parsingErrors?: Array<ParserError>
|
||||
};
|
||||
stylesheet?: StyleRules;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------
|
||||
|
||||
Vendored
+2
-4
@@ -1,4 +1,4 @@
|
||||
// Type definitions for cucumber-js 2.0
|
||||
// Type definitions for cucumber-js 2.1
|
||||
// Project: https://github.com/cucumber/cucumber-js
|
||||
// Definitions by: Abraão Alves <https://github.com/abraaoalves>
|
||||
// Jan Molak <https://github.com/jan-molak>
|
||||
@@ -23,9 +23,7 @@ export interface TableDefinition {
|
||||
hashes(): Array<{ [colName: string]: string }>;
|
||||
}
|
||||
|
||||
export type StepDefinitionParam = string | number | CallbackStepDefinition | TableDefinition;
|
||||
|
||||
export type StepDefinitionCode = (this: World, ...stepArgs: StepDefinitionParam[]) => PromiseLike<any> | any | void;
|
||||
export type StepDefinitionCode = (this: World, ...stepArgs: any[]) => any;
|
||||
|
||||
export interface StepDefinitionOptions {
|
||||
timeout?: number;
|
||||
|
||||
@@ -12,6 +12,8 @@ cy
|
||||
.get('.query-button')
|
||||
.contains('Save Form').should('have.class', 'btn');
|
||||
|
||||
cy.location('host');
|
||||
|
||||
cy
|
||||
.get('form')
|
||||
.find('input')
|
||||
|
||||
Vendored
+2
-1
@@ -249,7 +249,8 @@ declare namespace Cypress {
|
||||
/**
|
||||
* @see https://on.cypress.io/api/location
|
||||
*/
|
||||
location(options?: Loggable): Chainable;
|
||||
location(options?: LoggableTimeoutable): Chainable;
|
||||
location(key: string, options?: LoggableTimeoutable): Chainable;
|
||||
|
||||
/**
|
||||
* @see https://on.cypress.io/api/log
|
||||
|
||||
Vendored
+4
-1
@@ -36,7 +36,10 @@ export type GeoGeometryObjects = GeoJSON.GeometryObject | GeoSphere;
|
||||
export interface ExtendedGeometryCollection<GeometryType extends GeoGeometryObjects> {
|
||||
type: string;
|
||||
bbox?: number[];
|
||||
crs?: GeoJSON.CoordinateReferenceSystem;
|
||||
crs?: {
|
||||
type: string;
|
||||
properties: any;
|
||||
};
|
||||
geometries: GeometryType[];
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import elasticsearch = require("elasticsearch");
|
||||
import * as elasticsearch from "elasticsearch";
|
||||
|
||||
var client = new elasticsearch.Client({
|
||||
let client = new elasticsearch.Client({
|
||||
host: 'localhost:9200',
|
||||
log: 'trace'
|
||||
});
|
||||
@@ -10,26 +10,26 @@ client = new elasticsearch.Client({
|
||||
'box1.server.org',
|
||||
'box2.server.org'
|
||||
],
|
||||
selector: function (hosts: any) { }
|
||||
selector: (hosts: any) => { }
|
||||
});
|
||||
|
||||
client.ping({
|
||||
requestTimeout: 30000
|
||||
}, function (error) {
|
||||
}, (error) => {
|
||||
});
|
||||
|
||||
client.search({
|
||||
q: 'pants'
|
||||
}).then(function (body) {
|
||||
var hits = body.hits.hits;
|
||||
}, function (error) {
|
||||
}).then((body) => {
|
||||
const hits = body.hits.hits;
|
||||
}, (error) => {
|
||||
});
|
||||
|
||||
client.indices.delete({
|
||||
index: 'test_index',
|
||||
ignore: [404]
|
||||
}).then(function (body) {
|
||||
}, function (error) {
|
||||
}).then((body) => {
|
||||
}, (error) => {
|
||||
});
|
||||
|
||||
client.deleteByQuery({
|
||||
@@ -39,8 +39,8 @@ client.deleteByQuery({
|
||||
query: {
|
||||
}
|
||||
}
|
||||
}).then(function (response) {
|
||||
}, function (error) {
|
||||
}).then((response) => {
|
||||
}, (error) => {
|
||||
});
|
||||
|
||||
client.create({
|
||||
@@ -103,7 +103,7 @@ client.cluster.stats({
|
||||
|
||||
client.count({
|
||||
index: 'index_name'
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -120,7 +120,7 @@ client.count({
|
||||
}
|
||||
}
|
||||
}
|
||||
}, function (err, response) {
|
||||
}, (err, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -132,7 +132,7 @@ client.explain({
|
||||
|
||||
// the query to score it against
|
||||
q: 'field:value'
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -145,7 +145,7 @@ client.explain({
|
||||
match: { title: 'test' }
|
||||
}
|
||||
}
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -158,8 +158,7 @@ client.index({
|
||||
tags: ['y', 'z'],
|
||||
published: true,
|
||||
}
|
||||
}, function (error, response) {
|
||||
|
||||
}, (error, response) => {
|
||||
});
|
||||
|
||||
client.mget({
|
||||
@@ -170,7 +169,7 @@ client.mget({
|
||||
{ _index: 'indexC', _type: 'typeC', _id: '1' }
|
||||
]
|
||||
}
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -180,14 +179,14 @@ client.mget({
|
||||
body: {
|
||||
ids: [1, 2, 3]
|
||||
}
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
client.search({
|
||||
index: 'myindex',
|
||||
q: 'title:test'
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -207,7 +206,7 @@ client.search({
|
||||
}
|
||||
}
|
||||
}
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
@@ -221,12 +220,11 @@ client.suggest({
|
||||
}
|
||||
}
|
||||
}
|
||||
}, function (error, response) {
|
||||
}, (error, response) => {
|
||||
});
|
||||
|
||||
|
||||
// first we do a search, and specify a scroll timeout
|
||||
var allTitles: string[] = [];
|
||||
const allTitles: string[] = [];
|
||||
client.search({
|
||||
index: 'myindex',
|
||||
// Set to 30 seconds because we are calling right back
|
||||
@@ -236,14 +234,14 @@ client.search({
|
||||
q: 'title:test'
|
||||
}, function getMoreUntilDone(error, response) {
|
||||
// collect the title from each response
|
||||
response.hits.hits.forEach(function (hit) {
|
||||
response.hits.hits.forEach((hit) => {
|
||||
allTitles.push(hit.fields.title);
|
||||
});
|
||||
|
||||
if (response.hits.total !== allTitles.length) {
|
||||
// now we can call scroll over and over
|
||||
client.scroll({
|
||||
scrollId: response._scroll_id,
|
||||
scrollId: response._scroll_id!,
|
||||
scroll: '30s'
|
||||
}, getMoreUntilDone);
|
||||
} else {
|
||||
@@ -258,8 +256,13 @@ client.indices.updateAliases({
|
||||
{ add: { index: 'logstash-2014.05', alias: 'logstash-current' } }
|
||||
]
|
||||
}
|
||||
}).then(function (response) {
|
||||
}).then((response) => {
|
||||
// ...
|
||||
}, function (error) {
|
||||
}, (error) => {
|
||||
// ...
|
||||
});
|
||||
|
||||
// Errors
|
||||
function testErrors() {
|
||||
throw new elasticsearch.errors.AuthenticationException();
|
||||
}
|
||||
|
||||
Vendored
+1605
-1554
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
@@ -21,4 +21,4 @@
|
||||
"index.d.ts",
|
||||
"elasticsearch-tests.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,79 +1,7 @@
|
||||
{
|
||||
"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
|
||||
"no-empty-interface": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+9
@@ -993,6 +993,7 @@ declare namespace DS {
|
||||
* Push some raw data into the store.
|
||||
*/
|
||||
pushPayload(modelName: string, inputPayload: {}): any;
|
||||
pushPayload(inputPayload: {}): any;
|
||||
/**
|
||||
* `normalize` converts a json payload into the normalized form that
|
||||
* [push](#method_push) expects.
|
||||
@@ -1032,6 +1033,14 @@ declare namespace DS {
|
||||
* should use the REST adapter.
|
||||
*/
|
||||
class RESTAdapter extends Adapter implements BuildURLMixin {
|
||||
/**
|
||||
* Takes a URL, an HTTP method and a hash of data, and makes an HTTP request.
|
||||
*/
|
||||
ajax(url: string, type: string, options?: object): Promise<any>;
|
||||
/**
|
||||
* Generate ajax options
|
||||
*/
|
||||
ajaxOptions(url: string, type: string, options?: object): object;
|
||||
/**
|
||||
* By default, the RESTAdapter will send the query params sorted alphabetically to the
|
||||
* server.
|
||||
|
||||
@@ -23,3 +23,34 @@ const AuthTokenHeader = DS.JSONAPIAdapter.extend({
|
||||
};
|
||||
})
|
||||
});
|
||||
|
||||
const UseAjax = DS.JSONAPIAdapter.extend({
|
||||
query(store: DS.Store, type: string, query: object) {
|
||||
const url = 'https://api.example.com/my-api';
|
||||
return this.ajax(url, 'POST', {
|
||||
param: 'foo'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const UseAjaxOptions = DS.JSONAPIAdapter.extend({
|
||||
query(store: DS.Store, type: string, query: object) {
|
||||
const url = 'https://api.example.com/my-api';
|
||||
const options = this.ajaxOptions(url, 'DELETE', {
|
||||
foo: 'bar'
|
||||
});
|
||||
return Ember.$.ajax(url, {
|
||||
...options
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
const UseAjaxOptionsWithOptionalThirdParams = DS.JSONAPIAdapter.extend({
|
||||
query(store: DS.Store, type: string, query: object) {
|
||||
const url = 'https://api.example.com/my-api';
|
||||
const options = this.ajaxOptions(url, 'DELETE');
|
||||
return Ember.$.ajax(url, {
|
||||
...options
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Vendored
+1
-1
@@ -27,7 +27,7 @@ declare namespace gapi.auth2 {
|
||||
* Signs in the user using the specified options.
|
||||
* If no option specified here, fallback to the options specified to gapi.auth2.init().
|
||||
*/
|
||||
signIn(options?: SigninOptions | SigninOptionsBuilder): any;
|
||||
signIn(options?: SigninOptions | SigninOptionsBuilder): Promise<GoogleUser>;
|
||||
|
||||
/**
|
||||
* Signs out all accounts from the application.
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
let featureCollection: GeoJSON.FeatureCollection<any> = {
|
||||
import {
|
||||
BBox,
|
||||
Feature, FeatureCollection, GeometryCollection, LineString,
|
||||
MultiLineString, MultiPoint, MultiPolygon, Point, Polygon, GeometryObject
|
||||
} from "geojson";
|
||||
|
||||
let featureCollection: FeatureCollection<Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon | GeometryCollection> = {
|
||||
type: "FeatureCollection",
|
||||
features: [
|
||||
{
|
||||
@@ -34,7 +40,7 @@ let featureCollection: GeoJSON.FeatureCollection<any> = {
|
||||
geometry: {
|
||||
type: "Polygon",
|
||||
coordinates: [
|
||||
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
|
||||
[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]
|
||||
]
|
||||
},
|
||||
properties: {
|
||||
@@ -44,17 +50,10 @@ let featureCollection: GeoJSON.FeatureCollection<any> = {
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
crs: {
|
||||
type: "link",
|
||||
properties: {
|
||||
href: "http://example.com/crs/42",
|
||||
type: "proj4"
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
let featureWithPolygon: GeoJSON.Feature<GeoJSON.Polygon> = {
|
||||
const featureWithPolygon: Feature<Polygon> = {
|
||||
type: "Feature",
|
||||
bbox: [-180.0, -90.0, 180.0, 90.0],
|
||||
geometry: {
|
||||
@@ -66,57 +65,57 @@ let featureWithPolygon: GeoJSON.Feature<GeoJSON.Polygon> = {
|
||||
properties: null
|
||||
};
|
||||
|
||||
let point: GeoJSON.Point = {
|
||||
const point: Point = {
|
||||
type: "Point",
|
||||
coordinates: [100.0, 0.0]
|
||||
};
|
||||
|
||||
// This type is commonly used in the turf package
|
||||
let pointCoordinates: number[] = point.coordinates;
|
||||
const pointCoordinates: number[] = point.coordinates;
|
||||
|
||||
let lineString: GeoJSON.LineString = {
|
||||
const lineString: LineString = {
|
||||
type: "LineString",
|
||||
coordinates: [ [100.0, 0.0], [101.0, 1.0] ]
|
||||
coordinates: [[100.0, 0.0], [101.0, 1.0]]
|
||||
};
|
||||
|
||||
let polygon: GeoJSON.Polygon = {
|
||||
const polygon: Polygon = {
|
||||
type: "Polygon",
|
||||
coordinates: [
|
||||
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
|
||||
[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]
|
||||
]
|
||||
};
|
||||
|
||||
let polygonWithHole: GeoJSON.Polygon = {
|
||||
const polygonWithHole: Polygon = {
|
||||
type: "Polygon",
|
||||
coordinates: [
|
||||
[ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],
|
||||
[ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]
|
||||
[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]],
|
||||
[[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]
|
||||
]
|
||||
};
|
||||
|
||||
let multiPoint: GeoJSON.MultiPoint = {
|
||||
const multiPoint: MultiPoint = {
|
||||
type: "MultiPoint",
|
||||
coordinates: [ [100.0, 0.0], [101.0, 1.0] ]
|
||||
coordinates: [[100.0, 0.0], [101.0, 1.0]]
|
||||
};
|
||||
|
||||
let multiLineString: GeoJSON.MultiLineString = {
|
||||
const multiLineString: MultiLineString = {
|
||||
type: "MultiLineString",
|
||||
coordinates: [
|
||||
[ [100.0, 0.0], [101.0, 1.0] ],
|
||||
[ [102.0, 2.0], [103.0, 3.0] ]
|
||||
[[100.0, 0.0], [101.0, 1.0]],
|
||||
[[102.0, 2.0], [103.0, 3.0]]
|
||||
]
|
||||
};
|
||||
|
||||
let multiPolygon: GeoJSON.MultiPolygon = {
|
||||
const multiPolygon: MultiPolygon = {
|
||||
type: "MultiPolygon",
|
||||
coordinates: [
|
||||
[[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]],
|
||||
[[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]],
|
||||
[[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]]
|
||||
[[100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2]]]
|
||||
]
|
||||
};
|
||||
|
||||
let geometryCollection: GeoJSON.GeometryCollection = {
|
||||
const geometryCollection: GeometryCollection = {
|
||||
type: "GeometryCollection",
|
||||
geometries: [
|
||||
{
|
||||
@@ -125,16 +124,17 @@ let geometryCollection: GeoJSON.GeometryCollection = {
|
||||
},
|
||||
{
|
||||
type: "LineString",
|
||||
coordinates: [ [101.0, 0.0], [102.0, 1.0] ]
|
||||
coordinates: [[101.0, 0.0], [102.0, 1.0]]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
let feature: GeoJSON.Feature<GeoJSON.GeometryObject> = {
|
||||
let feature: Feature<GeometryObject> = {
|
||||
type: "Feature",
|
||||
geometry: lineString,
|
||||
properties: null
|
||||
};
|
||||
|
||||
feature = {
|
||||
type: "Feature",
|
||||
geometry: polygon,
|
||||
@@ -172,44 +172,37 @@ featureCollection = {
|
||||
{
|
||||
type: "Feature",
|
||||
geometry: lineString,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}, {
|
||||
type: "Feature",
|
||||
geometry: polygon,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}, {
|
||||
type: "Feature",
|
||||
geometry: polygonWithHole,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}, {
|
||||
type: "Feature",
|
||||
geometry: multiPoint,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}, {
|
||||
type: "Feature",
|
||||
geometry: multiLineString,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}, {
|
||||
type: "Feature",
|
||||
geometry: multiPolygon,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}, {
|
||||
type: "Feature",
|
||||
geometry: geometryCollection,
|
||||
properties: {test: "OK"}
|
||||
properties: { test: "OK" }
|
||||
}
|
||||
],
|
||||
crs: {
|
||||
type: "link",
|
||||
properties: {
|
||||
href: "http://example.com/crs/42",
|
||||
type: "proj4"
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
// Allow access to custom properties
|
||||
const pt: GeoJSON.Feature<GeoJSON.Point> = {
|
||||
const pt: Feature<Point> = {
|
||||
type: "Feature",
|
||||
properties: {
|
||||
foo: "bar",
|
||||
@@ -221,9 +214,14 @@ const pt: GeoJSON.Feature<GeoJSON.Point> = {
|
||||
coordinates: [0, 0]
|
||||
}
|
||||
};
|
||||
pt.properties.foo;
|
||||
pt.properties.hello;
|
||||
pt.properties[1];
|
||||
|
||||
if (pt.properties) {
|
||||
if (pt.properties.foo == null || pt.properties.hello == null || pt.properties[1] == null) {
|
||||
throw TypeError("Properties should not be null or undefined.");
|
||||
}
|
||||
} else {
|
||||
throw TypeError("Feature should have a 'properties' property.");
|
||||
}
|
||||
|
||||
// Optional generic for properties
|
||||
|
||||
@@ -232,19 +230,21 @@ interface TestProperty {
|
||||
hello: string;
|
||||
}
|
||||
|
||||
const typedPropertiesFeature: GeoJSON.Feature<GeoJSON.Point, TestProperty> = {
|
||||
const testProps: TestProperty = {
|
||||
foo: "bar",
|
||||
hello: "world"
|
||||
};
|
||||
|
||||
const typedPropertiesFeature: Feature<Point> = {
|
||||
type: "Feature",
|
||||
properties: {
|
||||
foo: "bar",
|
||||
hello: "world",
|
||||
},
|
||||
properties: testProps,
|
||||
geometry: {
|
||||
type: "Point",
|
||||
coordinates: [0, 0]
|
||||
}
|
||||
};
|
||||
|
||||
const typedPropertiesFeatureCollection: GeoJSON.FeatureCollection<GeoJSON.Point, TestProperty> = {
|
||||
const typedPropertiesFeatureCollection: FeatureCollection<Point> = {
|
||||
type: "FeatureCollection",
|
||||
features: [typedPropertiesFeature]
|
||||
};
|
||||
|
||||
Vendored
+108
-66
@@ -1,123 +1,165 @@
|
||||
// Type definitions for GeoJSON Format Specification Revision 1.0
|
||||
// Project: http://geojson.org/
|
||||
// Type definitions for geojson 7946.0
|
||||
// Project: https://geojson.org/
|
||||
// Definitions by: Jacob Bruun <https://github.com/cobster>
|
||||
// Arne Schubert <https://github.com/atd-schubert>
|
||||
// Jeff Jacobson <https://github.com/JeffJacobson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
// Note: as of the RFC 7946 version of GeoJSON, Coordinate Reference Systems
|
||||
// are no longer supported. (See https://tools.ietf.org/html/rfc7946#appendix-B)}
|
||||
|
||||
export as namespace GeoJSON;
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#geojson-objects
|
||||
/**
|
||||
* The valid values for the "type" property of GeoJSON geometry objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-1.4
|
||||
*/
|
||||
export type GeoJsonGeometryTypes = "Point" | "LineString" | "MultiPoint" | "Polygon" | "MultiLineString" |
|
||||
"MultiPolygon" | "GeometryCollection";
|
||||
|
||||
/**
|
||||
* The value values for the "type" property of GeoJSON Objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-1.4
|
||||
*/
|
||||
export type GeoJsonTypes = "FeatureCollection" | "Feature" | GeoJsonGeometryTypes;
|
||||
|
||||
/**
|
||||
* Bounding box
|
||||
* https://tools.ietf.org/html/rfc7946#section-5
|
||||
*/
|
||||
export type BBox = [number, number, number, number] | [number, number, number, number, number, number];
|
||||
|
||||
/**
|
||||
* A Position is an array of coordinates.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.1
|
||||
* Array should contain between two and three elements.
|
||||
* The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values),
|
||||
* but the current specification only allows X, Y, and (optionally) Z to be defined.
|
||||
*/
|
||||
export type Position = number[]; // [number, number] | [number, number, number];
|
||||
|
||||
/**
|
||||
* The base GeoJSON object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3
|
||||
* The GeoJSON specification also allows foreign members
|
||||
* (https://tools.ietf.org/html/rfc7946#section-6.1)
|
||||
* Developers should use "&" type in TypeScript or extend the interface
|
||||
* to add these foreign members.
|
||||
*/
|
||||
export interface GeoJsonObject {
|
||||
type: string;
|
||||
bbox?: number[];
|
||||
crs?: CoordinateReferenceSystem;
|
||||
// Don't include foreign members directly into this type def.
|
||||
// in order to preserve type safety.
|
||||
// [key: string]: any;
|
||||
/**
|
||||
* Specifies the type of GeoJSON object.
|
||||
*/
|
||||
type: GeoJsonTypes;
|
||||
/**
|
||||
* Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections.
|
||||
* https://tools.ietf.org/html/rfc7946#section-5
|
||||
*/
|
||||
bbox?: BBox;
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#positions
|
||||
*/
|
||||
export type Position = number[];
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#geometry-objects
|
||||
*/
|
||||
export interface DirectGeometryObject extends GeoJsonObject {
|
||||
coordinates: Position[][][] | Position[][] | Position[] | Position;
|
||||
}
|
||||
/**
|
||||
* GeometryObject supports geometry collection as well
|
||||
* A geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3
|
||||
*/
|
||||
export type GeometryObject = DirectGeometryObject | GeometryCollection;
|
||||
export interface GeometryObject extends GeoJsonObject {
|
||||
type: GeoJsonGeometryTypes;
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#point
|
||||
/**
|
||||
* Point geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.2
|
||||
*/
|
||||
export interface Point extends DirectGeometryObject {
|
||||
export interface Point extends GeometryObject {
|
||||
type: "Point";
|
||||
coordinates: Position;
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#multipoint
|
||||
/**
|
||||
* MultiPoint geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.3
|
||||
*/
|
||||
export interface MultiPoint extends DirectGeometryObject {
|
||||
export interface MultiPoint extends GeometryObject {
|
||||
type: "MultiPoint";
|
||||
coordinates: Position[];
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#linestring
|
||||
/**
|
||||
* LineString geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.4
|
||||
*/
|
||||
export interface LineString extends DirectGeometryObject {
|
||||
export interface LineString extends GeometryObject {
|
||||
type: "LineString";
|
||||
coordinates: Position[];
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#multilinestring
|
||||
/**
|
||||
* MultiLineString geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.5
|
||||
*/
|
||||
export interface MultiLineString extends DirectGeometryObject {
|
||||
export interface MultiLineString extends GeometryObject {
|
||||
type: "MultiLineString";
|
||||
coordinates: Position[][];
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#polygon
|
||||
/**
|
||||
* Polygon geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.6
|
||||
*/
|
||||
export interface Polygon extends DirectGeometryObject {
|
||||
export interface Polygon extends GeometryObject {
|
||||
type: "Polygon";
|
||||
coordinates: Position[][];
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#multipolygon
|
||||
/**
|
||||
* MultiPolygon geometry object.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.7
|
||||
*/
|
||||
export interface MultiPolygon extends DirectGeometryObject {
|
||||
export interface MultiPolygon extends GeometryObject {
|
||||
type: "MultiPolygon";
|
||||
coordinates: Position[][][];
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#geometry-collection
|
||||
/**
|
||||
* Geometry Collection
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.1.8
|
||||
*/
|
||||
export interface GeometryCollection extends GeoJsonObject {
|
||||
export interface GeometryCollection extends GeometryObject {
|
||||
type: "GeometryCollection";
|
||||
geometries: GeometryObject[];
|
||||
geometries: Array<Point | LineString | Polygon | MultiPoint | MultiLineString | MultiPolygon>;
|
||||
}
|
||||
|
||||
/***
|
||||
export type GeoJsonProperties = { [name: string]: any; } | null;
|
||||
|
||||
/**
|
||||
* A feature object which contains a geometry and associated properties.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.2
|
||||
*/
|
||||
export interface Feature<G extends GeometryObject, P = any> extends GeoJsonObject {
|
||||
export interface Feature<G extends GeometryObject, P = GeoJsonProperties> extends GeoJsonObject {
|
||||
type: "Feature";
|
||||
geometry: G;
|
||||
properties: P;
|
||||
/**
|
||||
* The feature's geometry
|
||||
*/
|
||||
geometry: G | null;
|
||||
/**
|
||||
* A value that uniquely identifies this feature in a
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.2.
|
||||
*/
|
||||
id?: string | number;
|
||||
/**
|
||||
* Properties associated with this feature.
|
||||
*/
|
||||
properties: P | null;
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#feature-collection-objects
|
||||
/**
|
||||
* A collection of feature objects.
|
||||
* https://tools.ietf.org/html/rfc7946#section-3.3
|
||||
*/
|
||||
export interface FeatureCollection<G extends GeometryObject, P = any> extends GeoJsonObject {
|
||||
type: "FeatureCollection";
|
||||
export interface FeatureCollection<G extends GeometryObject, P = GeoJsonProperties> extends GeoJsonObject {
|
||||
features: Array<Feature<G, P>>;
|
||||
}
|
||||
|
||||
/***
|
||||
* http://geojson.org/geojson-spec.html#coordinate-reference-system-objects
|
||||
*/
|
||||
export interface CoordinateReferenceSystem {
|
||||
type: string;
|
||||
properties: any;
|
||||
}
|
||||
|
||||
export interface NamedCoordinateReferenceSystem extends CoordinateReferenceSystem {
|
||||
properties: { name: string };
|
||||
}
|
||||
|
||||
export interface LinkedCoordinateReferenceSystem extends CoordinateReferenceSystem {
|
||||
properties: { href: string; type: string };
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -455,6 +455,7 @@ export class GraphQLEnumType {
|
||||
constructor(config: GraphQLEnumTypeConfig);
|
||||
getValues(): GraphQLEnumValue[];
|
||||
getValue(name: string): GraphQLEnumValue;
|
||||
isValidValue(value: any): boolean;
|
||||
serialize(value: any): string;
|
||||
parseValue(value: any): any;
|
||||
parseLiteral(valueNode: ValueNode): any;
|
||||
|
||||
@@ -1,7 +1,16 @@
|
||||
import fs = require('fs');
|
||||
import gzipSize = require('gzip-size');
|
||||
|
||||
const string = 'Lorem ipsum dolor sit amet.';
|
||||
|
||||
console.log(string.length);
|
||||
|
||||
gzipSize(string).then(size => console.log(size));
|
||||
|
||||
console.log(gzipSize.sync(string));
|
||||
|
||||
const stream = fs.createReadStream("index.d.ts");
|
||||
const gstream = stream.pipe(gzipSize.stream()).on("gzip-size", size => console.log(size));
|
||||
console.log(gstream.gzipSize); // Could be a number or undefined. Recommended to use "gzip-size" event instead
|
||||
|
||||
gzipSize.file("index.d.ts").then(size => console.log(size));
|
||||
|
||||
Vendored
+37
-2
@@ -1,7 +1,8 @@
|
||||
// Type definitions for gzip-size 4.0
|
||||
// Type definitions for gzip-size 4.1
|
||||
// Project: https://github.com/sindresorhus/gzip-size
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Jimi van der Woning <https://github.com/jimivdw>
|
||||
// Andre Wiggins <https://github.com/andrewiggins>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -9,11 +10,45 @@
|
||||
import * as stream from 'stream';
|
||||
import * as zlib from 'zlib';
|
||||
|
||||
interface GzipSizeStream extends stream.PassThrough {
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "gzip-size", listener: (size: number) => void): this;
|
||||
|
||||
/**
|
||||
* Contains the gzip size of the stream after it is finished.
|
||||
* Since this happens asynchronously, it is recommended you use
|
||||
* the `.on("gzip-size", size => console.log(size))` method instead
|
||||
*/
|
||||
gzipSize?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Promise for the size.
|
||||
* @param input A string or Buffer to determine the gzip size of
|
||||
* @param options Any zlib option
|
||||
*/
|
||||
declare function gzipSize(input: string | Buffer, options?: zlib.ZlibOptions): Promise<number>;
|
||||
|
||||
declare namespace gzipSize {
|
||||
/**
|
||||
* Returns the size synchronously
|
||||
* @param input A string or Buffer to determine the gzip size of
|
||||
* @param options Any zlib option
|
||||
*/
|
||||
function sync(input: string | Buffer, options?: zlib.ZlibOptions): number;
|
||||
function stream(options?: zlib.ZlibOptions): stream.PassThrough;
|
||||
|
||||
/**
|
||||
* Returns a stream.PassThrough. The stream emits a gzip-size event and has a gzipSize property.
|
||||
* @param options Any zlib option
|
||||
*/
|
||||
function stream(options?: zlib.ZlibOptions): GzipSizeStream;
|
||||
|
||||
/**
|
||||
* Returns a Promise for the size of the file.
|
||||
* @param path The path to the file
|
||||
* @param options Any zlib option
|
||||
*/
|
||||
function file(path: string, options?: zlib.ZlibOptions): Promise<number>;
|
||||
}
|
||||
|
||||
export = gzipSize;
|
||||
|
||||
Vendored
+5
-1
@@ -1,10 +1,14 @@
|
||||
// Type definitions for highlight.js v9.12
|
||||
// Project: https://github.com/isagalaev/highlight.js
|
||||
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee>, Jeremy Hull <https://github.com/sourrust>
|
||||
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee>
|
||||
// Jeremy Hull <https://github.com/sourrust>
|
||||
// Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace hljs
|
||||
{
|
||||
interface Node { }
|
||||
|
||||
export function highlight(
|
||||
name: string,
|
||||
value: string,
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/TheDeveloper/http-aws-es#readme
|
||||
// Definitions by: Marco Gonzalez <https://github.com/marcogrcr>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
Vendored
+5
-1
@@ -1320,4 +1320,8 @@ declare var is: Is;
|
||||
|
||||
declare module 'is' {
|
||||
export = is;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'is_js' {
|
||||
export = is;
|
||||
}
|
||||
|
||||
Vendored
+14
@@ -8,6 +8,7 @@
|
||||
// Rytis Alekna <https://github.com/ralekna>
|
||||
// Pavel Ivanov <https://github.com/schfkt>
|
||||
// Youngrok Kim <https://github.com/rokoroku>
|
||||
// Dan Kraus <https://github.com/dankraus>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
@@ -127,6 +128,13 @@ export interface UriOptions {
|
||||
scheme?: string | RegExp | Array<string | RegExp>;
|
||||
}
|
||||
|
||||
export interface Base64Options {
|
||||
/**
|
||||
* optional parameter defaulting to true which will require = padding if true or make padding optional if false
|
||||
*/
|
||||
paddingRequired?: boolean;
|
||||
}
|
||||
|
||||
export interface WhenOptions {
|
||||
/**
|
||||
* the required condition joi type.
|
||||
@@ -520,6 +528,12 @@ export interface StringSchema extends AnySchema {
|
||||
*/
|
||||
normalize(form?: 'NFC' | 'NFD' | 'NFKC' | 'NFKD'): this;
|
||||
|
||||
/**
|
||||
* Requires the string value to be a valid base64 string; does not check the decoded value.
|
||||
* @param options - optional settings: The unicode normalization options to use. Valid values: NFC [default], NFD, NFKC, NFKD
|
||||
*/
|
||||
base64(options?: Base64Options): this;
|
||||
|
||||
/**
|
||||
* Requires the number to be a credit card number (Using Lunh Algorithm).
|
||||
*/
|
||||
|
||||
+54
-45
@@ -1,51 +1,52 @@
|
||||
import Joi = require('joi');
|
||||
import { GuidVersions } from 'joi';
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var x: any = null;
|
||||
var value: any = null;
|
||||
var num: number = 0;
|
||||
var str: string = '';
|
||||
var bool: boolean = false;
|
||||
var exp: RegExp = null;
|
||||
var obj: object = null;
|
||||
var date: Date = null;
|
||||
var err: Error = null;
|
||||
var func: Function = null;
|
||||
let x: any = null;
|
||||
let value: any = null;
|
||||
let num: number = 0;
|
||||
let str: string = '';
|
||||
let bool: boolean = false;
|
||||
let exp: RegExp = null;
|
||||
let obj: object = null;
|
||||
let date: Date = null;
|
||||
let err: Error = null;
|
||||
let func: Function = null;
|
||||
|
||||
var anyArr: any[] = [];
|
||||
var numArr: number[] = [];
|
||||
var strArr: string[] = [];
|
||||
var boolArr: boolean[] = [];
|
||||
var expArr: RegExp[] = [];
|
||||
var objArr: object[] = [];
|
||||
var errArr: Error[] = [];
|
||||
var funcArr: Function[] = [];
|
||||
let anyArr: any[] = [];
|
||||
let numArr: number[] = [];
|
||||
let strArr: string[] = [];
|
||||
let boolArr: boolean[] = [];
|
||||
let expArr: RegExp[] = [];
|
||||
let objArr: object[] = [];
|
||||
let errArr: Error[] = [];
|
||||
let funcArr: Function[] = [];
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var schema: Joi.Schema = null;
|
||||
var schemaLike: Joi.SchemaLike = null;
|
||||
let schema: Joi.Schema = null;
|
||||
let schemaLike: Joi.SchemaLike = null;
|
||||
|
||||
var anySchema: Joi.AnySchema = null;
|
||||
var numSchema: Joi.NumberSchema = null;
|
||||
var strSchema: Joi.StringSchema = null;
|
||||
var arrSchema: Joi.ArraySchema = null;
|
||||
var boolSchema: Joi.BooleanSchema = null;
|
||||
var binSchema: Joi.BinarySchema = null;
|
||||
var dateSchema: Joi.DateSchema = null;
|
||||
var funcSchema: Joi.FunctionSchema = null;
|
||||
var objSchema: Joi.ObjectSchema = null;
|
||||
var altSchema: Joi.AlternativesSchema = null;
|
||||
let anySchema: Joi.AnySchema = null;
|
||||
let numSchema: Joi.NumberSchema = null;
|
||||
let strSchema: Joi.StringSchema = null;
|
||||
let arrSchema: Joi.ArraySchema = null;
|
||||
let boolSchema: Joi.BooleanSchema = null;
|
||||
let binSchema: Joi.BinarySchema = null;
|
||||
let dateSchema: Joi.DateSchema = null;
|
||||
let funcSchema: Joi.FunctionSchema = null;
|
||||
let objSchema: Joi.ObjectSchema = null;
|
||||
let altSchema: Joi.AlternativesSchema = null;
|
||||
|
||||
var schemaArr: Joi.Schema[] = [];
|
||||
let schemaArr: Joi.Schema[] = [];
|
||||
|
||||
var ref: Joi.Reference = null;
|
||||
var description: Joi.Description = null;
|
||||
let ref: Joi.Reference = null;
|
||||
let description: Joi.Description = null;
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var validOpts: Joi.ValidationOptions = null;
|
||||
let validOpts: Joi.ValidationOptions = null;
|
||||
|
||||
validOpts = { abortEarly: bool };
|
||||
validOpts = { convert: bool };
|
||||
@@ -77,7 +78,7 @@ validOpts = {
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var renOpts: Joi.RenameOptions = null;
|
||||
let renOpts: Joi.RenameOptions = null;
|
||||
|
||||
renOpts = { alias: bool };
|
||||
renOpts = { multiple: bool };
|
||||
@@ -86,7 +87,7 @@ renOpts = { ignoreUndefined: bool };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var emailOpts: Joi.EmailOptions = null;
|
||||
let emailOpts: Joi.EmailOptions = null;
|
||||
|
||||
emailOpts = { errorLevel: num };
|
||||
emailOpts = { errorLevel: bool };
|
||||
@@ -96,7 +97,7 @@ emailOpts = { minDomainAtoms: num };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var ipOpts: Joi.IpOptions = null;
|
||||
let ipOpts: Joi.IpOptions = null;
|
||||
|
||||
ipOpts = { version: str };
|
||||
ipOpts = { version: strArr };
|
||||
@@ -104,7 +105,7 @@ ipOpts = { cidr: str };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var uriOpts: Joi.UriOptions = null;
|
||||
let uriOpts: Joi.UriOptions = null;
|
||||
|
||||
uriOpts = { scheme: str };
|
||||
uriOpts = { scheme: exp };
|
||||
@@ -113,7 +114,13 @@ uriOpts = { scheme: expArr };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var whenOpts: Joi.WhenOptions = null;
|
||||
let base64Opts: Joi.Base64Options = null;
|
||||
|
||||
base64Opts = { paddingRequired: bool };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
let whenOpts: Joi.WhenOptions = null;
|
||||
|
||||
whenOpts = { is: x };
|
||||
whenOpts = { is: schema, then: schema };
|
||||
@@ -122,16 +129,16 @@ whenOpts = { is: schemaLike, then: schemaLike, otherwise: schemaLike };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var refOpts: Joi.ReferenceOptions = null;
|
||||
let refOpts: Joi.ReferenceOptions = null;
|
||||
|
||||
refOpts = { separator: str };
|
||||
refOpts = { contextPrefix: str };
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var validErr: Joi.ValidationError = null;
|
||||
var validErrItem: Joi.ValidationErrorItem;
|
||||
var validErrFunc: Joi.ValidationErrorFunction;
|
||||
let validErr: Joi.ValidationError = null;
|
||||
let validErrItem: Joi.ValidationErrorItem;
|
||||
let validErrFunc: Joi.ValidationErrorFunction;
|
||||
|
||||
validErrItem = {
|
||||
message: str,
|
||||
@@ -176,7 +183,7 @@ anySchema = objSchema;
|
||||
|
||||
// --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
||||
|
||||
var schemaMap: Joi.SchemaMap = null;
|
||||
let schemaMap: Joi.SchemaMap = null;
|
||||
|
||||
schemaMap = {
|
||||
a: numSchema,
|
||||
@@ -765,7 +772,7 @@ strSchema = strSchema.ip(ipOpts);
|
||||
strSchema = strSchema.uri();
|
||||
strSchema = strSchema.uri(uriOpts);
|
||||
strSchema = strSchema.guid();
|
||||
strSchema = strSchema.guid({ version: ['uuidv1', 'uuidv2', 'uuidv3', 'uuidv4', 'uuidv5'] });
|
||||
strSchema = strSchema.guid({ version: ['uuidv1' as GuidVersions, 'uuidv2' as GuidVersions, 'uuidv3' as GuidVersions, 'uuidv4' as GuidVersions, 'uuidv5' as GuidVersions]});
|
||||
strSchema = strSchema.guid({ version: 'uuidv4' });
|
||||
strSchema = strSchema.hex();
|
||||
strSchema = strSchema.hostname();
|
||||
@@ -777,6 +784,8 @@ strSchema = strSchema.truncate();
|
||||
strSchema = strSchema.truncate(false);
|
||||
strSchema = strSchema.normalize();
|
||||
strSchema = strSchema.normalize('NFKC');
|
||||
strSchema = strSchema.base64();
|
||||
strSchema = strSchema.base64(base64Opts);
|
||||
|
||||
namespace common {
|
||||
strSchema = strSchema.allow(x);
|
||||
|
||||
Vendored
+1
-1
@@ -156,7 +156,7 @@ declare namespace Knex {
|
||||
delete(returning?: string | string[]): QueryBuilder;
|
||||
truncate(): QueryBuilder;
|
||||
|
||||
transacting(trx: Transaction): QueryBuilder;
|
||||
transacting(trx?: Transaction): QueryBuilder;
|
||||
connection(connection: any): QueryBuilder;
|
||||
|
||||
clone(): QueryBuilder;
|
||||
|
||||
@@ -672,6 +672,9 @@ knex.transaction<{ length: number }>(function(trx) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
// transacting handles undefined
|
||||
knex.insert({ name: 'Old Books'}).transacting(undefined);
|
||||
|
||||
knex.schema.withSchema("public").hasTable("table") as Promise<boolean>;
|
||||
|
||||
knex.schema.createTable('users', function (table) {
|
||||
|
||||
Vendored
+133
-64
@@ -1234,7 +1234,7 @@ declare namespace _ {
|
||||
*/
|
||||
findIndex<T>(
|
||||
array: List<T> | null | undefined,
|
||||
predicate?: ListIterateeBoolean<T>,
|
||||
predicate?: ListIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): number;
|
||||
}
|
||||
@@ -1245,7 +1245,7 @@ declare namespace _ {
|
||||
*/
|
||||
findIndex<T>(
|
||||
this: LoDashImplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>,
|
||||
predicate?: ListIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): number;
|
||||
}
|
||||
@@ -1256,7 +1256,7 @@ declare namespace _ {
|
||||
*/
|
||||
findIndex<T>(
|
||||
this: LoDashExplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>,
|
||||
predicate?: ListIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): LoDashExplicitWrapper<number>;
|
||||
}
|
||||
@@ -1282,7 +1282,7 @@ declare namespace _ {
|
||||
*/
|
||||
findLastIndex<T>(
|
||||
array: List<T> | null | undefined,
|
||||
predicate?: ListIterateeBoolean<T>,
|
||||
predicate?: ListIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): number;
|
||||
}
|
||||
@@ -1293,7 +1293,7 @@ declare namespace _ {
|
||||
*/
|
||||
findLastIndex<T>(
|
||||
this: LoDashImplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>,
|
||||
predicate?: ListIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): number;
|
||||
}
|
||||
@@ -1304,7 +1304,7 @@ declare namespace _ {
|
||||
*/
|
||||
findLastIndex<T>(
|
||||
this: LoDashExplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>,
|
||||
predicate?: ListIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): LoDashExplicitWrapper<number>;
|
||||
}
|
||||
@@ -4315,6 +4315,14 @@ declare namespace _ {
|
||||
* @param thisArg The this binding of iteratee.
|
||||
* @return Returns the composed aggregate object.
|
||||
*/
|
||||
countBy<T>(
|
||||
collection: string | null | undefined,
|
||||
iteratee?: StringIterator<T>
|
||||
): Dictionary<number>;
|
||||
|
||||
/**
|
||||
* @see _.countBy
|
||||
*/
|
||||
countBy<T>(
|
||||
collection: List<T> | null | undefined,
|
||||
iteratee?: ListIteratee<T>
|
||||
@@ -4338,6 +4346,14 @@ declare namespace _ {
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapper<TValue> {
|
||||
/**
|
||||
* @see _.countBy
|
||||
*/
|
||||
countBy<T>(
|
||||
this: LoDashImplicitWrapper<string | null | undefined>,
|
||||
iteratee?: StringIterator<T>
|
||||
): LoDashImplicitWrapper<Dictionary<number>>;
|
||||
|
||||
/**
|
||||
* @see _.countBy
|
||||
*/
|
||||
@@ -4364,6 +4380,14 @@ declare namespace _ {
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<TValue> {
|
||||
/**
|
||||
* @see _.countBy
|
||||
*/
|
||||
countBy<T>(
|
||||
this: LoDashExplicitWrapper<string | null | undefined>,
|
||||
iteratee?: StringIterator<T>
|
||||
): LoDashExplicitWrapper<Dictionary<number>>;
|
||||
|
||||
/**
|
||||
* @see _.countBy
|
||||
*/
|
||||
@@ -4479,7 +4503,7 @@ declare namespace _ {
|
||||
*/
|
||||
every<T>(
|
||||
collection: List<T> | null | undefined,
|
||||
predicate?: ListIterateeBoolean<T>
|
||||
predicate?: ListIterateeCustom<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -4487,7 +4511,7 @@ declare namespace _ {
|
||||
*/
|
||||
every<T>(
|
||||
collection: NumericDictionary<T> | null | undefined,
|
||||
predicate?: NumericDictionaryIterateeBoolean<T>
|
||||
predicate?: NumericDictionaryIterateeCustom<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -4495,7 +4519,7 @@ declare namespace _ {
|
||||
*/
|
||||
every<T extends object>(
|
||||
collection: T | null | undefined,
|
||||
predicate?: ObjectIterateeBoolean<T>
|
||||
predicate?: ObjectIterateeCustom<T, boolean>
|
||||
): boolean;
|
||||
}
|
||||
|
||||
@@ -4505,7 +4529,7 @@ declare namespace _ {
|
||||
*/
|
||||
every<T>(
|
||||
this: LoDashImplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>
|
||||
predicate?: ListIterateeCustom<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -4513,7 +4537,7 @@ declare namespace _ {
|
||||
*/
|
||||
every<T extends object>(
|
||||
this: LoDashImplicitWrapper<T | null | undefined>,
|
||||
predicate?: ObjectIterateeBoolean<T>
|
||||
predicate?: ObjectIterateeCustom<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -4521,7 +4545,7 @@ declare namespace _ {
|
||||
*/
|
||||
every<T>(
|
||||
this: LoDashImplicitWrapper<NumericDictionary<T> | null | undefined>,
|
||||
predicate?: NumericDictionaryIterateeBoolean<T>
|
||||
predicate?: NumericDictionaryIterateeCustom<T, boolean>
|
||||
): boolean;
|
||||
}
|
||||
|
||||
@@ -4531,7 +4555,7 @@ declare namespace _ {
|
||||
*/
|
||||
every<T>(
|
||||
this: LoDashExplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>
|
||||
predicate?: ListIterateeCustom<T, boolean>
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
/**
|
||||
@@ -4539,7 +4563,7 @@ declare namespace _ {
|
||||
*/
|
||||
every<T extends object>(
|
||||
this: LoDashExplicitWrapper<T | null | undefined>,
|
||||
predicate?: ObjectIterateeBoolean<T>
|
||||
predicate?: ObjectIterateeCustom<T, boolean>
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
/**
|
||||
@@ -4547,7 +4571,7 @@ declare namespace _ {
|
||||
*/
|
||||
every<T>(
|
||||
this: LoDashExplicitWrapper<NumericDictionary<T> | null | undefined>,
|
||||
predicate?: NumericDictionaryIterateeBoolean<T>
|
||||
predicate?: NumericDictionaryIterateeCustom<T, boolean>
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
@@ -4589,7 +4613,7 @@ declare namespace _ {
|
||||
*/
|
||||
filter<T>(
|
||||
collection: List<T> | null | undefined,
|
||||
predicate?: ListIterateeBoolean<T>
|
||||
predicate?: ListIterateeCustom<T, boolean>
|
||||
): T[];
|
||||
|
||||
/**
|
||||
@@ -4605,7 +4629,7 @@ declare namespace _ {
|
||||
*/
|
||||
filter<T extends object>(
|
||||
collection: T | null | undefined,
|
||||
predicate?: ObjectIterateeBoolean<T>
|
||||
predicate?: ObjectIterateeCustom<T, boolean>
|
||||
): Array<T[keyof T]>;
|
||||
}
|
||||
|
||||
@@ -4631,7 +4655,7 @@ declare namespace _ {
|
||||
*/
|
||||
filter<T>(
|
||||
this: LoDashImplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>
|
||||
predicate?: ListIterateeCustom<T, boolean>
|
||||
): LoDashImplicitWrapper<T[]>;
|
||||
|
||||
/**
|
||||
@@ -4647,7 +4671,7 @@ declare namespace _ {
|
||||
*/
|
||||
filter<T extends object>(
|
||||
this: LoDashImplicitWrapper<T | null | undefined>,
|
||||
predicate?: ObjectIterateeBoolean<T>
|
||||
predicate?: ObjectIterateeCustom<T, boolean>
|
||||
): LoDashImplicitWrapper<Array<T[keyof T]>>;
|
||||
}
|
||||
|
||||
@@ -4673,7 +4697,7 @@ declare namespace _ {
|
||||
*/
|
||||
filter<T>(
|
||||
this: LoDashExplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>
|
||||
predicate?: ListIterateeCustom<T, boolean>
|
||||
): LoDashExplicitWrapper<T[]>;
|
||||
|
||||
/**
|
||||
@@ -4689,7 +4713,7 @@ declare namespace _ {
|
||||
*/
|
||||
filter<T extends object>(
|
||||
this: LoDashExplicitWrapper<T | null | undefined>,
|
||||
predicate?: ObjectIterateeBoolean<T>
|
||||
predicate?: ObjectIterateeCustom<T, boolean>
|
||||
): LoDashExplicitWrapper<Array<T[keyof T]>>;
|
||||
}
|
||||
|
||||
@@ -4724,7 +4748,7 @@ declare namespace _ {
|
||||
*/
|
||||
find<T>(
|
||||
collection: List<T> | null | undefined,
|
||||
predicate?: ListIterateeBoolean<T>,
|
||||
predicate?: ListIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): T|undefined;
|
||||
|
||||
@@ -4742,7 +4766,7 @@ declare namespace _ {
|
||||
*/
|
||||
find<T extends object>(
|
||||
collection: T | null | undefined,
|
||||
predicate?: ObjectIterateeBoolean<T>,
|
||||
predicate?: ObjectIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): T[keyof T]|undefined;
|
||||
}
|
||||
@@ -4762,7 +4786,7 @@ declare namespace _ {
|
||||
*/
|
||||
find<T>(
|
||||
this: LoDashImplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>,
|
||||
predicate?: ListIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): T|undefined;
|
||||
|
||||
@@ -4780,7 +4804,7 @@ declare namespace _ {
|
||||
*/
|
||||
find<T extends object>(
|
||||
this: LoDashImplicitWrapper<T | null | undefined>,
|
||||
predicate?: ObjectIterateeBoolean<T>,
|
||||
predicate?: ObjectIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): T[keyof T]|undefined;
|
||||
}
|
||||
@@ -4800,7 +4824,7 @@ declare namespace _ {
|
||||
*/
|
||||
find<T>(
|
||||
this: LoDashExplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>,
|
||||
predicate?: ListIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): LoDashExplicitWrapper<T|undefined>;
|
||||
|
||||
@@ -4818,7 +4842,7 @@ declare namespace _ {
|
||||
*/
|
||||
find<T extends object>(
|
||||
this: LoDashExplicitWrapper<T | null | undefined>,
|
||||
predicate?: ObjectIterateeBoolean<T>,
|
||||
predicate?: ObjectIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): LoDashExplicitWrapper<T[keyof T]|undefined>;
|
||||
}
|
||||
@@ -4844,7 +4868,7 @@ declare namespace _ {
|
||||
*/
|
||||
findLast<T>(
|
||||
collection: List<T> | null | undefined,
|
||||
predicate?: ListIterateeBoolean<T>,
|
||||
predicate?: ListIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): T|undefined;
|
||||
|
||||
@@ -4862,7 +4886,7 @@ declare namespace _ {
|
||||
*/
|
||||
findLast<T extends object>(
|
||||
collection: T | null | undefined,
|
||||
predicate?: ObjectIterateeBoolean<T>,
|
||||
predicate?: ObjectIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): T[keyof T]|undefined;
|
||||
}
|
||||
@@ -4882,7 +4906,7 @@ declare namespace _ {
|
||||
*/
|
||||
findLast<T>(
|
||||
this: LoDashImplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>,
|
||||
predicate?: ListIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): T | undefined;
|
||||
|
||||
@@ -4900,7 +4924,7 @@ declare namespace _ {
|
||||
*/
|
||||
findLast<T extends object>(
|
||||
this: LoDashImplicitWrapper<T | null | undefined>,
|
||||
predicate?: ObjectIterateeBoolean<T>,
|
||||
predicate?: ObjectIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): T[keyof T]|undefined;
|
||||
}
|
||||
@@ -4920,7 +4944,7 @@ declare namespace _ {
|
||||
*/
|
||||
findLast<T>(
|
||||
this: LoDashExplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>,
|
||||
predicate?: ListIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): LoDashExplicitWrapper<T | undefined>;
|
||||
|
||||
@@ -4938,7 +4962,7 @@ declare namespace _ {
|
||||
*/
|
||||
findLast<T extends object>(
|
||||
this: LoDashExplicitWrapper<T | null | undefined>,
|
||||
predicate?: ObjectIterateeBoolean<T>,
|
||||
predicate?: ObjectIterateeCustom<T, boolean>,
|
||||
fromIndex?: number
|
||||
): LoDashExplicitWrapper<T[keyof T]|undefined>;
|
||||
}
|
||||
@@ -5849,9 +5873,17 @@ declare namespace _ {
|
||||
* @param thisArg The this binding of iteratee.
|
||||
* @return Returns the composed aggregate object.
|
||||
*/
|
||||
keyBy(
|
||||
collection: string | null | undefined,
|
||||
iteratee?: StringIterator<PropertyName>
|
||||
): Dictionary<string>;
|
||||
|
||||
/**
|
||||
* @see _.keyBy
|
||||
*/
|
||||
keyBy<T>(
|
||||
collection: List<T> | null | undefined,
|
||||
iteratee?: ListIteratee<T>
|
||||
iteratee?: ListIterateeCustom<T, PropertyName>
|
||||
): Dictionary<T>;
|
||||
|
||||
/**
|
||||
@@ -5859,7 +5891,7 @@ declare namespace _ {
|
||||
*/
|
||||
keyBy<T extends object>(
|
||||
collection: T | null | undefined,
|
||||
iteratee?: ObjectIteratee<T>
|
||||
iteratee?: ObjectIterateeCustom<T, PropertyName>
|
||||
): Dictionary<T[keyof T]>;
|
||||
|
||||
/**
|
||||
@@ -5867,17 +5899,25 @@ declare namespace _ {
|
||||
*/
|
||||
keyBy<T>(
|
||||
collection: NumericDictionary<T> | null | undefined,
|
||||
iteratee?: NumericDictionaryIteratee<T>
|
||||
iteratee?: NumericDictionaryIterateeCustom<T, PropertyName>
|
||||
): Dictionary<T>;
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapper<TValue> {
|
||||
/**
|
||||
* @see _.keyBy
|
||||
*/
|
||||
keyBy(
|
||||
this: LoDashImplicitWrapper<string | null | undefined>,
|
||||
iteratee?: StringIterator<PropertyName>
|
||||
): LoDashImplicitWrapper<Dictionary<string>>;
|
||||
|
||||
/**
|
||||
* @see _.keyBy
|
||||
*/
|
||||
keyBy<T>(
|
||||
this: LoDashImplicitWrapper<List<T> | null | undefined>,
|
||||
iteratee?: ListIteratee<T>
|
||||
iteratee?: ListIterateeCustom<T, PropertyName>
|
||||
): LoDashImplicitWrapper<Dictionary<T>>;
|
||||
|
||||
/**
|
||||
@@ -5885,7 +5925,7 @@ declare namespace _ {
|
||||
*/
|
||||
keyBy<T extends object>(
|
||||
this: LoDashImplicitWrapper<T | null | undefined>,
|
||||
iteratee?: ObjectIteratee<T>
|
||||
iteratee?: ObjectIterateeCustom<T, PropertyName>
|
||||
): LoDashImplicitWrapper<Dictionary<T[keyof T]>>;
|
||||
|
||||
/**
|
||||
@@ -5893,17 +5933,25 @@ declare namespace _ {
|
||||
*/
|
||||
keyBy<T>(
|
||||
this: LoDashImplicitWrapper<NumericDictionary<T> | null | undefined>,
|
||||
iteratee?: NumericDictionaryIteratee<T>
|
||||
iteratee?: NumericDictionaryIterateeCustom<T, PropertyName>
|
||||
): LoDashImplicitWrapper<Dictionary<T>>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<TValue> {
|
||||
/**
|
||||
* @see _.keyBy
|
||||
*/
|
||||
keyBy(
|
||||
this: LoDashExplicitWrapper<string | null | undefined>,
|
||||
iteratee?: StringIterator<PropertyName>
|
||||
): LoDashExplicitWrapper<Dictionary<string>>;
|
||||
|
||||
/**
|
||||
* @see _.keyBy
|
||||
*/
|
||||
keyBy<T>(
|
||||
this: LoDashExplicitWrapper<List<T> | null | undefined>,
|
||||
iteratee?: ListIteratee<T>
|
||||
iteratee?: ListIterateeCustom<T, PropertyName>
|
||||
): LoDashExplicitWrapper<Dictionary<T>>;
|
||||
|
||||
/**
|
||||
@@ -5911,7 +5959,7 @@ declare namespace _ {
|
||||
*/
|
||||
keyBy<T extends object>(
|
||||
this: LoDashExplicitWrapper<T | null | undefined>,
|
||||
iteratee?: ObjectIteratee<T>
|
||||
iteratee?: ObjectIterateeCustom<T, PropertyName>
|
||||
): LoDashExplicitWrapper<Dictionary<T[keyof T]>>;
|
||||
|
||||
/**
|
||||
@@ -5919,7 +5967,7 @@ declare namespace _ {
|
||||
*/
|
||||
keyBy<T>(
|
||||
this: LoDashExplicitWrapper<NumericDictionary<T> | null | undefined>,
|
||||
iteratee?: NumericDictionaryIteratee<T>
|
||||
iteratee?: NumericDictionaryIterateeCustom<T, PropertyName>
|
||||
): LoDashExplicitWrapper<Dictionary<T>>;
|
||||
}
|
||||
|
||||
@@ -6718,7 +6766,7 @@ declare namespace _ {
|
||||
*/
|
||||
reject<T>(
|
||||
collection: List<T> | null | undefined,
|
||||
predicate?: ListIterateeBoolean<T>
|
||||
predicate?: ListIterateeCustom<T, boolean>
|
||||
): T[];
|
||||
|
||||
/**
|
||||
@@ -6726,7 +6774,7 @@ declare namespace _ {
|
||||
*/
|
||||
reject<T extends object>(
|
||||
collection: T | null | undefined,
|
||||
predicate?: ObjectIterateeBoolean<T>
|
||||
predicate?: ObjectIterateeCustom<T, boolean>
|
||||
): Array<T[keyof T]>;
|
||||
}
|
||||
|
||||
@@ -6744,7 +6792,7 @@ declare namespace _ {
|
||||
*/
|
||||
reject<T>(
|
||||
this: LoDashImplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>
|
||||
predicate?: ListIterateeCustom<T, boolean>
|
||||
): LoDashImplicitWrapper<T[]>;
|
||||
|
||||
/**
|
||||
@@ -6752,7 +6800,7 @@ declare namespace _ {
|
||||
*/
|
||||
reject<T extends object>(
|
||||
this: LoDashImplicitWrapper<T | null | undefined>,
|
||||
predicate?: ObjectIterateeBoolean<T>
|
||||
predicate?: ObjectIterateeCustom<T, boolean>
|
||||
): LoDashImplicitWrapper<Array<T[keyof T]>>;
|
||||
}
|
||||
|
||||
@@ -6770,7 +6818,7 @@ declare namespace _ {
|
||||
*/
|
||||
reject<T>(
|
||||
this: LoDashExplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>
|
||||
predicate?: ListIterateeCustom<T, boolean>
|
||||
): LoDashExplicitWrapper<T[]>;
|
||||
|
||||
/**
|
||||
@@ -6778,7 +6826,7 @@ declare namespace _ {
|
||||
*/
|
||||
reject<T extends object>(
|
||||
this: LoDashExplicitWrapper<T | null | undefined>,
|
||||
predicate?: ObjectIterateeBoolean<T>
|
||||
predicate?: ObjectIterateeCustom<T, boolean>
|
||||
): LoDashExplicitWrapper<Array<T[keyof T]>>;
|
||||
}
|
||||
|
||||
@@ -6992,7 +7040,7 @@ declare namespace _ {
|
||||
*/
|
||||
some<T>(
|
||||
collection: List<T> | null | undefined,
|
||||
predicate?: ListIterateeBoolean<T>
|
||||
predicate?: ListIterateeCustom<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -7000,7 +7048,7 @@ declare namespace _ {
|
||||
*/
|
||||
some<T extends object>(
|
||||
collection: T | null | undefined,
|
||||
predicate?: ObjectIterateeBoolean<T>
|
||||
predicate?: ObjectIterateeCustom<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -7008,7 +7056,7 @@ declare namespace _ {
|
||||
*/
|
||||
some<T>(
|
||||
collection: NumericDictionary<T> | null | undefined,
|
||||
predicate?: NumericDictionaryIterateeBoolean<T>
|
||||
predicate?: NumericDictionaryIterateeCustom<T, boolean>
|
||||
): boolean;
|
||||
}
|
||||
|
||||
@@ -7018,7 +7066,7 @@ declare namespace _ {
|
||||
*/
|
||||
some<T>(
|
||||
this: LoDashImplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>
|
||||
predicate?: ListIterateeCustom<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -7026,7 +7074,7 @@ declare namespace _ {
|
||||
*/
|
||||
some<T extends object>(
|
||||
this: LoDashImplicitWrapper<T | null | undefined>,
|
||||
predicate?: ObjectIterateeBoolean<T>
|
||||
predicate?: ObjectIterateeCustom<T, boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -7034,7 +7082,7 @@ declare namespace _ {
|
||||
*/
|
||||
some<T>(
|
||||
this: LoDashImplicitWrapper<NumericDictionary<T> | null | undefined>,
|
||||
predicate?: NumericDictionaryIterateeBoolean<T>
|
||||
predicate?: NumericDictionaryIterateeCustom<T, boolean>
|
||||
): boolean;
|
||||
}
|
||||
|
||||
@@ -7044,7 +7092,7 @@ declare namespace _ {
|
||||
*/
|
||||
some<T>(
|
||||
this: LoDashExplicitWrapper<List<T> | null | undefined>,
|
||||
predicate?: ListIterateeBoolean<T>
|
||||
predicate?: ListIterateeCustom<T, boolean>
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
/**
|
||||
@@ -7052,7 +7100,7 @@ declare namespace _ {
|
||||
*/
|
||||
some<T extends object>(
|
||||
this: LoDashExplicitWrapper<T | null | undefined>,
|
||||
predicate?: ObjectIterateeBoolean<T>
|
||||
predicate?: ObjectIterateeCustom<T, boolean>
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
|
||||
/**
|
||||
@@ -7060,7 +7108,7 @@ declare namespace _ {
|
||||
*/
|
||||
some<T>(
|
||||
this: LoDashExplicitWrapper<NumericDictionary<T> | null | undefined>,
|
||||
predicate?: NumericDictionaryIterateeBoolean<T>
|
||||
predicate?: NumericDictionaryIterateeCustom<T, boolean>
|
||||
): LoDashExplicitWrapper<boolean>;
|
||||
}
|
||||
|
||||
@@ -9315,14 +9363,16 @@ declare namespace _ {
|
||||
/**
|
||||
* @see _.conformsTo
|
||||
*/
|
||||
conformsTo(source: ConformsPredicateObject<TValue>): boolean;
|
||||
conformsTo<T>(this: LoDashImplicitWrapper<T>, source: ConformsPredicateObject<T>): boolean;
|
||||
// Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled.
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<TValue> {
|
||||
/**
|
||||
* @see _.conformsTo
|
||||
*/
|
||||
conformsTo(source: ConformsPredicateObject<TValue>): LoDashExplicitWrapper<boolean>;
|
||||
conformsTo<T>(this: LoDashImplicitWrapper<T>, source: ConformsPredicateObject<T>): LoDashExplicitWrapper<boolean>;
|
||||
// Note: we can't use TValue here, because it generates a typescript error when strictFunctionTypes is enabled.
|
||||
}
|
||||
|
||||
type CondPair<T, R> = [(val: T) => boolean, (val: T) => R]
|
||||
@@ -10723,7 +10773,7 @@ declare namespace _ {
|
||||
/**
|
||||
* @see _.toArray
|
||||
*/
|
||||
toArray(): LoDashImplicitWrapper<Array<TValue[keyof TValue]>>;
|
||||
toArray<T extends object>(this: LoDashImplicitWrapper<T>): LoDashImplicitWrapper<Array<T[keyof T]>>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<TValue> {
|
||||
@@ -10735,7 +10785,7 @@ declare namespace _ {
|
||||
/**
|
||||
* @see _.toArray
|
||||
*/
|
||||
toArray(): LoDashExplicitWrapper<Array<TValue[keyof TValue]>>;
|
||||
toArray<T extends object>(this: LoDashImplicitWrapper<T>): LoDashExplicitWrapper<Array<T[keyof T]>>;
|
||||
}
|
||||
|
||||
//_.toPlainObject
|
||||
@@ -14348,6 +14398,9 @@ declare namespace _ {
|
||||
...props: Array<Many<U>>
|
||||
): Pick<T, U>;
|
||||
|
||||
/**
|
||||
* @see _.pick
|
||||
*/
|
||||
pick<T>(
|
||||
object: T | null | undefined,
|
||||
...props: PropertyPath[]
|
||||
@@ -14355,6 +14408,14 @@ declare namespace _ {
|
||||
}
|
||||
|
||||
interface LoDashImplicitWrapper<TValue> {
|
||||
/**
|
||||
* @see _.pick
|
||||
*/
|
||||
pick<T extends object, U extends keyof T>(
|
||||
this: LoDashImplicitWrapper<T | null | undefined>,
|
||||
...props: Array<Many<U>>
|
||||
): LoDashImplicitWrapper<Pick<T, U>>;
|
||||
|
||||
/**
|
||||
* @see _.pick
|
||||
*/
|
||||
@@ -14365,6 +14426,14 @@ declare namespace _ {
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<TValue> {
|
||||
/**
|
||||
* @see _.pick
|
||||
*/
|
||||
pick<T extends object, U extends keyof T>(
|
||||
this: LoDashExplicitWrapper<T | null | undefined>,
|
||||
...props: Array<Many<U>>
|
||||
): LoDashExplicitWrapper<Pick<T, U>>;
|
||||
|
||||
/**
|
||||
* @see _.pick
|
||||
*/
|
||||
@@ -17015,13 +17084,13 @@ declare namespace _ {
|
||||
type ArrayIterator<T, TResult> = (value: T, index: number, collection: T[]) => TResult;
|
||||
type ListIterator<T, TResult> = (value: T, index: number, collection: List<T>) => TResult;
|
||||
type ListIteratee<T> = ListIterator<T, NotVoid> | string | [string, any] | PartialDeep<T>;
|
||||
type ListIterateeBoolean<T> = ListIterator<T, boolean> | string | [string, any] | PartialDeep<T>;
|
||||
type ListIterateeCustom<T, TResult> = ListIterator<T, TResult> | string | [string, any] | PartialDeep<T>;
|
||||
type ListIteratorTypeGuard<T, S extends T> = (value: T, index: number, collection: List<T>) => value is S;
|
||||
|
||||
// Note: key should be string, not keyof T, because the actual object may contain extra properties that were not specified in the type.
|
||||
type ObjectIterator<TObject, TResult> = (value: TObject[keyof TObject], key: string, collection: TObject) => TResult;
|
||||
type ObjectIteratee<TObject> = ObjectIterator<TObject, NotVoid> | string | [string, any] | PartialDeep<TObject[keyof TObject]>;
|
||||
type ObjectIterateeBoolean<TObject> = ObjectIterator<TObject, boolean> | string | [string, any] | PartialDeep<TObject[keyof TObject]>;
|
||||
type ObjectIterateeCustom<TObject, TResult> = ObjectIterator<TObject, TResult> | string | [string, any] | PartialDeep<TObject[keyof TObject]>;
|
||||
type ObjectIteratorTypeGuard<TObject, S extends TObject[keyof TObject]> = (value: TObject[keyof TObject], key: string, collection: TObject) => value is S;
|
||||
|
||||
type DictionaryIterator<T, TResult> = ObjectIterator<Dictionary<T>, TResult>;
|
||||
@@ -17030,7 +17099,7 @@ declare namespace _ {
|
||||
|
||||
type NumericDictionaryIterator<T, TResult> = (value: T, key: number, collection: NumericDictionary<T>) => TResult;
|
||||
type NumericDictionaryIteratee<T> = NumericDictionaryIterator<T, NotVoid> | string | [string, any] | PartialDeep<T>;
|
||||
type NumericDictionaryIterateeBoolean<T> = NumericDictionaryIterator<T, boolean> | string | [string, any] | PartialDeep<T>;
|
||||
type NumericDictionaryIterateeCustom<T, TResult> = NumericDictionaryIterator<T, TResult> | string | [string, any] | PartialDeep<T>;
|
||||
|
||||
type StringIterator<TResult> = (char: string, index: number, string: string) => TResult;
|
||||
|
||||
|
||||
@@ -4,86 +4,19 @@ interface IFoodOrganic {
|
||||
name: string;
|
||||
organic: boolean;
|
||||
}
|
||||
|
||||
interface IFoodType {
|
||||
name: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface IFoodCombined {
|
||||
name: string;
|
||||
organic: boolean;
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface IStoogesQuote {
|
||||
name: string;
|
||||
quotes: string[];
|
||||
}
|
||||
|
||||
interface IStoogesAge {
|
||||
name: string;
|
||||
age: number;
|
||||
}
|
||||
|
||||
interface IStoogesCombined {
|
||||
name: string;
|
||||
age: number;
|
||||
quotes: string[];
|
||||
}
|
||||
|
||||
interface IKey {
|
||||
dir: string;
|
||||
code: number;
|
||||
}
|
||||
|
||||
interface IDictionary<T> {
|
||||
[index: string]: T;
|
||||
}
|
||||
|
||||
const foodsOrganic: IFoodOrganic[] = [
|
||||
{ name: 'banana', organic: true },
|
||||
{ name: 'beet', organic: false },
|
||||
];
|
||||
const foodsType: IFoodType[] = [
|
||||
{ name: 'apple', type: 'fruit' },
|
||||
{ name: 'banana', type: 'fruit' },
|
||||
{ name: 'beet', type: 'vegetable' }
|
||||
];
|
||||
const foodsCombined: IFoodCombined[] = [
|
||||
{ 'name': 'apple', 'organic': false, 'type': 'fruit' },
|
||||
{ 'name': 'carrot', 'organic': true, 'type': 'vegetable' }
|
||||
];
|
||||
|
||||
const stoogesQuotes: IStoogesQuote[] = [
|
||||
{ 'name': 'curly', 'quotes': ['Oh, a wise guy, eh?', 'Poifect!'] },
|
||||
{ 'name': 'moe', 'quotes': ['Spread out!', 'You knucklehead!'] }
|
||||
];
|
||||
const stoogesAges: IStoogesAge[] = [
|
||||
{ 'name': 'moe', 'age': 40 },
|
||||
{ 'name': 'larry', 'age': 50 }
|
||||
];
|
||||
const stoogesAgesDict: IDictionary<IStoogesAge> = {
|
||||
first: { 'name': 'moe', 'age': 40 },
|
||||
second: { 'name': 'larry', 'age': 50 }
|
||||
};
|
||||
const stoogesCombined: IStoogesCombined[] = [
|
||||
{ 'name': 'curly', 'age': 30, 'quotes': ['Oh, a wise guy, eh?', 'Poifect!'] },
|
||||
{ 'name': 'moe', 'age': 40, 'quotes': ['Spread out!', 'You knucklehead!'] }
|
||||
];
|
||||
|
||||
const keys: IKey[] = [
|
||||
{ 'dir': 'left', 'code': 97 },
|
||||
{ 'dir': 'right', 'code': 100 }
|
||||
];
|
||||
|
||||
class Dog {
|
||||
constructor(public name: string) { }
|
||||
|
||||
bark() {
|
||||
// Woof
|
||||
}
|
||||
}
|
||||
|
||||
let result: any;
|
||||
|
||||
@@ -4591,9 +4524,9 @@ namespace TestFilter {
|
||||
let obj: any = {};
|
||||
let dictionary: _.Dictionary<TResult> | null | undefined = obj;
|
||||
|
||||
let stringIterator: (char: string, index: number, string: string) => any = (char: string, index: number, string: string) => 1;
|
||||
let listIterator: (value: TResult, index: number, collection: _.List<TResult>) => any = (value: TResult, index: number, collection: _.List<TResult>) => 1;
|
||||
let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary<TResult>) => any = (value: TResult, key: string, collection: _.Dictionary<TResult>) => 1;
|
||||
let stringIterator = (char: string, index: number, string: string) => true;
|
||||
let listIterator = (value: TResult, index: number, collection: _.List<TResult>) => true;
|
||||
let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary<TResult>) => true;
|
||||
|
||||
{
|
||||
let result: string[];
|
||||
@@ -5207,7 +5140,7 @@ namespace TestFlatMapDepth {
|
||||
|
||||
let listIterator: (value: number|number[], index: number, collection: _.List<number|number[]>) => _.ListOfRecursiveArraysOrValues<number> = (a, b, c) =>[ 1];
|
||||
|
||||
let dictionaryIterator: (value: number|number[], key: number, collection: _.Dictionary<number|number[]>) => _.ListOfRecursiveArraysOrValues<number> = (a, b, c) => [1];
|
||||
let dictionaryIterator: (value: number|number[], key: string, collection: _.Dictionary<number|number[]>) => _.ListOfRecursiveArraysOrValues<number> = (a, b, c) => [1];
|
||||
|
||||
let numericDictionaryIterator: (value: number|number[], key: number, collection: _.NumericDictionary<number|number[]>) => _.ListOfRecursiveArraysOrValues<number> = (a, b, c) => [1];
|
||||
|
||||
@@ -5776,8 +5709,8 @@ namespace TestGroupBy {
|
||||
{
|
||||
let result: _.Dictionary<string[]>;
|
||||
|
||||
result = _.groupBy<string>('');
|
||||
result = _.groupBy<string>('', stringIterator);
|
||||
result = _.groupBy('');
|
||||
result = _.groupBy('', stringIterator);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -5909,16 +5842,16 @@ namespace TestKeyBy {
|
||||
let dictionary: _.Dictionary<SampleObject> | null | undefined = obj;
|
||||
let numericDictionary: _.NumericDictionary<SampleObject> | null | undefined = obj;
|
||||
|
||||
let stringIterator: (value: string, index: number, collection: string) => any = (value: string, index: number, collection: string) => 1;
|
||||
let listIterator: (value: SampleObject, index: number, collection: _.List<SampleObject>) => any = (value: SampleObject, index: number, collection: _.List<SampleObject>) => 1;
|
||||
let dictionaryIterator: (value: SampleObject, key: string, collection: _.Dictionary<SampleObject>) => any = (value: SampleObject, key: string, collection: _.Dictionary<SampleObject>) => 1;
|
||||
let numericDictionaryIterator: (value: SampleObject, key: number, collection: _.NumericDictionary<SampleObject>) => any = (value: SampleObject, key: number, collection: _.NumericDictionary<SampleObject>) => 1;
|
||||
let stringIterator = (value: string, index: number, collection: string) => "a";
|
||||
let listIterator = (value: SampleObject, index: number, collection: _.List<SampleObject>) => 1;
|
||||
let dictionaryIterator = (value: SampleObject, key: string, collection: _.Dictionary<SampleObject>) => Symbol.name;
|
||||
let numericDictionaryIterator = (value: SampleObject, key: number, collection: _.NumericDictionary<SampleObject>) => "a";
|
||||
|
||||
{
|
||||
let result: _.Dictionary<string>;
|
||||
|
||||
result = _.keyBy<string>('abcd');
|
||||
result = _.keyBy<string>('abcd', stringIterator);
|
||||
result = _.keyBy('abcd');
|
||||
result = _.keyBy('abcd', stringIterator);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -6464,9 +6397,9 @@ namespace TestReject {
|
||||
let obj: any = {};
|
||||
let dictionary: _.Dictionary<TResult> | null | undefined = obj;
|
||||
|
||||
let stringIterator: (char: string, index: number, string: string) => any = (char: string, index: number, string: string) => 1;
|
||||
let listIterator: (value: TResult, index: number, collection: _.List<TResult>) => any = (value: TResult, index: number, collection: _.List<TResult>) => 1;
|
||||
let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary<TResult>) => any = (value: TResult, key: string, collection: _.Dictionary<TResult>) => 1;
|
||||
let stringIterator = (char: string, index: number, string: string) => true;
|
||||
let listIterator = (value: TResult, index: number, collection: _.List<TResult>) => true;
|
||||
let dictionaryIterator = (value: TResult, key: string, collection: _.Dictionary<TResult>) => true;
|
||||
|
||||
{
|
||||
let result: string[];
|
||||
@@ -8667,9 +8600,7 @@ namespace TestIsEqual {
|
||||
|
||||
// _.isEqualWith
|
||||
namespace TestIsEqualWith {
|
||||
let customizer = (value: any, other: any, indexOrKey: number|string|undefined, parent: any, otherParent: any, stack: any) => {
|
||||
return value ? undefined : true;
|
||||
};
|
||||
let customizer = (value: any, other: any, indexOrKey: number|string|symbol|undefined, parent: any, otherParent: any, stack: any) => true;
|
||||
|
||||
{
|
||||
let result: boolean;
|
||||
@@ -8873,7 +8804,7 @@ namespace TestIsMatch {
|
||||
|
||||
// _.isMatchWith
|
||||
namespace TestIsMatchWith {
|
||||
let testIsMatchCustiomizerFn = (value: any, other: any, indexOrKey: number|string) => true;
|
||||
let testIsMatchCustiomizerFn = (value: any, other: any, indexOrKey: number|string|symbol) => true;
|
||||
|
||||
let result: boolean;
|
||||
|
||||
@@ -11890,7 +11821,7 @@ namespace TestPick {
|
||||
{
|
||||
let result: Pick<TResult, 'a' | 'b'>;
|
||||
result = _.pick(obj, 'a', 'b');
|
||||
result = _.pick(obj, ['a', 'b']);
|
||||
result = _.pick(obj, ['a' as 'a', 'b' as 'b']);
|
||||
}
|
||||
|
||||
{
|
||||
@@ -11901,6 +11832,13 @@ namespace TestPick {
|
||||
result = _(obj).pick<TResult>(['b', 1], 0, 'a');
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitWrapper<Pick<TResult, 'a' | 'b'>>;
|
||||
|
||||
result = _(obj).pick('a', 'b');
|
||||
result = _(obj).pick(['a' as 'a', 'b' as 'b']);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<Partial<TResult>>;
|
||||
|
||||
@@ -11908,6 +11846,13 @@ namespace TestPick {
|
||||
result = _(obj).chain().pick<TResult>(0, 'a');
|
||||
result = _(obj).chain().pick<TResult>(['b', 1], 0, 'a');
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitWrapper<Pick<TResult, 'a' | 'b'>>;
|
||||
|
||||
result = _(obj).chain().pick('a', 'b');
|
||||
result = _(obj).chain().pick(['a' as 'a', 'b' as 'b']);
|
||||
}
|
||||
}
|
||||
|
||||
// _.pickBy
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
|
||||
Vendored
+59
-28
@@ -1,6 +1,8 @@
|
||||
// Type definitions for lolex 1.5
|
||||
// Type definitions for lolex 2.1
|
||||
// Project: https://github.com/sinonjs/lolex
|
||||
// Definitions by: Wim Looman <https://github.com/Nemo157>, Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Definitions by: Wim Looman <https://github.com/Nemo157>
|
||||
// Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
@@ -34,7 +36,7 @@ type BrowserClock = LolexClock<number>;
|
||||
type NodeClock = LolexClock<NodeTimer> & {
|
||||
/**
|
||||
* Mimicks process.hrtime().
|
||||
*
|
||||
*
|
||||
* @param prevTime Previous system time to calculate time elapsed.
|
||||
* @returns High resolution real time as [seconds, nanoseconds].
|
||||
*/
|
||||
@@ -49,7 +51,7 @@ type Clock = BrowserClock | NodeClock;
|
||||
/**
|
||||
* Names of clock methods that may be faked by install.
|
||||
*/
|
||||
type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date";
|
||||
type FakeMethod = "setTimeout" | "clearTimeout" | "setImmediate" | "clearImmediate" | "setInterval" | "clearInterval" | "Date" | "nextTick" | "hrtime";
|
||||
|
||||
/**
|
||||
* Controls the flow of time.
|
||||
@@ -67,7 +69,7 @@ export interface LolexClock<TTimerId extends TimerId> {
|
||||
|
||||
/**
|
||||
* Schedules a callback to be fired once timeout milliseconds have ticked by.
|
||||
*
|
||||
*
|
||||
* @param callback Callback to be fired.
|
||||
* @param timeout How many ticks to wait to run the callback.
|
||||
* @param args Any extra arguments to pass to the callback.
|
||||
@@ -77,14 +79,14 @@ export interface LolexClock<TTimerId extends TimerId> {
|
||||
|
||||
/**
|
||||
* Clears a timer, as long as it was created using setTimeout.
|
||||
*
|
||||
*
|
||||
* @param id Timer ID or object.
|
||||
*/
|
||||
clearTimeout(id: TTimerId): void;
|
||||
|
||||
/**
|
||||
* Schedules a callback to be fired every time timeout milliseconds have ticked by.
|
||||
*
|
||||
*
|
||||
* @param callback Callback to be fired.
|
||||
* @param timeout How many ticks to wait between callbacks.
|
||||
* @param args Any extra arguments to pass to the callback.
|
||||
@@ -94,14 +96,14 @@ export interface LolexClock<TTimerId extends TimerId> {
|
||||
|
||||
/**
|
||||
* Clears a timer, as long as it was created using setInterval.
|
||||
*
|
||||
*
|
||||
* @param id Timer ID or object.
|
||||
*/
|
||||
clearInterval(id: TTimerId): void;
|
||||
|
||||
/**
|
||||
* Schedules the callback to be fired once 0 milliseconds have ticked by.
|
||||
*
|
||||
*
|
||||
* @param callback Callback to be fired.
|
||||
* @remarks You'll still have to call clock.tick() for the callback to fire.
|
||||
* @remarks If called during a tick the callback won't fire until 1 millisecond has ticked by.
|
||||
@@ -110,11 +112,16 @@ export interface LolexClock<TTimerId extends TimerId> {
|
||||
|
||||
/**
|
||||
* Clears a timer, as long as it was created using setImmediate.
|
||||
*
|
||||
*
|
||||
* @param id Timer ID or object.
|
||||
*/
|
||||
clearImmediate(id: TTimerId): void;
|
||||
|
||||
/**
|
||||
* Simulates process.nextTick();
|
||||
*/
|
||||
nextTick(callback: () => void): void;
|
||||
|
||||
/**
|
||||
* Advances the clock to the the moment of the first scheduled timer, firing it.
|
||||
*/
|
||||
@@ -122,14 +129,14 @@ export interface LolexClock<TTimerId extends TimerId> {
|
||||
|
||||
/**
|
||||
* Advance the clock, firing callbacks if necessary.
|
||||
*
|
||||
*
|
||||
* @param time How many ticks to advance by.
|
||||
*/
|
||||
tick(time: number | string): void;
|
||||
|
||||
/**
|
||||
* Runs all pending timers until there are none remaining.
|
||||
*
|
||||
*
|
||||
* @remarks If new timers are added while it is executing they will be run as well.
|
||||
*/
|
||||
runAll(): void;
|
||||
@@ -142,7 +149,7 @@ export interface LolexClock<TTimerId extends TimerId> {
|
||||
|
||||
/**
|
||||
* Simulates a user changing the system clock.
|
||||
*
|
||||
*
|
||||
* @param now New system time.
|
||||
* @remarks This affects the current time but it does not in itself cause timers to fire.
|
||||
*/
|
||||
@@ -157,7 +164,7 @@ export interface LolexClock<TTimerId extends TimerId> {
|
||||
|
||||
/**
|
||||
* Creates a clock.
|
||||
*
|
||||
*
|
||||
* @param now Current time for the clock.
|
||||
* @param loopLimit Maximum number of timers that will be run when calling runAll()
|
||||
* before assuming that we have an infinite loop and throwing an error
|
||||
@@ -167,23 +174,47 @@ export interface LolexClock<TTimerId extends TimerId> {
|
||||
*/
|
||||
export declare function createClock<TClock extends Clock>(now?: number | Date, loopLimit?: number): TClock;
|
||||
|
||||
/**
|
||||
* Creates a clock and installs it globally.
|
||||
*
|
||||
* @param now Current time for the clock, as with lolex.createClock().
|
||||
* @param toFake Names of methods that should be faked.
|
||||
* @type TClock Type of clock to create.
|
||||
* @usage lolex.install(["setTimeout", "clearTimeout"]);
|
||||
*/
|
||||
export declare function install<TClock extends Clock>(now?: number | Date, toFake?: FakeMethod[]): TClock;
|
||||
|
||||
export interface LolexInstallOpts {
|
||||
/**
|
||||
* Installs lolex onto the specified target context (default: global)
|
||||
*/
|
||||
target?: any;
|
||||
|
||||
/**
|
||||
* Installs lolex with the specified unix epoch (default: 0)
|
||||
*/
|
||||
now?: number;
|
||||
|
||||
/**
|
||||
* An array with explicit function names to hijack. When not set, lolex will automatically fake all methods except nextTick
|
||||
* e.g., lolex.install({ toFake: ["setTimeout", "nextTick"]}) will fake only setTimeout and nextTick
|
||||
*/
|
||||
toFake?: FakeMethod[];
|
||||
|
||||
/**
|
||||
* The maximum number of timers that will be run when calling runAll() (default: 1000)
|
||||
*/
|
||||
loopLimit?: number;
|
||||
|
||||
/**
|
||||
* Tells lolex to increment mocked time automatically based on the real system time shift (e.g. the mocked time will be incremented by
|
||||
* 20ms for every 20ms change in the real system time) (default: false)
|
||||
*/
|
||||
shouldAdvanceTime?: boolean;
|
||||
|
||||
/**
|
||||
* Relevant only when using with shouldAdvanceTime: true. increment mocked time by advanceTimeDelta ms every advanceTimeDelta ms change
|
||||
* in the real system time (default: 20)
|
||||
*/
|
||||
advanceTimeDelta?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a clock and installs it onto the context object.
|
||||
*
|
||||
* @param context Context to install the clock onto.
|
||||
* Creates a clock and installs it globally.
|
||||
*
|
||||
* @param now Current time for the clock, as with lolex.createClock().
|
||||
* @param toFake Names of methods that should be faked.
|
||||
* @type TClock Type of clock to create.
|
||||
* @usage lolex.install(context, ["setTimeout", "clearTimeout"]);
|
||||
*/
|
||||
export declare function install<TClock extends Clock>(context?: any, now?: number | Date, toFake?: FakeMethod[]): TClock;
|
||||
export declare function install<TClock extends Clock>(opts: LolexInstallOpts): TClock;
|
||||
|
||||
+10
-19
@@ -16,25 +16,14 @@ lolex.createClock<lolex.NodeClock>(new Date());
|
||||
lolex.createClock<lolex.NodeClock>(7, 9001);
|
||||
lolex.createClock<lolex.NodeClock>(new Date(), 9001);
|
||||
|
||||
lolex.install<lolex.BrowserClock>(7);
|
||||
lolex.install<lolex.BrowserClock>(new Date());
|
||||
lolex.install<lolex.BrowserClock>(7, ["setTimeout"]);
|
||||
lolex.install<lolex.BrowserClock>(new Date(), ["setTimeout"]);
|
||||
|
||||
lolex.install<lolex.NodeClock>(7);
|
||||
lolex.install<lolex.NodeClock>(new Date());
|
||||
lolex.install<lolex.NodeClock>(7, ["setTimeout"]);
|
||||
lolex.install<lolex.NodeClock>(new Date(), ["setTimeout"]);
|
||||
|
||||
lolex.install<lolex.BrowserClock>({}, 7);
|
||||
lolex.install<lolex.BrowserClock>({}, new Date());
|
||||
lolex.install<lolex.BrowserClock>({}, 7, ["setTimeout"]);
|
||||
lolex.install<lolex.BrowserClock>({}, new Date(), ["setTimeout"]);
|
||||
|
||||
lolex.install<lolex.NodeClock>({}, 7);
|
||||
lolex.install<lolex.NodeClock>({}, new Date());
|
||||
lolex.install<lolex.NodeClock>({}, 7, ["setTimeout"]);
|
||||
lolex.install<lolex.NodeClock>({}, new Date(), ["setTimeout"]);
|
||||
lolex.install<lolex.BrowserClock>({
|
||||
advanceTimeDelta: 20,
|
||||
loopLimit: 10,
|
||||
now: 0,
|
||||
shouldAdvanceTime: true,
|
||||
target: {},
|
||||
toFake: ["setTimeout", "nextTick", "hrtime"]
|
||||
});
|
||||
|
||||
const browserNow: number = browserClock.now;
|
||||
const browserDate: Date = new browserClock.Date();
|
||||
@@ -80,5 +69,7 @@ nodeClock.setSystemTime();
|
||||
nodeClock.setSystemTime(7);
|
||||
nodeClock.setSystemTime(new Date());
|
||||
|
||||
nodeClock.nextTick(() => undefined);
|
||||
|
||||
browserClock.uninstall();
|
||||
nodeClock.uninstall();
|
||||
|
||||
Vendored
+13
-13
@@ -1,25 +1,25 @@
|
||||
// Type definitions for lozad 1.0
|
||||
// Type definitions for lozad 1.1
|
||||
// Project: https://github.com/ApoorvSaxena/lozad.js
|
||||
// Definitions by: York Yao <https://github.com/plantain-00>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface Option {
|
||||
rootMargin?: string;
|
||||
threshold?: number;
|
||||
load?(element: HTMLElement | HTMLCanvasElement): void;
|
||||
}
|
||||
|
||||
interface Observer {
|
||||
observe(): void;
|
||||
}
|
||||
|
||||
declare function lozad(selector?: string, options?: Option): Observer;
|
||||
|
||||
declare namespace lozad {
|
||||
interface Option {
|
||||
rootMargin?: string;
|
||||
threshold?: number;
|
||||
load?(element: HTMLElement | HTMLCanvasElement): void;
|
||||
}
|
||||
|
||||
interface Observer {
|
||||
observe(): void;
|
||||
}
|
||||
|
||||
const prototype: {
|
||||
};
|
||||
}
|
||||
|
||||
declare function lozad(selector?: string, options?: lozad.Option): lozad.Observer;
|
||||
|
||||
export as namespace lozad;
|
||||
|
||||
export = lozad;
|
||||
|
||||
Vendored
+1
@@ -1440,6 +1440,7 @@ declare namespace __MaterialUI {
|
||||
hintText?: React.ReactNode;
|
||||
iconStyle?: React.CSSProperties;
|
||||
id?: string;
|
||||
name?: string;
|
||||
labelStyle?: React.CSSProperties;
|
||||
multiple?: boolean;
|
||||
onBlur?: React.FocusEventHandler<{}>;
|
||||
|
||||
Vendored
+31
-25
@@ -4,8 +4,6 @@
|
||||
// Connor Schlesiger <https://github.com/schlesiger>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/* tslint:disable:max-line-length */
|
||||
|
||||
export interface NightwatchCustomPageObjects {
|
||||
page: {};
|
||||
}
|
||||
@@ -887,7 +885,7 @@ export interface NightwatchAPI {
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
* @returns The value of the attribute
|
||||
*/
|
||||
getAttribute(selector: string, attribute: string, callback?: (result: NightwatchCallbackResult) => void): this;
|
||||
getAttribute(selector: string, attribute: string, callback?: (this: NightwatchAPI, result: NightwatchCallbackResult) => void): this;
|
||||
|
||||
/**
|
||||
* Retrieve a single cookie visible to the current page. The cookie is returned as a cookie JSON object, as defined here.
|
||||
@@ -906,7 +904,7 @@ export interface NightwatchAPI {
|
||||
* @param callback: The callback function which will receive the response as an argument.
|
||||
* @returns The cookie object as a selenium cookie JSON object or null if the cookie wasn't found.
|
||||
*/
|
||||
getCookie(name: string, callback?: (result: NightwatchCallbackResult) => void): this;
|
||||
getCookie(name: string, callback?: (this: NightwatchAPI, result: NightwatchCallbackResult) => void): this;
|
||||
|
||||
/**
|
||||
* Retrieve all cookies visible to the current page. The cookies are returned as an array of cookie JSON object,
|
||||
@@ -924,7 +922,7 @@ export interface NightwatchAPI {
|
||||
* @param callback: The callback function which will receive the response as an argument.
|
||||
* @returns A list of cookies
|
||||
*/
|
||||
getCookies(callback?: (result: NightwatchCallbackResult) => void): this;
|
||||
getCookies(callback?: (this: NightwatchAPI, result: NightwatchCallbackResult) => void): this;
|
||||
|
||||
/**
|
||||
* Retrieve the value of a css property for a given DOM element. Uses elementIdCssProperty protocol command.
|
||||
@@ -944,7 +942,7 @@ export interface NightwatchAPI {
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
* @returns The value of the css property
|
||||
*/
|
||||
getCssProperty(selector: string, cssProperty: string, callback?: (result: NightwatchCallbackResult) => void): this;
|
||||
getCssProperty(selector: string, cssProperty: string, callback?: (this: NightwatchAPI, result: NightwatchCallbackResult) => void): this;
|
||||
|
||||
/**
|
||||
* Determine an element's size in pixels. Uses elementIdSize protocol command.
|
||||
@@ -964,7 +962,7 @@ export interface NightwatchAPI {
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
* @returns The width and height of the element in pixels
|
||||
*/
|
||||
getElementSize(selector: string, callback?: (result: NightwatchCallbackResult) => void): this;
|
||||
getElementSize(selector: string, callback?: (this: NightwatchAPI, result: NightwatchCallbackResult) => void): this;
|
||||
|
||||
/**
|
||||
* Determine an element's location on the page. The point (0, 0) refers to the upper-left corner of the page.
|
||||
@@ -985,7 +983,7 @@ export interface NightwatchAPI {
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
* @returns The X and Y coordinates for the element on the page
|
||||
*/
|
||||
getLocation(selector: string, callback?: (result: NightwatchCallbackResult) => void): this;
|
||||
getLocation(selector: string, callback?: (this: NightwatchAPI, result: NightwatchCallbackResult) => void): this;
|
||||
|
||||
/**
|
||||
* Determine an element's location on the screen once it has been scrolled into view. Uses elementIdLocationInView protocol command.
|
||||
@@ -1005,7 +1003,7 @@ export interface NightwatchAPI {
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
* @returns The X and Y coordinates for the element on the page.
|
||||
*/
|
||||
getLocationInView(selector: string, callback?: (result: NightwatchCallbackResult) => void): this;
|
||||
getLocationInView(selector: string, callback?: (this: NightwatchAPI, result: NightwatchCallbackResult) => void): this;
|
||||
|
||||
/**
|
||||
* Gets a log from selenium
|
||||
@@ -1059,7 +1057,7 @@ export interface NightwatchAPI {
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
* @returns The element's tag name, as a lowercase string.
|
||||
*/
|
||||
getTagName(selector: string, callback?: (result: NightwatchCallbackResult) => void): this;
|
||||
getTagName(selector: string, callback?: (this: NightwatchAPI, result: NightwatchCallbackResult) => void): this;
|
||||
|
||||
/**
|
||||
* Returns the visible text for the element. Uses elementIdText protocol command.
|
||||
@@ -1078,7 +1076,7 @@ export interface NightwatchAPI {
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
* @returns The element's visible text.
|
||||
*/
|
||||
getText(selector: string, callback?: (result: NightwatchCallbackResult) => void): this;
|
||||
getText(selector: string, callback?: (this: NightwatchAPI, result: NightwatchCallbackResult) => void): this;
|
||||
|
||||
/**
|
||||
* Returns the title of the current page. Uses title protocol command.
|
||||
@@ -1095,7 +1093,7 @@ export interface NightwatchAPI {
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
* @returns The page title.
|
||||
*/
|
||||
getTitle(callback?: (result: NightwatchCallbackResult) => void): this;
|
||||
getTitle(callback?: (this: NightwatchAPI, result?: string) => void): this;
|
||||
|
||||
/**
|
||||
* Returns a form element current value. Uses elementIdValue protocol command.
|
||||
@@ -1114,7 +1112,7 @@ export interface NightwatchAPI {
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
* @returns The element's value.
|
||||
*/
|
||||
getValue(selector: string, callback?: (result: NightwatchCallbackResult) => void): this;
|
||||
getValue(selector: string, callback?: (this: NightwatchAPI, result: NightwatchCallbackResult) => void): this;
|
||||
|
||||
/**
|
||||
* This command is an alias to url and also a convenience method when called without any arguments in the sense that it performs a call to .url() with passing the value of launch_url
|
||||
@@ -1180,7 +1178,7 @@ export interface NightwatchAPI {
|
||||
* @param selector: The CSS/Xpath selector used to locate the element.
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
*/
|
||||
isVisible(selector: string, callback?: (result: NightwatchCallbackResult) => void): this;
|
||||
isVisible(selector: string, callback?: (this: NightwatchAPI, result: NightwatchCallbackResult) => void): this;
|
||||
|
||||
/**
|
||||
* Maximizes the current window.
|
||||
@@ -1559,7 +1557,9 @@ export interface NightwatchAPI {
|
||||
* ```
|
||||
* @param selector: The selector (CSS / Xpath) used to locate the element.
|
||||
* @param time: The number of milliseconds to wait. The runner performs repeated checks every 500 ms.
|
||||
* @param abortOnFailure: By the default if the element is not found the test will fail. Set this to false if you wish for the test to continue even if the assertion fails. To set this globally you can define a property `abortOnNightwatchAssertionsFailure` in your globals.
|
||||
* @param abortOnFailure: By the default if the element is not found the test will fail.
|
||||
* Set this to false if you wish for the test to continue even if the assertion fails.
|
||||
* To set this globally you can define a property `abortOnNightwatchAssertionsFailure` in your globals.
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
* @param message: Optional message to be shown in the output; the message supports two placeholders: %s for current selector and %d for the time (e.g. Element %s was not in the page for %d ms).
|
||||
*/
|
||||
@@ -1847,7 +1847,8 @@ export interface NightwatchAPI {
|
||||
/**
|
||||
* Send a sequence of key strokes to the active element. The sequence is defined in the same format as the sendKeys command.
|
||||
* An object map with available keys and their respective UTF-8 characters, as defined on W3C WebDriver draft spec, is loaded onto the main Nightwatch instance as client.Keys.
|
||||
* Rather than the setValue, the modifiers are not released at the end of the call. The state of the modifier keys is kept between calls, so mouse interactions can be performed while modifier keys are depressed.
|
||||
* Rather than the setValue, the modifiers are not released at the end of the call.
|
||||
* The state of the modifier keys is kept between calls, so mouse interactions can be performed while modifier keys are depressed.
|
||||
* @param keysToSend: The keys sequence to be sent.
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
*/
|
||||
@@ -1862,8 +1863,10 @@ export interface NightwatchAPI {
|
||||
mouseButtonClick(button: string, callback?: () => void): this;
|
||||
|
||||
/**
|
||||
* Click and hold the left mouse button (at the coordinates set by the last moveto command). Note that the next mouse-related command that should follow is mouseButtonUp . Any other mouse command (such as click or another call to buttondown) will yield undefined behaviour.
|
||||
* Can be used for implementing drag-and-drop. The button can be (0, 1, 2) or ('left', 'middle', 'right'). It defaults to left mouse button, and if you don't pass in a button but do pass in a callback, it will handle it correctly.
|
||||
* Click and hold the left mouse button (at the coordinates set by the last moveto command). Note that the next mouse-related command that should follow is mouseButtonUp .
|
||||
* Any other mouse command (such as click or another call to buttondown) will yield undefined behaviour.
|
||||
* Can be used for implementing drag-and-drop. The button can be (0, 1, 2) or ('left', 'middle', 'right').
|
||||
* It defaults to left mouse button, and if you don't pass in a button but do pass in a callback, it will handle it correctly.
|
||||
* @param button: The mouse button
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
*/
|
||||
@@ -1871,14 +1874,16 @@ export interface NightwatchAPI {
|
||||
|
||||
/**
|
||||
* Releases the mouse button previously held (where the mouse is currently at). Must be called once for every mouseButtonDown command issued.
|
||||
* Can be used for implementing drag-and-drop. The button can be (0, 1, 2) or ('left', 'middle', 'right'). It defaults to left mouse button, and if you don't pass in a button but do pass in a callback, it will handle it correctly.
|
||||
* Can be used for implementing drag-and-drop. The button can be (0, 1, 2) or ('left', 'middle', 'right').
|
||||
* It defaults to left mouse button, and if you don't pass in a button but do pass in a callback, it will handle it correctly.
|
||||
* @param button: The mouse button
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
*/
|
||||
mouseButtonUp(button: string, callback?: () => void): this;
|
||||
|
||||
/**
|
||||
* Move the mouse by an offset of the specificed element. If no element is specified, the move is relative to the current mouse cursor. If an element is provided but no offset, the mouse will be moved to the center of the element.
|
||||
* Move the mouse by an offset of the specificed element. If no element is specified, the move is relative to the current mouse cursor.
|
||||
* If an element is provided but no offset, the mouse will be moved to the center of the element.
|
||||
* If the element is not visible, it will be scrolled into view.
|
||||
* @param element: Opaque ID assigned to the element to move to. If not specified or is null, the offset is relative to current position of the mouse.
|
||||
* @param xofset: X offset to move to, relative to the top-left corner of the element. If not specified, the mouse will move to the middle of the element.
|
||||
@@ -1997,14 +2002,16 @@ export interface NightwatchAPI {
|
||||
|
||||
/**
|
||||
* Configure the amount of time that a particular type of operation can execute for before they are aborted and a |Timeout| error is returned to the client.
|
||||
* @param typeOfOperation: The type of operation to set the timeout for. Valid values are: "script" for script timeouts, "implicit" for modifying the implicit wait timeout and "page load" for setting a page load timeout.
|
||||
* @param typeOfOperation: The type of operation to set the timeout for.
|
||||
* Valid values are: "script" for script timeouts, "implicit" for modifying the implicit wait timeout and "page load" for setting a page load timeout.
|
||||
* @param ms: The amount of time, in milliseconds, that time-limited commands are permitted to run.
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
*/
|
||||
timeouts(typeOfOperation: string, ms: number, callback?: () => void): this;
|
||||
|
||||
/**
|
||||
* Set the amount of time, in milliseconds, that asynchronous scripts executed by /session/:sessionId/execute_async are permitted to run before they are aborted and a |Timeout| error is returned to the client.
|
||||
* Set the amount of time, in milliseconds, that asynchronous scripts executed by /session/:sessionId/execute_async are permitted
|
||||
* to run before they are aborted and a |Timeout| error is returned to the client.
|
||||
* @param ms: The amount of time, in milliseconds, that time-limited commands are permitted to run.
|
||||
* @param callback: Optional callback function to be called when the command finishes.
|
||||
*/
|
||||
@@ -2087,7 +2094,8 @@ export interface NightwatchAPI {
|
||||
windowMaximize(handleOrName?: string, callback?: () => void): this;
|
||||
|
||||
/**
|
||||
* Change or get the position of the specified window. If the second argument is a function it will be used as a callback and the call will perform a get request to retrieve the existing window position.
|
||||
* Change or get the position of the specified window. If the second argument is a function it will be used as a callback and the call
|
||||
* will perform a get request to retrieve the existing window position.
|
||||
* @param windowHandle:
|
||||
* @param: offsetX:
|
||||
* @param: offsetY:
|
||||
@@ -2199,5 +2207,3 @@ export interface Nightwatch {
|
||||
api: NightwatchAPI;
|
||||
client: NightwatchClient;
|
||||
}
|
||||
|
||||
/* tslint:enable:max-line-length */
|
||||
|
||||
@@ -7,6 +7,9 @@ const test: NightwatchTests = {
|
||||
.waitForElementVisible('body', 1000)
|
||||
.setValue('input[type=text]', 'nightwatch')
|
||||
.waitForElementVisible('button[name=btnG]', 1000)
|
||||
.getTitle(function(result) {
|
||||
this.assert.equal(typeof result, 'string');
|
||||
})
|
||||
.click('button[name=btnG]')
|
||||
.pause(1000)
|
||||
.assert.containsText('#main', 'Night Watch')
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
// TODO
|
||||
"no-any-union": false
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+22
-4
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/tcs-de/nodecache
|
||||
// Definitions by: Ilya Mochalov <https://github.com/chrootsu>
|
||||
// Daniel Thunell <https://github.com/dthunell>
|
||||
// Ulf Seltmann <https://github.com/useltmann>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -89,8 +90,16 @@ declare namespace NodeCache {
|
||||
|
||||
ttl(
|
||||
key: Key,
|
||||
cb?: Callback<boolean>,
|
||||
ttl?: number
|
||||
cb?: Callback<boolean>
|
||||
): boolean;
|
||||
|
||||
getTtl(
|
||||
key: Key,
|
||||
): number|undefined;
|
||||
|
||||
getTtl(
|
||||
key: Key,
|
||||
cb?: Callback<boolean>
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
@@ -130,6 +139,7 @@ declare namespace NodeCache {
|
||||
checkperiod?: number;
|
||||
useClones?: boolean;
|
||||
errorOnMissing?: boolean;
|
||||
deleteOnExpire?: boolean;
|
||||
}
|
||||
|
||||
interface Stats {
|
||||
@@ -225,7 +235,7 @@ declare class NodeCache extends events.EventEmitter implements NodeCache.NodeCac
|
||||
): number;
|
||||
|
||||
/**
|
||||
* reset or redefine the ttl of a key. If `ttl` is not passed or set to 0 it's similar to `.del()`
|
||||
* reset or redefine the ttl of a key. If `ttl` is not passed or set to 0 `stdTtl` is used. if set lt 0 it's similar to `.del()`
|
||||
*/
|
||||
ttl(
|
||||
key: Key,
|
||||
@@ -234,9 +244,17 @@ declare class NodeCache extends events.EventEmitter implements NodeCache.NodeCac
|
||||
): boolean;
|
||||
|
||||
ttl(
|
||||
key: Key,
|
||||
cb?: Callback<boolean>
|
||||
): boolean;
|
||||
|
||||
getTtl(
|
||||
key: Key
|
||||
): number|undefined;
|
||||
|
||||
getTtl(
|
||||
key: Key,
|
||||
cb?: Callback<boolean>,
|
||||
ttl?: number
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
|
||||
@@ -83,7 +83,7 @@ interface TypeSample {
|
||||
result = cache.getStats();
|
||||
}
|
||||
|
||||
/* tslint:disable void-return no-void-expression */
|
||||
/* tslint-:disable void-return no-void-expression
|
||||
{
|
||||
let cache: NodeCache;
|
||||
let result: void;
|
||||
@@ -95,4 +95,4 @@ interface TypeSample {
|
||||
let result: void;
|
||||
result = cache.close();
|
||||
}
|
||||
/* tslint:enable void-return */
|
||||
tslint-:enable void-return */
|
||||
|
||||
Vendored
+198
-51
@@ -94,23 +94,30 @@ export function downloadImage(root: Root, opts: DownloadImgopts): Promise<string
|
||||
// Layout
|
||||
export interface Layout {
|
||||
title: string;
|
||||
titlefont: Partial<Font>;
|
||||
autosize: boolean;
|
||||
showlegend: boolean;
|
||||
xaxis: Partial<Axis>;
|
||||
yaxis: Partial<Axis>;
|
||||
yaxis2: Partial<Axis>;
|
||||
yaxis3: Partial<Axis>;
|
||||
yaxis4: Partial<Axis>;
|
||||
yaxis5: Partial<Axis>;
|
||||
yaxis6: Partial<Axis>;
|
||||
yaxis7: Partial<Axis>;
|
||||
yaxis8: Partial<Axis>;
|
||||
yaxis9: Partial<Axis>;
|
||||
paper_bgcolor: Color;
|
||||
plot_bgcolor: Color;
|
||||
separators: string;
|
||||
hidesources: boolean;
|
||||
xaxis: Partial<LayoutAxis>;
|
||||
yaxis: Partial<LayoutAxis>;
|
||||
yaxis2: Partial<LayoutAxis>;
|
||||
yaxis3: Partial<LayoutAxis>;
|
||||
yaxis4: Partial<LayoutAxis>;
|
||||
yaxis5: Partial<LayoutAxis>;
|
||||
yaxis6: Partial<LayoutAxis>;
|
||||
yaxis7: Partial<LayoutAxis>;
|
||||
yaxis8: Partial<LayoutAxis>;
|
||||
yaxis9: Partial<LayoutAxis>;
|
||||
margin: Partial<Margin>;
|
||||
height: number;
|
||||
width: number;
|
||||
hovermode: "closest" | "x" | "y" | false;
|
||||
'xaxis.range': [Datum, Datum];
|
||||
hovermode: 'closest' | 'x' | 'y' | false;
|
||||
hoverlabel: Partial<Label>;
|
||||
calendar: Calendar;
|
||||
'xaxis.range': [Datum, Datum];
|
||||
'xaxis.range[0]': Datum;
|
||||
'xaxis.range[1]': Datum;
|
||||
'yaxis.range': [Datum, Datum];
|
||||
@@ -120,47 +127,112 @@ export interface Layout {
|
||||
'xaxis.type': AxisType;
|
||||
'xaxis.autorange': boolean;
|
||||
'yaxis.autorange': boolean;
|
||||
dragmode: "lasso" | "pan" | "select" | "zoom";
|
||||
ternary: {}; // TODO
|
||||
geo: {}; // TODO
|
||||
mapbox: {}; // TODO
|
||||
radialaxis: {}; // TODO
|
||||
angularaxis: {}; // TODO
|
||||
direction: 'clockwise' | 'counterclockwise';
|
||||
dragmode: 'zoom' | 'pan' | 'select' | 'lasso' | 'orbit' | 'turntable';
|
||||
orientation: number;
|
||||
annotations: {}; // TODO
|
||||
shapes: Array<Partial<Shape>>;
|
||||
legend: Partial<Legend>;
|
||||
images: {}; // TODO
|
||||
updatemenus: {}; // TODO
|
||||
sliders: {}; // TODO
|
||||
legend: Partial<Legend>;
|
||||
font: Partial<Font>;
|
||||
scene: Partial<Scene>;
|
||||
}
|
||||
|
||||
export interface Legend {
|
||||
traceorder: "grouped" | "normal" | "reversed";
|
||||
export interface Legend extends Label {
|
||||
traceorder: 'grouped' | 'normal' | 'reversed';
|
||||
x: number;
|
||||
y: number;
|
||||
font: Partial<Font>;
|
||||
bgcolor: string;
|
||||
bordercolor: string;
|
||||
borderwidth: number;
|
||||
orientation: "v" | "h";
|
||||
orientation: 'v' | 'h';
|
||||
tracegroupgap: number;
|
||||
xanchor: 'auto' | 'left' | 'center' | 'right';
|
||||
yanchor: 'auto' | 'top' | 'middle' | 'bottom';
|
||||
}
|
||||
|
||||
export type AxisType = "date" | "log" | "linear";
|
||||
export type AxisType = '-' | 'linear' | 'log' | 'date' | 'category';
|
||||
|
||||
export interface Axis {
|
||||
title: string;
|
||||
showgrid: boolean;
|
||||
fixedrange: boolean;
|
||||
rangemode: "tozero" | 'normal' | 'nonnegative';
|
||||
domain: number[];
|
||||
type: AxisType;
|
||||
tickformat: string;
|
||||
hoverformat: string;
|
||||
exponentformat: "none" | "e" | "E" | "power" | "SI" | "B";
|
||||
rangeslider: Partial<RangeSlider>;
|
||||
rangeselector: Partial<RangeSelector>;
|
||||
range: [Datum, Datum];
|
||||
showticklabels: boolean;
|
||||
autotick: boolean;
|
||||
zeroline: boolean;
|
||||
autorange: boolean | 'reversed';
|
||||
side: "top" | "bottom" | "left" | "right";
|
||||
overlaying: "free" | "/^x([2-9]|[1-9][0-9]+)?$/" | "/^y([2-9]|[1-9][0-9]+)?$/";
|
||||
visible: boolean;
|
||||
color: Color;
|
||||
title: string;
|
||||
titlefont: Partial<Font>;
|
||||
type: AxisType;
|
||||
autorange: true | false | 'reversed';
|
||||
rangemode: 'normal' | 'tozero' | 'nonnegative';
|
||||
range: any[];
|
||||
tickmode: 'auto' | 'linear' | 'array';
|
||||
nticks: number;
|
||||
tick0: number | string;
|
||||
dtick: number | string;
|
||||
tickvals: any[];
|
||||
ticktext: string[];
|
||||
ticks: 'outside' | 'inside' | '';
|
||||
mirror: true | 'ticks' | false | 'all' | 'allticks';
|
||||
ticklen: number;
|
||||
tickwidth: number;
|
||||
tickcolor: Color;
|
||||
showticklabels: boolean;
|
||||
showspikes: boolean;
|
||||
spikecolor: Color;
|
||||
spikethickness: number;
|
||||
categoryorder: 'trace' | 'category ascending' | 'category descending' | 'array';
|
||||
categoryarray: any[];
|
||||
tickfont: Partial<Font>;
|
||||
tickangle: number;
|
||||
tickprefix: string;
|
||||
showtickprefix: 'all' | 'first' | 'last' | 'none';
|
||||
ticksuffix: string;
|
||||
showticksuffix: 'all' | 'first' | 'last' | 'none';
|
||||
showexponent: 'all' | 'first' | 'last' | 'none';
|
||||
exponentformat: 'none' | 'e' | 'E' | 'power' | 'SI' | 'B';
|
||||
separatethousands: boolean;
|
||||
tickformat: string;
|
||||
hoverformat: string;
|
||||
showline: boolean;
|
||||
linecolor: Color;
|
||||
linewidth: number;
|
||||
showgrid: boolean;
|
||||
gridcolor: Color;
|
||||
gridwidth: number;
|
||||
zeroline: boolean;
|
||||
zerolinecolor: Color;
|
||||
zerolinewidth: number;
|
||||
calendar: Calendar;
|
||||
}
|
||||
|
||||
export type Calendar = 'gregorian' | 'chinese' | 'coptic' | 'discworld' | 'ethiopian' | 'hebrew' | 'islamic' | 'julian' | 'mayan' |
|
||||
'nanakshahi' | 'nepali' | 'persian' | 'jalali' | 'taiwan' | 'thai' | 'ummalqura';
|
||||
|
||||
export interface LayoutAxis extends Axis {
|
||||
fixedrange: boolean;
|
||||
scaleanchor: '/^x([2-9]|[1-9][0-9]+)?$/' | '/^y([2-9]|[1-9][0-9]+)?$/';
|
||||
scaleratio: number;
|
||||
constrain: 'range' | 'domain';
|
||||
constraintoward: 'left' | 'center' | 'right' | 'top' | 'middle' | 'bottom';
|
||||
spikedash: string;
|
||||
spikemode: string;
|
||||
anchor: 'free' | '/^x([2-9]|[1-9][0-9]+)?$/' | '/^y([2-9]|[1-9][0-9]+)?$/';
|
||||
side: 'top' | 'bottom' | 'left' | 'right';
|
||||
overlaying: 'free' | '/^x([2-9]|[1-9][0-9]+)?$/' | '/^y([2-9]|[1-9][0-9]+)?$/';
|
||||
layer: 'above traces' | 'below traces';
|
||||
domain: number[];
|
||||
position: number;
|
||||
rangeslider: Partial<RangeSlider>;
|
||||
rangeselector: Partial<RangeSelector>;
|
||||
}
|
||||
|
||||
export interface SceneAxis extends Axis {
|
||||
spikesides: boolean;
|
||||
showbackground: boolean;
|
||||
backgroundcolor: Color;
|
||||
showaxeslabels: boolean;
|
||||
}
|
||||
|
||||
export interface ShapeLine {
|
||||
@@ -212,7 +284,7 @@ export type Color = string | Array<string | undefined | null> | Array<Array<stri
|
||||
|
||||
// Bar Scatter
|
||||
export interface ScatterData {
|
||||
type: 'bar' | 'scatter' | 'scattergl';
|
||||
type: 'bar' | 'scatter' | 'scattergl' | 'scatter3d';
|
||||
x: Datum[] | Datum[][];
|
||||
y: Datum[] | Datum[][];
|
||||
z: Datum[] | Datum[][] | Datum[][][];
|
||||
@@ -234,13 +306,13 @@ export interface ScatterData {
|
||||
'marker.maxdisplayed': number;
|
||||
'marker.sizeref': number;
|
||||
'marker.sizemin': number;
|
||||
'marker.sizemode': "diameter" | "area";
|
||||
'marker.sizemode': 'diameter' | 'area';
|
||||
'marker.showscale': boolean;
|
||||
'marker.line': {}; // TODO
|
||||
'marker.line': Partial<ScatterMarkerLine>;
|
||||
'marker.colorbar': {}; // TODO
|
||||
mode: "lines" | "markers" | "text" | "lines+markers" | "text+markers" | "text+lines" | "text+lines+markers" | "none";
|
||||
hoveron: "points" | "fills";
|
||||
hoverinfo: "text";
|
||||
mode: 'lines' | 'markers' | 'text' | 'lines+markers' | 'text+markers' | 'text+lines' | 'text+lines+markers' | 'none';
|
||||
hoveron: 'points' | 'fills';
|
||||
hoverinfo: 'text';
|
||||
fill: 'none' | 'tozeroy' | 'tozerox' | 'tonexty' | 'tonextx' | 'toself' | 'tonext';
|
||||
fillcolor: string;
|
||||
legendgroup: string;
|
||||
@@ -250,16 +322,34 @@ export interface ScatterData {
|
||||
|
||||
export interface ScatterMarker {
|
||||
symbol: string | string[]; // Drawing.symbolList
|
||||
color: Color;
|
||||
color: Color | number[];
|
||||
colorscale: string | string[];
|
||||
cauto: boolean;
|
||||
cmax: boolean;
|
||||
cmin: boolean;
|
||||
autocolorscale: boolean;
|
||||
reversescale: boolean;
|
||||
opacity: number | number[];
|
||||
size: number | number[];
|
||||
maxdisplayed: number;
|
||||
sizeref: number;
|
||||
sizemin: number;
|
||||
sizemode: "diameter" | "area";
|
||||
sizemode: 'diameter' | 'area';
|
||||
showscale: boolean;
|
||||
line: {}; // TODO
|
||||
line: Partial<ScatterMarkerLine>;
|
||||
colorbar: {}; // TODO
|
||||
gradient: {}; // TODO
|
||||
}
|
||||
|
||||
export interface ScatterMarkerLine {
|
||||
width: number | number[];
|
||||
color: Color;
|
||||
colorscale: string | string[];
|
||||
cauto: boolean;
|
||||
cmax: number;
|
||||
cmin: number;
|
||||
autocolorscale: boolean;
|
||||
reversescale: boolean;
|
||||
}
|
||||
|
||||
export interface ScatterLine {
|
||||
@@ -380,16 +470,73 @@ export interface RangeSelectorButton {
|
||||
label: string;
|
||||
}
|
||||
|
||||
export interface RangeSelector {
|
||||
export interface RangeSelector extends Label {
|
||||
buttons: Array<Partial<RangeSelectorButton>>;
|
||||
visible: boolean;
|
||||
x: number;
|
||||
xanchor: 'auto' | 'left' | 'center' | 'right';
|
||||
y: number;
|
||||
yanchor: 'auto' | 'top' | 'middle' | 'bottom';
|
||||
bgcolor: string;
|
||||
activecolor: string;
|
||||
bordercolor: string;
|
||||
borderwidth: number;
|
||||
}
|
||||
|
||||
export interface Camera {
|
||||
up: Partial<Point>;
|
||||
center: Partial<Point>;
|
||||
eye: Partial<Point>;
|
||||
}
|
||||
|
||||
export interface Label {
|
||||
bgcolor: string;
|
||||
bordercolor: string;
|
||||
font: Partial<Font>;
|
||||
}
|
||||
|
||||
export interface Annotations extends Point, Label {
|
||||
visible: boolean;
|
||||
ax: number;
|
||||
ay: number;
|
||||
xanchor: 'auto' | 'left' | 'center' | 'right';
|
||||
xshift: number;
|
||||
yanchor: 'auto' | 'top' | 'middle' | 'bottom';
|
||||
yshift: number;
|
||||
text: string;
|
||||
textangle: string;
|
||||
width: number;
|
||||
height: number;
|
||||
opacity: number;
|
||||
align: 'left' | 'center' | 'right';
|
||||
valign: 'top' | 'middle' | 'bottom';
|
||||
borderpad: number;
|
||||
borderwidth: number;
|
||||
showarrow: boolean;
|
||||
arrowcolor: string;
|
||||
arrowhead: number;
|
||||
arrowsize: number;
|
||||
arrowwidth: number;
|
||||
standoff: number;
|
||||
hovertext: string;
|
||||
hoverlabel: Partial<Label>;
|
||||
captureevents: boolean;
|
||||
}
|
||||
|
||||
export interface Scene {
|
||||
bgcolor: string;
|
||||
camera: Partial<Camera>;
|
||||
domain: Partial<Domain>;
|
||||
aspectmode: 'auto' | 'cube' | 'data' | 'manual';
|
||||
aspectratio: Partial<Point>;
|
||||
xaxis: Partial<SceneAxis>;
|
||||
yaxis: Partial<SceneAxis>;
|
||||
zaxis: Partial<SceneAxis>;
|
||||
dragmode: 'orbit' | 'turntable' | 'zoom' | 'pan' | false;
|
||||
hovermode: 'closest' | false;
|
||||
annotations: Partial<Annotations> | Array<Partial<Annotations>>;
|
||||
captureevents: boolean;
|
||||
}
|
||||
|
||||
export interface Domain {
|
||||
x: number[];
|
||||
y: number[];
|
||||
}
|
||||
|
||||
Vendored
+11
-4
@@ -58,7 +58,7 @@ export interface Mouse {
|
||||
* @param y The y position.
|
||||
* @param options The click options.
|
||||
*/
|
||||
click(x: number, y: number, options: ClickOptions): Promise<void>;
|
||||
click(x: number, y: number, options?: ClickOptions): Promise<void>;
|
||||
/**
|
||||
* Dispatches a `mousedown` event.
|
||||
* @param options The mouse press options.
|
||||
@@ -251,6 +251,12 @@ export interface EmulateOptions {
|
||||
|
||||
export type EvaluateFn = string | ((...args: any[]) => any);
|
||||
|
||||
export type LoadEvent =
|
||||
| "load"
|
||||
| "domcontentloaded"
|
||||
| "networkidle0"
|
||||
| "networkidle2";
|
||||
|
||||
/** The navigation options. */
|
||||
export interface NavigationOptions {
|
||||
/**
|
||||
@@ -262,7 +268,7 @@ export interface NavigationOptions {
|
||||
* When to consider navigation succeeded.
|
||||
* @default load Navigation is consider when the `load` event is fired.
|
||||
*/
|
||||
waitUntil?: "load" | "domcontentloaded" | "networkidle0" | "networkidle2";
|
||||
waitUntil?: LoadEvent | LoadEvent[];
|
||||
}
|
||||
|
||||
export type PDFFormat =
|
||||
@@ -667,7 +673,8 @@ export interface FrameBase {
|
||||
*/
|
||||
$eval(
|
||||
selector: string,
|
||||
fn: (...args: any[]) => void
|
||||
fn: (element: ElementHandle | null, ...args: any[]) => any,
|
||||
...args: any[]
|
||||
): Promise<any>;
|
||||
|
||||
/**
|
||||
@@ -680,7 +687,7 @@ export interface FrameBase {
|
||||
*/
|
||||
$$eval(
|
||||
selector: string,
|
||||
fn: (...args: any[]) => void,
|
||||
fn: (elements: ElementHandle[], ...args: any[]) => any,
|
||||
...args: any[]
|
||||
): Promise<any>;
|
||||
|
||||
|
||||
Vendored
+64
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for react-loadable 4.0
|
||||
// Type definitions for react-loadable 5.3
|
||||
// Project: https://github.com/thejameskyle/react-loadable#readme
|
||||
// Definitions by: Diogo Franco <https://github.com/Kovensky>, Oden S. <https://github.com/odensc>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -36,6 +36,31 @@ export interface CommonOptions {
|
||||
* After the specified time in milliseconds passes, the component's `timedOut` prop will be set to true.
|
||||
*/
|
||||
timeout?: number | false | null;
|
||||
|
||||
/**
|
||||
* Optional array of module paths that `Loadable.Capture`'s `report` function will be applied on during
|
||||
* server-side rendering. This helps the server know which modules were imported/used during SSR.
|
||||
* ```ts
|
||||
* Loadable({
|
||||
* loader: () => import('./my-component'),
|
||||
* modules: ['./my-component'],
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
modules?: string[];
|
||||
|
||||
/**
|
||||
* An optional function which returns an array of Webpack module ids which you can get
|
||||
* with require.resolveWeak. This is used by the client (inside `Loadable.preloadReady`) to
|
||||
* guarantee each webpack module is preloaded before the first client render.
|
||||
* ```ts
|
||||
* Loadable({
|
||||
* loader: () => import('./Foo'),
|
||||
* webpack: () => [require.resolveWeak('./Foo')],
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
webpack?: () => number[];
|
||||
}
|
||||
|
||||
export interface OptionsWithoutRender<Props> extends CommonOptions {
|
||||
@@ -112,9 +137,47 @@ export interface LoadableComponent {
|
||||
preload(): void;
|
||||
}
|
||||
|
||||
export interface LoadableCaptureProps {
|
||||
/**
|
||||
* Function called for every moduleName that is rendered via React Loadable.
|
||||
*/
|
||||
report: (moduleName: string) => void;
|
||||
}
|
||||
|
||||
export interface Loadable {
|
||||
<Props, Exports extends object>(options: Options<Props, Exports>): React.ComponentType<Props> & LoadableComponent;
|
||||
Map<Props, Exports extends { [key: string]: any }>(options: OptionsWithMap<Props, Exports>): React.ComponentType<Props> & LoadableComponent;
|
||||
|
||||
/**
|
||||
* This will call all of the LoadableComponent.preload methods recursively until they are all
|
||||
* resolved. Allowing you to preload all of your dynamic modules in environments like the server.
|
||||
* ```ts
|
||||
* Loadable.preloadAll().then(() => {
|
||||
* app.listen(3000, () => {
|
||||
* console.log('Running on http://localhost:3000/');
|
||||
* });
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
preloadAll(): Promise<void>;
|
||||
|
||||
/**
|
||||
* Check for modules that are already loaded in the browser and call the matching
|
||||
* `LoadableComponent.preload` methods.
|
||||
* ```ts
|
||||
* window.main = () => {
|
||||
* Loadable.preloadReady().then(() => {
|
||||
* ReactDOM.hydrate(
|
||||
* <App/>,
|
||||
* document.getElementById('app'),
|
||||
* );
|
||||
* });
|
||||
* };
|
||||
* ```
|
||||
*/
|
||||
preloadReady(): Promise<void>;
|
||||
|
||||
Capture: React.ComponentType<LoadableCaptureProps>;
|
||||
}
|
||||
|
||||
declare const LoadableExport: Loadable;
|
||||
|
||||
Vendored
+5
-2
@@ -349,7 +349,8 @@ export interface NavigationDrawerScreenOptions extends NavigationScreenOptions {
|
||||
any
|
||||
> | null));
|
||||
drawerLabel?:
|
||||
React.ReactElement<any>
|
||||
string
|
||||
| React.ReactElement<any>
|
||||
| ((options: { tintColor: (string | null), focused: boolean }) => (React.ReactElement<
|
||||
any
|
||||
> | null));
|
||||
@@ -593,7 +594,9 @@ export interface TabViewConfig {
|
||||
}
|
||||
|
||||
// From navigators/TabNavigator.js
|
||||
export interface TabNavigatorConfig extends NavigationTabRouterConfig, TabViewConfig { }
|
||||
export interface TabNavigatorConfig extends NavigationTabRouterConfig, TabViewConfig {
|
||||
initialLayout?: { height: number, width: number };
|
||||
}
|
||||
|
||||
// From navigators/TabNavigator.js
|
||||
export function TabNavigator(
|
||||
|
||||
@@ -146,6 +146,11 @@ const tabNavigatorConfig: TabNavigatorConfig = {
|
||||
tabBarOptions: { activeBackgroundColor: "blue" },
|
||||
};
|
||||
|
||||
const tabNavigatorConfigWithInitialLayout: TabNavigatorConfig = {
|
||||
...tabNavigatorConfig,
|
||||
initialLayout: { height: 0, width: 100 },
|
||||
};
|
||||
|
||||
const BasicTabNavigator = TabNavigator(
|
||||
routeConfigMap,
|
||||
tabNavigatorConfig,
|
||||
|
||||
Vendored
+5
-5
@@ -120,28 +120,28 @@ export interface Connect {
|
||||
mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,
|
||||
mapDispatchToProps: null | undefined,
|
||||
mergeProps: null | undefined,
|
||||
options: Options<TStateProps, TOwnProps>
|
||||
options: Options<State, TStateProps, TOwnProps>
|
||||
): InferableComponentEnhancerWithProps<DispatchProp<any> & TStateProps, TOwnProps>;
|
||||
|
||||
<no_state = {}, TDispatchProps = {}, TOwnProps = {}>(
|
||||
<TStateProps = {}, TDispatchProps = {}, TOwnProps = {}>(
|
||||
mapStateToProps: null | undefined,
|
||||
mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,
|
||||
mergeProps: null | undefined,
|
||||
options: Options<no_state, TOwnProps>
|
||||
options: Options<{}, TStateProps, TOwnProps>
|
||||
): InferableComponentEnhancerWithProps<TDispatchProps, TOwnProps>;
|
||||
|
||||
<TStateProps = {}, TDispatchProps = {}, TOwnProps = {}, State = {}>(
|
||||
mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,
|
||||
mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,
|
||||
mergeProps: null | undefined,
|
||||
options: Options<TStateProps, TOwnProps>
|
||||
options: Options<State, TStateProps, TOwnProps>
|
||||
): InferableComponentEnhancerWithProps<TStateProps & TDispatchProps, TOwnProps>;
|
||||
|
||||
<TStateProps = {}, TDispatchProps = {}, TOwnProps = {}, TMergedProps = {}, State = {}>(
|
||||
mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>,
|
||||
mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>,
|
||||
mergeProps: MergeProps<TStateProps, TDispatchProps, TOwnProps, TMergedProps>,
|
||||
options: Options<TStateProps, TOwnProps, TMergedProps>
|
||||
options: Options<State, TStateProps, TOwnProps, TMergedProps>
|
||||
): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>;
|
||||
}
|
||||
|
||||
|
||||
@@ -247,22 +247,26 @@ namespace MapStateAndDispatchAndMerge {
|
||||
}
|
||||
|
||||
namespace MapStateAndOptions {
|
||||
interface State { state: string; }
|
||||
interface OwnProps { foo: string }
|
||||
interface StateProps { bar: number }
|
||||
interface DispatchProps { dispatch: Dispatch<any> }
|
||||
|
||||
class TestComponent extends Component<OwnProps & StateProps & DispatchProps> {}
|
||||
|
||||
const mapStateToProps = () => ({
|
||||
const mapStateToProps = (state: State) => ({
|
||||
bar: 1
|
||||
})
|
||||
|
||||
const Test = connect(
|
||||
const areStatePropsEqual = (next: StateProps, current: StateProps) => true;
|
||||
|
||||
const Test = connect<StateProps, DispatchProps, OwnProps, State>(
|
||||
mapStateToProps,
|
||||
null,
|
||||
null,
|
||||
{
|
||||
pure: true
|
||||
pure: true,
|
||||
areStatePropsEqual,
|
||||
}
|
||||
)(TestComponent)
|
||||
|
||||
|
||||
Vendored
+22
-19
@@ -1,39 +1,42 @@
|
||||
// Type definitions for react-swipeable 4.0
|
||||
// Type definitions for react-swipeable 4.2
|
||||
// Project: https://www.npmjs.com/package/react-swipeable
|
||||
// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>
|
||||
// Konstantin Vasilev <https://github.com/mctep>
|
||||
// Hiroki Horiuchi <https://github.com/horiuchi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import * as React from 'react';
|
||||
|
||||
declare class ReactSwipeable extends React.Component<ReactSwipeable.SwipeableProps> {}
|
||||
declare class ReactSwipeable<T extends Element = HTMLElement> extends React.Component<ReactSwipeable.SwipeableProps<T>> {}
|
||||
|
||||
declare namespace ReactSwipeable {
|
||||
type OnSwipingCallback = (event: React.TouchEvent<HTMLElement>, deltaX: number, deltaY: number, absX: number, absY: number, velocity: number) => void;
|
||||
type OnSwipedCallback = (event: React.TouchEvent<HTMLElement>, deltaX: number, deltaY: number, isFlick: boolean, velocity: number) => void;
|
||||
type OnSwipedDirectionCallback = (event: React.TouchEvent<HTMLElement>, delta: number, isFlick: boolean) => void;
|
||||
type OnSwipingDirectionCallback = (event: React.TouchEvent<HTMLElement>, delta: number) => void;
|
||||
type OnTapCallback = (event: React.TouchEvent<HTMLElement>) => void;
|
||||
type OnSwipingCallback<T extends Element = HTMLElement> = (event: React.TouchEvent<T>, deltaX: number, deltaY: number, absX: number, absY: number, velocity: number) => void;
|
||||
type OnSwipedCallback<T extends Element = HTMLElement> = (event: React.TouchEvent<T>, deltaX: number, deltaY: number, isFlick: boolean, velocity: number) => void;
|
||||
type OnSwipedDirectionCallback<T extends Element = HTMLElement> = (event: React.TouchEvent<T>, delta: number, isFlick: boolean) => void;
|
||||
type OnSwipingDirectionCallback<T extends Element = HTMLElement> = (event: React.TouchEvent<T>, delta: number) => void;
|
||||
type OnTapCallback<T extends Element = HTMLElement> = (event: React.TouchEvent<T>) => void;
|
||||
|
||||
interface SwipeableProps extends React.ClassAttributes<ReactSwipeable>, React.HTMLAttributes<HTMLElement> {
|
||||
onSwiped?: OnSwipedCallback;
|
||||
onSwiping?: OnSwipingCallback;
|
||||
onSwipingUp?: OnSwipingDirectionCallback;
|
||||
onSwipingRight?: OnSwipingDirectionCallback;
|
||||
onSwipingDown?: OnSwipingDirectionCallback;
|
||||
onSwipingLeft?: OnSwipingDirectionCallback;
|
||||
onSwipedUp?: OnSwipedDirectionCallback;
|
||||
onSwipedRight?: OnSwipedDirectionCallback;
|
||||
onSwipedDown?: OnSwipedDirectionCallback;
|
||||
onSwipedLeft?: OnSwipedDirectionCallback;
|
||||
onTap?: OnTapCallback;
|
||||
interface SwipeableProps<T extends Element = HTMLElement> extends React.ClassAttributes<ReactSwipeable<T>>, React.HTMLAttributes<T> {
|
||||
onSwiped?: OnSwipedCallback<T>;
|
||||
onSwiping?: OnSwipingCallback<T>;
|
||||
onSwipingUp?: OnSwipingDirectionCallback<T>;
|
||||
onSwipingRight?: OnSwipingDirectionCallback<T>;
|
||||
onSwipingDown?: OnSwipingDirectionCallback<T>;
|
||||
onSwipingLeft?: OnSwipingDirectionCallback<T>;
|
||||
onSwipedUp?: OnSwipedDirectionCallback<T>;
|
||||
onSwipedRight?: OnSwipedDirectionCallback<T>;
|
||||
onSwipedDown?: OnSwipedDirectionCallback<T>;
|
||||
onSwipedLeft?: OnSwipedDirectionCallback<T>;
|
||||
onTap?: OnTapCallback<T>;
|
||||
flickThreshold?: number;
|
||||
delta?: number;
|
||||
preventDefaultTouchmoveEvent?: boolean;
|
||||
stopPropagation?: boolean;
|
||||
nodeName?: string;
|
||||
trackMouse?: boolean;
|
||||
disabled?: boolean;
|
||||
innerRef?: React.Ref<T>;
|
||||
children?: React.ReactNode;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ class SampleComponent extends React.PureComponent<Swipeable.SwipeableProps> {
|
||||
stopPropagation
|
||||
nodeName="swipe"
|
||||
trackMouse
|
||||
disabled
|
||||
innerRef="swipe-ref"
|
||||
onClick={this.handleClick}
|
||||
>
|
||||
<div>
|
||||
@@ -44,3 +46,16 @@ class SampleComponent extends React.PureComponent<Swipeable.SwipeableProps> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class DivSwipeable extends Swipeable<HTMLDivElement> {}
|
||||
const TestComponent: React.StatelessComponent = (_) => {
|
||||
const handleSwiped = (event: React.TouchEvent<HTMLDivElement>) => {};
|
||||
return (
|
||||
<DivSwipeable
|
||||
nodeName="div"
|
||||
onSwiped={handleSwiped}
|
||||
>
|
||||
<div>this is sample code.</div>
|
||||
</DivSwipeable>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": false,
|
||||
"strictNullChecks": false,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
@@ -22,4 +22,4 @@
|
||||
"index.d.ts",
|
||||
"react-swipeable-tests.tsx"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// Type definitions for react-toastr 3.0
|
||||
// Project: https://github.com/tomchentw/react-toastr
|
||||
// Definitions by: Josh Holmer <https://github.com/shssoichiro>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { Component, ReactHTML } from 'react';
|
||||
|
||||
export class ToastContainer extends Component<{
|
||||
toastMessageFactory: any;
|
||||
className?: string;
|
||||
}> {
|
||||
error: (message: string, title: string, optionsOverride?: {}) => void;
|
||||
info: (message: string, title: string, optionsOverride?: {}) => void;
|
||||
success: (message: string, title: string, optionsOverride?: {}) => void;
|
||||
warning: (message: string, title: string, optionsOverride?: {}) => void;
|
||||
clear: () => void;
|
||||
}
|
||||
export const ToastMessageAnimated: keyof ReactHTML;
|
||||
export const ToastMessagejQuery: keyof ReactHTML;
|
||||
@@ -0,0 +1,22 @@
|
||||
import * as React from 'react';
|
||||
import { ToastContainer, ToastMessageAnimated } from 'react-toastr';
|
||||
|
||||
const toastMessageFactory = React.createFactory(ToastMessageAnimated);
|
||||
|
||||
class Test extends React.Component {
|
||||
ref: ToastContainer;
|
||||
|
||||
toastRef = (ref: ToastContainer) => {
|
||||
this.ref = ref;
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<ToastContainer
|
||||
ref={this.toastRef}
|
||||
toastMessageFactory={toastMessageFactory}
|
||||
className="toast-top-right"
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"jsx": "react"
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"react-toastr-tests.tsx"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
@@ -3,8 +3,6 @@
|
||||
// Definitions by: Remo H. Jansen <https://github.com/remojansen>, Ben Rogers <https://github.com/highflying>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="redux" />
|
||||
|
||||
import * as Redux from "redux";
|
||||
|
||||
type isImmutableDefault = (value: any) => boolean;
|
||||
|
||||
Vendored
+7
-3
@@ -1,10 +1,11 @@
|
||||
// Type definitions for stripe 4.8
|
||||
// Type definitions for stripe 4.9
|
||||
// Project: https://github.com/stripe/stripe-node/
|
||||
// Definitions by: William Johnston <https://github.com/wjohnsto>
|
||||
// Peter Harris <https://github.com/codeanimal>
|
||||
// Sampson Oliver <https://github.com/sampsonjoliver>
|
||||
// Linus Unnebäck <https://github.com/LinusU>
|
||||
// Brannon Jones <https://github.com/brannon>
|
||||
// Kyle Kamperschroer <https://github.com/kkamperschroer>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -735,7 +736,7 @@ declare namespace Stripe {
|
||||
* The application fee (if any) for the charge. See the Connect documentation
|
||||
* for details. [Expandable]
|
||||
*/
|
||||
application_fee?: string;
|
||||
application_fee?: string | applicationFees.IApplicationFee;
|
||||
|
||||
/**
|
||||
* ID of the balance transaction that describes the impact of this charge on
|
||||
@@ -4258,7 +4259,10 @@ declare namespace Stripe {
|
||||
*/
|
||||
current_period_start: number;
|
||||
|
||||
customer: string;
|
||||
/**
|
||||
* ID of the customer who owns the subscription. [Expandable]
|
||||
*/
|
||||
customer: string | customers.ICustomer;
|
||||
|
||||
/**
|
||||
* Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a
|
||||
|
||||
@@ -82,9 +82,15 @@ stripe.charges.create({
|
||||
|
||||
stripe.charges.retrieve("ch_15fvyXEe31JkLCeQOo0SwFk9", function (err, charge) {
|
||||
// asynchronously called
|
||||
if (typeof charge.application_fee === "object") {
|
||||
charge.application_fee.amount;
|
||||
}
|
||||
});
|
||||
stripe.charges.retrieve("ch_15fvyXEe31JkLCeQOo0SwFk9").then(function (charge) {
|
||||
// asynchronously called
|
||||
if (typeof charge.application_fee === "object") {
|
||||
charge.application_fee.amount;
|
||||
}
|
||||
});
|
||||
|
||||
stripe.charges.update(
|
||||
@@ -1083,9 +1089,15 @@ stripe.subscriptions.create({ plan: "platypi-dev", customer: "cus_5rfJKDJkuxzh5Q
|
||||
|
||||
stripe.subscriptions.retrieve("sub_8QwCiwZ9tmMSpt", function(err, subscription) {
|
||||
// asynchronously called
|
||||
if (typeof subscription.customer === "object") {
|
||||
subscription.customer.email;
|
||||
}
|
||||
});
|
||||
stripe.subscriptions.retrieve("sub_8QwCiwZ9tmMSpt").then(function(subscription) {
|
||||
// asynchronously called
|
||||
if (typeof subscription.customer === "object") {
|
||||
subscription.customer.email;
|
||||
}
|
||||
});
|
||||
|
||||
stripe.subscriptions.update("sub_8QwCiwZ9tmMSpt", { plan: "platypi" }, function(err, subscription) {
|
||||
|
||||
Vendored
+1
-1
@@ -826,7 +826,7 @@ export namespace dom {
|
||||
|
||||
parseStyle(cssText: string): {};
|
||||
|
||||
remove<T>(node: string, keepChildren?: boolean): Element | T[];
|
||||
remove<T>(node: string | Element, keepChildren?: boolean): Element | T[];
|
||||
|
||||
removeAllAttribs(e: Element): void;
|
||||
|
||||
|
||||
Vendored
+2732
-2063
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,7 @@
|
||||
"double"
|
||||
],
|
||||
"jsdoc-format": true,
|
||||
"no-unnecessary-generics": false
|
||||
"no-unnecessary-generics": false,
|
||||
"no-empty-interface": false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user