mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
correct CI errors because of TS 2.1 and trailing whitespaces
This commit is contained in:
Vendored
+92
-92
@@ -8,247 +8,247 @@
|
||||
import {Stream} from 'stream';
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function array(arr: any[], message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function bool(bool: boolean, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function buffer(buffer: Buffer, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function func(func: any, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function number(number: number, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function finite(finite: number, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function object(obj: any, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function string(str: string, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function stream(stream: Stream, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function date(date: Date, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function regexp(regexp: RegExp, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function uuid(uuid: string, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function arrayOfArray(arr: any[][], message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function arrayOfBool(arr: boolean[], message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function arrayOfBuffer(arr: Buffer[], message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function arrayOfFunc(arr: any[], message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function arrayOfNumber(arr: number[], message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function arrayOfFinite(arr: number[], message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function arrayOfObject(arr: any[], message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function arrayOfString(arr: string[], message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function arrayOfStream(arr: Stream[], message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function arrayOfDate(arr: Date[], message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function arrayOfRegexp(arr: RegExp[], message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function arrayOfUuid(arr: string[], message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalArray(arr: any[] | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalBool(bool: boolean | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalBuffer(buffer: Buffer | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalFunc(options: any, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalNumber(options: number | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalFinite(options: number | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalObject(options: any, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalString(options: string | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalStream(options: Stream | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalDate(options: Date | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalRegexp(options: RegExp | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalUuid(options: string | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalArrayOfArray(arr: any[][] | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalArrayOfBool(arr: boolean[] | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalArrayOfBuffer(arr: Buffer[] | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalArrayOfFunc(arr: any[] | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalArrayOfNumber(arr: number[] | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalArrayOfFinite(arr: number[] | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalArrayOfObject(arr: any[] | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalArrayOfString(arr: string[] | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalArrayOfStream(arr: Stream[] | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalArrayOfDate(arr: Date[] | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalArrayOfRegexp(arr: RegExp[] | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function optionalArrayOfUuid(arr: string[] | undefined, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function AssertionError(options: any, message ?: string): void;
|
||||
|
||||
@@ -256,13 +256,13 @@ export function AssertionError(options: any, message ?: string): void;
|
||||
* Throws an `AssertionError`. If `message` is falsy, the error message is set
|
||||
* as the values of `actual` and `expected` separated by the provided `operator`.
|
||||
* Otherwise, the error message is the value of `message`.
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* const assert = require('assert');
|
||||
*
|
||||
*
|
||||
* assert.fail(1, 2, undefined, '>');
|
||||
* // AssertionError: 1 > 2
|
||||
*
|
||||
*
|
||||
* assert.fail(1, 2, 'whoops', '>');
|
||||
* // AssertionError: whoops
|
||||
* ```
|
||||
@@ -272,14 +272,14 @@ export function fail(actual: any, expected: any, message: any, operator: any): v
|
||||
|
||||
/**
|
||||
* Tests if `value` is truthy. It is equivalent to `assert.equal(!!value, true, message)`.
|
||||
*
|
||||
*
|
||||
* If `value` is not truthy, an `AssertionError` is thrown with a `message` property
|
||||
* set equal to the value of the `message` parameter.
|
||||
* If the `message` parameter is `undefined`, a default error message is assigned.
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* const assert = require('assert');
|
||||
*
|
||||
*
|
||||
* assert.ok(true);
|
||||
* // OK
|
||||
* assert.ok(1);
|
||||
@@ -297,21 +297,21 @@ export function ok(options: any, message ?: string): void;
|
||||
/**
|
||||
* Tests shallow, coercive equality between the actual and expected parameters
|
||||
* using the equal comparison operator ( `==` ).
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* const assert = require('assert');
|
||||
*
|
||||
*
|
||||
* assert.equal(1, 1);
|
||||
* // OK, 1 == 1
|
||||
* assert.equal(1, '1');
|
||||
* // OK, 1 == '1'
|
||||
*
|
||||
*
|
||||
* assert.equal(1, 2);
|
||||
* // AssertionError: 1 == 2
|
||||
* assert.equal({a: {b: 1}}, {a: {b: 1}});
|
||||
* //AssertionError: { a: { b: 1 } } == { a: { b: 1 } }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* If the values are not equal, an `AssertionError` is thrown with
|
||||
* a `message` property set equal to the value of the `message` parameter.
|
||||
* If the `message` parameter is undefined, a default error message is assigned.
|
||||
@@ -320,20 +320,20 @@ export function equal(actual: any, expected: any, message ?: string): void;
|
||||
|
||||
/**
|
||||
* Tests shallow, coercive inequality with the not equal comparison operator ( `!=` ).
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* const assert = require('assert');
|
||||
*
|
||||
*
|
||||
* assert.notEqual(1, 2);
|
||||
* // OK
|
||||
*
|
||||
*
|
||||
* assert.notEqual(1, 1);
|
||||
* // AssertionError: 1 != 1
|
||||
*
|
||||
*
|
||||
* assert.notEqual(1, '1');
|
||||
* // AssertionError: 1 != '1'
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* If the values are equal, an `AssertionError` is thrown with
|
||||
* a `message` property set equal to the value of the `message` parameter.
|
||||
* If the `message` parameter is undefined, a default error message is assigned.
|
||||
@@ -343,20 +343,20 @@ export function notEqual(actual: any, expected: any, message ?: string): void;
|
||||
/**
|
||||
* Tests for deep equality between the `actual` and `expected` parameters.
|
||||
* Primitive values are compared with the equal comparison operator ( `==` ).
|
||||
*
|
||||
*
|
||||
* Only enumerable "own" properties are considered.
|
||||
* The `deepEqual()` implementation does not test object prototypes, attached symbols,
|
||||
* or non-enumerable properties. This can lead to some potentially surprising results.
|
||||
* For example, the following example does not throw an `AssertionError` because
|
||||
* the properties on the Error object are non-enumerable:
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* // WARNING: This does not throw an AssertionError!
|
||||
* assert.deepEqual(Error('a'), Error('b'));
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* "Deep" equality means that the enumerable "own" properties of child objects are evaluated also.
|
||||
*
|
||||
*
|
||||
* If the values are not equal, an `AssertionError` is thrown with a `message` property
|
||||
* set equal to the value of the `message` parameter. If the `message` parameter is undefined,
|
||||
* a default error message is assigned.
|
||||
@@ -365,28 +365,28 @@ export function deepEqual<T>(actual: T, expected: T, message ?: string): void;
|
||||
|
||||
/**
|
||||
* Tests for any deep inequality. Opposite of `assert.deepEqual()`.
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* const assert = require('assert');
|
||||
*
|
||||
*
|
||||
* const obj1 = { a : { b : 1 } };
|
||||
* const obj2 = { a : { b : 2 } };
|
||||
* const obj3 = { a : { b : 1 } };
|
||||
* const obj4 = Object.create(obj1);
|
||||
*
|
||||
*
|
||||
* assert.notDeepEqual(obj1, obj1);
|
||||
* // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
|
||||
*
|
||||
*
|
||||
* assert.notDeepEqual(obj1, obj2);
|
||||
* // OK, obj1 and obj2 are not deeply equal
|
||||
*
|
||||
*
|
||||
* assert.notDeepEqual(obj1, obj3);
|
||||
* // AssertionError: { a: { b: 1 } } notDeepEqual { a: { b: 1 } }
|
||||
*
|
||||
*
|
||||
* assert.notDeepEqual(obj1, obj4);
|
||||
* // OK, obj1 and obj2 are not deeply equal
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* If the values are deeply equal, an `AssertionError` is thrown with
|
||||
* a `message` property set equal to the value of the `message` parameter.
|
||||
* If the `message` parameter is undefined, a default error message is assigned.
|
||||
@@ -395,20 +395,20 @@ export function notDeepEqual(actual: any, expected: any, message ?: string): voi
|
||||
|
||||
/**
|
||||
* Tests strict equality as determined by the strict equality operator ( `===` ).
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* const assert = require('assert');
|
||||
*
|
||||
*
|
||||
* assert.strictEqual(1, 2);
|
||||
* // AssertionError: 1 === 2
|
||||
*
|
||||
*
|
||||
* assert.strictEqual(1, 1);
|
||||
* // OK
|
||||
*
|
||||
*
|
||||
* assert.strictEqual(1, '1');
|
||||
* // AssertionError: 1 === '1'
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* If the values are not strictly equal, an `AssertionError` is thrown with
|
||||
* a `message` property set equal to the value of the `message` parameter.
|
||||
* If the `message` parameter is undefined, a default error message is assigned.
|
||||
@@ -417,20 +417,20 @@ export function strictEqual<T>(actual: T, expected: T, message ?: string): void;
|
||||
|
||||
/**
|
||||
* Tests strict inequality as determined by the strict not equal operator ( `!==` ).
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* const assert = require('assert');
|
||||
*
|
||||
*
|
||||
* assert.notStrictEqual(1, 2);
|
||||
* // OK
|
||||
*
|
||||
*
|
||||
* assert.notStrictEqual(1, 1);
|
||||
* // AssertionError: 1 !== 1
|
||||
*
|
||||
*
|
||||
* assert.notStrictEqual(1, '1');
|
||||
* // OK
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* If the values are strictly equal, an `AssertionError` is thrown with a `message` property
|
||||
* set equal to the value of the `message` parameter. If the `message` parameter is undefined,
|
||||
* a default error message is assigned.
|
||||
@@ -438,19 +438,19 @@ export function strictEqual<T>(actual: T, expected: T, message ?: string): void;
|
||||
export function notStrictEqual(actual: any, expected: any, message ?: string): void;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
export function throws(block: any, error ?: any, message ?: string): void;
|
||||
|
||||
/**
|
||||
* Asserts that the function `block` does not throw an error. See `assert.throws()` for more details.
|
||||
*
|
||||
*
|
||||
* When `assert.doesNotThrow()` is called, it will immediately call the `block` function.
|
||||
*
|
||||
*
|
||||
* If an error is thrown and it is the same type as that specified by the `error` parameter,
|
||||
* then an `AssertionError` is thrown. If the error is of a different type,
|
||||
* or if the `error` parameter is undefined, the error is propagated back to the caller.
|
||||
*
|
||||
*
|
||||
* The following, for instance, will throw the TypeError because there is no matching error type in the assertion:
|
||||
* ```js
|
||||
* assert.doesNotThrow(
|
||||
@@ -460,7 +460,7 @@ export function throws(block: any, error ?: any, message ?: string): void;
|
||||
* SyntaxError
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* However, the following will result in an `AssertionError` with the message 'Got unwanted exception (TypeError)..':
|
||||
* ```js
|
||||
* assert.doesNotThrow(
|
||||
@@ -470,7 +470,7 @@ export function throws(block: any, error ?: any, message ?: string): void;
|
||||
* TypeError
|
||||
* );
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* If an `AssertionError` is thrown and a value is provided for the `message` parameter,
|
||||
* the value of `message` will be appended to the `AssertionError` message:
|
||||
* ```js
|
||||
@@ -490,7 +490,7 @@ export function doesNotThrow(block: any, error ?: any, message ?: string): void;
|
||||
* Throws `value` if `value` is truthy. This is useful when testing the `error` argument in callbacks.
|
||||
* ```js
|
||||
* const assert = require('assert');
|
||||
*
|
||||
*
|
||||
* assert.ifError(0);
|
||||
* // OK
|
||||
* assert.ifError(1);
|
||||
|
||||
Vendored
+4
-4
@@ -61,22 +61,22 @@ interface GlobuleStatic {
|
||||
*/
|
||||
find(pattern: string, pattern2: string, pattern3: string | string[], options?: FindOptions): string[];
|
||||
|
||||
/**
|
||||
/**
|
||||
* Given a set of source file paths, returns an array of src-dest file mapping objects
|
||||
*/
|
||||
mapping(filepaths: string[], options?: MappingOptions): OneMapping[];
|
||||
|
||||
/**
|
||||
/**
|
||||
* Given a set of source file paths, returns an array of src-dest file mapping objects
|
||||
*/
|
||||
mapping(options: MappingOptions): OneMapping[];
|
||||
|
||||
/**
|
||||
/**
|
||||
* Given a set of source file paths, returns an array of src-dest file mapping objects
|
||||
*/
|
||||
mapping(filepaths: string[], filepaths2: string[], options?: MappingOptions): OneMapping[];
|
||||
|
||||
/**
|
||||
/**
|
||||
* Given a set of source file paths, returns an array of src-dest file mapping objects
|
||||
*/
|
||||
mapping(filepaths: string[], filepaths2: string[], filepaths3: string[], options?: MappingOptions): OneMapping[];
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/koajs/json-error
|
||||
// Definitions by: Mudkip <https://github.com/mudkipme>
|
||||
// Definitions: https://github.com/mudkipme/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import * as Koa from "koa";
|
||||
|
||||
|
||||
Vendored
+1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/brianc/node-libpq#readme
|
||||
// Definitions by: Vlad Rindevich <https://github.com/Lodin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
|
||||
Vendored
+30
-30
@@ -17,35 +17,35 @@ import * as loopback from "loopback";
|
||||
* ```
|
||||
* var loopback= require('loopback');
|
||||
* var boot = require('loopback-boot');
|
||||
*
|
||||
*
|
||||
* var app = module.exports = loopback();
|
||||
*
|
||||
*
|
||||
* boot(app, __dirname);
|
||||
*
|
||||
*
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Initialize an application from an options object or a set of JSON and JavaScript files.
|
||||
*
|
||||
* NOTE: This module is primarily intended for use with LoopBack 2.0. It does work with LoopBack 1.x applications,
|
||||
*
|
||||
* NOTE: This module is primarily intended for use with LoopBack 2.0. It does work with LoopBack 1.x applications,
|
||||
* but none of the LoopBack 1.x examples or generated code (scaffolding) use it.
|
||||
*
|
||||
*
|
||||
* This function takes an optional argument that is either a string or an object.
|
||||
*
|
||||
*
|
||||
* If the argument is a string, then it sets the application root directory based on the string value. Then it:
|
||||
* Creates DataSources from the datasources.json file in the application root directory.
|
||||
*
|
||||
*
|
||||
* Configures Models from the model-config.json file in the application root directory.
|
||||
*
|
||||
* Configures the LoopBack Application object from the config.json file in the application root directory.
|
||||
*
|
||||
* Configures the LoopBack Application object from the config.json file in the application root directory.
|
||||
* These properties can be accessed using app.get('propname').
|
||||
*
|
||||
*
|
||||
* If the argument is an object, then it looks for models, dataSources, 'config', modelsRootDir, dsRootDir,
|
||||
* appConfigRootDir and appRootDir properties of the object.
|
||||
*
|
||||
*
|
||||
* If the object has no appRootDir property then it sets the current working directory as the application root directory.
|
||||
*
|
||||
*
|
||||
* The execution environment, {env}, is established from, in order,
|
||||
*
|
||||
*
|
||||
* options.env
|
||||
* process.env.NODE_ENV,
|
||||
* the literal development.
|
||||
@@ -64,20 +64,20 @@ import * as loopback from "loopback";
|
||||
* config.json,
|
||||
* config.local.js or config.local.json (only one),
|
||||
* config.{env}.js or config.{env}.json (only one)
|
||||
*
|
||||
*
|
||||
* in the directory designated by 'options.appConfigRootDir', if present, or the application root directory.
|
||||
* It merges the properties from the files found.
|
||||
*
|
||||
* In both cases, the function loads JavaScript files in the /boot subdirectory of the application root directory
|
||||
*
|
||||
* In both cases, the function loads JavaScript files in the /boot subdirectory of the application root directory
|
||||
* with require().
|
||||
*
|
||||
*
|
||||
* NOTE: The version 2.0 of loopback-boot changed the way how models are created.
|
||||
* The model-config.json file contains only configuration options like dataSource and extra relations.
|
||||
* The model-config.json file contains only configuration options like dataSource and extra relations.
|
||||
* To define a model, create a per-model JSON file in models/ directory.
|
||||
*
|
||||
*
|
||||
* NOTE: Mixing bootLoopBackApp(app, bootConfig) and app.model(name, modelConfig) in multiple files may result in models being undefined due to race conditions. To avoid this when using bootLoopBackApp() make sure all models are passed as part of the models definition.
|
||||
* Throws an error if the config object is not valid or if boot fails.
|
||||
*
|
||||
*
|
||||
* @param {Loopback.LoopbackApplication} app LoopBack application created by loopback().
|
||||
* @param {string|OptionsLB} options Boot options; If String, this is the application root directory; if object, has below properties.
|
||||
* @param {() => void} callback
|
||||
@@ -87,13 +87,13 @@ declare function lb(app: loopback.LoopBackApplication, options: string|OptionsLB
|
||||
|
||||
interface OptionsLB {
|
||||
/**
|
||||
* Directory to use when loading JSON and JavaScript files.
|
||||
* Directory to use when loading JSON and JavaScript files.
|
||||
* Defaults to the current directory (process.cwd()).
|
||||
*/
|
||||
appRootDir: string;
|
||||
|
||||
/**
|
||||
* Directory to use when loading config.json. Defaults to appRootDir.
|
||||
* Directory to use when loading config.json. Defaults to appRootDir.
|
||||
*/
|
||||
appConfigRootDir: string;
|
||||
|
||||
@@ -103,7 +103,7 @@ interface OptionsLB {
|
||||
models: any;
|
||||
|
||||
/**
|
||||
* List of model definitions to use. When options.modelDefinitions is provided,
|
||||
* List of model definitions to use. When options.modelDefinitions is provided,
|
||||
* loopback-boot does not search filesystem and use only the models provided in this argument.
|
||||
*/
|
||||
modelDefinitions: any[];
|
||||
@@ -134,8 +134,8 @@ interface OptionsLB {
|
||||
componentRootDir: string;
|
||||
|
||||
/**
|
||||
* Environment type, defaults to process.env.NODE_ENV or development.
|
||||
* Common values are development, staging and production;
|
||||
* Environment type, defaults to process.env.NODE_ENV or development.
|
||||
* Common values are development, staging and production;
|
||||
* however the applications are free to use any names.
|
||||
*/
|
||||
env: string;
|
||||
@@ -156,7 +156,7 @@ interface OptionsLB {
|
||||
components: any;
|
||||
|
||||
/**
|
||||
* List of directories where to look for files containing model mixin definitions.
|
||||
* List of directories where to look for files containing model mixin definitions.
|
||||
* All files (mixins) found in these directory are loaded.
|
||||
*/
|
||||
mixinDirs: string[];
|
||||
@@ -187,7 +187,7 @@ declare namespace lb {
|
||||
|
||||
/**
|
||||
* compileToBrowserify
|
||||
*
|
||||
*
|
||||
* Compile boot instructions and add them to a browserify bundler.
|
||||
* @param {string|any} options as described in bootLoopBackApp above.
|
||||
* @param {any} bundler A browserify bundler created by browserify().
|
||||
@@ -198,7 +198,7 @@ declare namespace lb {
|
||||
class compileToBrowserify {
|
||||
|
||||
/**
|
||||
* Application identifier used to load the correct boot configuration when
|
||||
* Application identifier used to load the correct boot configuration when
|
||||
* building multiple applications using browserify.
|
||||
*/
|
||||
appId: string;
|
||||
|
||||
Vendored
+69
-69
@@ -88,7 +88,7 @@ declare namespace l {
|
||||
* @returns {any} http.Server A node `http.Server` with this application configured
|
||||
* as the request handle
|
||||
* listen(cb?: () => void):http.Serve
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
// listen(port?: number, cb?: () => void): any;
|
||||
@@ -203,16 +203,16 @@ declare namespace l {
|
||||
|
||||
/**
|
||||
* Register (new) middleware phases.
|
||||
*
|
||||
*
|
||||
* If all names are new, then the phases are added just before "routes" phase.
|
||||
* Otherwise the provided list of names is merged with the existing phases
|
||||
* in such way that the order of phases is preserved
|
||||
*
|
||||
*
|
||||
* **Examples*
|
||||
* ```js
|
||||
* // built-in phases:
|
||||
* // initial, session, auth, parse, routes, files, fina
|
||||
*
|
||||
*
|
||||
* app.defineMiddlewarePhases('custom');
|
||||
* // new list of phases
|
||||
* // initial, session, auth, parse, custom, routes, files, fina
|
||||
@@ -340,7 +340,7 @@ declare namespace l {
|
||||
* In the second variant, the parameters `name`, `properties` and `options`
|
||||
* are provided in the config object. Any additional config entries are
|
||||
* interpreted as `options`, i.e. the following two configs are identical
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* { name: 'Customer', base: 'User' }
|
||||
* { name: 'Customer', options: { base: 'User' } }
|
||||
@@ -792,7 +792,7 @@ declare namespace l {
|
||||
* // => model with id 1 has been changed
|
||||
* });
|
||||
* ``
|
||||
*
|
||||
*
|
||||
* #### Event: `deleted
|
||||
* Emitted after an individual model has been deleted.
|
||||
* Argument: `id`, model ID (number)
|
||||
@@ -803,7 +803,7 @@ declare namespace l {
|
||||
* });
|
||||
* ``
|
||||
* #### Event: `deletedAll
|
||||
*
|
||||
*
|
||||
* Emitted after an individual model has been deleted.
|
||||
* Argument: `where` (optional), where filter, JSON object
|
||||
* ```js
|
||||
@@ -816,7 +816,7 @@ declare namespace l {
|
||||
* }
|
||||
* });
|
||||
* ``
|
||||
*
|
||||
*
|
||||
* #### Event: `attached
|
||||
* Emitted after a `Model` has been attached to an `app`
|
||||
* #### Event: `dataSourceAttached
|
||||
@@ -830,7 +830,7 @@ declare namespace l {
|
||||
* // => model with id 1 has been changed
|
||||
* });
|
||||
* ``
|
||||
*
|
||||
*
|
||||
* @param {any} data
|
||||
* @property {string} Model.modelName The name of the model. Static property.
|
||||
* @property {DataSource} Model.dataSource Data source to which the model is connected, if any. Static property.
|
||||
@@ -943,12 +943,12 @@ declare namespace l {
|
||||
* SharedClass
|
||||
* Create a new SharedClass with the given options.
|
||||
* **NOTE** TODO : exported from another module type definition called strong-remoting
|
||||
*
|
||||
*
|
||||
* @param {string} name The SharedClass name
|
||||
* @param {() => void} constructor The constructor the SharedClass represents
|
||||
* @param {any} options Additional options.
|
||||
* @property {() => void } ctor The constructor
|
||||
* @property {any} http The HTTP settings
|
||||
* @property {any} http The HTTP settings
|
||||
*/
|
||||
|
||||
class SharedClass {
|
||||
@@ -1013,7 +1013,7 @@ declare namespace l {
|
||||
|
||||
/**
|
||||
* Get all shared methods belonging to this shared class.
|
||||
* @param {any} options
|
||||
* @param {any} options
|
||||
* @return {any[]} An array of shared methods SharedMethod[]
|
||||
*/
|
||||
|
||||
@@ -1034,7 +1034,7 @@ declare namespace l {
|
||||
* cb(null, str);
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @param {() => void} resolver The resolver function.
|
||||
*/
|
||||
|
||||
@@ -1053,7 +1053,7 @@ declare namespace l {
|
||||
* **Change Event*
|
||||
* Listen for model changes using the `change` event
|
||||
* ```js
|
||||
* MyPersistedModel.on('changed', function(obj)
|
||||
* MyPersistedModel.on('changed', function(obj)
|
||||
* console.log(obj) // => the changed model
|
||||
* });
|
||||
* ```
|
||||
@@ -1116,10 +1116,10 @@ declare namespace l {
|
||||
|
||||
static create(data?: any|any[], callback?: (err: Error, models: any) => void): void;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Create a change stream. See here for more info http://loopback.io/doc/en/lb2/Realtime-server-sent-events.html
|
||||
* @param {any} options Only changes to models matching this where filter will be included in the ChangeStream.
|
||||
* @param {() => void} callback
|
||||
* @param {() => void} callback
|
||||
*/
|
||||
|
||||
static createChangeStream(options: {where: any}, callback: (err: Error, changes: any) => void): void;
|
||||
@@ -1150,7 +1150,7 @@ declare namespace l {
|
||||
* ```
|
||||
* <br/>See
|
||||
* [Where filter](docs.strongloop.com/display/LB/Where+filter#Wherefilter-Whereclauseforothermethods)
|
||||
*
|
||||
*
|
||||
* @callback {() => void} callback Optional callback function called with `(err, info)` arguments.
|
||||
* @param {Error} err Error object; see [Error object](docs.strongloop.com/display/LB/Error+object).
|
||||
* @param {any} info Additional information about the command outcome.
|
||||
@@ -1270,7 +1270,7 @@ declare namespace l {
|
||||
* the same as `find`, but limited to one object. Returns an object, not
|
||||
* collection. If you don't provide the filter object argument, it tries to
|
||||
* locate an existing object that matches the `data` argument
|
||||
*
|
||||
*
|
||||
* @options {any} [filter] Optional Filter object; see below.
|
||||
* @property {string|any|Array} fields Identify fields to include in return result.
|
||||
* <br/>See [Fields filter](docs.strongloop.com/display/LB/Fields+filter).
|
||||
@@ -1627,7 +1627,7 @@ declare namespace l {
|
||||
function static(root: string, options: any): void;
|
||||
|
||||
/**
|
||||
* Return HTTP response with basic application status information:
|
||||
* Return HTTP response with basic application status information:
|
||||
* date the application was started and uptime, in JSON format. For example:
|
||||
* ```
|
||||
* {
|
||||
@@ -1651,7 +1651,7 @@ declare namespace l {
|
||||
* - `access_token` (params only)
|
||||
* - `X-Access-Token` (headers only)
|
||||
* - `authorization` (headers and cookies
|
||||
*
|
||||
*
|
||||
* It checks for these values in cookies, headers, and query string parameters _in addition_ to the items
|
||||
* specified in the options parameter
|
||||
* **NOTE:** This function only checks for [signed cookies](expressjs.com/api.html#req.signedCookies)
|
||||
@@ -1664,7 +1664,7 @@ declare namespace l {
|
||||
* params: ['foo-auth', 'foo_auth']
|
||||
* }));
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @options {any} [options] Each option Array is used to add additional keys to find an `accessToken` for a `request`.
|
||||
* @property {Array} [cookies] Array of cookie names.
|
||||
* @property {Array} [headers] Array of header names.
|
||||
@@ -1985,7 +1985,7 @@ declare namespace l {
|
||||
* pushSettings.apns.feedbackOptions.port (APNS).
|
||||
* pushSettings.apns.feedbackOptions.batchFeedback (APNS).
|
||||
* pushSettings.apns.feedbackOptions.interval (APNS).
|
||||
* pushSettings.gcm.serverApiKey: Google Cloud Messaging API key.
|
||||
* pushSettings.gcm.serverApiKey: Google Cloud Messaging API key.
|
||||
*/
|
||||
pushSetings: {
|
||||
apns: {
|
||||
@@ -2091,7 +2091,7 @@ declare namespace l {
|
||||
/** Model ID. */
|
||||
modelId: string;
|
||||
|
||||
/**
|
||||
/**
|
||||
* settings Extends the `Model.settings` object.
|
||||
* settings.hashAlgorithm Algorithm used to create cryptographic hash, used as argument
|
||||
* to [crypto.createHash](nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm).Default is sha1.
|
||||
@@ -2260,7 +2260,7 @@ declare namespace l {
|
||||
/**
|
||||
* When two changes conflict a conflict is created
|
||||
* **Note**: call `conflict.fetch()` to get the `target` and `source` models
|
||||
*
|
||||
*
|
||||
* @param {*} modelId
|
||||
* @param {PersistedModel} SourceModel
|
||||
* @param {PersistedModel} TargetModel
|
||||
@@ -2337,7 +2337,7 @@ declare namespace l {
|
||||
* Return a new Conflict instance with swapped Source and Target models
|
||||
* This is useful when resolving a conflict in one-way
|
||||
* replication, where the source data must not be changed
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* conflict.swapParties().resolveUsingTarget(cb);
|
||||
* ```
|
||||
@@ -2349,11 +2349,11 @@ declare namespace l {
|
||||
/**
|
||||
* Determine the conflict type
|
||||
* Possible results ar
|
||||
*
|
||||
*
|
||||
* - `Change.UPDATE`: Source and target models were updated
|
||||
* - `Change.DELETE`: Source and or target model was deleted.
|
||||
* - `Change.UNKNOWN`: the conflict type is uknown or due to an erro
|
||||
*
|
||||
*
|
||||
* @callback {() => void} callback
|
||||
* @param {Error} err
|
||||
* @param {string} type The conflict type
|
||||
@@ -2402,7 +2402,7 @@ declare namespace l {
|
||||
* }
|
||||
* ``
|
||||
* See github.com/andris9/Nodemailer for other supported options
|
||||
*
|
||||
*
|
||||
* @options {any} options See below
|
||||
* @prop {string} from Senders's email address
|
||||
* @prop {string} to List of one or more recipient email addresses (comma-delimited)
|
||||
@@ -2424,19 +2424,19 @@ declare namespace l {
|
||||
|
||||
/**
|
||||
* Data model for key-value databases.
|
||||
* @class
|
||||
* @class
|
||||
*/
|
||||
class KeyValueModel {
|
||||
|
||||
/**
|
||||
* Set the TTL (time to live) in ms (milliseconds) for a given key.
|
||||
* Set the TTL (time to live) in ms (milliseconds) for a given key.
|
||||
* TTL is the remaining time before a key-value pair is discarded from the database.
|
||||
*
|
||||
* Callback (Optional) Optional callback.
|
||||
*
|
||||
* Callback (Optional) Optional callback.
|
||||
* When the callback function is not provided, a promise is returned instead (see below).
|
||||
*
|
||||
* Promise
|
||||
* this method supports both callback-based and promise-based invocation.
|
||||
*
|
||||
* Promise
|
||||
* this method supports both callback-based and promise-based invocation.
|
||||
* Call this method with no callback argument to get back a promise instead.
|
||||
* @param {string} key Key to use when searching the database.
|
||||
* @param {number} ttl TTL in ms to set for the key.
|
||||
@@ -2448,14 +2448,14 @@ declare namespace l {
|
||||
|
||||
/**
|
||||
* Return the value associated with a given key.
|
||||
*
|
||||
*
|
||||
* Callback (Optional)
|
||||
* Optional callback. When the callback function is not provided, a promise is returned instead (see below).
|
||||
*
|
||||
*
|
||||
* Promise
|
||||
* This method supports both callback-based and promise-based invocation.
|
||||
* This method supports both callback-based and promise-based invocation.
|
||||
* Call this method with no callback argument to get back a promise instead.
|
||||
*
|
||||
*
|
||||
* @param {string} key Key to use when searching the database.
|
||||
* @param {any} options
|
||||
* @param {() => void} callback
|
||||
@@ -2464,8 +2464,8 @@ declare namespace l {
|
||||
static get(key: string, option?: any, callback?: (err: Error, result: any) => void): PromiseLike<any>;
|
||||
|
||||
/**
|
||||
* Asynchronously iterate all keys in the database. Similar to .keys()
|
||||
* but instead allows for iteration over large data sets without having
|
||||
* Asynchronously iterate all keys in the database. Similar to .keys()
|
||||
* but instead allows for iteration over large data sets without having
|
||||
* to load everything into memory at once.
|
||||
* Callback example:
|
||||
* ```
|
||||
@@ -2478,7 +2478,7 @@ declare namespace l {
|
||||
* });
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* Promise example:
|
||||
* ```
|
||||
* // Given a model named `Color` with two keys `red` and `blue`
|
||||
@@ -2494,10 +2494,10 @@ declare namespace l {
|
||||
* // key contains `blue`
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @param {any} filter An optional filter object with the following
|
||||
* @param {string} filter.match Glob string to use to filter returned keys (i.e. userid.*).
|
||||
* All connectors are required to support * and ?.
|
||||
* All connectors are required to support * and ?.
|
||||
* They may also support additional special characters that are specific to the backing database.
|
||||
* @param {any} filter.options
|
||||
* @return {any} result AsyncIterator An Object implementing next(cb) -> Promise function that can be used to iterate all keys.
|
||||
@@ -2509,33 +2509,33 @@ declare namespace l {
|
||||
* Return all keys in the database.
|
||||
* WARNING: This method is not suitable for large data sets as all key-values pairs
|
||||
* are loaded into memory at once. For large data sets, use iterateKeys() instead.
|
||||
*
|
||||
* This method supports both callback-based and promise-based invocation.
|
||||
*
|
||||
* This method supports both callback-based and promise-based invocation.
|
||||
* Call this method with no callback argument to get back a promise instead
|
||||
*
|
||||
*
|
||||
* WARNING: this promise implementation will not resolve according to the callback function.
|
||||
*
|
||||
*
|
||||
* @param {any} filter An optional filter object with the following
|
||||
* @param {string} filter.match Glob string used to filter returned keys (i.e. userid.*).
|
||||
* All connectors are required to support * and ?, but may also support additional special
|
||||
* @param {string} filter.match Glob string used to filter returned keys (i.e. userid.*).
|
||||
* All connectors are required to support * and ?, but may also support additional special
|
||||
* characters specific to the database.
|
||||
* @param {any} filter.options
|
||||
* @param {any} filter.options
|
||||
* @param {() => void} callback
|
||||
* @return {PromiseLike<any>}
|
||||
* @return {PromiseLike<any>}
|
||||
*/
|
||||
|
||||
static keys(filter: {match: string; options: any}, callback: () => void): PromiseLike<any>;
|
||||
|
||||
/**
|
||||
* Persist a value and associate it with the given key.
|
||||
*
|
||||
*
|
||||
* Callback (Optional)
|
||||
* Optional callback. When the callback function is not provided, a promise is returned instead (see below).
|
||||
*
|
||||
*
|
||||
* Promise
|
||||
* This method supports both callback-based and promise-based invocation.
|
||||
* This method supports both callback-based and promise-based invocation.
|
||||
* Call this method with no callback argument to get back a promise instead.
|
||||
*
|
||||
*
|
||||
* @param {string} key Key to associate with the given value.
|
||||
* @param {any} value Value to persist.
|
||||
* @param {number|any} Optional settings for the key-value pair. If a Number is provided, it is set as the TTL (time to live) in ms (milliseconds) for the key-value pair.
|
||||
@@ -2545,15 +2545,15 @@ declare namespace l {
|
||||
static set(key: string, value: any, options?: number|any, callback?: (err: Error) => void): PromiseLike<any>;
|
||||
|
||||
/**
|
||||
* Return the TTL (time to live) for a given key.
|
||||
* Return the TTL (time to live) for a given key.
|
||||
* TTL is the remaining time before a key-value pair is discarded from the database.
|
||||
*
|
||||
*
|
||||
* Callback (Optional)
|
||||
* Optional callback. When the callback function is not provided,
|
||||
* Optional callback. When the callback function is not provided,
|
||||
* a promise is returned instead (see below).
|
||||
*
|
||||
*
|
||||
* @param {string} key Key to use when searching the database.
|
||||
* @param {any} options
|
||||
* @param {any} options
|
||||
* @param {() => void} callback
|
||||
*/
|
||||
|
||||
@@ -2702,7 +2702,7 @@ declare namespace l {
|
||||
* - ALLOW EVERYONE `logout`
|
||||
* - ALLOW OWNER `findById`
|
||||
* - ALLOW OWNER `updateAttributes`
|
||||
*
|
||||
*
|
||||
* @property {string} username Must be unique.
|
||||
* @property {string} password Hidden from remote clients.
|
||||
* @property {string} email Must be valid email.
|
||||
@@ -2724,7 +2724,7 @@ declare namespace l {
|
||||
* @property {number} settings.resetPasswordTokenTTL Time to live for password reset `AccessToken`. Default is `900` (15 minutes).
|
||||
* @property {number} settings.saltWorkFactor The `bcrypt` salt work factor. Default is `10`.
|
||||
* @property {boolean} settings.caseSensitiveEmail Enable case sensitive email.
|
||||
*
|
||||
*
|
||||
* @class User
|
||||
* @inherits {PersistedModel}
|
||||
*/
|
||||
@@ -2798,13 +2798,13 @@ declare namespace l {
|
||||
|
||||
/**
|
||||
* Login a user by with the given `credentials`
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* User.login({username: 'foo', password: 'bar'}, function (err, token) {
|
||||
* console.log(token.id);
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @param {any} credentials username/password or email/password
|
||||
* @param {string[]|string} [include] Optionally set it to "user" to include
|
||||
* the user info
|
||||
@@ -2817,13 +2817,13 @@ declare namespace l {
|
||||
|
||||
/**
|
||||
* Logout a user with the given accessToken id
|
||||
*
|
||||
*
|
||||
* ```js
|
||||
* User.logout('asd0a9f8dsj9s0s3223mk', function (err) {
|
||||
* console.log(err || 'Logged out');
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @param {string} accessTokenID
|
||||
* @callback {() => void} callback
|
||||
* @param {Error} er
|
||||
@@ -2884,10 +2884,10 @@ declare namespace l {
|
||||
* redirect: '/',
|
||||
* tokenGenerator: function (user, cb) { cb("random-token"); }
|
||||
* };
|
||||
*
|
||||
*
|
||||
* user.verify(options, next);
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @options {any} options
|
||||
* @property {string} type Must be 'email'.
|
||||
* @property {string} to Email address to which verification email is sent.
|
||||
|
||||
Vendored
+1
-1
@@ -43,7 +43,7 @@ declare namespace StrongClusterControl {
|
||||
* @description Start the controller
|
||||
* @param [options] - An options object, no default, and options object is not required.
|
||||
* @param [options.size] - Number of workers that should be running, the default is to not control the number of workers
|
||||
* @param [options.env=null] - Environment properties object passed to cluster.fork() if the controller has to start a worker to resize the cluster, default is null.
|
||||
* @param [options.env=null] - Environment properties object passed to cluster.fork() if the controller has to start a worker to resize the cluster, default is null.
|
||||
* @param [options.shutdownTimeout=5000] - Number of milliseconds to wait after shutdown before terminating a worker, the default is 5 seconds
|
||||
* @param [options.terminateTimeout=5000] - Number of milliseconds to wait after terminate before killing a worker, the default is 5 seconds
|
||||
* @param [options.throttoleDelay] - Number of milliseconds to delay restarting workers after they are exiting abnormally. Abnormal is defined as as not suicide.
|
||||
|
||||
Vendored
+4
-4
@@ -6,16 +6,16 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
interface Option {
|
||||
/**
|
||||
* String used for tab, defaults to no tabs (compressed)
|
||||
/**
|
||||
* String used for tab, defaults to no tabs (compressed)
|
||||
*/
|
||||
indent?: string;
|
||||
/**
|
||||
* Return the result as a `stream` (default false)
|
||||
* Return the result as a `stream` (default false)
|
||||
*/
|
||||
stream?: boolean;
|
||||
/**
|
||||
* Add default xml declaration (default false)
|
||||
* Add default xml declaration (default false)
|
||||
*/
|
||||
declaration?: boolean | {
|
||||
encoding?: string;
|
||||
|
||||
Reference in New Issue
Block a user