Merge branch 'reactstrap-exportProps' into upstream/master

# Conflicts:
#	types/reactstrap/index.d.ts
#	types/reactstrap/lib/Alert.d.ts
#	types/reactstrap/lib/Badge.d.ts
#	types/reactstrap/lib/Breadcrumb.d.ts
#	types/reactstrap/lib/BreadcrumbItem.d.ts
#	types/reactstrap/lib/Button.d.ts
#	types/reactstrap/lib/ButtonDropdown.d.ts
#	types/reactstrap/lib/ButtonGroup.d.ts
#	types/reactstrap/lib/ButtonToolbar.d.ts
#	types/reactstrap/lib/Card.d.ts
#	types/reactstrap/lib/CardBlock.d.ts
#	types/reactstrap/lib/CardBody.d.ts
#	types/reactstrap/lib/CardColumns.d.ts
#	types/reactstrap/lib/CardDeck.d.ts
#	types/reactstrap/lib/CardFooter.d.ts
#	types/reactstrap/lib/CardGroup.d.ts
#	types/reactstrap/lib/CardHeader.d.ts
#	types/reactstrap/lib/CardImg.d.ts
#	types/reactstrap/lib/CardImgOverlay.d.ts
#	types/reactstrap/lib/CardLink.d.ts
#	types/reactstrap/lib/CardSubtitle.d.ts
#	types/reactstrap/lib/CardText.d.ts
#	types/reactstrap/lib/CardTitle.d.ts
#	types/reactstrap/lib/Col.d.ts
#	types/reactstrap/lib/Collapse.d.ts
#	types/reactstrap/lib/Container.d.ts
#	types/reactstrap/lib/Dropdown.d.ts
#	types/reactstrap/lib/DropdownItem.d.ts
#	types/reactstrap/lib/DropdownMenu.d.ts
#	types/reactstrap/lib/DropdownToggle.d.ts
#	types/reactstrap/lib/Fade.d.ts
#	types/reactstrap/lib/Form.d.ts
#	types/reactstrap/lib/FormFeedback.d.ts
#	types/reactstrap/lib/FormGroup.d.ts
#	types/reactstrap/lib/FormText.d.ts
#	types/reactstrap/lib/Input.d.ts
#	types/reactstrap/lib/InputGroup.d.ts
#	types/reactstrap/lib/InputGroupAddon.d.ts
#	types/reactstrap/lib/InputGroupButton.d.ts
#	types/reactstrap/lib/Jumbotron.d.ts
#	types/reactstrap/lib/Label.d.ts
#	types/reactstrap/lib/ListGroup.d.ts
#	types/reactstrap/lib/ListGroupItem.d.ts
#	types/reactstrap/lib/ListGroupItemHeading.d.ts
#	types/reactstrap/lib/ListGroupItemText.d.ts
#	types/reactstrap/lib/Media.d.ts
#	types/reactstrap/lib/Modal.d.ts
#	types/reactstrap/lib/ModalBody.d.ts
#	types/reactstrap/lib/ModalFooter.d.ts
#	types/reactstrap/lib/ModalHeader.d.ts
#	types/reactstrap/lib/Nav.d.ts
#	types/reactstrap/lib/NavDropdown.d.ts
#	types/reactstrap/lib/NavItem.d.ts
#	types/reactstrap/lib/NavLink.d.ts
#	types/reactstrap/lib/Navbar.d.ts
#	types/reactstrap/lib/NavbarBrand.d.ts
#	types/reactstrap/lib/NavbarToggler.d.ts
#	types/reactstrap/lib/Pagination.d.ts
#	types/reactstrap/lib/PaginationItem.d.ts
#	types/reactstrap/lib/PaginationLink.d.ts
#	types/reactstrap/lib/Popover.d.ts
#	types/reactstrap/lib/PopoverContent.d.ts
#	types/reactstrap/lib/PopoverTitle.d.ts
#	types/reactstrap/lib/Progress.d.ts
#	types/reactstrap/lib/Row.d.ts
#	types/reactstrap/lib/TabContent.d.ts
#	types/reactstrap/lib/TabPane.d.ts
#	types/reactstrap/lib/Table.d.ts
#	types/reactstrap/lib/Tag.d.ts
#	types/reactstrap/lib/TetherContent.d.ts
#	types/reactstrap/lib/Tooltip.d.ts
This commit is contained in:
FaithForHumans
2017-11-10 19:20:55 -06:00
876 changed files with 29529 additions and 11788 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
language: node_js
node_js:
- node
- 8
sudo: false
+6
View File
@@ -330,6 +330,12 @@
"sourceRepoURL": "https://github.com/tdegrunt/jsonschema",
"asOfVersion": "1.1.1"
},
{
"libraryName": "jsplumb",
"typingsPackageName": "jsplumb",
"sourceRepoURL": "https://github.com/jsplumb/jsPlumb",
"asOfVersion": "2.5.7"
},
{
"libraryName": "knockout-paging",
"typingsPackageName": "knockout-paging",
+12 -17
View File
@@ -1,13 +1,13 @@
import acorn = require('acorn');
import * as ESTree from 'estree';
declare var token: acorn.Token;
declare var tokens: acorn.Token[];
declare var comment: acorn.Comment;
declare var comments: acorn.Comment[];
declare var program: ESTree.Program;
var any: any;
var string: string;
declare let token: acorn.Token;
declare let tokens: acorn.Token[];
declare let comment: acorn.Comment;
declare let comments: acorn.Comment[];
declare let program: ESTree.Program;
let any: any;
let string: string;
// acorn
string = acorn.version;
@@ -32,16 +32,12 @@ const parser = new acorn.Parser({}, 'export default ""', 0);
const node = new acorn.Node(parser, 1, 1);
class LooseParser {
constructor(input: string, options = {}) {
}
constructor(input: string, options = {}) {}
// this means you can extend LooseParser
test() {
}
test() {}
}
acorn.addLooseExports(function () {
acorn.addLooseExports(() => {
return {
type: 'Program',
sourceType: 'script',
@@ -50,7 +46,7 @@ acorn.addLooseExports(function () {
type: 'EmptyStatement'
}
]
}
};
}, LooseParser, {});
acorn.parseExpressionAt('string', 2);
@@ -63,8 +59,7 @@ acorn.isIdentifierChar(56);
acorn.getLineInfo('string', 56);
acorn.plugins['test'] = function (p: acorn.Parser, config: any) {
}
acorn.plugins['test'] = (p: acorn.Parser, config: any) => {};
acorn.tokenizer('console.log("hello world)', {locations: true}).getToken();
acorn.tokenizer('console.log("hello world)', {locations: true})[Symbol.iterator]().next();
+9 -14
View File
@@ -1,10 +1,8 @@
// Type definitions for Acorn v4.0.3
// Type definitions for Acorn 4.0
// Project: https://github.com/marijnh/acorn
// Definitions by: RReverser <https://github.com/RReverser>, e-cloud <https://github.com/e-cloud>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="estree" />
export as namespace acorn;
export = acorn;
import * as ESTree from 'estree';
@@ -181,7 +179,7 @@ declare namespace acorn {
_typeof: TokenType;
_void: TokenType;
_delete: TokenType;
}
};
class TokContext {
constructor(token: string, isExpr: boolean, preserveSpace: boolean, override: (p: Parser) => void);
@@ -230,19 +228,18 @@ declare namespace acorn {
const version: string;
interface IParse {
(input: string, options?: Options): ESTree.Program;
}
// TODO: rename type.
type IParse = (input: string, options?: Options) => ESTree.Program;
const parse: IParse;
function parseExpressionAt(input: string, pos?: number, options?: Options): ESTree.Expression;
interface ITokenizer {
getToken() : Token,
[Symbol.iterator](): Iterator<Token>
getToken(): Token;
[Symbol.iterator](): Iterator<Token>;
}
function tokenizer(input: string, options: Options): ITokenizer;
let parse_dammit: IParse | undefined;
@@ -250,12 +247,10 @@ declare namespace acorn {
let pluginsLoose: PluginsObject | undefined;
interface ILooseParserClass {
new (input: string, options?: Options): ILooseParser
new (input: string, options?: Options): ILooseParser;
}
interface ILooseParser {
}
interface ILooseParser {}
function addLooseExports(parse: IParse, parser: ILooseParserClass, plugins: PluginsObject): void;
}
+1 -71
View File
@@ -1,79 +1,9 @@
{
"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-unnecessary-class": false
}
}
-3
View File
@@ -731,9 +731,6 @@ declare namespace adone {
*/
creationData(): DatetimeCreationData;
/**
*
*/
parsingFlags(): DatetimeParsingFlags;
/**
+251 -7
View File
@@ -95,6 +95,18 @@ declare namespace algoliasearch {
* https://github.com/algolia/algoliasearch-client-js#keep-alive
*/
destroy(): void;
/**
* Add a header to be sent with all upcoming requests
*/
setExtraHeader(name: string, value: string): void;
/**
* Get the value of an extra header
*/
getExtraHeader(name: string): string;
/**
* remove an extra header for all upcoming requests
*/
unsetExtraHeader(name: string): void;
/**
* List all your indices along with their associated information (number of entries, disk size, etc.)
* @param cb(err, res)
@@ -533,6 +545,65 @@ declare namespace algoliasearch {
options: SearchSynonymOptions,
cb: (err: Error, res: any) => void
): void;
/**
* Save a rule object
* @param rule
* @param options
* @param cb(err, res)
* https://github.com/algolia/algoliasearch-client-js#save-rule---saverule
*/
saveRule(
rule: AlgoliaRule,
options: RuleOption,
cb: (err: Error, res: any) => void
): void;
/**
* Save a rule object
* @param rules
* @param options
* @param cb(err, res)
*/
batchRules(
rules: AlgoliaRule[],
options: RuleOption,
cb: (err: Error, res: any) => void
): void;
/**
* Delete a specific rule
* @param identifier
* @param options
* @param cb(err, res)
* https://github.com/algolia/algoliasearch-client-js#batch-rules---batchrules
*/
deleteRule(
identifier: string,
options: RuleOption,
cb: (err: Error, res: any) => void
): void;
/**
* Clear all rules of an index
* @param options
* @param cb(err, res)
* https://github.com/algolia/algoliasearch-client-js#clear-all-rules---clearrules
*/
clearRules(options: RuleOption, cb: (err: Error, res: any) => void): void;
/**
* Get a specific rule
* @param identifier
* @param cb(err, res)
* https://github.com/algolia/algoliasearch-client-js#get-rule---getrule
*/
getRule(identifier: string, cb: (err: Error, res: any) => void): void;
/**
* Search a rules
* @param options
* @param cb(err, res)
* https://github.com/algolia/algoliasearch-client-js#search-rules---searchrules
*/
searchRules(
options: SearchRuleOptions,
cb: (err: Error, res: any) => void
): void;
/**
* List index user keys
* @param cb(err, res)
@@ -846,6 +917,50 @@ declare namespace algoliasearch {
* https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms
*/
searchSynonyms(options: SearchSynonymOptions): Promise<any>;
/**
* Save a rule object
* @param rule
* @param options
* return {Promise}
* https://github.com/algolia/algoliasearch-client-js#save-rule---saverule
*/
saveRule(rule: AlgoliaRule, options: RuleOption): Promise<any>;
/**
* Save a rule object
* @param rules
* @param options
* return {Promise}
*/
batchRules(rules: AlgoliaRule[], options: RuleOption): Promise<any>;
/**
* Delete a specific rule
* @param identifier
* @param options
* return {Promise}
* https://github.com/algolia/algoliasearch-client-js#batch-rules---batchrules
*/
deleteRule(identifier: string, options: RuleOption): Promise<any>;
/**
* Clear all query rules of an index
* @param options
* return {Promise}
* https://github.com/algolia/algoliasearch-client-js#clear-all-rules---clearrules
*/
clearRules(options: RuleOption): Promise<any>;
/**
* Get a specific query rule
* @param identifier
* return {Promise}
* https://github.com/algolia/algoliasearch-client-js#get-rule---getrule
*/
getRule(identifier: string): Promise<any>;
/**
* Search for query rules
* @param options
* return {Promise}
* https://github.com/algolia/algoliasearch-client-js#search-rules---searchrules
*/
searchRules(options: SearchRuleOptions): Promise<any>;
/**
* List index user keys
* return {Promise}
@@ -1024,8 +1139,8 @@ Interface describing options available for gettings the logs
description?: string;
}
/**
* Describes option used when making operation on synonyms
*/
* Describes option used when making operation on synonyms
*/
interface SynonymOption {
/**
* You can forward all settings updates to the replicas of an index
@@ -1039,8 +1154,8 @@ Interface describing options available for gettings the logs
replaceExistingSynonyms?: boolean;
}
/**
* Describes options used when searching for synonyms
*/
* Describes options used when searching for synonyms
*/
interface SearchSynonymOptions {
/**
* The actual search query to find synonyms
@@ -1049,7 +1164,7 @@ Interface describing options available for gettings the logs
query?: string;
/**
* The page to fetch when browsing through several pages of results
* default: 100
* default: 0
* https://github.com/algolia/algoliasearch-client-js#search-synonyms---searchsynonyms
*/
page?: number;
@@ -1066,6 +1181,49 @@ Interface describing options available for gettings the logs
*/
hitsPerPage?: number;
}
/**
* Describes option used when making operation on query rules
*/
interface RuleOption {
/**
* You can forward all settings updates to the replicas of an index
* https://github.com/algolia/algoliasearch-client-js#replica-settings
*/
forwardToReplicas?: boolean;
/**
* Replace all existing query rules on the index with the content of the batch
*/
clearExistingRules?: boolean;
}
/**
* Describes options used when searching for query rules
*/
interface SearchRuleOptions {
/**
* The actual search query to find synonyms
*/
query?: string;
/**
* When specified, restricts matches to rules with a specific anchoring type.
* When omitted, all anchoring types may match.
*/
anchoring?: string;
/**
* When specified, restricts matches to contextual rules with a specific context (exact match).
* When omitted, any generic or contextual rule (with any context) may match.
*/
context?: string;
/**
* Requested page (zero-based)
* default: 0
*/
page?: number;
/**
* Number of hits per page
* default: 20
*/
hitsPerPage?: number;
}
interface AlgoliaBrowseResponse {
cursor?: string;
hits: any[];
@@ -1094,8 +1252,94 @@ Interface describing options available for gettings the logs
synonyms: string[];
}
/**
* Describes the options used when generating new api keys
*/
* Describes a query rule object
*/
interface AlgoliaRule {
/**
* ObjectID of the synonym
* https://github.com/algolia/algoliasearch-client-js#save-synonym---savesynonym
*/
objectID: string;
/**
* Condition of the rule
*/
condition: {
/**
* Query pattern
* syntax: https://www.algolia.com/doc/rest-api/query-rules/?language=php#query-pattern-syntax
*/
pattern: string;
/**
* Whether the pattern must match the beginning or the end of the query string, or both, or none.
*/
anchoring: 'is' | 'startsWith' | 'endsWith' | 'contains';
/**
* Rule context (format: [A-Za-z0-9_-]+).
* When specified, the rule is contextual and applies only when the same context is specified
* at query time (using the ruleContexts parameter).
* When absent, the rule is generic and always applies
* (provided that its other conditions are met, of course).
*/
context?: string;
};
/**
* Consequence of the rule. At least one of the following must be used:
*/
consequence: {
params?: {
/**
* When a string, it replaces the entire query string.
* When an object, describes incremental edits to be made to the query string.
*/
query?:
| string
| {
/**
* Tokens (literals or placeholders) from the query pattern
* that should be removed from the query string.
*/
remove: string[];
};
/**
* Names of facets to which automatic filtering must be applied;
* they must match the facet name of a facet value placeholder in the query pattern.
*/
automaticFacetFilters?: string[];
/**
* Same as automaticFacetFilters, but for optionalFacetFilters.
* The same syntax as query parameters can be used to specify a score: facetName<score=1>.
*/
automaticOptionalFacetFilters?: string[];
};
/**
* Objects to promote as hits. Each object must contain the following fields
*/
promote?: {
/**
* Unique identifier of the object to promote
*/
objectID: string;
/**
* Promoted rank for the object (zero-based)
*/
position: number;
}[];
/**
* Custom JSON object that will be appended to the userData array in the response.
* This object is not interpreted by the API. It is limited to 1kB of minified JSON.
*/
userData?: {};
};
/**
* This field is intended for rule management purposes,
* in particular to ease searching for rules and presenting them to human readers.
* It is not interpreted by the API.
*/
description?: string;
}
/**
* Describes the options used when generating new api keys
*/
interface AlgoliaSecuredApiOptions {
/**
* Filter the query with numeric, facet or/and tag filters
+15 -22
View File
@@ -1,23 +1,16 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"algoliasearch-tests.ts"
]
}
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": ["../"],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": ["index.d.ts", "algoliasearch-tests.ts"]
}
+77 -77
View File
@@ -1,79 +1,79 @@
{
"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
}
"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
}
}
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: http://angularjs.org
// Definitions by: Michel Salib <https://github.com/michelsalib>, Adi Dahiya <https://github.com/adidahiya>, Raphael Schweizer <https://github.com/rasch>, Cody Schaaf <https://github.com/codyschaaf>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
// TypeScript Version: 2.3
declare var _: string;
export = _;
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/nervgh/angular-file-upload
// Definitions by: Cyril Gandon <https://github.com/cyrilgandon>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
// TypeScript Version: 2.3
import * as angular from 'angular';
+6 -2
View File
@@ -45,9 +45,9 @@ function withContainerAsString() {
});
}
// With container as jQuery element
// With container as jQuery/JQLite element
function withContainerAsJquery() {
var container: JQuery = $('body');
var container: JQuery = angular.element('body');
btfModal({
template: '<div></div>',
container: container
@@ -94,6 +94,10 @@ function callingValues() {
template: '<div></div>'
});
modal.activate().then(() => {}, () => {});
// activating with random locals
modal.activate({name: 'TestName'}).then(() => {}, () => {});
// activating with genericly typed locals
modal.activate<{name: string}>({name: 'TestName'}).then(() => {}, () => {});
modal.deactivate().then(() => {}, () => {});
var isActive: boolean = modal.active();
}
+2 -2
View File
@@ -5,7 +5,6 @@
// TypeScript Version: 2.3
/// <reference types="angular" />
/// <reference types="jquery" />
declare namespace angularModal {
@@ -28,7 +27,8 @@ declare namespace angularModal {
}
export interface AngularModal {
activate(): angular.IPromise<void>;
activate(locals?: {}): angular.IPromise<void>;
activate<T>(locals: T): angular.IPromise<void>;
deactivate(): angular.IPromise<void>;
active(): boolean;
}
+4 -1
View File
@@ -6,10 +6,13 @@
/// <reference types="angular" />
declare var _: string;
export = _;
import * as angular from 'angular';
declare module 'angular' {
export namespace a0.storage {
namespace a0.storage {
interface IStoreService extends INamespacedStoreService {
/**
* Returns a namespaced store
+1
View File
@@ -2,6 +2,7 @@
// Project: http://720kb.github.io/angular-tooltips
// Definitions by: Leonard Thieu <https://github.com/leonard-thieu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
declare const AngularTooltips: '720kb.tooltips';
export = AngularTooltips;
+50 -6
View File
@@ -707,7 +707,7 @@ class SampleDirective implements ng.IDirective {
restrict = 'A';
name = 'doh';
compile(templateElement: ng.IAugmentedJQuery) {
compile(templateElement: JQLite) {
return {
post: this.link
};
@@ -723,7 +723,7 @@ class SampleDirective implements ng.IDirective {
class SampleDirective2 implements ng.IDirective {
restrict = 'EAC';
compile(templateElement: ng.IAugmentedJQuery) {
compile(templateElement: JQLite) {
return {
pre: this.link
};
@@ -741,7 +741,7 @@ angular.module('SameplDirective', []).directive('sampleDirective', SampleDirecti
angular.module('AnotherSampleDirective', []).directive('myDirective', ['$interpolate', '$q', ($interpolate: ng.IInterpolateService, $q: ng.IQService) => {
return {
restrict: 'A',
link: (scope: ng.IScope, el: ng.IAugmentedJQuery, attr: ng.IAttributes) => {
link: (scope: ng.IScope, el: JQLite, attr: ng.IAttributes) => {
$interpolate(attr['test'])(scope);
$interpolate('', true)(scope);
$interpolate('', true, 'html')(scope);
@@ -869,7 +869,7 @@ angular.module('docsTimeDirective', [])
}])
.directive('myCurrentTime', ['$interval', 'dateFilter', ($interval: any, dateFilter: any) => {
return {
link(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes) {
link(scope: ng.IScope, element: JQLite, attrs: ng.IAttributes) {
let format: any;
let timeoutId: any;
@@ -916,7 +916,7 @@ angular.module('docsTransclusionExample', [])
transclude: true,
scope: {},
templateUrl: 'my-dialog.html',
link(scope: ng.IScope, element: ng.IAugmentedJQuery) {
link(scope: ng.IScope, element: JQLite) {
scope['name'] = 'Jeff';
}
};
@@ -1017,7 +1017,7 @@ angular.module('docsTabsExample', [])
scope: {
title: '@'
},
link(scope: ng.IScope, element: ng.IAugmentedJQuery, attrs: ng.IAttributes, tabsCtrl: any) {
link(scope: ng.IScope, element: JQLite, attrs: ng.IAttributes, tabsCtrl: any) {
tabsCtrl.addPane(scope);
},
templateUrl: 'my-pane.html'
@@ -1098,6 +1098,18 @@ angular.module('copyExample', [])
$scope.reset();
}]);
// Extending IScope for a directive, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/21160
interface IMyScope extends angular.IScope {
myScopeProperty: boolean;
}
angular.module('aaa').directive('directive', () => ({
link(scope: IMyScope) {
console.log(scope.myScopeProperty);
return;
}
}));
namespace locationTests {
const $location: ng.ILocationService = null;
@@ -1312,3 +1324,35 @@ function toPromise<T>(val: T): ng.IPromise<T> {
const p: ng.IPromise<T> = null;
return p;
}
const directiveCompileFn: ng.IDirectiveCompileFn = (
templateElement: JQLite,
templateAttributes: ng.IAttributes,
transclude: ng.ITranscludeFunction
): ng.IDirectiveLinkFn => {
return (
scope: ng.IScope,
instanceElement: JQLite,
instanceAttributes: ng.IAttributes
) => {
return null;
};
};
interface MyScope extends ng.IScope {
foo: string;
}
const directiveCompileFnWithGeneric: ng.IDirectiveCompileFn<MyScope> = (
templateElement: JQLite,
templateAttributes: ng.IAttributes,
transclude: ng.ITranscludeFunction
): ng.IDirectiveLinkFn<MyScope> => {
return (
scope: MyScope,
instanceElement: JQLite,
instanceAttributes: ng.IAttributes
) => {
return null;
};
};
+28 -22
View File
@@ -9,9 +9,6 @@
/// <reference path="jqlite.d.ts" />
// NOTE: @types/angular technically doesn't require TypeScript 2.3, only TypeScript 2.1.
// It has a TypeScript 2.3 header so that merging tests with @types/jquery v3 will work.
declare var angular: angular.IAngularStatic;
// Support for painless dependency injection
@@ -232,8 +229,8 @@ declare namespace angular {
* @param name Name of the directive in camel-case (i.e. ngBind which will match as ng-bind)
* @param directiveFactory An injectable directive factory function.
*/
directive(name: string, directiveFactory: Injectable<IDirectiveFactory>): IModule;
directive(object: {[directiveName: string]: Injectable<IDirectiveFactory>}): IModule;
directive<TScope extends IScope = IScope>(name: string, directiveFactory: Injectable<IDirectiveFactory<TScope>>): IModule;
directive<TScope extends IScope = IScope>(object: {[directiveName: string]: Injectable<IDirectiveFactory<TScope>>}): IModule;
/**
* Register a service factory, which will be called to return the service instance. This is short for registering a service where its provider consists of only a $get property, which is the given service factory function. You should use $provide.factory(getFn) if you do not need to configure your service in a provider.
*
@@ -1252,8 +1249,8 @@ declare namespace angular {
}
interface ICompileProvider extends IServiceProvider {
directive(name: string, directiveFactory: Injectable<IDirectiveFactory>): ICompileProvider;
directive(object: {[directiveName: string]: Injectable<IDirectiveFactory>}): ICompileProvider;
directive<TScope extends IScope = IScope>(name: string, directiveFactory: Injectable<IDirectiveFactory<TScope>>): ICompileProvider;
directive<TScope extends IScope = IScope>(object: {[directiveName: string]: Injectable<IDirectiveFactory<TScope>>}): ICompileProvider;
component(name: string, options: IComponentOptions): ICompileProvider;
@@ -1302,6 +1299,17 @@ declare namespace angular {
*/
cssClassDirectivesEnabled(): boolean;
cssClassDirectivesEnabled(enabled: boolean): ICompileProvider;
/**
* Call this method to enable/disable strict component bindings check.
* If enabled, the compiler will enforce that for all bindings of a
* component that are not set as optional with ?, an attribute needs
* to be provided on the component's HTML tag.
* Defaults to false.
* See: https://docs.angularjs.org/api/ng/provider/$compileProvider#strictComponentBindingsEnabled
*/
strictComponentBindingsEnabled(): boolean;
strictComponentBindingsEnabled(enabled: boolean): ICompileProvider;
}
interface ICloneAttachFunction {
@@ -1961,13 +1969,13 @@ declare namespace angular {
// and http://docs.angularjs.org/guide/directive
///////////////////////////////////////////////////////////////////////////
interface IDirectiveFactory {
(...args: any[]): IDirective | IDirectiveLinkFn;
interface IDirectiveFactory<TScope extends IScope = IScope> {
(...args: any[]): IDirective<TScope> | IDirectiveLinkFn<TScope>;
}
interface IDirectiveLinkFn {
interface IDirectiveLinkFn<TScope extends IScope = IScope> {
(
scope: IScope,
scope: TScope,
instanceElement: JQLite,
instanceAttributes: IAttributes,
controller?: IController | IController[] | {[key: string]: IController},
@@ -1975,12 +1983,12 @@ declare namespace angular {
): void;
}
interface IDirectivePrePost {
pre?: IDirectiveLinkFn;
post?: IDirectiveLinkFn;
interface IDirectivePrePost<TScope extends IScope = IScope> {
pre?: IDirectiveLinkFn<TScope>;
post?: IDirectiveLinkFn<TScope>;
}
interface IDirectiveCompileFn {
interface IDirectiveCompileFn<TScope extends IScope = IScope> {
(
templateElement: JQLite,
templateAttributes: IAttributes,
@@ -1991,11 +1999,11 @@ declare namespace angular {
* that is passed to the link function instead.
*/
transclude: ITranscludeFunction
): void | IDirectiveLinkFn | IDirectivePrePost;
): void | IDirectiveLinkFn<TScope> | IDirectivePrePost<TScope>;
}
interface IDirective {
compile?: IDirectiveCompileFn;
interface IDirective<TScope extends IScope = IScope> {
compile?: IDirectiveCompileFn<TScope>;
controller?: string | Injectable<IControllerConstructor>;
controllerAs?: string;
/**
@@ -2004,7 +2012,7 @@ declare namespace angular {
* relies upon bindings inside a $onInit method on the controller, instead.
*/
bindToController?: boolean | {[boundProperty: string]: string};
link?: IDirectiveLinkFn | IDirectivePrePost;
link?: IDirectiveLinkFn<TScope> | IDirectivePrePost<TScope>;
multiElement?: boolean;
priority?: number;
/**
@@ -2077,9 +2085,7 @@ declare namespace angular {
get<T>(name: '$xhrFactory'): IXhrFactory<T>;
has(name: string): boolean;
instantiate<T>(typeConstructor: {new(...args: any[]): T}, locals?: any): T;
invoke(inlineAnnotatedFunction: any[], context?: any, locals?: any): any;
invoke<T>(func: (...args: any[]) => T, context?: any, locals?: any): T;
invoke(func: Function, context?: any, locals?: any): any;
invoke<T = any>(func: Injectable<Function | ((...args: any[]) => T)>, context?: any, locals?: any): T;
strictDi: boolean;
}
+2 -2
View File
@@ -16,7 +16,7 @@
"noImplicitAny": false,
"noImplicitThis": false,
"strictNullChecks": false,
"strictFunctionTypes": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
@@ -25,4 +25,4 @@
"noEmit": true,
"forceConsistentCasingInFileNames": true
}
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
import * as angular from 'angular';
import { angulartics } from 'angulartics';
import * as angulartics from 'angulartics';
namespace Analytics {
angular.module("angulartics.app", ["angulartics"])
+39 -11
View File
@@ -1,11 +1,13 @@
// Type definitions for Angulartics 1.3
// Type definitions for Angulartics 1.4
// Project: http://luisfarzati.github.io/angulartics/
// Definitions by: Steven Fan <https://github.com/stevenfan>
// Definitions by: Bateast2 <https://github.com/bateast2>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import * as angular from 'angular';
export = angulartics;//AMD/Require module support
export as namespace angulartics;//UMD module support
declare namespace angulartics {
interface IAngularticsStatic {
@@ -13,41 +15,67 @@ declare namespace angulartics {
}
interface IAnalyticsService {
eventTrack(eventName: string, properties?: any): any;
getOptOut(): boolean;
pageTrack(path: string, location?: angular.ILocationService): any;
eventTrack(eventName: string, properties?: any): any;
exceptionTrack(error: any, cause: string): any;
transactionTrack: any;
setAlias(alias: string): any;
setOptOut(value: boolean): void;
setUsername(username: string): any;
setUserProperties(properties: any): any;
setSuperProperties(properties: any): any;
setUserProperties(userProperties: any): any;
setUserPropertiesOnce(userProperties: any): any;
setSuperProperties(superProperties: any): any;
setSuperPropertiesOnce(superProperties: any): any;
incrementProperty(property: string, value?: any): any;
userTimings(properties: any): any;
clearCookies: any;
getOptOut(): boolean;
setOptOut(value: boolean): void;
}
interface IAnalyticsServiceProvider extends angular.IServiceProvider {
virtualPageviews(value: boolean): void;
trackStates(value: boolean): void;
trackRoutes(value: boolean): void;
excludeRoutes(value: string[]): void;
queryKeysWhitelist(keys: string[]): void
queryKeysBlacklist(keys: string[]): void
firstPageview(value: boolean): void;
withBase(value: boolean): void;
withAutoBase(value: boolean): void;
developerMode(value: boolean): void;
trackExceptions(value: boolean): void;
trackRoutes(value: boolean): void;
trackStates(value: boolean): void;
developerMode(value: boolean): void;
registerPageTrack(callback: (path: string, location?: angular.ILocationService) => any): void;
registerEventTrack(callback: (eventName: string, properties?: any) => any): void;
registerTransactionTrack(callback: any): void;
registerSetAlias(callback: (alias: string) => any): void;
registerSetUsername(callback: (username: string) => any): void;
registerSetUserProperties(callback: (userProperties: any) => any): void;
registerSetUserPropertiesOnce(callback: (userProperties: any) => any): void;
registerSetSuperProperties(callback: (superProperties: any) => any): void;
registerSetSuperPropertiesOnce(callback: (superProperties: any) => any): void;
registerIncrementProperty(callback: (property: string, value?: any) => any): void;
registerUserTimings(callback: (properties: any) => any): void;
registerClearCookies(callback: any): void;
settings: {
pageTracking: {
autoTrackingVirtualPages: boolean,
autoTrackingFirstPage: boolean,
trackRelativePath: boolean,
trackRoutes: boolean,
trackStates: boolean,
autoBasePath: boolean,
basePath: string,
autoBasePath: boolean
excludedRoutes: string[],
queryKeysWhitelisted: string[],
queryKeysBlacklisted: string[]
},
eventTracking: {},
bufferFlushDelay: number,
trackExceptions: boolean,
optOut: boolean,
developerMode: boolean
};
}
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/apex/node-apex
// Definitions by: Yoriki Yamaguchi <https://github.com/y13i>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="aws-lambda" />
@@ -1,4 +1,3 @@
import * as errorHandler from 'api-error-handler';
import * as express from 'express';
+1 -3
View File
@@ -2,9 +2,7 @@
// Project: https://github.com/expressjs/api-error-handler
// Definitions by: Tanguy Krotoff <https://github.com/tkrotoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import * as express from 'express';
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/Esri/arcgis-to-geojson-utils
// Definitions by: Jeff Jacobson <https://github.com/JeffJacobson>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="geojson" />
+67
View File
@@ -0,0 +1,67 @@
import * as args from "args";
args
.option("opt1", "desc")
.option("opt2", "desc", false, (value: any): any => value)
.options([
{
name: 'opt3',
description: 'desc',
defaultValue: 1,
init: (value: any) => { },
},
{
name: 'opt4',
description: 'desc',
},
])
.command("cm1", "desc")
.command("cm2", "desc", (value: any): void => { }, ['a'])
.example("ex1", "desc")
.examples([
{
usage: "ex2",
description: "desc",
},
]);
args.parse(['~/bin/node', '~/dir', 'arg', '--param'], {
help: true,
name: "name",
version: true,
usageFilter: (a: any): any => a,
value: "value",
mri: {
args: ['a'],
alias: {
a: "b",
c: ['d'],
},
boolean: ['wat'],
default: {
foo: 'bar',
},
string: ['zulu'],
unknown: (param: string): boolean => true,
},
minimist: {
string: ['string'],
boolean: ['string'],
alias: {
bar: 'foo',
foo: ['bar1', 'bar2'],
},
default: {
foo: 'bar',
},
stopEarly: true,
"--": false,
unknown: (param: string): boolean => true,
},
mainColor: "yellow",
subColor: "dim"
});
args.showHelp();
const x: string = args.sub[0];
+72
View File
@@ -0,0 +1,72 @@
// Type definitions for args 3.0
// Project: https://github.com/leo/args#readme
// Definitions by: Slessi <https://github.com/Slessi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare const c: args;
export = c;
interface args {
sub: string[];
option(name: string | [string, string], description: string, defaultValue?: any, init?: OptionInitFunction): args;
options(list: Option[]): args;
command(name: string, description: string, init?: (name: string, sub: string[], options: ConfigurationOptions) => void, aliases?: string[]): args;
example(usage: string, description: string): args;
examples(list: Example[]): args;
parse(argv: string[], options?: ConfigurationOptions): { [key: string]: any };
showHelp(): void;
}
type OptionInitFunction = (value: any) => any;
interface MriOptions {
args?: string[];
alias?: {
[key: string]: string | string[]
};
boolean?: string | string[];
default?: {
[key: string]: any
};
string?: string | string[];
unknown?: (param: string) => boolean;
}
interface MinimistOptions {
string?: string | string[];
boolean?: boolean | string | string[];
alias?: {
[key: string]: string | string[]
};
default?: {
[key: string]: any
};
stopEarly?: boolean;
"--"?: boolean;
unknown?: (param: string) => boolean;
}
interface ConfigurationOptions {
help?: boolean;
name?: string;
version?: boolean;
usageFilter?: (output: any) => any;
value?: string;
mri: MriOptions;
minimist?: MinimistOptions;
mainColor: string | string[];
subColor: string | string[];
}
interface Option {
name: string | [string, string];
description: string;
init?: OptionInitFunction;
defaultValue?: any;
}
interface Example {
usage: string;
description: string;
}
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"args-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/shoreditch-ops/artillery#readme
// Definitions by: Kira McCoan <https://github.com/kmccoan-allocadia>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
// TypeScript Version: 2.3
import * as request from 'request';
import * as events from 'events';
+3 -2
View File
@@ -15,6 +15,7 @@ export interface AsyncResultArrayCallback<T, E> { (err?: E, results?: (T | undef
export interface AsyncResultObjectCallback<T, E> { (err: E | undefined, results: Dictionary<T | undefined>): void; }
export interface AsyncFunction<T, E> { (callback: (err?: E, result?: T) => void): void; }
export interface AsyncFunctionEx<T, E> { (callback: (err?: E, ...results: T[]) => void): void; }
export interface AsyncIterator<T, E> { (item: T, callback: ErrorCallback<E>): void; }
export interface AsyncForEachOfIterator<T, E> { (item: T, key: number|string, callback: ErrorCallback<E>): void; }
export interface AsyncResultIterator<T, R, E> { (item: T, callback: AsyncResultCallback<R, E>): void; }
@@ -174,9 +175,9 @@ export function parallel<T, E>(tasks: Dictionary<AsyncFunction<T, E>>, callback?
export function parallelLimit<T, E>(tasks: Array<AsyncFunction<T, E>>, limit: number, callback?: AsyncResultArrayCallback<T, E>): void;
export function parallelLimit<T, E>(tasks: Dictionary<AsyncFunction<T, E>>, limit: number, callback?: AsyncResultObjectCallback<T, E>): void;
export function whilst<E>(test: () => boolean, fn: AsyncVoidFunction<E>, callback: ErrorCallback<E>): void;
export function doWhilst<E>(fn: AsyncVoidFunction<E>, test: () => boolean, callback: ErrorCallback<E>): void;
export function doWhilst<T, E>(fn: AsyncFunctionEx<T, E>, test: (...results: T[]) => boolean, callback: ErrorCallback<E>): void;
export function until<E>(test: () => boolean, fn: AsyncVoidFunction<E>, callback: ErrorCallback<E>): void;
export function doUntil<E>(fn: AsyncVoidFunction<E>, test: () => boolean, callback: ErrorCallback<E>): void;
export function doUntil<T, E>(fn: AsyncFunctionEx<T, E>, test: (...results: T[]) => boolean, callback: ErrorCallback<E>): void;
export function during<E>(test: (testCallback : AsyncBooleanResultCallback<E>) => void, fn: AsyncVoidFunction<E>, callback: ErrorCallback<E>): void;
export function doDuring<E>(fn: AsyncVoidFunction<E>, test: (testCallback: AsyncBooleanResultCallback<E>) => void, callback: ErrorCallback<E>): void;
export function forever<E>(next: (next : ErrorCallback<E>) => void, errBack: ErrorCallback<E>) : void;
+4 -4
View File
@@ -47,13 +47,13 @@ interface NumberCallback { (err?: Error, result?: number): void; }
interface AsyncNumberGetter { (callback: NumberCallback): void; }
var taskDict: Lookup<AsyncNumberGetter> = {
one: function(callback){
setTimeout(function(){
one: function(callback) {
setTimeout(function() {
callback(undefined, 1);
}, 200);
},
two: function(callback){
setTimeout(function(){
two: function(callback) {
setTimeout(function() {
callback(undefined, 2);
}, 100);
}
+4 -4
View File
@@ -239,16 +239,16 @@ async.parallelLimit({
function whileFn(callback: any) {
count++;
setTimeout(callback, 1000);
setTimeout(() => callback(null, ++count), 1000);
}
function whileTest() { return count < 5; }
function doWhileTest(count: number) { return count < 5; }
var count = 0;
async.whilst(whileTest, whileFn, function (err) { });
async.until(whileTest, whileFn, function (err) { });
async.doWhilst(whileFn, whileTest, function (err) { });
async.doUntil(whileFn, whileTest, function (err) { });
async.doWhilst(whileFn, doWhileTest, function (err) { });
async.doUntil(whileFn, doWhileTest, function (err) { });
async.during(function (testCallback) { testCallback(new Error(), false); }, function (callback) { callback() }, function (error) { console.log(error) });
async.doDuring(function (callback) { callback() }, function (testCallback) { testCallback(new Error(), false); }, function (error) { console.log(error) });
+135
View File
@@ -0,0 +1,135 @@
import { ArrayIterator, AsyncIterator, BufferedIterator, ClonedIterator, EmptyIterator, IntegerIterator,
MultiTransformIterator, SingletonIterator, SimpleTransformIterator, TransformIterator } from "asynciterator";
function test_asynciterator() {
// We can't instantiate an abstract class.
const it1: AsyncIterator<number> = <any> {};
const read1: number = it1.read();
it1.each((data: number) => console.log(data));
it1.each((data: number) => console.log(data), {});
it1.close();
const it2: AsyncIterator<string> = <any> {};
const read2: string = it2.read();
it2.each((data: string) => console.log(data));
it2.each((data: string) => console.log(data), {});
it2.close();
const it3: AsyncIterator<AsyncIterator<string>> = <any> {};
const read3: AsyncIterator<string> = it3.read();
it3.each((data: AsyncIterator<string>) => data.each((data: string) => console.log(data)));
it3.each((data: AsyncIterator<string>) => data.each((data: string) => console.log(data), {}), {});
it3.close();
const readable2: boolean = it1.readable;
const closed2: boolean = it1.closed;
const ended2: boolean = it1.ended;
it1.setProperty('name1', 123);
it2.setProperty('name2', 'someValue');
const p1: number = it1.getProperty('name1');
const p2: string = it1.getProperty('name2');
it1.getProperty('name1', (value: number) => console.log(value));
it1.getProperty('name2', (value: string) => console.log(value));
const ps1: {[id: string]: any} = it1.getProperties();
it1.setProperties({ name1: 1234, name2: 'someOtherValue' });
it1.copyProperties(it2, [ 'name1', 'name2' ]);
const str: string = it1.toString();
const stit1: SimpleTransformIterator<number, string> = it1.transform();
const stit2: SimpleTransformIterator<number, string> = it1.map((number: number) => 'i' + number);
const stit3: AsyncIterator<string> = it1.map((number: number) => 'i' + number);
const stit4: AsyncIterator<number> = it2.map(parseInt);
const stit5: AsyncIterator<number> = it1.map((number: number) => number + 1);
const stit6: AsyncIterator<number> = it1.filter((number: number) => number < 10);
const stit7: AsyncIterator<number> = it1.prepend([0, 1, 2]);
const stit8: AsyncIterator<number> = it1.append([0, 1, 2]);
const stit9: AsyncIterator<number> = it1.surround([0, 1, 2], [0, 1, 2]);
const stit10: AsyncIterator<number> = it1.skip(2);
const stit11: AsyncIterator<number> = it1.take(2);
const stit12: AsyncIterator<number> = it1.range(2, 20);
const stit13: AsyncIterator<number> = it1.clone();
const intit1: IntegerIterator = AsyncIterator.range(10, 100, 1);
const intit2: IntegerIterator = AsyncIterator.range(10, 100);
const intit3: IntegerIterator = AsyncIterator.range(10);
const intit4: IntegerIterator = AsyncIterator.range();
}
function test_emptyiterator() {
const it1: AsyncIterator<number> = new EmptyIterator();
const it2: AsyncIterator<string> = new EmptyIterator();
}
function test_singletoniterator() {
const it1: AsyncIterator<number> = new SingletonIterator(3);
const it2: AsyncIterator<string> = new SingletonIterator('a');
}
function test_arrayiterator() {
const it1: AsyncIterator<number> = new ArrayIterator([1, 2, 3]);
const it2: AsyncIterator<string> = new ArrayIterator(['a', 'b', 'c']);
}
function test_integeriterator() {
const it1: IntegerIterator = new IntegerIterator();
const it2: AsyncIterator<number> = new IntegerIterator({});
const it3: AsyncIterator<number> = new IntegerIterator({ start: 0 });
const it4: AsyncIterator<number> = new IntegerIterator({ end: 100 });
const it5: AsyncIterator<number> = new IntegerIterator({ step: 10 });
}
function test_bufferediterator() {
const it1: BufferedIterator<number> = new BufferedIterator();
const it2: AsyncIterator<number> = new BufferedIterator({});
const it3: AsyncIterator<number> = new BufferedIterator({ maxBufferSize: 10 });
const it4: AsyncIterator<number> = new BufferedIterator({ autoStart: true });
}
function test_transformiterator() {
const it1: TransformIterator<number, string> = new TransformIterator<number, string>();
const it2: AsyncIterator<string> = new TransformIterator<number, string>();
const it3: AsyncIterator<number> = new TransformIterator<string, number>(it1);
const it4: AsyncIterator<number> = new TransformIterator<string, number>(it1, {});
const it5: AsyncIterator<number> = new TransformIterator<string, number>(it1, { optional: true });
const it6: AsyncIterator<number> = new TransformIterator<string, number>({ source: it1 });
const source: AsyncIterator<number> = it1.source;
}
function test_simpletransformiterator() {
const it1: SimpleTransformIterator<number, string> = new SimpleTransformIterator<number, string>();
const it2: TransformIterator<number, string> = new SimpleTransformIterator<number, string>();
const it3: AsyncIterator<string> = new SimpleTransformIterator<number, string>();
const it4: AsyncIterator<number> = new SimpleTransformIterator<string, number>(it1);
const it5: AsyncIterator<number> = new SimpleTransformIterator<string, number>(it1, {});
const it6: AsyncIterator<number> = new SimpleTransformIterator<string, number>({});
const it7: AsyncIterator<number> = new SimpleTransformIterator<string, number>({ optional: true });
const it8: AsyncIterator<number> = new SimpleTransformIterator<string, number>({ source: it1 });
const it9: AsyncIterator<number> = new SimpleTransformIterator<string, number>({ offset: 2 });
const it10: AsyncIterator<number> = new SimpleTransformIterator<string, number>({ limit: 2 });
const it11: AsyncIterator<number> = new SimpleTransformIterator<string, number>({ prepend: [0, 1, 2] });
const it12: AsyncIterator<number> = new SimpleTransformIterator<string, number>({ append: [0, 1, 2] });
const it13: AsyncIterator<number> = new SimpleTransformIterator<number, number>(
{ filter: (val: number) => val > 10 });
const it14: AsyncIterator<number> = new SimpleTransformIterator<number, number>({ map: (val: number) => val + 1 });
const it15: AsyncIterator<number> = new SimpleTransformIterator<number, number>(
{ transform: (val: number, cb: (result: number) => void) => cb(val + 1) });
}
function test_multitransformiterator() {
const it1: MultiTransformIterator<number, string> = new MultiTransformIterator<number, string>();
const it2: TransformIterator<number, string> = new MultiTransformIterator<number, string>();
const it3: AsyncIterator<string> = new MultiTransformIterator<number, string>();
const it4: AsyncIterator<number> = new MultiTransformIterator<string, number>(it1);
const it5: AsyncIterator<number> = new MultiTransformIterator<string, number>(it1, {});
const it6: AsyncIterator<number> = new MultiTransformIterator<string, number>({});
const it7: AsyncIterator<number> = new MultiTransformIterator<string, number>({ optional: true });
const it8: AsyncIterator<number> = new MultiTransformIterator<string, number>({ source: it1 });
}
function test_clonediterator() {
const it1: ClonedIterator<number> = new ClonedIterator<number>();
const it2: ClonedIterator<number> = new ClonedIterator<number>(it1);
}
+164
View File
@@ -0,0 +1,164 @@
// Type definitions for asynciterator 1.1
// Project: https://github.com/rubenverborgh/AsyncIterator#readme
// Definitions by: Ruben Taelman <https://github.com/rubensworks>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
/// <reference types="node" />
import { EventEmitter } from "events";
export abstract class AsyncIterator<T> extends NodeJS.EventEmitter {
protected static STATES: ['INIT', 'OPEN', 'CLOSING', 'CLOSED', 'ENDED'];
protected static INIT: 0;
protected static OPEN: 1;
protected static CLOSING: 2;
protected static CLOSED: 3;
protected static ENDED: 4;
protected _state: number;
protected _readable: boolean;
protected _destination?: AsyncIterator<any>;
readable: boolean;
closed: boolean;
ended: boolean;
constructor();
read(): T;
each(callback: (data: T) => void, self?: any): void;
close(): void;
protected _changeState(newState: number, eventAsync?: boolean): void;
private _hasListeners(eventName: string | symbol): boolean;
// tslint:disable-next-line ban-types
private _addSingleListener(eventName: string | symbol, listener: Function): void;
protected _end(): void;
getProperty(propertyName: string, callback?: (value: any) => void): any;
setProperty(propertyName: string, value: any): void;
getProperties(): {[id: string]: any};
setProperties(properties: {[id: string]: any}): void;
copyProperties(source: AsyncIterator<any>, propertyNames: string[]): void;
toString(): string;
protected _toStringDetails(): string;
transform<T2>(options?: SimpleTransformIteratorOptions<T, T2>): SimpleTransformIterator<T, T2>;
map<T2>(mapper: (item: T) => T2, self?: object): SimpleTransformIterator<T, T2>;
filter(filter: (item: T) => boolean, self?: object): SimpleTransformIterator<T, T>;
prepend(items: T[]): SimpleTransformIterator<T, T>;
append<T>(items: T[]): SimpleTransformIterator<T, T>;
surround<T>(prepend: T[], append: T[]): SimpleTransformIterator<T, T>;
skip<T>(offset: number): SimpleTransformIterator<T, T>;
take<T>(limit: number): SimpleTransformIterator<T, T>;
range<T>(start: number, end: number): SimpleTransformIterator<T, T>;
clone(): ClonedIterator<T>;
static range(start?: number, end?: number, step?: number): IntegerIterator;
}
export class EmptyIterator<T> extends AsyncIterator<T> {
_state: 4;
}
export class SingletonIterator<T> extends AsyncIterator<T> {
constructor(item?: T);
}
export class ArrayIterator<T> extends AsyncIterator<T> {
constructor(items?: T[]);
}
export interface IntegerIteratorOptions {
step?: number;
end?: number;
start?: number;
}
export class IntegerIterator extends AsyncIterator<number> {
protected _step: number;
protected _last: number;
protected _next: number;
constructor(options?: IntegerIteratorOptions);
}
export interface BufferedIteratorOptions {
maxBufferSize?: number;
autoStart?: boolean;
}
export class BufferedIterator<T> extends AsyncIterator<T> {
maxBufferSize: number;
protected _pushedCount: number;
protected _buffer: T[];
protected _init(autoStart: boolean): void;
protected _begin(done: () => void): void;
protected _read(count: number, done: () => void): void;
protected _push(item: T): void;
protected _fillBuffer(): void;
protected _completeClose(): void;
protected _flush(done: () => void): void;
constructor(options?: BufferedIteratorOptions);
}
export interface TransformIteratorOptions<S> extends BufferedIteratorOptions {
optional?: boolean;
source?: AsyncIterator<S>;
}
export class TransformIterator<S, T> extends BufferedIterator<T> {
protected _optional: boolean;
source: AsyncIterator<S>;
protected _validateSource(source: AsyncIterator<S>, allowDestination?: boolean): void;
protected _transform(item: S, done: (result: T) => void): void;
protected _closeWhenDone(): void;
constructor(source?: AsyncIterator<S> | TransformIteratorOptions<S>, options?: TransformIteratorOptions<S>);
}
export interface SimpleTransformIteratorOptions<S, T> extends TransformIteratorOptions<S> {
offset?: number;
limit?: number;
prepend?: T[];
append?: T[];
filter?(item: S): boolean;
map?(item: S): T;
transform?(item: S, callback: (result: T) => void): void;
}
export class SimpleTransformIterator<S, T> extends TransformIterator<S, T> {
protected _offset: number;
protected _limit: number;
protected _prepender?: ArrayIterator<T>;
protected _appender?: ArrayIterator<T>;
protected _filter?(item: S): boolean;
protected _map?(item: S): T;
protected _transform(item: S, done: (result: T) => void): void;
protected _insert(inserter: AsyncIterator<S>, done: () => void): void;
constructor(source?: AsyncIterator<S> | SimpleTransformIteratorOptions<S, T>,
options?: SimpleTransformIteratorOptions<S, T>);
}
export class MultiTransformIterator<S, T> extends TransformIterator<S, T> {
_transformerQueue: S[];
protected _createTransformer(): AsyncIterator<S>;
constructor(source?: AsyncIterator<S> | TransformIteratorOptions<S>, options?: TransformIteratorOptions<S>);
}
export class ClonedIterator<T> extends TransformIterator<T, T> {
_readPosition: number;
constructor(source?: AsyncIterator<T>);
}
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"asynciterator-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+2 -1
View File
@@ -1,8 +1,9 @@
import { Disposable } from "event-kit";
import KeymapManager = require("atom-keymap");
import * as ImportTest from "atom-keymap";
declare const element: HTMLElement;
declare let sub: EventKit.Disposable;
declare let sub: Disposable;
declare const event: KeyboardEvent;
// NPM Examples ===============================================================
+35 -23
View File
@@ -4,15 +4,17 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/// <reference types="event-kit" />
import { Disposable } from "event-kit";
declare global {
namespace AtomKeymap {
/** The event objects that are passed into the callbacks which the user provides to
/**
* The event objects that are passed into the callbacks which the user provides to
* specific API calls.
*/
namespace Events {
/** This custom subclass of CustomEvent exists to provide the ::abortKeyBinding
/**
* This custom subclass of CustomEvent exists to provide the ::abortKeyBinding
* method, as well as versions of the ::stopPropagation methods that record the
* intent to stop propagation so event bubbling can be properly simulated for
* detached elements.
@@ -70,12 +72,14 @@ declare global {
}
interface AddedKeystrokeResolver {
/** The currently resolved keystroke string. If your function returns a falsy
/**
* The currently resolved keystroke string. If your function returns a falsy
* value, this is how Atom will resolve your keystroke.
*/
keystroke: string;
/** The raw DOM 3 `KeyboardEvent` being resolved. See the DOM API documentation
/**
* The raw DOM 3 `KeyboardEvent` being resolved. See the DOM API documentation
* for more details.
*/
event: KeyboardEvent;
@@ -83,7 +87,8 @@ declare global {
/** The OS-specific name of the current keyboard layout. */
layoutName: string;
/** An object mapping DOM 3 `KeyboardEvent.code` values to objects with the
/**
* An object mapping DOM 3 `KeyboardEvent.code` values to objects with the
* typed character for that key in each modifier state, based on the current
* operating system layout.
*/
@@ -91,7 +96,8 @@ declare global {
}
}
/** The option objects that the user is expected to fill out and provide to
/**
* The option objects that the user is expected to fill out and provide to
* specific API calls.
*/
namespace Options {
@@ -120,7 +126,8 @@ declare global {
/** Determines whether the given keystroke matches any contained within this binding. */
matches(keystroke: string): boolean;
/** Compare another KeyBinding to this instance.
/**
* Compare another KeyBinding to this instance.
* Returns <= -1 if the argument is considered lesser or of lower priority.
* Returns 0 if this binding is equivalent to the argument.
* Returns >= 1 if the argument is considered greater or of higher priority.
@@ -128,7 +135,8 @@ declare global {
compare(other: KeyBinding): number;
}
/** Allows commands to be associated with keystrokes in a context-sensitive way.
/**
* Allows commands to be associated with keystrokes in a context-sensitive way.
* In Atom, you can access a global instance of this object via `atom.keymaps`.
*/
interface KeymapManager {
@@ -143,29 +151,30 @@ declare global {
destroy(): void;
// Event Subscription
/** Invoke the given callback when one or more keystrokes completely match a key binding. */
/**
* Invoke the given callback when one or more keystrokes completely match a
* key binding.
*/
onDidMatchBinding(callback: (event: Events.FullKeybindingMatch) => void):
EventKit.Disposable;
Disposable;
/** Invoke the given callback when one or more keystrokes partially match a binding. */
onDidPartiallyMatchBindings(callback: (event: Events.PartialKeybindingMatch) =>
void): EventKit.Disposable;
void): Disposable;
/** Invoke the given callback when one or more keystrokes fail to match any bindings. */
onDidFailToMatchBinding(callback: (event: Events.FailedKeybindingMatch) =>
void): EventKit.Disposable;
void): Disposable;
/** Invoke the given callback when a keymap file is reloaded. */
onDidReloadKeymap(callback: (event: Events.KeymapLoaded) => void):
EventKit.Disposable;
onDidReloadKeymap(callback: (event: Events.KeymapLoaded) => void): Disposable;
/** Invoke the given callback when a keymap file is unloaded. */
onDidUnloadKeymap(callback: (event: Events.KeymapLoaded) => void):
EventKit.Disposable;
onDidUnloadKeymap(callback: (event: Events.KeymapLoaded) => void): Disposable;
/** Invoke the given callback when a keymap file not able to be loaded. */
onDidFailToReadFile(callback: (error: Events.FailedKeymapFileRead) => void):
EventKit.Disposable;
Disposable;
// Adding and Removing Bindings
/** Construct KeyBindings from an object grouping them by CSS selector. */
@@ -174,7 +183,7 @@ declare global {
/** Add sets of key bindings grouped by CSS selector. */
add(source: string, bindings: { [key: string]: { [key: string]: string }},
priority?: number): EventKit.Disposable;
priority?: number): Disposable;
// Accessing Bindings
/** Get all current key bindings. */
@@ -192,13 +201,15 @@ declare global {
loadKeymap(bindingsPath: string, options?: { watch?: boolean, priority?: number }):
void;
/** Cause the keymap to reload the key bindings file at the given path whenever
/**
* Cause the keymap to reload the key bindings file at the given path whenever
* it changes.
*/
watchKeymap(filePath: string, options?: { priority: number }): void;
// Managing Keyboard Events
/** Dispatch a custom event associated with the matching key binding for the
/**
* Dispatch a custom event associated with the matching key binding for the
* given `KeyboardEvent` if one can be found.
*/
handleKeyboardEvent(event: KeyboardEvent): void;
@@ -208,9 +219,10 @@ declare global {
/** Customize translation of raw keyboard events to keystroke strings. */
addKeystrokeResolver(resolver: (event: Events.AddedKeystrokeResolver) => string):
EventKit.Disposable;
Disposable;
/** Get the number of milliseconds allowed before pending states caused by
/**
* Get the number of milliseconds allowed before pending states caused by
* partial matches of multi-keystroke bindings are terminated.
*/
getPartialMatchTimeout(): number;
+1 -1
View File
@@ -8,7 +8,7 @@
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
+2 -30
View File
@@ -1,36 +1,8 @@
{
"extends": "dtslint/dt.json",
"rules": {
"class-name": true,
"indent": [true, "spaces", 4],
"jsdoc-format": true,
"max-line-length": [true, 110],
"quotemark": [true, "double", "avoid-escape"],
"trailing-comma": [true, {
"multiline": { "objects": "always", "arrays": "always", "functions": "never" },
"singleline": { "objects": "never", "arrays": "never", "functions": "never" }
}],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-type",
"check-typecast",
"check-rest-spread",
"check-preblock"
],
// Soon to be defaults.
"arrow-return-shorthand": [true, "multiline"],
"no-any": true,
"no-floating-promises": true,
"no-unbound-method": true,
"no-unsafe-any": true,
"number-literal-format": true,
"restrict-plus-operands": true,
"return-undefined": true,
"switch-final-break": true
"max-line-length": [true, 100],
"no-any": true
}
}
@@ -1,3 +1,4 @@
import { AtomEnvironment, TestRunnerParams } from "atom";
import { createRunner } from "atom-mocha-test-runner";
import defaultMochaRunner = require("atom-mocha-test-runner");
@@ -20,12 +21,12 @@ testRunner = createRunner({
testSuffixes: ["test.file"],
});
declare const atom: AtomCore.AtomEnvironment;
declare const atom: AtomEnvironment;
declare const blob: object;
declare let num: number;
async function runTests(): Promise<number> {
const runnerArgs: AtomCore.Structures.TestRunnerArgs = {
const runnerArgs: TestRunnerParams = {
testPaths: ["/var/test"],
logFile: "/var/log",
headless: false,
+4 -3
View File
@@ -5,7 +5,8 @@
// TypeScript Version: 2.3
/// <reference types="mocha" />
/// <reference types="atom" />
import { TestRunner } from "atom";
interface AtomMochaOptions {
/** Which reporter to use on the terminal. */
@@ -30,9 +31,9 @@ interface AtomMochaOptions {
// module.exports = createRunner()
// module.exports.createRunner = createRunner
// Which is what we're trying to model here.
interface TestRunnerExport extends AtomCore.TestRunner {
interface TestRunnerExport extends TestRunner {
createRunner(options?: AtomMochaOptions, mochaConfigFunction?:
(mocha: Mocha) => void): AtomCore.TestRunner;
(mocha: Mocha) => void): TestRunner;
}
declare const runner: TestRunnerExport;
+1 -1
View File
@@ -9,7 +9,7 @@
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
+1 -29
View File
@@ -1,36 +1,8 @@
{
"extends": "dtslint/dt.json",
"rules": {
"class-name": true,
"indent": [true, "spaces", 4],
"jsdoc-format": true,
"max-line-length": [true, 100],
"quotemark": [true, "double", "avoid-escape"],
"trailing-comma": [true, {
"multiline": { "objects": "always", "arrays": "always", "functions": "never" },
"singleline": { "objects": "never", "arrays": "never", "functions": "never" }
}],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-type",
"check-typecast",
"check-rest-spread",
"check-preblock"
],
// Soon to be defaults.
"arrow-return-shorthand": [true, "multiline"],
"no-any": true,
"no-floating-promises": true,
"no-unbound-method": true,
"no-unsafe-any": true,
"number-literal-format": true,
"restrict-plus-operands": true,
"return-undefined": true,
"switch-final-break": true
"no-any": true
}
}
-60
View File
@@ -1,60 +0,0 @@
## Atom API Type Definitions
TypeScript type definitions for the [Atom Text Editor](https://atom.io/) public API, which is used to develop packages for the editor. Documentation for the public API can be found [here](https://atom.io/docs/api/v1.21.0/).
### Exports
#### The "atom" Variable
These definitions declare a global static variable named "atom" as ambient. Once these definitions have been referenced within your project, you will be able to access properties and member functions from the [AtomEnvironment](https://atom.io/docs/api/v1.21.0/AtomEnvironment) class off of this variable, as it is an instance of that class.
```ts
if (atom.inDevMode()) {}
```
#### The Atom Namespace
All of the types used by or referenced by the Atom public API have been pulled into the Atom namespace, providing a consistent and easy way to access each of them, without having to care about where that type actually lives within the Atom codebase.
```ts
function example(buffer: Atom.TextBuffer) {}
```
#### The AtomCore Namespace
All classes which are core to Atom itself have been provided under the AtomCore namespace.
```ts
function example(cursor: AtomCore.Cursor) {}
```
### Service Type Definitions
There are many services provided by other Atom packages that you may want to use within your own Atom package. We bundle type definitions for several of these services with these type definitions. All type definitions for services are available only through ES6 imports.
```ts
import { AutocompleteProvider } from "atom/autocomplete-plus";
let completionProvider: AutocompleteProvider;
```
The currently supported services are:
- [Autocomplete](https://github.com/atom/autocomplete-plus) (atom/autocomplete-plus)
- [Linter](https://github.com/atom/linter) (atom/linter)
- [Status Bar](https://github.com/atom/status-bar) (atom/status-bar)
### Exposing Private Methods and Properties
[Declaration Merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) can be used to augment any of the types used within Atom. As an example, if we wanted to reveal the private ```triggerActivationHook``` method within the PackageManager class, then we would create a file with the following contents:
```ts
// <<filename>>.d.ts
declare namespace AtomCore {
interface PackageManager {
triggerActivationHook(name: string): void;
triggerDeferredActivationHooks(): void;
}
}
```
Once this file is either referenced or included within your project, then this new member function would be freely usable on instances of the PackageManager class without TypeScript reporting errors.
+82 -81
View File
@@ -12,59 +12,59 @@ declare let regExp: RegExp;
declare let element: HTMLElement;
declare let elements: HTMLElement[];
declare const div: HTMLDivElement;
declare const keyboardEvent: KeyboardEvent;
declare const event: KeyboardEvent;
declare let buffer: TextBuffer.TextBuffer;
declare const color: AtomCore.Color;
declare let cursor: AtomCore.Cursor;
declare let cursors: AtomCore.Cursor[];
declare let decoration: AtomCore.Decoration;
declare let decorations: AtomCore.Decoration[];
declare let decorationLayerProps: AtomCore.Options.DecorationLayerProps;
declare let dir: PathWatcher.Directory;
declare let dirs: PathWatcher.Directory[];
declare let displayMarker: TextBuffer.DisplayMarker;
declare let displayMarkers: TextBuffer.DisplayMarker[];
declare let displayMarkerLayer: TextBuffer.DisplayMarkerLayer;
declare let dock: AtomCore.Dock;
declare let editor: AtomCore.TextEditor;
declare let editors: AtomCore.TextEditor[];
declare let emitter: EventKit.Emitter;
declare let file: PathWatcher.File;
declare let grammar: FirstMate.Grammar;
declare let grammars: FirstMate.Grammar[];
declare let gutter: AtomCore.Gutter;
declare let gutters: AtomCore.Gutter[];
declare let historyPaths: AtomCore.Structures.HistoryProject[];
declare let layerDecoration: AtomCore.LayerDecoration;
declare let marker: TextBuffer.Marker;
declare let markers: TextBuffer.Marker[];
declare let markerLayer: TextBuffer.MarkerLayer;
declare let notification: AtomCore.Notification;
declare let notifications: AtomCore.Notification[];
declare let pack: AtomCore.Package;
declare let packs: AtomCore.Package[];
declare let pane: AtomCore.Pane;
declare let panes: AtomCore.Pane[];
declare let paneContainer: AtomCore.Dock|AtomCore.WorkspaceCenter;
declare let panel: AtomCore.Panel;
declare let panels: AtomCore.Panel[];
declare let pos: TextBuffer.Point;
declare let posArr: TextBuffer.Point[];
declare let project: AtomCore.Project;
declare let range: TextBuffer.Range;
declare let ranges: TextBuffer.Range[];
declare let registry: FirstMate.GrammarRegistry;
declare let repository: AtomCore.GitRepository;
declare let repositories: AtomCore.GitRepository[];
declare let scopeDescriptor: AtomCore.ScopeDescriptor;
declare let selection: AtomCore.Selection;
declare let selections: AtomCore.Selection[];
declare let styleManager: AtomCore.StyleManager;
declare let subscription: EventKit.Disposable;
declare let subscriptions: EventKit.CompositeDisposable;
declare let tooltips: AtomCore.Structures.Tooltip[];
declare let workspaceCenter: AtomCore.WorkspaceCenter;
declare let buffer: Atom.TextBuffer;
declare const color: Atom.Color;
declare let cursor: Atom.Cursor;
declare let cursors: Atom.Cursor[];
declare let decoration: Atom.Decoration;
declare let decorations: Atom.Decoration[];
declare let decorationLayerProps: Atom.DecorationLayerOptions;
declare let dir: Atom.Directory;
declare let dirs: Atom.Directory[];
declare let displayMarker: Atom.DisplayMarker;
declare let displayMarkers: Atom.DisplayMarker[];
declare let displayMarkerLayer: Atom.DisplayMarkerLayer;
declare let dock: Atom.Dock;
declare let editor: Atom.TextEditor;
declare let editors: Atom.TextEditor[];
declare let emitter: Atom.Emitter;
declare let file: Atom.File;
declare let grammar: Atom.Grammar;
declare let grammars: Atom.Grammar[];
declare let gutter: Atom.Gutter;
declare let gutters: Atom.Gutter[];
declare let historyPaths: Atom.ProjectHistory[];
declare let layerDecoration: Atom.LayerDecoration;
declare let marker: Atom.Marker;
declare let markers: Atom.Marker[];
declare let markerLayer: Atom.MarkerLayer;
declare let notification: Atom.Notification;
declare let notifications: Atom.Notification[];
declare let pack: Atom.Package;
declare let packs: Atom.Package[];
declare let pane: Atom.Pane;
declare let panes: Atom.Pane[];
declare let paneContainer: Atom.Dock|Atom.WorkspaceCenter;
declare let panel: Atom.Panel;
declare let panels: Atom.Panel[];
declare let pos: Atom.Point;
declare let posArr: Atom.Point[];
declare let project: Atom.Project;
declare let range: Atom.Range;
declare let ranges: Atom.Range[];
declare let registry: Atom.GrammarRegistry;
declare let repository: Atom.GitRepository;
declare let repositories: Atom.GitRepository[];
declare let scopeDescriptor: Atom.ScopeDescriptor;
declare let selection: Atom.Selection;
declare let selections: Atom.Selection[];
declare let styleManager: Atom.StyleManager;
declare let subscription: Atom.Disposable;
declare let subscriptions: Atom.CompositeDisposable;
declare let tooltips: Atom.Tooltip[];
declare let workspaceCenter: Atom.WorkspaceCenter;
// AtomEnvironment ============================================================
function testAtomEnvironment() {
@@ -125,8 +125,8 @@ function testAtomEnvironment() {
});
subscription = atom.workspace.observeTextEditors((editor) => {
subscription = editor.onDidStopChanging((keyboardEvent) => {
for (const change of keyboardEvent.changes) {
subscription = editor.onDidStopChanging((event) => {
for (const change of event.changes) {
change.newExtent;
}
});
@@ -276,9 +276,6 @@ function testCommandRegistry() {
// CompositeDisposable ========================================================
function testCompositeDisposable() {
// Properties
bool = subscriptions.disposed;
// Construction and Lifecycle
subscriptions = new Atom.CompositeDisposable();
new Atom.CompositeDisposable(subscription);
@@ -482,7 +479,7 @@ function testCursor() {
// TestRunner =================================================================
function testTestRunner() {
const testRunner: AtomCore.TestRunner = (params) => {
const testRunner: Atom.TestRunner = (params) => {
const delegate = params.buildDefaultApplicationDelegate();
const environment = params.buildAtomEnvironment({
applicationDelegate: delegate,
@@ -803,7 +800,6 @@ function testDisplayMarkerLayer() {
// Disposable =================================================================
function testDisposable() {
bool = subscription.disposed;
if (subscription.disposalAction) subscription.disposalAction();
subscription.dispose();
}
@@ -829,8 +825,12 @@ function testDock() {
subscription = dock.onDidChangeActivePane(pane => pane.activate());
subscription = dock.observeActivePane(pane => pane.activate());
subscription = dock.onDidAddPaneItem(event => event.index && event.item && event.pane);
subscription = dock.onWillDestroyPaneItem(event => event.index && event.item && event.pane);
subscription = dock.onDidDestroyPaneItem(event => event.index && event.item && event.pane);
subscription = dock.onWillDestroyPaneItem(event => {
event.index && event.item && event.pane;
});
subscription = dock.onDidDestroyPaneItem(event => {
event.index && event.item && event.pane;
});
// Pane Items
objs = dock.getPaneItems();
@@ -847,8 +847,6 @@ function testDock() {
function testEmitter() {
emitter = new Atom.Emitter();
bool = emitter.disposed;
emitter.clear();
emitter.dispose();
@@ -1113,7 +1111,7 @@ function testKeymapManager() {
subscription = manager.add("a", {}, 0);
// Accessing Bindings
let bindings: AtomKeymap.KeyBinding[] = manager.getKeyBindings();
let bindings: Atom.KeyBinding[] = manager.getKeyBindings();
bindings = manager.findKeyBindings();
bindings = manager.findKeyBindings({ command: "a" });
bindings = manager.findKeyBindings({ keystrokes: "a" });
@@ -1127,8 +1125,8 @@ function testKeymapManager() {
manager.loadKeymap("Test.file", { watch: true, priority: 0});
// Managing Keyboard Events
manager.handleKeyboardEvent(keyboardEvent);
manager.keystrokeForKeyboardEvent(keyboardEvent);
manager.handleKeyboardEvent(event);
manager.keystrokeForKeyboardEvent(event);
subscription = manager.addKeystrokeResolver((event): string => {
event.layoutName;
@@ -1151,10 +1149,6 @@ function testLayerDecoration() {
function testMarker() {
// Properties
num = marker.id;
bool = marker.tailed;
bool = marker.reversed;
bool = marker.valid;
str = marker.invalidate;
// Lifecycle
marker = marker.copy({
@@ -1301,8 +1295,8 @@ function testNotification() {
});
// Event Subscription
subscription = notification.onDidDismiss(notification => notification.dismissed);
subscription = notification.onDidDisplay(notification => notification.timestamp);
subscription = notification.onDidDismiss(notification => notification.getType());
subscription = notification.onDidDisplay(notification => notification.getMessage());
// Methods
str = notification.getType();
@@ -1377,7 +1371,7 @@ function testPackageManager() {
subscription = atom.packages.onDidActivatePackage(pack => pack.name);
subscription = atom.packages.onDidDeactivatePackage(pack => pack.path);
subscription = atom.packages.onDidLoadPackage(pack => pack.isCompatible());
subscription = atom.packages.onDidUnloadPackage(pack => pack.bundledPackage);
subscription = atom.packages.onDidUnloadPackage(pack => pack.name);
// Package system data
str = atom.packages.getApmPath();
@@ -1618,7 +1612,7 @@ function testPoint() {
point.isGreaterThanOrEqual([0, 0]);
// Operations
const frozenPoint: Readonly<TextBuffer.Point> = point.freeze();
const frozenPoint: Readonly<Atom.Point> = point.freeze();
point = point.translate(point);
point.translate([0, 0]);
@@ -1644,7 +1638,7 @@ function testProject() {
});
subscription = project.onDidAddBuffer(buffer => buffer.id);
subscription = project.observeBuffers(buffer => buffer.file);
subscription = project.observeBuffers(buffer => buffer.getUri());
// Accessing the git repository
repositories = project.getRepositories();
@@ -1707,7 +1701,7 @@ function testRange() {
nums = range.getRows();
// Operations
const frozenRange: Readonly<TextBuffer.Range> = range.freeze();
const frozenRange: Readonly<Atom.Range> = range.freeze();
range = range.union(range);
range = range.translate(pos);
@@ -1923,7 +1917,7 @@ function testStyleManager() {
// Task =======================================================================
function testTask() {
let task: AtomCore.Task = Atom.Task.once("File.path", {}, () => {});
let task: Atom.Task = Atom.Task.once("File.path", {}, () => {});
task = new Atom.Task("File.path");
task.start({}, () => {});
@@ -2282,7 +2276,7 @@ function testTextEditor() {
subscription = editor.onDidChangeSoftWrapped(softWrapped => {});
subscription = editor.onDidChangeEncoding(encoding => {});
subscription = editor.observeGrammar(grammar => grammar.name);
subscription = editor.onDidChangeGrammar(grammar => grammar.scopeName);
subscription = editor.onDidChangeGrammar(grammar => grammar.name);
subscription = editor.onDidChangeModified(modified => {});
subscription = editor.onDidConflict(() => {});
subscription = editor.onWillInsertText(event => event.cancel && event.text);
@@ -2997,8 +2991,9 @@ function testWorkspace() {
subscription = atom.workspace.observeActivePane(pane => pane.activate());
subscription = atom.workspace.onDidAddPaneItem(event => event.index && event.item &&
event.pane);
subscription = atom.workspace.onWillDestroyPaneItem(event => event.index &&
event.item && event.pane);
subscription = atom.workspace.onWillDestroyPaneItem(event => {
event.index && event.item && event.pane;
});
subscription = atom.workspace.onDidDestroyPaneItem(event => event.index &&
event.item && event.pane);
subscription = atom.workspace.onDidAddTextEditor(event => event.index && event.pane &&
@@ -3045,7 +3040,13 @@ function testWorkspace() {
if (result) obj = result;
}
atom.workspace.addOpener(() => element);
atom.workspace.addOpener((uri) => {
if (uri === "test://") {
return {
getTitle: () => "Test Title",
};
}
});
atom.workspace.buildTextEditor(obj);
+128
View File
@@ -0,0 +1,128 @@
import "../index";
declare module "atom" {
interface ConfigValues {
/**
* Suggestions will show as you type if this preference is enabled. If it is
* disabled, you can still see suggestions by using the keymapping for
* 'autocomplete-plus:activate' (shown below).
*/
"autocomplete-plus.enableAutoActivation": boolean;
/**
* If you are experiencing performance issues when typing, you should try
* increasing this value to a non-zero number (e.g. 100).
*/
"autocomplete-plus.autoActivationDelay": number;
/** The suggestion list will only show this many suggestions. */
"autocomplete-plus.maxVisibleSuggestions": number;
/**
* You should use the key(s) indicated here to confirm a suggestion from the
* suggestion list and have it inserted into the file.
*/
"autocomplete-plus.confirmCompletion":
| "tab"
| "enter"
| "tab and enter"
| "tab always, enter when suggestion explicitly selected";
/**
* Disable this if you want to bind your own keystrokes to move around the
* suggestion list. You will also need to add definitions to your keymap.
*/
"autocomplete-plus.useCoreMovementCommands": boolean;
/**
* Suggestions will not be provided for files matching this list, e.g. *.md
* for Markdown files. To blacklist more than one file extension, use comma
* as a separator, e.g. ["*.md", "*.txt"] (both Markdown and text files).
*/
"autocomplete-plus.fileBlacklist": string[];
/** Suggestions will not be provided for scopes matching this list. */
"autocomplete-plus.scopeBlacklist": string[];
/**
* For grammars with no registered provider(s), the default provider will
* include completions from all buffers, instead of just the buffer you are
* currently editing.
*/
"autocomplete-plus.includeCompletionsFromAllBuffers": boolean;
/**
* Fuzzy searching is performed if this is disabled; if it is enabled, suggestions
* must begin with the prefix from the current word.
*/
"autocomplete-plus.strictMatching": boolean;
/**
* Only autocomplete when you've typed at least this many characters.
* Note: May not affect external providers.
*/
"autocomplete-plus.minimumWordLength": number;
/**
* The package comes with a built-in provider that will provide suggestions
* using the words in your current buffer or all open buffers. You will get
* better suggestions by installing additional autocomplete+ providers.
* To stop using the built-in provider, disable this option.
*/
"autocomplete-plus.enableBuiltinProvider": boolean;
/** Don't use the built-in provider for these selector(s). */
"autocomplete-plus.builtinProviderBlacklist": string;
/**
* If enabled, typing `backspace` will show the suggestion list if suggestions
* are available. If disabled, suggestions will not be shown while backspacing.
*/
"autocomplete-plus.backspaceTriggersAutocomplete": boolean;
/**
* If enabled, automatically insert suggestion on manual activation with
* 'autocomplete-plus:activate' when there is only one match.
*/
"autocomplete-plus.enableAutoConfirmSingleSuggestion": boolean;
/**
* With 'Cursor' the suggestion list appears at the cursor's position.
* With 'Word' it appears at the beginning of the word that's being completed.
*/
"autocomplete-plus.suggestionListFollows": "Word"|"Cursor";
/**
* If you're having trouble with autocomplete, you may consider falling back
* to the Symbol provider and filing an issue.
*/
"autocomplete-plus.defaultProvider": "Subsequence"|"Symbol";
/** Don't auto-activate when any of these classes are present in the editor. */
"autocomplete-plus.suppressActivationForEditorClasses": string[];
/**
* Completing a suggestion consumes text following the cursor matching the
* suffix of the chosen suggestion.
*/
"autocomplete-plus.consumeSuffix": boolean;
/**
* -EXPERIMENTAL- Prefers runs of consecutive characters, acronyms and start
* of words.
*/
"autocomplete-plus.useAlternateScoring": boolean;
/** Gives words near the cursor position a higher score than those far away. */
"autocomplete-plus.useLocalityBonus": boolean;
/** Identifies non-latin alphabet characters as letters. */
"autocomplete-plus.enableExtendedUnicodeSupport": boolean;
/**
* Should similar suggestions be removed from the list? If so how to determine
* they are similar.
*/
"autocomplete-plus.similarSuggestionRemoval": "none"|"textOrSnippet";
}
}
@@ -1,16 +1,20 @@
// Autocomplete Plus 2.x
// https://atom.io/packages/autocomplete-plus
/// <reference path="./config.d.ts" />
import { Point, ScopeDescriptor, TextEditor } from "../index";
/** The parameters passed into getSuggestions by Autocomplete+. */
export interface SuggestionsRequestedEvent {
/** The current TextEditor. */
editor: AtomCore.TextEditor;
editor: TextEditor;
/** The position of the cursor. */
bufferPosition: TextBuffer.Point;
bufferPosition: Point;
/** The scope descriptor for the current cursor position. */
scopeDescriptor: AtomCore.ScopeDescriptor;
scopeDescriptor: ScopeDescriptor;
/** The prefix for the word immediately preceding the current cursor position. */
prefix: string;
@@ -21,26 +25,30 @@ export interface SuggestionsRequestedEvent {
/** The parameters passed into onDidInsertSuggestion by Autocomplete+. */
export interface SuggestionInsertedEvent {
editor: AtomCore.TextEditor;
triggerPosition: TextBuffer.Point;
editor: TextEditor;
triggerPosition: Point;
suggestion: TextSuggestion|SnippetSuggestion;
}
/** An autocompletion suggestion for the user.
/**
* An autocompletion suggestion for the user.
* Primary data type for the Atom Autocomplete+ service.
*/
export interface Suggestion<T extends { text: string }|{ snippet: string }> {
/** A string that will show in the UI for this suggestion.
/**
* A string that will show in the UI for this suggestion.
* When not set, snippet || text is displayed.
*/
displayText?: string;
/** The text immediately preceding the cursor, which will be replaced by the text.
/**
* The text immediately preceding the cursor, which will be replaced by the text.
* If not provided, the prefix passed into getSuggestions will be used.
*/
replacementPrefix?: string;
/** The suggestion type. It will be converted into an icon shown against the
/**
* The suggestion type. It will be converted into an icon shown against the
* suggestion.
*/
type?: string;
@@ -51,7 +59,8 @@ export interface Suggestion<T extends { text: string }|{ snippet: string }> {
/** Use this instead of leftLabel if you want to use html for the left label. */
leftLabelHTML?: string;
/** An indicator (e.g. function, variable) denoting the "kind" of suggestion this
/**
* An indicator (e.g. function, variable) denoting the "kind" of suggestion this
* represents.
*/
rightLabel?: string;
@@ -59,22 +68,26 @@ export interface Suggestion<T extends { text: string }|{ snippet: string }> {
/** Use this instead of rightLabel if you want to use html for the right label. */
rightLabelHTML?: string;
/** Class name for the suggestion in the suggestion list. Allows you to style your
/**
* Class name for the suggestion in the suggestion list. Allows you to style your
* suggestion via CSS, if desired.
*/
className?: string;
/** If you want complete control over the icon shown against the suggestion.
/**
* If you want complete control over the icon shown against the suggestion.
* e.g. iconHTML: <i class="icon-move-right"></i>
*/
iconHTML?: string;
/** A doc-string summary or short description of the suggestion. When specified, it
/**
* A doc-string summary or short description of the suggestion. When specified, it
* will be displayed at the bottom of the suggestions list.
*/
description?: string;
/** A url to the documentation or more information about this suggestion.
/**
* A url to the documentation or more information about this suggestion.
* When specified, a More.. link will be displayed in the description area.
*/
descriptionMoreURL?: string;
@@ -86,7 +99,8 @@ export interface TextSuggestion extends Suggestion<TextSuggestion> {
}
export interface SnippetSuggestion extends Suggestion<SnippetSuggestion> {
/** A snippet string. This will allow users to tab through function arguments
/**
* A snippet string. This will allow users to tab through function arguments
* or other options.
*/
snippet: string;
@@ -96,24 +110,28 @@ export type Suggestions = Array<TextSuggestion|SnippetSuggestion>;
/** The interface that all Autocomplete+ providers must implement. */
export interface AutocompleteProvider {
/** Defines the scope selector(s) (can be comma-separated) for which your provider
/**
* Defines the scope selector(s) (can be comma-separated) for which your provider
* should receive suggestion requests.
*/
selector: string;
/** Is called when a suggestion request has been dispatched by autocomplete+ to
/**
* Is called when a suggestion request has been dispatched by autocomplete+ to
* your provider. Return an array of suggestions (if any) in the order you would
* like them displayed to the user. Returning a Promise of an array of suggestions
* is also supported.
*/
getSuggestions(params: SuggestionsRequestedEvent): Suggestions|Promise<Suggestions>;
/** Defines the scope selector(s) (can be comma-separated) for which your provider
/**
* Defines the scope selector(s) (can be comma-separated) for which your provider
* should not be used.
*/
disableForSelector?: string;
/** A number to indicate its priority to be included in a suggestions request.
/**
* A number to indicate its priority to be included in a suggestions request.
* The default provider has an inclusion priority of 0. Higher priority providers
* can suppress lower priority providers with excludeLowerPriority.
*/
@@ -122,12 +140,14 @@ export interface AutocompleteProvider {
/** Will not use lower priority providers when this provider is used. */
excludeLowerPriority?: boolean;
/** A number to determine the sort order of suggestions. The default provider has
/**
* A number to determine the sort order of suggestions. The default provider has
* an suggestion priority of 1.
*/
suggestionPriority?: number;
/** Function that is called when a suggestion from your provider was inserted
/**
* Function that is called when a suggestion from your provider was inserted
* into the buffer.
*/
onDidInsertSuggestion?(params: SuggestionInsertedEvent): void;
+6541 -4087
View File
File diff suppressed because it is too large Load Diff
+26
View File
@@ -0,0 +1,26 @@
import "../index";
declare module "atom" {
interface ConfigValues {
/** Lint tabs while they are still in preview status. */
"linter.lintPreviewTabs": boolean;
/** Lint files automatically when they are opened. */
"linter.lintOnOpen": boolean;
/**
* Lint files while typing, without the need to save (only for supported
* providers).
*/
"linter.lintOnChange": boolean;
/** Interval at which linting is done as you type (in ms). */
"linter.lintOnChangeInterval": number;
/** Ignore files matching this Glob. */
"linter.ignoreGlob": string;
/** Disabled providers. */
"linter.disabledProviders": string[];
}
}
+13 -8
View File
@@ -1,9 +1,13 @@
// Linter 2.x
// https://atom.io/packages/linter
/// <reference path="./config.d.ts" />
import { Disposable, Point, Range, TextEditor } from "../index";
export interface ReplacementSolution {
title?: string;
position: TextBuffer.Range;
position: Range;
priority?: number;
currentText?: string;
replaceWith: string;
@@ -11,7 +15,7 @@ export interface ReplacementSolution {
export interface CallbackSolution {
title?: string;
position: TextBuffer.Range;
position: Range;
priority?: number;
// tslint:disable-next-line:no-any
apply(): any;
@@ -24,7 +28,7 @@ export interface Message {
file: string;
/** The range of the message in the editor. */
position: TextBuffer.Range;
position: Range;
};
/** A reference to a different location in the editor. */
@@ -33,7 +37,7 @@ export interface Message {
file: string;
/** The point being referenced in that file. */
position?: TextBuffer.Point;
position?: Point;
};
/** An HTTP link to a resource explaining the issue. Default is a google search. */
@@ -51,7 +55,8 @@ export interface Message {
/** Possible solutions (which the user can invoke at will). */
solutions?: Array<ReplacementSolution|CallbackSolution>;
/** Markdown long description of the error. Accepts a callback so that you can
/**
* Markdown long description of the error. Accepts a callback so that you can
* do things like HTTP requests.
*/
description?: string|(() => Promise<string>|string);
@@ -63,8 +68,8 @@ export interface IndieDelegate {
clearMessages(): void;
setMessages(filePath: string, messages: Message[]): void;
setAllMessages(messages: Message[]): void;
onDidUpdate(callback: () => void): EventKit.Disposable;
onDidDestroy(callback: () => void): EventKit.Disposable;
onDidUpdate(callback: () => void): Disposable;
onDidDestroy(callback: () => void): Disposable;
dispose(): void;
}
@@ -73,5 +78,5 @@ export interface LinterProvider {
scope: "file"|"project";
lintsOnChange: boolean;
grammarScopes: string[];
lint(textEditor: AtomCore.TextEditor): Message[]|void|Promise<Message[]|undefined>;
lint(textEditor: TextEditor): Message[]|void|Promise<Message[]|undefined>;
}
+23
View File
@@ -0,0 +1,23 @@
import "../index";
declare module "atom" {
interface ConfigValues {
/** Show status bar at the bottom of the workspace. */
"status-bar.isVisible": boolean;
/** Fit the status-bar to the window's full-width. */
"status-bar.fullWidth": boolean;
/**
* Format for the cursor position status bar element, where %L is the line
* number and %C is the column number.
*/
"status-bar.cursorPositionFormat": string;
/**
* Format for the selection count status bar element, where %L is the line
* count and %C is the character count.
*/
"status-bar.selectionCountFormat": string;
}
}
@@ -1,13 +1,17 @@
// Status Bar 1.x
// https://atom.io/packages/status-bar
/// <reference path="./config.d.ts" />
export interface AddTileOptions {
/** A DOM element, a jQuery object, or a model object for which a view provider
/**
* A DOM element, a jQuery object, or a model object for which a view provider
* has been registered in the the view registry.
*/
item: object;
/** Determines the placement of the tile within the status bar. Lower priority
/**
* Determines the placement of the tile within the status bar. Lower priority
* will result in closer placement to the anchor.
*/
priority: number;
@@ -25,12 +29,14 @@ export interface Tile {
}
export interface StatusBar {
/** Add a tile to the left side of the status bar. Lower priority tiles are placed
/**
* Add a tile to the left side of the status bar. Lower priority tiles are placed
* further to the left.
*/
addLeftTile(options: AddTileOptions): Tile;
/** Add a tile to the right side of the status bar. Lower priority tiles are placed
/**
* Add a tile to the right side of the status bar. Lower priority tiles are placed
* further to the right.
*/
addRightTile(options: AddTileOptions): Tile;
+4 -4
View File
@@ -8,7 +8,7 @@
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
@@ -20,8 +20,8 @@
"files": [
"index.d.ts",
"atom-tests.ts",
"autocomplete-plus.d.ts",
"linter.d.ts",
"status-bar.d.ts"
"autocomplete-plus/index.d.ts",
"linter/index.d.ts",
"status-bar/index.d.ts"
]
}
+2 -30
View File
@@ -2,36 +2,8 @@
"extends": "dtslint/dt.json",
"rules": {
"await-promise": [true, "CancellablePromise"],
"class-name": true,
"indent": [true, "spaces", 4],
"jsdoc-format": true,
"max-line-length": [true, 110],
"quotemark": [true, "double", "avoid-escape"],
"trailing-comma": [true, {
"multiline": { "objects": "always", "arrays": "always", "functions": "never" },
"singleline": { "objects": "never", "arrays": "never", "functions": "never" }
}],
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-type",
"check-typecast",
"check-rest-spread",
"check-preblock"
],
// Soon to be defaults.
"arrow-return-shorthand": [true, "multiline"],
"no-any": true,
"no-floating-promises": true,
"no-unbound-method": true,
"no-unsafe-any": true,
"number-literal-format": true,
"restrict-plus-operands": true,
"return-undefined": true,
"switch-final-break": true
"max-line-length": [true, 100],
"no-any": true
}
}
+6
View File
@@ -355,6 +355,12 @@ export class Popup {
domain: string,
/** your Auth0 client identifier obtained when creating the client in the Auth0 Dashboard */
clientId?: string,
/**
* identity provider whose login page will be displayed in the popup.
* If omitted the hosted login page is used.
* {@link https://auth0.com/docs/identityproviders}
*/
connection?: string,
/** url that the Auth0 will redirect after Auth with the Authorization Response */
redirectUri: string,
/**
+90 -11
View File
@@ -1,4 +1,4 @@
// Type definitions for auth0 2.4
// Type definitions for auth0 2.5
// Project: https://github.com/auth0/node-auth0
// Definitions by: Wilson Hobbs <https://github.com/wbhob>, Seth Westphal <https://github.com/westy92>, Amiram Korach <https://github.com/amiram>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -87,6 +87,84 @@ export interface Rule {
order?: number;
}
export interface Client {
/**
* The name of the client.
*/
name?: string;
/**
* Free text description of the purpose of the Client. (Max character length: `140`).
*/
description?: string;
/**
* The id of the client.
*/
client_id?: string;
/**
* The client secret, it must not be public.
*/
client_secret?: string;
/**
* The type of application this client represents.
*/
app_type?: string;
/**
* The URL of the client logo (recommended size: 150x150).
*/
logo_uri?: string;
/**
* Whether this client a first party client or not.
*/
is_first_party?: boolean;
/**
* Whether this client will conform to strict OIDC specifications.
*/
oidc_conformant?: boolean;
/**
* The URLs that Auth0 can use to as a callback for the client.
*/
callbacks?: string[];
allowed_origins?: string[];
web_origins?: string[];
client_aliases?: string[];
allowed_clients?: string[];
allowed_logout_urls?: string[];
jwt_configuration?: any;
/**
* Client signing keys.
*/
signing_keys?: string[];
encryption_key?: any;
sso?: boolean;
/**
* `true` to disable Single Sign On, `false` otherwise (default: `false`)
*/
sso_disabled?: boolean;
/**
* `true` if this client can be used to make cross-origin authentication requests, `false` otherwise (default: `false`)
*/
cross_origin_auth?: boolean;
/**
* Url fo the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page.
*/
cross_origin_loc?: string;
/**
* `true` if the custom login page is to be used, `false` otherwise. (default: `true`)
*/
custom_login_page_on?: boolean;
custom_login_page?: string;
custom_login_page_preview?: string;
form_template?: string;
addons?: any;
/**
* Defines the requested authentication method for the token endpoint. Possible values are 'none' (public client without a client secret), 'client_secret_post' (client uses HTTP POST parameters) or 'client_secret_basic' (client uses HTTP Basic) ['none' or 'client_secret_post' or 'client_secret_basic']
*/
token_endpoint_auth_method?: string;
client_metadata?: any;
mobile?: any;
}
export interface User {
email?: string;
email_verified?: boolean;
@@ -338,21 +416,22 @@ export class ManagementClient {
// Clients
getClients(): Promise<User>;
getClients(cb: (err: Error, data: any) => void): void;
getClients(): Promise<Client[]>;
getClients(cb: (err: Error, clients: Client[]) => void): void;
getClient(params: ClientParams): Promise<User>;
getClient(params: ClientParams, cb: (err: Error, data: any) => void): void;
getClient(params: ClientParams): Promise<Client>;
getClient(params: ClientParams, cb: (err: Error, client: Client) => void): void;
createClient(data: Data): Promise<User>;
createClient(data: Data, cb: (err: Error, data: any) => void): void;
createClient(data: Data): Promise<Client>;
createClient(data: Data, cb: (err: Error, client: Client) => void): void;
updateClient(params: ClientParams, data: Data): Promise<User>;
updateClient(params: ClientParams, data: Data, cb: (err: Error, data: any) => void): void;
updateClient(params: ClientParams, data: Data): Promise<Client>;
updateClient(params: ClientParams, data: Data, cb: (err: Error, client: Client) => void): void;
deleteClient(params: ClientParams): Promise<User>;
deleteClient(params: ClientParams, cb: (err: Error, data: any) => void): void;
deleteClient(params: ClientParams): Promise<void>;
deleteClient(params: ClientParams, cb: (err: Error) => void): void;
// Client Grants
getClientGrants(): Promise<User>;
getClientGrants(cb: (err: Error, data: any) => void): void;
+3 -3
View File
@@ -32,19 +32,19 @@ export interface DeviceOptions extends mqtt.IClientOptions {
* same as certPath, but can also accept a buffer containing client
* certificate data
*/
clientCert?: string;
clientCert?: string | Buffer;
/**
* same as keyPath, but can also accept a buffer containing private key
* data
*/
privateKey?: string;
privateKey?: string | Buffer;
/**
* same as caPath, but can also accept a buffer containing CA certificate
* data
*/
caCert?: string;
caCert?: string | Buffer;
/**
* set to "true" to automatically re-subscribe to topics after
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/moskalyk/typed-aws-lambda-mock-context
// Definitions by: Morgan Moskalyk <morgan.moskalyk@gmail.com>, Anand Nimkar <anand.a.nimkar@gmail.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
declare function context(options?: Options): Context;
+36 -28
View File
@@ -4,6 +4,7 @@ var anyObj: any = { abc: 123 };
var num: number = 5;
var error: Error = new Error();
var b: boolean = true;
var apiGwEvtReqCtx: AWSLambda.APIGatewayEventRequestContext;
var apiGwEvt: AWSLambda.APIGatewayEvent;
var customAuthorizerEvt: AWSLambda.CustomAuthorizerEvent;
var clientCtx: AWSLambda.ClientContext;
@@ -22,33 +23,33 @@ var snsEvtRec: AWSLambda.SNSEventRecord;
var snsMsg: AWSLambda.SNSMessage;
var snsMsgAttr: AWSLambda.SNSMessageAttribute;
var snsMsgAttrs: AWSLambda.SNSMessageAttributes;
var S3EvtRec: AWSLambda.S3EventRecord = {
var S3EvtRec: AWSLambda.S3EventRecord = {
eventVersion: '2.0',
eventSource: 'aws:s3',
awsRegion: 'us-east-1',
eventTime: '1970-01-01T00:00:00.000Z',
eventName: 'ObjectCreated:Put',
userIdentity: {
userIdentity: {
principalId: 'AIDAJDPLRKLG7UEXAMPLE'
},
requestParameters:{
requestParameters:{
sourceIPAddress: '127.0.0.1'
},
responseElements: {
responseElements: {
'x-amz-request-id': 'C3D13FE58DE4C810',
'x-amz-id-2': 'FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD'
},
s3: {
s3: {
s3SchemaVersion: '1.0',
configurationId: 'testConfigRule',
bucket: {
bucket: {
name: 'mybucket',
ownerIdentity: {
ownerIdentity: {
principalId: 'A3NL1KOZZKExample'
},
arn: 'arn:aws:s3:::mybucket'
},
object: {
object: {
key: 'HappyFace.jpg',
size: 1024,
eTag: 'd41d8cd98f00b204e9800998ecf8427e',
@@ -65,6 +66,27 @@ var cognitoUserPoolEvent: AWSLambda.CognitoUserPoolEvent;
var cloudformationCustomResourceEvent: AWSLambda.CloudFormationCustomResourceEvent;
var cloudformationCustomResourceResponse: AWSLambda.CloudFormationCustomResourceResponse;
/* API Gateway Event request context */
str = apiGwEvtReqCtx.accountId;
str = apiGwEvtReqCtx.apiId;
str = apiGwEvtReqCtx.httpMethod;
str = apiGwEvtReqCtx.identity.accessKey;
str = apiGwEvtReqCtx.identity.accountId;
str = apiGwEvtReqCtx.identity.apiKey;
str = apiGwEvtReqCtx.identity.caller;
str = apiGwEvtReqCtx.identity.cognitoAuthenticationProvider;
str = apiGwEvtReqCtx.identity.cognitoAuthenticationType;
str = apiGwEvtReqCtx.identity.cognitoIdentityId;
str = apiGwEvtReqCtx.identity.cognitoIdentityPoolId;
str = apiGwEvtReqCtx.identity.sourceIp;
str = apiGwEvtReqCtx.identity.user;
str = apiGwEvtReqCtx.identity.userAgent;
str = apiGwEvtReqCtx.identity.userArn;
str = apiGwEvtReqCtx.stage;
str = apiGwEvtReqCtx.requestId;
str = apiGwEvtReqCtx.resourceId;
str = apiGwEvtReqCtx.resourcePath;
/* API Gateway Event */
str = apiGwEvt.body;
str = apiGwEvt.headers["example"];
@@ -74,31 +96,17 @@ str = apiGwEvt.path;
str = apiGwEvt.pathParameters["example"];
str = apiGwEvt.queryStringParameters["example"];
str = apiGwEvt.stageVariables["example"];
str = apiGwEvt.requestContext.accountId;
str = apiGwEvt.requestContext.apiId;
str = apiGwEvt.requestContext.httpMethod;
str = apiGwEvt.requestContext.identity.accessKey;
str = apiGwEvt.requestContext.identity.accountId;
str = apiGwEvt.requestContext.identity.apiKey;
str = apiGwEvt.requestContext.identity.caller;
str = apiGwEvt.requestContext.identity.cognitoAuthenticationProvider;
str = apiGwEvt.requestContext.identity.cognitoAuthenticationType;
str = apiGwEvt.requestContext.identity.cognitoIdentityId;
str = apiGwEvt.requestContext.identity.cognitoIdentityPoolId;
str = apiGwEvt.requestContext.identity.sourceIp;
str = apiGwEvt.requestContext.identity.user;
str = apiGwEvt.requestContext.identity.userAgent;
str = apiGwEvt.requestContext.identity.userArn;
str = apiGwEvt.requestContext.stage;
str = apiGwEvt.requestContext.requestId;
str = apiGwEvt.requestContext.resourceId;
str = apiGwEvt.requestContext.resourcePath;
apiGwEvtReqCtx = apiGwEvt.requestContext;
str = apiGwEvt.resource;
/* API Gateway CustomAuthorizer Event */
str = customAuthorizerEvt.type;
str = customAuthorizerEvt.authorizationToken;
str = customAuthorizerEvt.methodArn;
str = customAuthorizerEvt.authorizationToken;
str = apiGwEvt.pathParameters["example"];
str = apiGwEvt.queryStringParameters["example"];
str = apiGwEvt.stageVariables["example"];
apiGwEvtReqCtx = apiGwEvt.requestContext;
/* SNS Event */
snsEvtRecs = snsEvt.Records;
+34 -26
View File
@@ -8,9 +8,35 @@
// Yoriki Yamaguchi <https://github.com/y13i>
// wwwy3y3 <https://github.com/wwwy3y3>
// Ishaan Malhi <https://github.com/OrthoDex>
// Daniel Cottone <https://github.com/daniel-cottone>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
// API Gateway "event" request context
interface APIGatewayEventRequestContext {
accountId: string;
apiId: string;
httpMethod: string;
identity: {
accessKey: string | null;
accountId: string | null;
apiKey: string | null;
caller: string | null;
cognitoAuthenticationProvider: string | null;
cognitoAuthenticationType: string | null;
cognitoIdentityId: string | null;
cognitoIdentityPoolId: string | null;
sourceIp: string;
user: string | null;
userAgent: string | null;
userArn: string | null;
},
stage: string;
requestId: string;
resourceId: string;
resourcePath: string;
}
// API Gateway "event"
interface APIGatewayEvent {
body: string | null;
@@ -21,37 +47,19 @@ interface APIGatewayEvent {
pathParameters: { [name: string]: string } | null;
queryStringParameters: { [name: string]: string } | null;
stageVariables: { [name: string]: string } | null;
requestContext: {
accountId: string;
apiId: string;
httpMethod: string;
identity: {
accessKey: string | null;
accountId: string | null;
apiKey: string | null;
caller: string | null;
cognitoAuthenticationProvider: string | null;
cognitoAuthenticationType: string | null;
cognitoIdentityId: string | null;
cognitoIdentityPoolId: string | null;
sourceIp: string;
user: string | null;
userAgent: string | null;
userArn: string | null;
},
stage: string;
requestId: string;
resourceId: string;
resourcePath: string;
};
requestContext: APIGatewayEventRequestContext;
resource: string;
}
// API Gateway CustomAuthorizer "event"
interface CustomAuthorizerEvent {
type: string;
authorizationToken: string;
methodArn: string;
authorizationToken?: string;
headers?: { [name: string]: string };
pathParameters?: { [name: string]: string } | null;
queryStringParameters?: { [name: string]: string } | null;
requestContext?: APIGatewayEventRequestContext;
}
// SNS "event"
@@ -323,9 +331,9 @@ interface PolicyDocument {
* http://docs.aws.amazon.com/apigateway/latest/developerguide/use-custom-authorizer.html#api-gateway-custom-authorizer-output
*/
interface Statement {
Action: string | [string];
Action: string | string[];
Effect: string;
Resource: string | [string];
Resource: string | string[];
}
/**
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/awslabs/aws-serverless-express
// Definitions by: Ben Speakman <https://github.com/threesquared>, Josh Caffey <https://github.com/jcaffey>, Matthias Meyer <https://github.com/mattmeye>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="node"/>
import * as http from 'http';
+1
View File
@@ -3,6 +3,7 @@
// Definitions by: Troy Gerwien <https://github.com/yortus>
// Johnny Estilles <https://github.com/johnnyestilles>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import * as t from 'babel-types';
+7 -2
View File
@@ -165,7 +165,12 @@ function CommonMethodsInEventStreamsAndProperties() {
{
// Calculator for grouped consecutive values until group is cancelled:
var events = [
interface Event {
id:number;
type:string;
val?:number;
}
var events: Event[] = [
{id: 1, type: "add", val: 3},
{id: 2, type: "add", val: -1},
{id: 1, type: "add", val: 2},
@@ -177,7 +182,7 @@ function CommonMethodsInEventStreamsAndProperties() {
{id: 1, type: "cancel"}
],
keyF = (event:{id:number}) => event.id,
limitF = (groupedStream:Bacon.EventStream<string, {id:number; type:string; val?:number}>) => {
limitF = (groupedStream:Bacon.EventStream<string, Event>) => {
var cancel = groupedStream.filter(x => x.type === "cancel").take(1),
adds = groupedStream.filter(x => x.type === "add");
return adds.takeUntil(cancel).map(x => x.val);
+1 -1
View File
@@ -203,5 +203,5 @@ declare namespace BezierJs {
}
declare module "bezier-js" {
export = BezierJs;
export = BezierJs.Bezier;
}
@@ -0,0 +1,95 @@
import { Parser } from "binary-parser";
// Build an IP packet header Parser
const ipHeader = new Parser()
.endianess('big')
.bit4('version')
.bit4('headerLength')
.uint8('tos')
.uint16('packetLength')
.uint16('id')
.bit3('offset')
.bit13('fragOffset')
.uint8('ttl')
.uint8('protocol')
.uint16('checksum')
.array('src', {
type: 'uint8',
length: 4
})
.array('dst', {
type: 'uint8',
length: 4
});
// Prepare buffer to parse.
const buf = new Buffer('450002c5939900002c06ef98adc24f6c850186d1', 'hex');
// Parse buffer and show result
ipHeader.parse(buf);
const parser2 = new Parser()
// Signed 32-bit integer (little endian)
.int32le('a')
// Unsigned 8-bit integer
.uint8('b')
// Signed 16-bit integer (big endian)
.int16be('c');
const parser3 = new Parser()
// 32-bit floating value (big endian)
.floatbe('a')
// 64-bit floating value (little endian)
.doublele('b');
const parser4 = new Parser()
// Statically sized array
.array('data', {
type: 'int32',
length: 8
})
// Dynamically sized array (references another variable)
.uint8('dataLength')
.array('data2', {
type: 'int32',
length: 'dataLength'
})
// Dynamically sized array (with some calculation)
.array('data3', {
type: 'int32',
length: () => 4 // other fields are available through this
})
// Statically sized array
.array('data4', {
type: 'int32',
lengthInBytes: 16
})
// Dynamically sized array (references another variable)
.uint8('dataLengthInBytes')
.array('data5', {
type: 'int32',
lengthInBytes: 'dataLengthInBytes'
})
// Dynamically sized array (with some calculation)
.array('data6', {
type: 'int32',
lengthInBytes: () => 4, // other fields are available through this
})
// Dynamically sized array (with stop-check on parsed item)
.array('data7', {
type: 'int32',
readUntil: (item, buffer) => true // stop when specific item is parsed. buffer can be used to perform a read-ahead.
});
const parser5 = new Parser()
.array('ipv4', {
type: 'uint8',
length: '4',
formatter: (arr) => { }
});
+147
View File
@@ -0,0 +1,147 @@
// Type definitions for binary-parser 1.3
// Project: https://github.com/keichi/binary-parser
// Definitions by: Benjamin Riggs <https://github.com/riggs>, Dolan Miu <https://github.com/dolanmiu>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
export interface Parser {
parse(buffer: Buffer, callback?: (err?: Error, result?: any) => void): Parser.Parsed;
create(constructorFunction: ObjectConstructor): Parser;
int8(name: string, options?: Parser.Options): Parser;
uint8(name: string, options?: Parser.Options): Parser;
int16(name: string, options?: Parser.Options): Parser;
uint16(name: string, options?: Parser.Options): Parser;
int16le(name: string, options?: Parser.Options): Parser;
int16be(name: string, options?: Parser.Options): Parser;
uint16le(name: string, options?: Parser.Options): Parser;
uint16be(name: string, options?: Parser.Options): Parser;
int32(name: string, options?: Parser.Options): Parser;
uint32(name: string, options?: Parser.Options): Parser;
int32le(name: string, options?: Parser.Options): Parser;
int32be(name: string, options?: Parser.Options): Parser;
uint32le(name: string, options?: Parser.Options): Parser;
uint32be(name: string, options?: Parser.Options): Parser;
bit1(name: string, options?: Parser.Options): Parser;
bit2(name: string, options?: Parser.Options): Parser;
bit3(name: string, options?: Parser.Options): Parser;
bit4(name: string, options?: Parser.Options): Parser;
bit5(name: string, options?: Parser.Options): Parser;
bit6(name: string, options?: Parser.Options): Parser;
bit7(name: string, options?: Parser.Options): Parser;
bit8(name: string, options?: Parser.Options): Parser;
bit9(name: string, options?: Parser.Options): Parser;
bit10(name: string, options?: Parser.Options): Parser;
bit11(name: string, options?: Parser.Options): Parser;
bit12(name: string, options?: Parser.Options): Parser;
bit13(name: string, options?: Parser.Options): Parser;
bit14(name: string, options?: Parser.Options): Parser;
bit15(name: string, options?: Parser.Options): Parser;
bit16(name: string, options?: Parser.Options): Parser;
bit17(name: string, options?: Parser.Options): Parser;
bit18(name: string, options?: Parser.Options): Parser;
bit19(name: string, options?: Parser.Options): Parser;
bit20(name: string, options?: Parser.Options): Parser;
bit21(name: string, options?: Parser.Options): Parser;
bit22(name: string, options?: Parser.Options): Parser;
bit23(name: string, options?: Parser.Options): Parser;
bit24(name: string, options?: Parser.Options): Parser;
bit25(name: string, options?: Parser.Options): Parser;
bit26(name: string, options?: Parser.Options): Parser;
bit27(name: string, options?: Parser.Options): Parser;
bit28(name: string, options?: Parser.Options): Parser;
bit29(name: string, options?: Parser.Options): Parser;
bit30(name: string, options?: Parser.Options): Parser;
bit31(name: string, options?: Parser.Options): Parser;
bit32(name: string, options?: Parser.Options): Parser;
float(name: string, options?: Parser.Options): Parser;
floatle(name: string, options?: Parser.Options): Parser;
floatbe(name: string, options?: Parser.Options): Parser;
double(name: string, options?: Parser.Options): Parser;
doublele(name: string, options?: Parser.Options): Parser;
doublebe(name: string, options?: Parser.Options): Parser;
string(name: string, options?: Parser.StringOptions): Parser;
buffer(name: string, options: Parser.BufferOptions): Parser;
array(name: string, options: Parser.ArrayOptions): Parser;
choice(name: string, options: Parser.ChoiceOptions): Parser;
nest(name: string, options: Parser.NestOptions): Parser;
skip(length: number): Parser;
endianess(endianess: Parser.Endianness): Parser; /* [sic] */
namely(alias: string): Parser;
compile(): void;
getCode(): string;
}
export interface ParserConstructor {
new(): Parser;
}
export const Parser: ParserConstructor;
export namespace Parser {
type Data = number | string | Array<number | Parsed> | Parsed | Buffer;
interface Parsed {
[name: string]: Data;
}
interface Options {
formatter?: ((value: Data) => any);
assert?: string | number | ((value: Data) => boolean);
}
interface StringOptions extends Options {
encoding?: string;
length?: number | string | ((this: Parsed) => number);
zeroTerminated?: boolean;
greedy?: boolean;
stripNull?: boolean;
}
interface BufferOptions extends Options {
clone?: boolean;
length?: number | string | ((this: Parsed) => number);
readUntil?: string | ((item: number, buffer: Buffer) => boolean);
}
interface ArrayOptions extends Options {
type: string | Parser;
length?: number | string | ((this: Parsed) => number);
lengthInBytes?: number | string | ((this: Parsed) => number);
readUntil?: string | ((item: number, buffer: Buffer) => boolean);
}
interface ChoiceOptions extends Options {
tag: string | ((this: Parsed) => number);
choices: { [item: number]: Parser | string };
defaultChoice?: Parser | string;
}
interface NestOptions extends Options {
type: Parser | string;
}
type Endianness =
'little' |
'big';
interface Context {
[name: string]: Parsed;
}
}
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"binary-parser-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+17 -13
View File
@@ -10,12 +10,12 @@
/// <reference types="node" />
import BigInteger = require("bigi");
export interface Output {
export interface Out {
script: Buffer;
value: number;
}
export interface Input {
export interface In {
script: Buffer;
hash: Buffer;
index: number;
@@ -152,8 +152,8 @@ export class HDNode {
export class Transaction {
version: number;
locktime: number;
ins: Input[];
outs: Output[];
ins: In[];
outs: Out[];
constructor();
addInput(hash: Buffer, index: number, sequence?: number, scriptSig?: Buffer): number;
@@ -205,21 +205,25 @@ export class Transaction {
static isCoinbaseHash(buffer: Buffer): boolean;
}
export interface Input {
pubKeys: Buffer[];
signatures: Buffer[];
prevOutScript: Buffer;
prevOutType: string;
signType: string;
signScript: Buffer;
witness: boolean;
}
export class TransactionBuilder {
tx: Transaction;
inputs: Array<{ pubKeys: Buffer[],
signatures: Buffer[],
prevOutScript: Buffer,
prevOutType: string,
signType: string,
signScript: Buffer,
witness: boolean} >;
inputs: Input[];
constructor(network?: Network, maximumFeeRate?: number);
addInput(txhash: Buffer | string | Transaction, vout: number, sequence?: number, prevOutScript?: Buffer): number;
addOutput(scriptPubKey: Buffer, value: number): number;
addOutput(scriptPubKey: Buffer | string, value: number): number;
build(): Transaction;
@@ -537,7 +541,7 @@ export namespace script {
output: {
check(script: Buffer): boolean;
decode(buffer: Buffer): Buffer;
encode(data: Buffer[]): Buffer;
encode(data: Buffer): Buffer;
};
};
}
+224 -62
View File
@@ -43,24 +43,37 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
constructor(callback: (resolve: (thenableOrResult?: R | PromiseLike<R>) => void, reject: (error?: any) => void, onCancel?: (callback: () => void) => void) => void);
/**
* Promises/A+ `.then()`. Returns a new promise chained from this promise. The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise.
* Promises/A+ `.then()`. Returns a new promise chained from this promise.
*
* The new promise will be rejected or resolved dedefer on the passed `fulfilledHandler`, `rejectedHandler` and the state of this promise.
*/
// Based on PromiseLike.then, but returns a Bluebird instance.
then<U>(onFulfill?: (value: R) => U | PromiseLike<U>, onReject?: (error: any) => U | PromiseLike<U>): Bluebird<U>; // For simpler signature help.
then<TResult1 = R, TResult2 = never>(onfulfilled?: ((value: R) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Bluebird<TResult1 | TResult2>;
then<TResult1 = R, TResult2 = never>(
onfulfilled?: ((value: R) => TResult1 | PromiseLike<TResult1>) | null,
onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null
): Bluebird<TResult1 | TResult2>;
/**
* This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler.
* This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise.
*
* Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler.
*
* Alias `.caught();` for compatibility with earlier ECMAScript version.
*/
catch(onReject: (error: any) => R | PromiseLike<R>): Bluebird<R>;
catch<U>(onReject?: ((error: any) => U | PromiseLike<U>) | undefined | null): Bluebird<U | R>;
catch<U>(onReject: ((error: any) => U | PromiseLike<U>) | undefined | null): Bluebird<U | R>;
/**
* This extends `.catch` to work more like catch-clauses in languages like Java or C#. Instead of manually checking `instanceof` or `.name === "SomeError"`, you may specify a number of error constructors which are eligible for this catch handler. The catch handler that is first met that has eligible constructors specified, is the one that will be called.
* This extends `.catch` to work more like catch-clauses in languages like Java or C#.
*
* This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. The return result of the predicate will be used determine whether the error handler should be called.
* Instead of manually checking `instanceof` or `.name === "SomeError"`,
* you may specify a number of error constructors which are eligible for this catch handler.
* The catch handler that is first met that has eligible constructors specified, is the one that will be called.
*
* This method also supports predicate-based filters.
* If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument.
* The return result of the predicate will be used determine whether the error handler should be called.
*
* Alias `.caught();` for compatibility with earlier ECMAScript version.
*/
@@ -190,17 +203,23 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
): Bluebird<U | R>;
/**
* This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise. Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler.
* This is a catch-all exception handler, shortcut for calling `.then(null, handler)` on this promise.
*
* Any exception happening in a `.then`-chain will propagate to nearest `.catch` handler.
*
* Alias `.caught();` for compatibility with earlier ECMAScript version.
*/
caught(onReject: (error: any) => R | PromiseLike<R>): Bluebird<R>;
caught<U>(onReject?: ((error: any) => U | PromiseLike<U>) | undefined | null): Bluebird<U | R>;
caught<U>(onReject: ((error: any) => U | PromiseLike<U>) | undefined | null): Bluebird<U | R>;
/**
* This extends `.catch` to work more like catch-clauses in languages like Java or C#. Instead of manually checking `instanceof` or `.name === "SomeError"`, you may specify a number of error constructors which are eligible for this catch handler. The catch handler that is first met that has eligible constructors specified, is the one that will be called.
* This extends `.catch` to work more like catch-clauses in languages like Java or C#.
*
* This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument. The return result of the predicate will be used determine whether the error handler should be called.
* Instead of manually checking `instanceof` or `.name === "SomeError"`, you may specify a number of error constructors which are eligible for this catch handler.
* The catch handler that is first met that has eligible constructors specified, is the one that will be called.
*
* This method also supports predicate-based filters. If you pass a predicate function instead of an error constructor, the predicate will receive the error as an argument.
* The return result of the predicate will be used determine whether the error handler should be called.
*
* Alias `.caught();` for compatibility with earlier ECMAScript version.
*/
@@ -335,7 +354,9 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
error<U>(onReject: (reason: any) => U | PromiseLike<U>): Bluebird<U>;
/**
* Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise. There are special semantics for `.finally()` in that the final value cannot be modified from the handler.
* Pass a handler that will be called regardless of this promise's fate. Returns a new promise chained from this promise.
*
* There are special semantics for `.finally()` in that the final value cannot be modified from the handler.
*
* Alias `.lastly();` for compatibility with earlier ECMAScript version.
*/
@@ -344,7 +365,9 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
lastly<U>(handler: () => U | PromiseLike<U>): Bluebird<R>;
/**
* Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`. Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise.
* Create a promise that follows this promise, but is bound to the given `thisArg` value. A bound promise will call its handlers with the bound value set to `this`.
*
* Additionally promises derived from a bound promise will also be bound promises with the same `thisArg` binding as the original promise.
*/
bind(thisArg: any): Bluebird<R>;
@@ -409,7 +432,11 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
timeout(ms: number, message?: string | Error): Bluebird<R>;
/**
* Register a node-style callback on this promise. When this promise is is either fulfilled or rejected, the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument. The error argument will be `null` in case of success.
* Register a node-style callback on this promise.
*
* When this promise is is either fulfilled or rejected,
* the node callback will be called back with the node.js convention where error reason is the first argument and success value is the second argument.
* The error argument will be `null` in case of success.
* If the `callback` argument is not a function, this method does not do anything.
*/
nodeify(callback: (err: any, value?: R) => void, options?: Bluebird.SpreadOption): this;
@@ -694,7 +721,8 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
/**
* Start the chain of promises with `Promise.try`. Any synchronous exceptions will be turned into rejections on the returned promise.
*
* Note about second argument: if it's specifically a true array, its values become respective arguments for the function call. Otherwise it is passed as is as the first argument for the function call.
* Note about second argument: if it's specifically a true array, its values become respective arguments for the function call.
* Otherwise it is passed as is as the first argument for the function call.
*
* Alias for `attempt();` for compatibility with earlier ECMAScript version.
*/
@@ -702,7 +730,8 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
static attempt<R>(fn: () => R | PromiseLike<R>): Bluebird<R>;
/**
* Returns a new function that wraps the given function `fn`. The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function.
* Returns a new function that wraps the given function `fn`.
* The new function will always return a promise that is fulfilled with the original functions return values or rejected with thrown exceptions from the original function.
* This method is convenient when a function can sometimes return synchronously or throw synchronously.
*/
static method<R, A1>(fn: (arg1: A1) => R | PromiseLike<R>): (arg1: A1) => Bluebird<R>;
@@ -729,7 +758,10 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
static defer<R>(): Bluebird.Resolver<R>;
/**
* Cast the given `value` to a trusted promise. If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value. If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable.
* Cast the given `value` to a trusted promise.
*
* If `value` is already a trusted `Promise`, it is returned as is. If `value` is not a thenable, a fulfilled is: Promise returned with `value` as its fulfillment value.
* If `value` is a thenable (Promise-like object, like those returned by jQuery's `$.ajax`), returns a trusted that: Promise assimilates the state of the thenable.
*/
static cast<R>(value: R | PromiseLike<R>): Bluebird<R>;
@@ -744,7 +776,10 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
static is(value: any): boolean;
/**
* Call this right after the library is loaded to enabled long stack traces. Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have already been created. Long stack traces imply a substantial performance penalty, around 4-5x for throughput and 0.5x for latency.
* Call this right after the library is loaded to enabled long stack traces.
*
* Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have already been created.
* Long stack traces imply a substantial performance penalty, around 4-5x for throughput and 0.5x for latency.
*/
static longStackTraces(): void;
@@ -757,24 +792,49 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
static delay(ms: number): Bluebird<void>;
/**
* Returns a function that will wrap the given `nodeFunction`. Instead of taking a callback, the returned function will return a promise whose fate is decided by the callback behavior of the given node function. The node function should conform to node.js convention of accepting a callback as last argument and calling that callback with error as the first argument and success value on the second argument.
* Returns a function that will wrap the given `nodeFunction`.
*
* Instead of taking a callback, the returned function will return a promise whose fate is decided by the callback behavior of the given node function.
* The node function should conform to node.js convention of accepting a callback as last argument and
* calling that callback with error as the first argument and success value on the second argument.
*
* If the `nodeFunction` calls its callback with multiple success values, the fulfillment value will be an array of them.
*
* If you pass a `receiver`, the `nodeFunction` will be called as a method on the `receiver`.
*/
static promisify<T>(func: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): () => Bluebird<T>;
static promisify<T, A1>(func: (arg1: A1, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1) => Bluebird<T>;
static promisify<T, A1, A2>(func: (arg1: A1, arg2: A2, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2) => Bluebird<T>;
static promisify<T, A1, A2, A3>(func: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3) => Bluebird<T>;
static promisify<T, A1, A2, A3, A4>(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird<T>;
static promisify<T, A1, A2, A3, A4, A5>(func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, result?: T) => void) => void, options?: Bluebird.PromisifyOptions): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird<T>;
static promisify<T>(
func: (callback: (err: any, result?: T) => void) => void,
options?: Bluebird.PromisifyOptions
): () => Bluebird<T>;
static promisify<T, A1>(
func: (arg1: A1, callback: (err: any, result?: T) => void) => void,
options?: Bluebird.PromisifyOptions
): (arg1: A1) => Bluebird<T>;
static promisify<T, A1, A2>(
func: (arg1: A1, arg2: A2, callback: (err: any, result?: T) => void) => void,
options?: Bluebird.PromisifyOptions
): (arg1: A1, arg2: A2) => Bluebird<T>;
static promisify<T, A1, A2, A3>(
func: (arg1: A1, arg2: A2, arg3: A3, callback: (err: any, result?: T) => void) => void,
options?: Bluebird.PromisifyOptions
): (arg1: A1, arg2: A2, arg3: A3) => Bluebird<T>;
static promisify<T, A1, A2, A3, A4>(
func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, callback: (err: any, result?: T) => void) => void,
options?: Bluebird.PromisifyOptions
): (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => Bluebird<T>;
static promisify<T, A1, A2, A3, A4, A5>(
func: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5, callback: (err: any, result?: T) => void) => void,
options?: Bluebird.PromisifyOptions
): (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => Bluebird<T>;
static promisify(nodeFunction: (...args: any[]) => void, options?: Bluebird.PromisifyOptions): (...args: any[]) => Bluebird<any>;
/**
* Promisifies the entire object by going through the object's properties and creating an async equivalent of each function on the object and its prototype chain. The promisified method name will be the original method name postfixed with `Async`. Returns the input object.
* Promisifies the entire object by going through the object's properties and creating an async equivalent of each function on the object and its prototype chain.
*
* Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example, if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method.
* The promisified method name will be the original method name postfixed with `Async`. Returns the input object.
*
* Note that the original methods on the object are not overwritten but new methods are created with the `Async`-postfix. For example,
* if you `promisifyAll()` the node.js `fs` object use `fs.statAsync()` to call the promisified `stat` method.
*/
// TODO how to model promisifyAll?
static promisifyAll<T extends object>(target: T, options?: Bluebird.PromisifyAllOptions<T>): T;
@@ -788,19 +848,49 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
static fromCallback<T>(resolver: (callback: (err: any, result?: T) => void) => void, options?: Bluebird.FromNodeOptions): Bluebird<T>;
/**
* Returns a function that can use `yield` to run asynchronous code synchronously. This feature requires the support of generators which are drafted in the next version of the language. Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch.
* Returns a function that can use `yield` to run asynchronous code synchronously.
*
* This feature requires the support of generators which are drafted in the next version of the language.
* Node version greater than `0.11.2` is required and needs to be executed with the `--harmony-generators` (or `--harmony`) command-line switch.
*/
// TODO: After https://github.com/Microsoft/TypeScript/issues/2983 is implemented, we can use
// the return type propagation of generators to automatically infer the return type T.
static coroutine<T>(generatorFunction: () => IterableIterator<any>, options?: Bluebird.CoroutineOptions): () => Bluebird<T>;
static coroutine<T, A1>(generatorFunction: (a1: A1) => IterableIterator<any>, options?: Bluebird.CoroutineOptions): (a1: A1) => Bluebird<T>;
static coroutine<T, A1, A2>(generatorFunction: (a1: A1, a2: A2) => IterableIterator<any>, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2) => Bluebird<T>;
static coroutine<T, A1, A2, A3>(generatorFunction: (a1: A1, a2: A2, a3: A3) => IterableIterator<any>, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3) => Bluebird<T>;
static coroutine<T, A1, A2, A3, A4>(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4) => IterableIterator<any>, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4) => Bluebird<T>;
static coroutine<T, A1, A2, A3, A4, A5>(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => IterableIterator<any>, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => Bluebird<T>;
static coroutine<T, A1, A2, A3, A4, A5, A6>(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => IterableIterator<any>, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => Bluebird<T>;
static coroutine<T, A1, A2, A3, A4, A5, A6, A7>(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => IterableIterator<any>, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => Bluebird<T>;
static coroutine<T, A1, A2, A3, A4, A5, A6, A7, A8>(generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => IterableIterator<any>, options?: Bluebird.CoroutineOptions): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => Bluebird<T>;
static coroutine<T>(
generatorFunction: () => IterableIterator<any>,
options?: Bluebird.CoroutineOptions
): () => Bluebird<T>;
static coroutine<T, A1>(
generatorFunction: (a1: A1) => IterableIterator<any>,
options?: Bluebird.CoroutineOptions
): (a1: A1) => Bluebird<T>;
static coroutine<T, A1, A2>(
generatorFunction: (a1: A1, a2: A2) => IterableIterator<any>,
options?: Bluebird.CoroutineOptions
): (a1: A1, a2: A2) => Bluebird<T>;
static coroutine<T, A1, A2, A3>(
generatorFunction: (a1: A1, a2: A2, a3: A3) => IterableIterator<any>,
options?: Bluebird.CoroutineOptions
): (a1: A1, a2: A2, a3: A3) => Bluebird<T>;
static coroutine<T, A1, A2, A3, A4>(
generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4) => IterableIterator<any>,
options?: Bluebird.CoroutineOptions
): (a1: A1, a2: A2, a3: A3, a4: A4) => Bluebird<T>;
static coroutine<T, A1, A2, A3, A4, A5>(
generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => IterableIterator<any>,
options?: Bluebird.CoroutineOptions
): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5) => Bluebird<T>;
static coroutine<T, A1, A2, A3, A4, A5, A6>(
generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => IterableIterator<any>,
options?: Bluebird.CoroutineOptions
): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6) => Bluebird<T>;
static coroutine<T, A1, A2, A3, A4, A5, A6, A7>(
generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => IterableIterator<any>,
options?: Bluebird.CoroutineOptions
): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7) => Bluebird<T>;
static coroutine<T, A1, A2, A3, A4, A5, A6, A7, A8>(
generatorFunction: (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => IterableIterator<any>,
options?: Bluebird.CoroutineOptions
): (a1: A1, a2: A2, a3: A3, a4: A4, a5: A5, a6: A6, a7: A7, a8: A8) => Bluebird<T>;
/**
* Add `handler` as the handler to call when there is a possibly unhandled rejection. The default handler logs the error stack to stderr or `console.error` in browsers.
@@ -820,7 +910,9 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
static onPossiblyUnhandledRejection(handler?: (error: Error, promise: Bluebird<any>) => void): void;
/**
* Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are fulfilled. The promise's fulfillment value is an array with fulfillment values at respective positions to the original array. If any promise in the array rejects, the returned promise is rejected with the rejection reason.
* Given an array, or a promise of an array, which contains promises (or a mix of promises and values) return a promise that is fulfilled when all the items in the array are fulfilled.
* The promise's fulfillment value is an array with fulfillment values at respective positions to the original array.
* If any promise in the array rejects, the returned promise is rejected with the rejection reason.
*/
// TODO enable more overloads
// array with promises of different types
@@ -833,9 +925,13 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
static all<R>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>): Bluebird<R[]>;
/**
* Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled. The promise's fulfillment value is an object with fulfillment values at respective keys to the original object. If any promise in the object rejects, the returned promise is rejected with the rejection reason.
* Like ``Promise.all`` but for object properties instead of array items. Returns a promise that is fulfilled when all the properties of the object are fulfilled.
*
* If `object` is a trusted `Promise`, then it will be treated as a promise for object rather than for its properties. All other objects are treated for their properties as is returned by `Object.keys` - the object's own enumerable properties.
* The promise's fulfillment value is an object with fulfillment values at respective keys to the original object.
* If any promise in the object rejects, the returned promise is rejected with the rejection reason.
*
* If `object` is a trusted `Promise`, then it will be treated as a promise for object rather than for its properties.
* All other objects are treated for their properties as is returned by `Object.keys` - the object's own enumerable properties.
*
* *The original object is not modified.*
*/
@@ -859,7 +955,8 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
static race<R>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>): Bluebird<R>;
/**
* Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises). When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution.
* Initiate a competetive race between multiple promises or values (values will become immediately fulfilled promises).
* When `count` amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution.
*
* If too many promises are rejected so that the promise can never become fulfilled, it will be immediately rejected with an array of rejection reasons in the order they were thrown in.
*
@@ -874,60 +971,112 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
* ) -> Promise
* For coordinating multiple concurrent discrete promises.
*
* Note: In 1.x and 0.x Promise.join used to be a Promise.all that took the values in as arguments instead in an array. This behavior has been deprecated but is still supported partially - when the last argument is an immediate function value the new semantics will apply
* Note: In 1.x and 0.x Promise.join used to be a Promise.all that took the values in as arguments instead in an array.
* This behavior has been deprecated but is still supported partially - when the last argument is an immediate function value the new semantics will apply
*/
static join<R, A1>(arg1: A1 | PromiseLike<A1>, handler: (arg1: A1) => R | PromiseLike<R>): Bluebird<R>;
static join<R, A1, A2>(arg1: A1 | PromiseLike<A1>, arg2: A2 | PromiseLike<A2>, handler: (arg1: A1, arg2: A2) => R | PromiseLike<R>): Bluebird<R>;
static join<R, A1, A2, A3>(arg1: A1 | PromiseLike<A1>, arg2: A2 | PromiseLike<A2>, arg3: A3 | PromiseLike<A3>, handler: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike<R>): Bluebird<R>;
static join<R, A1, A2, A3, A4>(arg1: A1 | PromiseLike<A1>, arg2: A2 | PromiseLike<A2>, arg3: A3 | PromiseLike<A3>, arg4: A4 | PromiseLike<A4>, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike<R>): Bluebird<R>;
static join<R, A1, A2, A3, A4, A5>(arg1: A1 | PromiseLike<A1>, arg2: A2 | PromiseLike<A2>, arg3: A3 | PromiseLike<A3>, arg4: A4 | PromiseLike<A4>, arg5: A5 | PromiseLike<A5>, handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike<R>): Bluebird<R>;
static join<R, A1>(
arg1: A1 | PromiseLike<A1>,
handler: (arg1: A1) => R | PromiseLike<R>
): Bluebird<R>;
static join<R, A1, A2>(
arg1: A1 | PromiseLike<A1>,
arg2: A2 | PromiseLike<A2>,
handler: (arg1: A1, arg2: A2) => R | PromiseLike<R>
): Bluebird<R>;
static join<R, A1, A2, A3>(
arg1: A1 | PromiseLike<A1>,
arg2: A2 | PromiseLike<A2>,
arg3: A3 | PromiseLike<A3>,
handler: (arg1: A1, arg2: A2, arg3: A3) => R | PromiseLike<R>
): Bluebird<R>;
static join<R, A1, A2, A3, A4>(
arg1: A1 | PromiseLike<A1>,
arg2: A2 | PromiseLike<A2>,
arg3: A3 | PromiseLike<A3>,
arg4: A4 | PromiseLike<A4>,
handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4) => R | PromiseLike<R>
): Bluebird<R>;
static join<R, A1, A2, A3, A4, A5>(
arg1: A1 | PromiseLike<A1>,
arg2: A2 | PromiseLike<A2>,
arg3: A3 | PromiseLike<A3>,
arg4: A4 | PromiseLike<A4>,
arg5: A5 | PromiseLike<A5>,
handler: (arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5) => R | PromiseLike<R>
): Bluebird<R>;
// variadic array
/** @deprecated use .all instead */
static join<R>(...values: Array<R | PromiseLike<R>>): Bluebird<R[]>;
/**
* Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well.
* Map an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `mapper` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array.
* If any promise in the input array is rejected the returned promise is rejected as well.
*
* If the `mapper` function returns promises or thenables, the returned promise will wait for all the mapped results to be resolved as well.
*
* *The original array is not modified.*
*/
static map<R, U>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>, mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>, options?: Bluebird.ConcurrencyOption): Bluebird<U[]>;
static map<R, U>(
values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>,
mapper: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>,
options?: Bluebird.ConcurrencyOption
): Bluebird<U[]>;
/**
* Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well.
* Reduce an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `reducer` function with the signature `(total, current, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array.
* If any promise in the input array is rejected the returned promise is rejected as well.
*
* If the reducer function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration.
*
* *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned. If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.*
* *The original array is not modified. If no `intialValue` is given and the array doesn't contain at least 2 items, the callback will not be called and `undefined` is returned.
* If `initialValue` is given and the array doesn't have at least 1 item, `initialValue` is returned.*
*/
static reduce<R, U>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>, reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike<U>, initialValue?: U): Bluebird<U>;
static reduce<R, U>(
values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>,
reducer: (total: U, current: R, index: number, arrayLength: number) => U | PromiseLike<U>,
initialValue?: U
): Bluebird<U>;
/**
* Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array. If any promise in the input array is rejected the returned promise is rejected as well.
* Filter an array, or a promise of an array, which contains a promises (or a mix of promises and values) with the given `filterer` function with the signature `(item, index, arrayLength)` where `item` is the resolved value of a respective promise in the input array.
* If any promise in the input array is rejected the returned promise is rejected as well.
*
* The return values from the filtered functions are coerced to booleans, with the exception of promises and thenables which are awaited for their eventual result.
*
* *The original array is not modified.
*/
static filter<R>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>, filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike<boolean>, option?: Bluebird.ConcurrencyOption): Bluebird<R[]>;
static filter<R>(
values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>,
filterer: (item: R, index: number, arrayLength: number) => boolean | PromiseLike<boolean>,
option?: Bluebird.ConcurrencyOption
): Bluebird<R[]>;
/**
* Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array. Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well.
* Iterate over an array, or a promise of an array, which contains promises (or a mix of promises and values) with the given iterator function with the signature (item, index, value) where item is the resolved value of a respective promise in the input array.
* Iteration happens serially. If any promise in the input array is rejected the returned promise is rejected as well.
*
* Resolves to the original array unmodified, this method is meant to be used for side effects. If the iterator function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration.
* Resolves to the original array unmodified, this method is meant to be used for side effects.
* If the iterator function returns a promise or a thenable, the result for the promise is awaited for before continuing with next iteration.
*/
static each<R, U>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>): Bluebird<R[]>;
static each<R, U>(
values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>,
iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>
): Bluebird<R[]>;
/**
* Given an Iterable(arrays are Iterable), or a promise of an Iterable, which produces promises (or a mix of promises and values), iterate over all the values in the Iterable into an array and iterate over the array serially, in-order.
*
* Returns a promise for an array that contains the values returned by the iterator function in their respective positions. The iterator won't be called for an item until its previous item, and the promise returned by the iterator for that item are fulfilled. This results in a mapSeries kind of utility but it can also be used simply as a side effect iterator similar to Array#forEach.
* Returns a promise for an array that contains the values returned by the iterator function in their respective positions.
* The iterator won't be called for an item until its previous item, and the promise returned by the iterator for that item are fulfilled.
* This results in a mapSeries kind of utility but it can also be used simply as a side effect iterator similar to Array#forEach.
*
* If any promise in the input array is rejected or any promise returned by the iterator function is rejected, the result will be rejected as well.
*/
static mapSeries<R, U>(values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>, iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>): Bluebird<U[]>;
static mapSeries<R, U>(
values: PromiseLike<Iterable<PromiseLike<R> | R>> | Iterable<PromiseLike<R> | R>,
iterator: (item: R, index: number, arrayLength: number) => U | PromiseLike<U>
): Bluebird<U[]>;
/**
* A meta method used to specify the disposer method that cleans up a resource when using `Promise.using`.
@@ -946,9 +1095,21 @@ declare class Bluebird<R> implements PromiseLike<R>, Bluebird.Inspection<R> {
* will be called when the promise returned by the callback passed to using has settled. The disposer is
* necessary because there is no standard interface in node for disposing resources.
*/
static using<R, T>(disposer: Bluebird.Disposer<R>, executor: (transaction: R) => PromiseLike<T>): Bluebird<T>;
static using<R1, R2, T>(disposer: Bluebird.Disposer<R1>, disposer2: Bluebird.Disposer<R2>, executor: (transaction1: R1, transaction2: R2) => PromiseLike<T>): Bluebird<T>;
static using<R1, R2, R3, T>(disposer: Bluebird.Disposer<R1>, disposer2: Bluebird.Disposer<R2>, disposer3: Bluebird.Disposer<R3>, executor: (transaction1: R1, transaction2: R2, transaction3: R3) => PromiseLike<T>): Bluebird<T>;
static using<R, T>(
disposer: Bluebird.Disposer<R>,
executor: (transaction: R) => PromiseLike<T>
): Bluebird<T>;
static using<R1, R2, T>(
disposer: Bluebird.Disposer<R1>,
disposer2: Bluebird.Disposer<R2>,
executor: (transaction1: R1, transaction2: R2
) => PromiseLike<T>): Bluebird<T>;
static using<R1, R2, R3, T>(
disposer: Bluebird.Disposer<R1>,
disposer2: Bluebird.Disposer<R2>,
disposer3: Bluebird.Disposer<R3>,
executor: (transaction1: R1, transaction2: R2, transaction3: R3) => PromiseLike<T>
): Bluebird<T>;
/**
* Configure long stack traces, warnings, monitoring and cancellation.
@@ -1083,7 +1244,8 @@ declare namespace Bluebird {
reject(reason: any): void;
/**
* Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property. The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions.
* Gives you a callback representation of the `PromiseResolver`. Note that this is not a method but a property.
* The callback accepts error object in first argument and success values on the 2nd parameter and the rest, I.E. node js conventions.
*
* If the the callback is called with multiple success values, the resolver fullfills its promise with an array of the values.
*/
+1 -2
View File
@@ -1,8 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"max-line-length": [true, 490],
"no-redundant-undefined": false,
"max-line-length": [true, 280],
"no-unnecessary-generics": false,
"prefer-const": false
}
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/expressjs/body-parser
// Definitions by: Santi Albo <https://github.com/santialbo>, Vilic Vane <https://github.com/vilic>, Jonathan Häberle <https://github.com/dreampulse>, Gevik Babakhani <https://github.com/blendsdk>, Tomasz Łaziuk <https://github.com/tlaziuk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// TypeScript Version: 2.2
/// <reference types="node" />
+2 -2
View File
@@ -1,4 +1,4 @@
// Type definitions for bookshelfjs v0.9.3
// Type definitions for bookshelfjs v0.9.4
// Project: http://bookshelfjs.org/
// Definitions by: Andrew Schurman <https://github.com/arcticwaters>, Vesa Poikajärvi <https://github.com/vesse>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -17,7 +17,7 @@ interface Bookshelf extends Bookshelf.Events<any> {
Collection: typeof Bookshelf.Collection;
plugin(name: string | string[] | Function, options?: any): Bookshelf;
transaction<T>(callback: (transaction: knex.Transaction) => BlueBird<T>): BlueBird<T>;
transaction<T>(callback: (transaction: knex.Transaction) => PromiseLike<T>): BlueBird<T>;
}
declare function Bookshelf(knex: knex): Bookshelf;
+2 -2
View File
@@ -4,7 +4,7 @@
// AJP <https://github.com/AJamesPhillips>
// Jinesh Shah <https://github.com/jineshshah36>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// TypeScript Version: 2.4
export = Boom;
@@ -55,7 +55,7 @@ declare namespace Boom {
// Excluded this to aid typing of the other values. See tests for example casting to a custom interface to manipulate the payload
// [anyContent: string]: any;
}
/**
* Decorates an error with the boom properties
* @param error the error object to wrap. If error is already a boom object, it defaults to overriding the object with the new status code and message.
+2 -1011
View File
File diff suppressed because it is too large Load Diff
+5 -4
View File
@@ -1,10 +1,11 @@
bowser.msedge === true;
bowser.test(['msie']) === true;
bowser.msedge; // $ExpectType boolean
bowser.test(['msie']); // $ExpectType boolean
bowser.a === bowser.c;
bowser.osversion > 10;
bowser.osversion === '10.1A';
bowser.compareVersions(['9.0', '10']);
bowser() === {android: true, x: true};
bowser().android; // $ExpectType boolean
bowser().x; // $ExpectType boolean
bowser.check({msie: "11"}, window.navigator.userAgent);
bowser.isUnsupportedBrowser({msie: "10"}, window.navigator.userAgent);
bowser.isUnsupportedBrowser({msie: "10"}, window.navigator.userAgent);
+18 -21
View File
@@ -8,13 +8,12 @@ export = bowser;
export as namespace bowser;
declare namespace bowser {
export interface IBowserOS {
interface IBowserOS {
mac: boolean;
/**other than Windows Phone */
/** other than Windows Phone */
windows: boolean;
windowsphone: boolean;
/**other than android, chromeos, webos, tizen, and sailfish */
/** other than android, chromeos, webos, tizen, and sailfish */
linux: boolean;
chromeos: boolean;
android: boolean;
@@ -29,7 +28,7 @@ declare namespace bowser {
sailfish: boolean;
}
export interface IBowserVersions {
interface IBowserVersions {
chrome: boolean;
firefox: boolean;
msie: boolean;
@@ -53,14 +52,14 @@ declare namespace bowser {
kMeleon: boolean;
}
export interface IBowserEngines {
interface IBowserEngines {
/** IE <= 11 */
msie: boolean;
/**Chrome 0-27, Android <4.4, iOs, BB, etc. */
/** Chrome 0-27, Android <4.4, iOs, BB, etc. */
webkit: boolean;
/**Chrome >=28, Android >=4.4, Opera, etc. */
/** Chrome >=28, Android >=4.4, Opera, etc. */
blink: boolean;
/**Firefox, etc. */
/** Firefox, etc. */
gecko: boolean;
/** IE > 11 */
msedge: boolean;
@@ -68,37 +67,35 @@ declare namespace bowser {
tablet: boolean;
/** All detected mobile OSes are additionally flagged mobile, unless it's a tablet */
mobile: boolean;
}
export interface IBowserGrade {
interface IBowserGrade {
/** Grade A browser */
a: boolean;
/** Grade C browser */
c: boolean;
/** Grade X browser */
x: boolean;
/**A human readable name for this browser. E.g. 'Chrome', '' */
/** A human readable name for this browser. E.g. 'Chrome', '' */
name: string;
/**Version number for the browser. E.g. '32.0' */
version: string|number;
osversion: string|number;
/** Version number for the browser. E.g. '32.0' */
version: string | number;
osversion: string | number;
}
export interface IBowserDetection extends IBowserGrade, IBowserEngines, IBowserOS, IBowserVersions { }
interface IBowserDetection extends IBowserGrade, IBowserEngines, IBowserOS, IBowserVersions { }
export interface IBowserMinVersions {
interface IBowserMinVersions {
// { msie: "11", "firefox": "4" }
[index: string]: string;
}
export interface IBowser extends IBowserDetection {
interface IBowser extends IBowserDetection {
(): IBowserDetection;
test(browserList: string[]): boolean;
_detect(ua: string): IBowser;
compareVersions(versions: string[]): number;
check(minVersions: IBowserMinVersions, strictMode?: boolean|string, ua?: string): Boolean;
isUnsupportedBrowser(minVersions: IBowserMinVersions, strictMode?: boolean|string, ua?: string): boolean;
check(minVersions: IBowserMinVersions, strictMode?: boolean | string, ua?: string): boolean;
isUnsupportedBrowser(minVersions: IBowserMinVersions, strictMode?: boolean | string, ua?: string): boolean;
}
}
+2 -74
View File
@@ -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
// TODO
"interface-name": false
}
}
+1
View File
@@ -3,6 +3,7 @@
// Definitions by: Paul Lockwood <https://github.com/PaulLockwood>
// Michael Strobel <https://github.com/kryops>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="node" />
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/Floby/node-bunyan-blackhole
// Definitions by: Olivier Chevet <https://github.com/olivr70>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
import * as Logger from "bunyan";
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/marnusw/bunyan-bugsnag
// Definitions by: Pasi Eronen <https://github.com/pasieronen>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
import * as Logger from 'bunyan';
@@ -0,0 +1,5 @@
import BunyanFormatWritable = require('bunyan-format');
const formatOut = new BunyanFormatWritable({ outputMode: 'short' });
const formatOut2 = new BunyanFormatWritable({ outputMode: 'bunyan', levelInString: true });
+30
View File
@@ -0,0 +1,30 @@
// Type definitions for bunyan-format 0.2
// Project: https://github.com/thlorenz/bunyan-format
// Definitions by: Piotr Roszatycki <https://github.com/dex4er>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/// <reference types="node" />
import { Writable } from 'stream';
declare namespace BunyanFormatWritable {
interface ColorFromLevel {
[level: number]: string;
}
interface Options {
outputMode?: 'short' | 'long' | 'simple' | 'json' | 'bunyan';
color?: boolean;
colorFromLevel?: ColorFromLevel;
levelInString?: boolean;
jsonIndent?: string | number;
}
}
declare class BunyanFormatWritable extends Writable {
/** Creates a writable stream that formats bunyan records written to it. */
constructor(options: BunyanFormatWritable.Options, output?: Writable);
}
export = BunyanFormatWritable;
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"bunyan-format-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/gluwer/bunyan-winston-adapter
// Definitions by: Steve Hipwell <https://github.com/stevehipwell>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
import * as bunyan from "bunyan";
import { LoggerInstance } from "winston";
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/rsamec/form
// Definitions by: Roman Samec <https://github.com/rsamec>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// Source: typings/business-rules-engine/Validation.d.ts
+1 -1
View File
@@ -2,7 +2,7 @@
// Project: https://github.com/hapijs/catbox
// Definitions by: Jason Swearingen <https://github.com/jasonswearingen>, AJP <https://github.com/AJamesPhillips>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// TypeScript Version: 2.4
import * as Boom from 'boom';
@@ -16,7 +16,7 @@ const mockContext: Mocha.IBeforeAndAfterContext = <any> {
}
};
chaiJestSnapshot.setFileName("filename");
chaiJestSnapshot.setFilename("filename");
chaiJestSnapshot.setTestName("testname");
chaiJestSnapshot.configureUsingMochaContext(mockContext);
chaiJestSnapshot.resetSnapshotRegistry();
+1 -1
View File
@@ -21,7 +21,7 @@ interface ChaiJestSnapshot {
(chai: any, utils: any): void;
/** Set snapshot file name */
setFileName(filename: string): void;
setFilename(filename: string): void;
/**
* Set snapshot test name
+3 -3
View File
@@ -154,7 +154,7 @@ declare namespace Chart {
responsiveAnimationDuration?: number;
maintainAspectRatio?: boolean;
events?: string[];
onClick?(any?: any): any;
onClick?(event?: MouseEvent, activeElements?: Array<{}>): any;
title?: ChartTitleOptions;
legend?: ChartLegendOptions;
tooltips?: ChartTooltipOptions;
@@ -411,8 +411,8 @@ declare namespace Chart {
interface ChartDataSets {
cubicInterpolationMode?: 'default' | 'monotone';
backgroundColor?: ChartColor | ChartColor[];
borderWidth?: number;
borderColor?: ChartColor;
borderWidth?: number | number[];
borderColor?: ChartColor | ChartColor[];
borderCapStyle?: string;
borderDash?: number[];
borderDashOffset?: number;
+3 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for Cheerio v0.22.0
// Project: https://github.com/cheeriojs/cheerio
// Definitions by: Bret Little <https://github.com/blittle>, VILIC VANE <http://vilic.info>, Wayne Maurer <https://github.com/wmaurer>, Umar Nizamani <https://github.com/umarniz>
// Definitions by: Bret Little <https://github.com/blittle>, VILIC VANE <http://vilic.info>, Wayne Maurer <https://github.com/wmaurer>, Umar Nizamani <https://github.com/umarniz>, LiJinyao <https://github.com/LiJinyao>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface Cheerio {
@@ -172,7 +172,7 @@ interface Cheerio {
empty(): Cheerio;
html(): string;
html(): string | null;
html(html: string): Cheerio;
text(): string;
@@ -255,6 +255,7 @@ interface CheerioElement {
children: CheerioElement[];
childNodes: CheerioElement[];
lastChild: CheerioElement;
firstChild: CheerioElement;
next: CheerioElement;
nextSibling: CheerioElement;
prev: CheerioElement;
+17 -4
View File
@@ -1426,8 +1426,7 @@ declare namespace chrome.declarativeContent {
ports?: (number | number[])[];
}
/** Matches the state of a web page by various criteria. */
interface PageStateMatcher {
class PageStateMatcherProperties {
/** Optional. Filters URLs for various criteria. See event filtering. All criteria are case sensitive. */
pageUrl?: PageStateUrlDetails;
/** Optional. Matches if all of the CSS selectors in the array match displayed elements in a frame with the same origin as the page's main frame. All selectors in this array must be compound selectors to speed up matching. Note that listing hundreds of CSS selectors or CSS selectors that match hundreds of times per page can still slow down web sites. */
@@ -1439,6 +1438,19 @@ declare namespace chrome.declarativeContent {
*/
isBookmarked?: boolean;
}
/** Matches the state of a web page by various criteria. */
class PageStateMatcher {
constructor(options: PageStateMatcherProperties);
}
/** Declarative event action that shows the extension's page action while the corresponding conditions are met. */
class ShowPageAction {}
/** Provides the Declarative Event API consisting of addRules, removeRules, and getRules. */
interface PageChangedEvent extends chrome.events.Event<() => void> {}
var onPageChanged: PageChangedEvent;
}
////////////////////
@@ -5126,7 +5138,7 @@ declare namespace chrome.runtime {
actions?: {
type: string;
}[];
conditions?: chrome.declarativeContent.PageStateMatcher[]
conditions?: chrome.declarativeContent.PageStateMatcherProperties[]
}[];
externally_connectable?: {
ids?: string[];
@@ -7018,8 +7030,9 @@ declare namespace chrome.webNavigation {
/**
* The ID of the process runs the renderer for this tab.
* @since Chrome 22.
* @deprecated since Chrome 49. Frames are now uniquely identified by their tab ID and frame ID; the process ID is no longer needed and therefore ignored.
*/
processId: number;
processId?: number;
/** The ID of the tab in which the frame is. */
tabId: number;
/** The ID of the frame in the given tab. */
+3 -1
View File
@@ -2,6 +2,8 @@
// Project: https://github.com/chocolatechipui/chocolatechip-ui
// Definitions by: Robert Biggs <http://chocolatechip-ui.com>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// ChocolateChip-UI 3.9.1
/**
These TypeScript delcarations for ChocolateChip-UI contain interfaces for both ChocolateChipJS and jQuery. Depending on which library you are using, you will get the type interfaces appropriate for it.
@@ -1078,7 +1080,7 @@ interface JQueryStatic {
data: {
repeaterName?: any;
};
/**
* Use this value to output an index value in a template repeater.
*/
+17
View File
@@ -52,6 +52,23 @@ function test_config() {
[ 'list', 'indent', 'blocks', 'align', 'bidi' ],
],
};
var config3: CKEDITOR.config = {
toolbarGroups: [
{ name: 'clipboard', groups: [ 'clipboard', 'undo' ] },
{ name: 'editing', groups: [ 'find', 'selection', 'spellchecker', 'editing' ] },
{ name: 'links', groups: [ 'links' ] },
{ name: 'insert', groups: [ 'insert' ] },
{ name: 'tools', groups: [ 'tools' ] },
{ name: 'document', groups: [ 'mode' ] },
{ name: 'about', groups: [ 'about' ] },
'/',
{ name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ] },
{ name: 'paragraph', groups: [ 'list', 'indent', 'blocks', 'align', 'paragraph' ] },
'/',
{ name: 'styles', groups: [ 'styles' ] },
{ name: 'colors', groups: [ 'colors' ] },
],
}
}
function test_dom_comment() {
+2 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for CKEditor
// Project: http://ckeditor.com/
// Definitions by: Ondrej Sevcik <https://github.com/ondrejsevcik>
// Definitions by: Thomas Wittwer <https://github.com/wittwert>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// WORK-IN-PROGRESS: Any contribution support welcomed.
@@ -814,7 +814,7 @@ declare namespace CKEDITOR {
toolbar?: string | (string | string[])[];
toolbarCanCollapse?: boolean;
toolbarGroupCycling?: boolean;
toolbarGroups?: toolbarGroups[];
toolbarGroups?: (toolbarGroups | string)[];
toolbarLocation?: string;
toolbarStartupExpanded?: boolean;
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/cojs/co-body
// Definitions by: Joshua DeVinney <https://github.com/geoffreak>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="node"/>
/// <reference types="koa"/>
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/expressjs/compression
// Definitions by: Santi Albo <https://github.com/santialbo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import * as express from 'express';
+1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/jaredhanson/connect-ensure-login
// Definitions by: Pavel Puchkov <https://github.com/0x6368656174>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
import { RequestHandler } from "express";

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