mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 19:51:53 +00:00
Merging
This commit is contained in:
Vendored
+5
@@ -764,6 +764,11 @@ declare namespace algoliasearch {
|
||||
* https://github.com/algolia/algoliasearch-client-js#client-options
|
||||
*/
|
||||
hosts?: { read?: string[]; write?: string[] };
|
||||
/**
|
||||
* enable the experimental feature: caching requests instead of responses
|
||||
* see https://github.com/algolia/algoliasearch-client-javascript/pull/694
|
||||
*/
|
||||
_useRequestCache?: boolean
|
||||
}
|
||||
/**
|
||||
* Interface describing options available for gettings the logs
|
||||
|
||||
Vendored
+5
@@ -180,6 +180,11 @@ declare namespace algoliasearch {
|
||||
* https://github.com/algolia/algoliasearch-client-js#client-options
|
||||
*/
|
||||
hosts?: { read?: string[]; write?: string[] };
|
||||
/**
|
||||
* enable the experimental feature: caching requests instead of responses
|
||||
* see https://github.com/algolia/algoliasearch-client-javascript/pull/694
|
||||
*/
|
||||
_useRequestCache?: boolean
|
||||
}
|
||||
interface BrowseResponse {
|
||||
cursor?: string;
|
||||
|
||||
@@ -214,11 +214,18 @@ mod.factory({
|
||||
name1(foo: any) {},
|
||||
name2: ['foo', (foo: any) => {}]
|
||||
});
|
||||
mod.filter('name', ($scope: ng.IScope) => {});
|
||||
mod.filter('name', ['$scope', ($scope: ng.IScope) => {}]);
|
||||
mod.filter('name', ($scope: ng.IScope) => () => {});
|
||||
mod.filter('name', ['$scope', ($scope: ng.IScope) => () => {}]);
|
||||
mod.filter({
|
||||
name1(foo: any) {},
|
||||
name2: ['foo', (foo: any) => {}]
|
||||
name1(foo: any) { return () => {}; },
|
||||
name2: ['foo', (foo: any) => () => {}],
|
||||
});
|
||||
const customStatefulFilter: ng.IFilterFunction = (s) => 1;
|
||||
mod.filter('name', () => customStatefulFilter);
|
||||
mod.filter('name', ['$scope', () => customStatefulFilter]);
|
||||
mod.filter({
|
||||
name1: () => customStatefulFilter,
|
||||
name2: ['foo', () => customStatefulFilter],
|
||||
});
|
||||
mod.provider('name', ($scope: ng.IScope) => ({ $get: () => { } }));
|
||||
mod.provider('name', TestProvider);
|
||||
|
||||
Vendored
+11
-2
@@ -250,8 +250,8 @@ declare namespace angular {
|
||||
*/
|
||||
factory(name: string, $getFn: Injectable<Function>): IModule;
|
||||
factory(object: {[name: string]: Injectable<Function>}): IModule;
|
||||
filter(name: string, filterFactoryFunction: Injectable<Function>): IModule;
|
||||
filter(object: {[name: string]: Injectable<Function>}): IModule;
|
||||
filter(name: string, filterFactoryFunction: Injectable<FilterFactory>): IModule;
|
||||
filter(object: {[name: string]: Injectable<FilterFactory>}): IModule;
|
||||
provider(name: string, serviceProviderFactory: IServiceProviderFactory): IModule;
|
||||
provider(name: string, serviceProviderConstructor: IServiceProviderClass): IModule;
|
||||
provider(name: string, inlineAnnotatedConstructor: any[]): IModule;
|
||||
@@ -2237,4 +2237,13 @@ declare namespace angular {
|
||||
interface IHttpParamSerializer {
|
||||
(obj: Object): string;
|
||||
}
|
||||
|
||||
interface IFilterFunction extends Function {
|
||||
/**
|
||||
* By default, filters are only run once the input value changes. By marking the filter as `$stateful`, the filter will be run on every `$digest` to update the output. **This is strongly discouraged.**
|
||||
* See https://docs.angularjs.org/guide/filter#stateful-filters
|
||||
*/
|
||||
$stateful?: boolean;
|
||||
}
|
||||
type FilterFactory = (...I: any[]) => IFilterFunction;
|
||||
}
|
||||
|
||||
@@ -67,3 +67,15 @@ archiver.use(() => {});
|
||||
archiver.finalize();
|
||||
|
||||
archiver.symlink('./path', './target');
|
||||
|
||||
function fakeHandler(err: Archiver.ArchiverError) {
|
||||
console.log(err.code);
|
||||
console.log(err.message);
|
||||
console.log(err.stack);
|
||||
console.log(err.data);
|
||||
}
|
||||
|
||||
const fakeError = new Archiver.ArchiverError('code', 'foo');
|
||||
|
||||
archiver.on('error', fakeHandler);
|
||||
archiver.on('warning', fakeHandler);
|
||||
|
||||
Vendored
+24
@@ -24,9 +24,26 @@ declare namespace archiver {
|
||||
mode?: number;
|
||||
}
|
||||
|
||||
interface ProgressData {
|
||||
entries: {
|
||||
total: number;
|
||||
processed: number;
|
||||
};
|
||||
fs: {
|
||||
totalBytes: number;
|
||||
processedBytes: number;
|
||||
};
|
||||
}
|
||||
|
||||
/** A function that lets you either opt out of including an entry (by returning false), or modify the contents of an entry as it is added (by returning an EntryData) */
|
||||
type EntryDataFunction = (entry: EntryData) => false | EntryData;
|
||||
|
||||
class ArchiverError extends Error {
|
||||
code: string; // Since archiver format support is modular, we cannot enumerate all possible error codes, as the modules can throw arbitrary ones.
|
||||
data: any;
|
||||
constructor(code: string, data: any);
|
||||
}
|
||||
|
||||
interface Archiver extends stream.Transform {
|
||||
abort(): this;
|
||||
append(source: stream.Readable | Buffer | string, name?: EntryData): this;
|
||||
@@ -44,6 +61,13 @@ declare namespace archiver {
|
||||
use(plugin: Function): this;
|
||||
|
||||
symlink(filepath: string, target: string): this;
|
||||
|
||||
on(event: 'error' | 'warning', listener: (error: ArchiverError) => void): this;
|
||||
on(event: 'data', listener: (data: EntryData) => void): this;
|
||||
on(event: 'progress', listener: (progress: ProgressData) => void): this;
|
||||
on(event: 'close' | 'drain' | 'finish', listener: () => void): this;
|
||||
on(event: 'pipe' | 'unpipe', listener: (src: stream.Readable) => void): this;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
}
|
||||
|
||||
type ArchiverOptions = CoreOptions & TransformOptions & ZipOptions & TarOptions;
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
import asap = require("asap");
|
||||
import rawAsap = require("asap/raw");
|
||||
|
||||
class Callable {
|
||||
call(): void {
|
||||
"'Callable' invoked";
|
||||
}
|
||||
}
|
||||
function f(): void {
|
||||
"'f' invoked";
|
||||
}
|
||||
|
||||
// $ExpectType void
|
||||
asap(f);
|
||||
|
||||
// $ExpectType void
|
||||
asap((): void => {
|
||||
"'arrow' invoked";
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
asap(new Callable());
|
||||
|
||||
// $ExpectType void
|
||||
rawAsap(f);
|
||||
|
||||
// $ExpectType void
|
||||
rawAsap((): void => {
|
||||
"'arrow' invoked";
|
||||
});
|
||||
|
||||
// $ExpectType void
|
||||
rawAsap(new Callable());
|
||||
|
||||
// $ExpectType void
|
||||
rawAsap.requestFlush();
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// Type definitions for asap 2.0
|
||||
// Project: https://github.com/kriskowal/asap
|
||||
// Definitions by: fpascutti <https://github.com/fpascutti>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface Task {
|
||||
call(...args: any[]): any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a task as soon as possible.
|
||||
* @param task Function or any object that implements `call()`.
|
||||
*/
|
||||
declare function asap(task: Task): void;
|
||||
export = asap;
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
interface Task {
|
||||
call(...args: any[]): any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a task as soon as possible.
|
||||
* @param task Function or any object that implements `call()`.
|
||||
*/
|
||||
declare function rawAsap(task: Task): void;
|
||||
declare namespace rawAsap {
|
||||
/**
|
||||
* Flushes the event queue.
|
||||
*/
|
||||
function requestFlush(): void;
|
||||
}
|
||||
export = rawAsap;
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"asap-tests.ts",
|
||||
"index.d.ts",
|
||||
"raw.d.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Vendored
+80
-10
@@ -1,4 +1,4 @@
|
||||
// Type definitions for cesium 1.44
|
||||
// Type definitions for cesium 1.46
|
||||
// Project: http://cesiumjs.org
|
||||
// Definitions by: Aigars Zeiza <https://github.com/Zuzon>
|
||||
// Harry Nicholls <https://github.com/hnipps>
|
||||
@@ -1437,10 +1437,10 @@ declare namespace Cesium {
|
||||
}
|
||||
|
||||
class TerrainData {
|
||||
credits: Credit[];
|
||||
waterMask: Uint8Array | HTMLImageElement | HTMLCanvasElement;
|
||||
interpolateHeight(rectangle: Rectangle, longitude: number, latitude: number): number;
|
||||
isChildAvailable(thisX: number, thisY: number, childX: number, childY: number): boolean;
|
||||
createMesh(tilingScheme: TilingScheme, x: number, y: number, level: number): Promise<TerrainMesh>;
|
||||
upsample(tilingScheme: TilingScheme, thisX: number, thisY: number, thisLevel: number, descendantX: number, descendantY: number, descendantLevel: number): Promise<TerrainData>;
|
||||
wasCreatedByUpsampling(): boolean;
|
||||
}
|
||||
@@ -1459,7 +1459,7 @@ declare namespace Cesium {
|
||||
}
|
||||
|
||||
abstract class TerrainProvider {
|
||||
availability: any; // TileAvailability
|
||||
availability: TileAvailability;
|
||||
credit: Credit;
|
||||
errorEvent: Event;
|
||||
hasVertexNormals: boolean;
|
||||
@@ -1475,6 +1475,15 @@ declare namespace Cesium {
|
||||
requestTileGeometry(x: number, y: number, level: number, throttleRequests?: boolean): Promise<TerrainData>;
|
||||
}
|
||||
|
||||
class TileAvailability {
|
||||
constructor(tilingScheme: TilingScheme, maximumLevel: number);
|
||||
addAvailableTileRange(level: number, startX: number, startY: number, endX: number, endY: number): void;
|
||||
computeBestAvailableLevelOverRectangle(rectangle: Rectangle): number;
|
||||
computeChildMaskForTile(level: number, x: number, y: number): number;
|
||||
computeMaximumLevelAtPosition(position: Cartographic): number;
|
||||
isTileAvailable(level: number, x: number, y: number): boolean;
|
||||
}
|
||||
|
||||
class TileProviderError {
|
||||
provider: ImageryProvider | TerrainProvider;
|
||||
message: string;
|
||||
@@ -3007,23 +3016,84 @@ declare namespace Cesium {
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
class GoogleEarthEnterpriseMetadata {
|
||||
imageryPresent: boolean;
|
||||
key: ArrayBuffer;
|
||||
negativeAltitudeExponentBias: number;
|
||||
negativeAltitudeThreshold: number;
|
||||
protoImagery: boolean;
|
||||
readonly proxy: Proxy;
|
||||
readonly readyPromise: Promise<boolean>;
|
||||
readonly resource: Resource;
|
||||
terrainPresent: boolean;
|
||||
readonly url: string;
|
||||
constructor(resourceOrUrl: Resource | string);
|
||||
static quadKeyToTileXY(quadkey: string): {x: number, y: number, level: number};
|
||||
static tileXYToQuadKey(x: number, y: number, level: number): string;
|
||||
}
|
||||
|
||||
class GoogleEarthEnterpriseImageryProvider extends ImageryProvider {
|
||||
url: string;
|
||||
path: string;
|
||||
channel: number;
|
||||
version: number;
|
||||
requestType: string;
|
||||
readonly url: string;
|
||||
constructor(options: {
|
||||
url: string;
|
||||
url: Resource | string;
|
||||
metadata: GoogleEarthEnterpriseMetadata;
|
||||
ellipsoid?: Ellipsoid;
|
||||
tileDiscardPolicy?: TileDiscardPolicy;
|
||||
credit?: Credit | string;
|
||||
});
|
||||
}
|
||||
|
||||
class GoogleEarthEnterpriseMapsProvider extends ImageryProvider {
|
||||
readonly channel: number;
|
||||
readonly path: string;
|
||||
readonly requestType: string;
|
||||
readonly url: string;
|
||||
readonly version: number;
|
||||
static logoUrl: string;
|
||||
constructor(options: {
|
||||
url: Resource | string;
|
||||
channel: number;
|
||||
path?: string;
|
||||
maximumLevel?: number;
|
||||
tileDiscardPolicy?: TileDiscardPolicy;
|
||||
ellipsoid?: Ellipsoid;
|
||||
proxy?: Proxy
|
||||
});
|
||||
}
|
||||
|
||||
class GoogleEarthEnterpriseTerrainData extends TerrainData {
|
||||
constructor(options: {
|
||||
buffer: ArrayBuffer;
|
||||
negativeAltitudeExponentBias: number;
|
||||
negativeElevationThreshold: number;
|
||||
childTileMask?: number;
|
||||
createdByUpsampling?: boolean;
|
||||
credits?: Credit[];
|
||||
});
|
||||
}
|
||||
|
||||
class GoogleEarthEnterpriseTerrainProvider {
|
||||
static heightmapTerrainQuality: number;
|
||||
availability: TileAvailability;
|
||||
credit: Credit;
|
||||
errorEvent: Event;
|
||||
hasVertexNormals: boolean;
|
||||
hasWaterMask: boolean;
|
||||
ready: boolean;
|
||||
readonly readyPromise: Promise<boolean>;
|
||||
tilingScheme: TilingScheme;
|
||||
constructor(options: {
|
||||
url: Resource | string;
|
||||
metadata: GoogleEarthEnterpriseMetadata;
|
||||
ellipsoid?: Ellipsoid;
|
||||
credit?: Credit | string;
|
||||
})
|
||||
static getEstimatedLevelZeroGeometricErrorForAHeightmap(ellipsoid: Ellipsoid, tileImageWidth: number, numberOfTilesAtLevelZero: number): number;
|
||||
static getRegularGridIndices(width: number, height: number): Uint16Array;
|
||||
getLevelMaximumGeometricError(level: number): number;
|
||||
getTileDataAvailable(x: number, y: number, level: number): boolean;
|
||||
requestTileGeometry(x: number, y: number, level: number, request?: Request): Promise<TerrainData>;
|
||||
}
|
||||
|
||||
class GridImageryProvider extends ImageryProvider {
|
||||
constructor(options?: {
|
||||
tilingScheme?: TilingScheme;
|
||||
|
||||
@@ -56,7 +56,7 @@ const ClassicComponent: React.ClassicComponentClass<Props> = createReactClass<Pr
|
||||
shouldComponentUpdate(this: React.ClassicComponent<Props, State>, nextProps, nextState) {
|
||||
const newFoo: string = nextProps.foo;
|
||||
const newBar: number = nextState.bar;
|
||||
return newFoo !== this.props.foo && newBar !== this.state!.bar;
|
||||
return newFoo !== this.props.foo && newBar !== this.state.bar;
|
||||
},
|
||||
statics: {
|
||||
test: 1
|
||||
|
||||
@@ -343,17 +343,29 @@ const positions = oneOf({a: {x: 100, y: 100}}, (node: cytoscape.NodeCollection):
|
||||
|
||||
// TODO: cy.style
|
||||
|
||||
// $ExpectType string
|
||||
cy.png({
|
||||
output: oneOf('base64uri', 'base64', 'blob', undefined),
|
||||
output: oneOf('base64uri', 'base64', undefined),
|
||||
bg: oneOf('#ffffff', undefined),
|
||||
full: true,
|
||||
scale: 2,
|
||||
maxWidth: 100,
|
||||
maxHeight: 100
|
||||
});
|
||||
// $ExpectType Blob
|
||||
cy.png({
|
||||
output: 'blob',
|
||||
bg: oneOf('#ffffff', undefined),
|
||||
full: true,
|
||||
scale: 2,
|
||||
maxWidth: 100,
|
||||
maxHeight: 100
|
||||
});
|
||||
|
||||
aliases(cy.jpg, cy.jpeg);
|
||||
// $ExpectType string
|
||||
cy.jpg({
|
||||
output: oneOf('base64uri', 'base64', 'blob', undefined),
|
||||
output: oneOf('base64uri', 'base64', undefined),
|
||||
bg: oneOf('#ffffff', undefined),
|
||||
full: true,
|
||||
scale: 2,
|
||||
@@ -361,6 +373,17 @@ cy.jpg({
|
||||
maxHeight: 100,
|
||||
quality: 0.5
|
||||
});
|
||||
// $ExpectType Blob
|
||||
cy.jpg({
|
||||
output: 'blob',
|
||||
bg: oneOf('#ffffff', undefined),
|
||||
full: true,
|
||||
scale: 2,
|
||||
maxWidth: 100,
|
||||
maxHeight: 100,
|
||||
quality: 0.5
|
||||
});
|
||||
|
||||
cy.json(cy.json());
|
||||
|
||||
// Types possible to call methods
|
||||
|
||||
Vendored
+22
-7
@@ -1052,10 +1052,6 @@ declare namespace cytoscape {
|
||||
* http://js.cytoscape.org/#core/export
|
||||
*/
|
||||
interface ExportOptions {
|
||||
/**
|
||||
* output Whether the output should be 'base64uri' (default), 'base64', or 'blob'.
|
||||
*/
|
||||
output?: "base64uri" | "base64" | "blob";
|
||||
/**
|
||||
* The background colour of the image (transparent by default).
|
||||
*/
|
||||
@@ -1077,6 +1073,18 @@ declare namespace cytoscape {
|
||||
*/
|
||||
maxHeight?: number;
|
||||
}
|
||||
interface ExportStringOptions extends ExportOptions {
|
||||
/**
|
||||
* output Whether the output should be 'base64uri' (default), 'base64', or 'blob'.
|
||||
*/
|
||||
output?: "base64uri" | "base64";
|
||||
}
|
||||
interface ExportBlobOptions extends ExportOptions {
|
||||
/**
|
||||
* output Whether the output should be 'base64uri' (default), 'base64', or 'blob'.
|
||||
*/
|
||||
output?: "blob";
|
||||
}
|
||||
|
||||
interface ExportJpgOptions extends ExportOptions {
|
||||
/**
|
||||
@@ -1086,22 +1094,29 @@ declare namespace cytoscape {
|
||||
*/
|
||||
quality?: number;
|
||||
}
|
||||
interface ExportJpgStringOptions extends ExportJpgOptions, ExportStringOptions {
|
||||
}
|
||||
interface ExportJpgBlobOptions extends ExportJpgOptions, ExportBlobOptions {
|
||||
}
|
||||
|
||||
interface CoreExport {
|
||||
/**
|
||||
* Export the current graph view as a PNG image in Base64 representation.
|
||||
*/
|
||||
png(options?: ExportOptions): string;
|
||||
png(options?: ExportStringOptions): string;
|
||||
png(options?: ExportBlobOptions): Blob;
|
||||
|
||||
/**
|
||||
* Export the current graph view as a JPG image in Base64 representation.
|
||||
*/
|
||||
jpg(options?: ExportJpgOptions): string;
|
||||
jpg(options?: ExportJpgStringOptions): string;
|
||||
jpg(options?: ExportJpgBlobOptions): Blob;
|
||||
|
||||
/**
|
||||
* Export the current graph view as a JPG image in Base64 representation.
|
||||
*/
|
||||
jpeg(options?: ExportJpgOptions): string;
|
||||
jpeg(options?: ExportJpgStringOptions): string;
|
||||
jpeg(options?: ExportJpgBlobOptions): Blob;
|
||||
|
||||
/**
|
||||
* Export the graph as JSON, the same format used at initialisation.
|
||||
|
||||
@@ -1002,6 +1002,9 @@ const static_6 = new $.fn.dataTable.Api("selector");
|
||||
|
||||
const version: boolean = $.fn.dataTable.versionCheck("1.10.0");
|
||||
const isDataTable: boolean = $.fn.dataTable.isDataTable("selector");
|
||||
const isDataTable_3: boolean = $.fn.dataTable.isDataTable(dt.row("selector").node());
|
||||
const isDataTable_2: boolean = $.fn.dataTable.isDataTable($("selector"));
|
||||
const isDataTable_4: boolean = $.fn.dataTable.isDataTable($("selector").dataTable().api());
|
||||
const escapeRegex: string = $.fn.dataTable.util.escapeRegex("");
|
||||
|
||||
const throttle_1 = $.fn.dataTable.util.throttle((data) => {
|
||||
|
||||
Vendored
+3
-3
@@ -1094,13 +1094,13 @@ declare namespace DataTables {
|
||||
(): JQueryDataTables;
|
||||
|
||||
/**
|
||||
* Check is a table node is a DataTable or not
|
||||
* Check if a table node is a DataTable already or not.
|
||||
*
|
||||
* Usage:
|
||||
* $.fn.dataTable.isDataTable("selector");
|
||||
* @param table Selector string for table
|
||||
* @param table The table to check.
|
||||
*/
|
||||
isDataTable(table: string): boolean;
|
||||
isDataTable(table: string | Node | JQuery | Api): boolean;
|
||||
|
||||
/**
|
||||
* Helpers for `columns.render`.
|
||||
|
||||
Vendored
+5
-5
@@ -962,11 +962,11 @@ declare class Dockerode {
|
||||
pull(repoTag: string, options: {}, callback: Callback<any>, auth?: {}): Dockerode.Image;
|
||||
pull(repoTag: string, options: {}, auth?: {}): Promise<any>;
|
||||
|
||||
run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions: {}, startOptions: {}, callback: Callback<any>): events.EventEmitter;
|
||||
run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, startOptions: {}, callback: Callback<any>): events.EventEmitter;
|
||||
run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, callback: Callback<any>): events.EventEmitter;
|
||||
run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions: {}, callback: Callback<any>): events.EventEmitter;
|
||||
run(image: string, cmd: string[], outputStream: NodeJS.WritableStream, createOptions?: {}, startOptions?: {}): Promise<any>;
|
||||
run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], createOptions: {}, startOptions: {}, callback: Callback<any>): events.EventEmitter;
|
||||
run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], startOptions: {}, callback: Callback<any>): events.EventEmitter;
|
||||
run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], callback: Callback<any>): events.EventEmitter;
|
||||
run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], createOptions: {}, callback: Callback<any>): events.EventEmitter;
|
||||
run(image: string, cmd: string[], outputStream: NodeJS.WritableStream | NodeJS.WritableStream[], createOptions?: {}, startOptions?: {}): Promise<any>;
|
||||
|
||||
swarmInit(options: {}, callback: Callback<any>): void;
|
||||
swarmInit(options: {}): Promise<any>;
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
/// <reference types="ember-qunit" />
|
||||
|
||||
import { test } from 'qunit';
|
||||
import Application from '@ember/application';
|
||||
import hbs from 'htmlbars-inline-precompile';
|
||||
import {
|
||||
click,
|
||||
doubleClick,
|
||||
tap,
|
||||
focus,
|
||||
blur,
|
||||
triggerEvent,
|
||||
triggerKeyEvent,
|
||||
fillIn,
|
||||
render,
|
||||
find,
|
||||
findAll,
|
||||
getRootElement,
|
||||
pauseTest,
|
||||
resumeTest,
|
||||
waitFor,
|
||||
waitUntil,
|
||||
settled,
|
||||
isSettled,
|
||||
getSettledState,
|
||||
visit,
|
||||
currentURL,
|
||||
currentRouteName,
|
||||
setApplication
|
||||
} from '@ember/test-helpers';
|
||||
|
||||
const MyApp = Application.extend({ modulePrefix: 'my-app' });
|
||||
|
||||
setApplication(MyApp.create());
|
||||
|
||||
test('DOM interactions', async () => {
|
||||
await render(hbs`<div class="message">Hello, world</div>`);
|
||||
|
||||
await click('.message');
|
||||
await doubleClick('.message');
|
||||
await tap('.message');
|
||||
await focus('.message');
|
||||
await blur('.message');
|
||||
await triggerEvent('.message', 'custom-event');
|
||||
await triggerKeyEvent('.message', 'keydown', 'Enter', { ctrlKey: true });
|
||||
await fillIn('.message', 'content');
|
||||
|
||||
const messageElement = find('.message')!;
|
||||
await click(messageElement);
|
||||
await doubleClick(messageElement);
|
||||
await tap(messageElement);
|
||||
await focus(messageElement);
|
||||
await blur(messageElement);
|
||||
await triggerEvent(messageElement, 'custom-event');
|
||||
await triggerKeyEvent(messageElement, 'keydown', 'Enter', { ctrlKey: true });
|
||||
await fillIn(messageElement, 'content');
|
||||
|
||||
const allMessages = findAll('.message');
|
||||
for (const element of allMessages) {
|
||||
await click(element);
|
||||
}
|
||||
|
||||
const root = getRootElement();
|
||||
await click(root);
|
||||
});
|
||||
|
||||
test('routing helpers', async (assert) => {
|
||||
await visit('/foo');
|
||||
|
||||
assert.equal(currentURL(), '/foo');
|
||||
assert.equal(currentRouteName(), 'foo');
|
||||
});
|
||||
|
||||
test('pause and resume', async () => {
|
||||
await pauseTest();
|
||||
setTimeout(resumeTest, 1000);
|
||||
});
|
||||
|
||||
test('wait helpers', async (assert) => {
|
||||
await render(hbs`<div class="message">Hello</div>`);
|
||||
|
||||
await waitFor('.message', { count: 1, timeout: 10, timeoutMessage: 'uh oh' });
|
||||
await waitUntil(() => 'hello', { timeout: 1000, timeoutMessage: 'boom' });
|
||||
|
||||
await settled();
|
||||
assert.ok(isSettled());
|
||||
|
||||
const {
|
||||
hasPendingRequests,
|
||||
hasPendingTimers,
|
||||
hasPendingWaiters,
|
||||
hasRunLoop,
|
||||
pendingRequestCount
|
||||
} = getSettledState();
|
||||
});
|
||||
Vendored
+220
@@ -0,0 +1,220 @@
|
||||
// Type definitions for @ember/test-helpers 0.7
|
||||
// Project: https://github.com/emberjs/ember-test-helpers
|
||||
// Definitions by: Dan Freeman <https://github.com/dfreeman>
|
||||
// James C. Davis <https://github.com/jamescdavis>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
/// <reference types="ember" />
|
||||
|
||||
declare module '@ember/test-helpers' {
|
||||
// DOM Interaction Helpers
|
||||
|
||||
export type Target = string | Element;
|
||||
|
||||
export { default as click } from '@ember/test-helpers/dom/click';
|
||||
export { default as doubleClick } from '@ember/test-helpers/dom/double-click';
|
||||
export { default as tap } from '@ember/test-helpers/dom/tap';
|
||||
export { default as focus } from '@ember/test-helpers/dom/focus';
|
||||
export { default as blur } from '@ember/test-helpers/dom/blur';
|
||||
export { default as triggerEvent } from '@ember/test-helpers/dom/trigger-event';
|
||||
export { default as triggerKeyEvent } from '@ember/test-helpers/dom/trigger-key-event';
|
||||
export { default as fillIn } from '@ember/test-helpers/dom/fill-in';
|
||||
|
||||
// DOM Query Helpers
|
||||
|
||||
export { default as find } from '@ember/test-helpers/dom/find';
|
||||
export { default as findAll } from '@ember/test-helpers/dom/find-all';
|
||||
export { default as getRootElement } from '@ember/test-helpers/dom/get-root-element';
|
||||
|
||||
// Routing Helpers
|
||||
|
||||
export { visit, currentRouteName, currentURL } from '@ember/test-helpers/setup-application-context';
|
||||
|
||||
// Rendering Helpers
|
||||
|
||||
export { render, clearRender } from '@ember/test-helpers/setup-rendering-context';
|
||||
|
||||
// Wait Helpers
|
||||
|
||||
export { default as waitFor } from '@ember/test-helpers/dom/wait-for';
|
||||
export { default as waitUntil } from '@ember/test-helpers/wait-until';
|
||||
export { default as settled, isSettled, getSettledState } from '@ember/test-helpers/settled';
|
||||
|
||||
// Pause Helpers
|
||||
|
||||
export { pauseTest, resumeTest } from '@ember/test-helpers/setup-context';
|
||||
|
||||
// Test Framework APIs
|
||||
|
||||
export { setResolver, getResolver } from '@ember/test-helpers/resolver';
|
||||
export { default as setupContext, getContext, setContext, unsetContext } from '@ember/test-helpers/setup-context';
|
||||
export { default as teardownContext } from '@ember/test-helpers/teardown-context';
|
||||
export { default as setupRenderingContext } from '@ember/test-helpers/setup-rendering-context';
|
||||
export { default as teardownRenderingContext } from '@ember/test-helpers/teardown-rendering-context';
|
||||
export { getApplication, setApplication } from '@ember/test-helpers/application';
|
||||
export { default as setupApplicationContext } from '@ember/test-helpers/setup-application-context';
|
||||
export { default as teardownApplicationContext } from '@ember/test-helpers/teardown-application-context';
|
||||
export { default as validateErrorHandler } from '@ember/test-helpers/validate-error-handler';
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/dom/click' {
|
||||
import { Target } from '@ember/test-helpers';
|
||||
|
||||
export default function(target: Target): Promise<void>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/dom/double-click' {
|
||||
import { Target } from '@ember/test-helpers';
|
||||
|
||||
export default function(target: Target): Promise<void>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/dom/tap' {
|
||||
import { Target } from '@ember/test-helpers';
|
||||
|
||||
export default function(target: Target): Promise<void>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/dom/focus' {
|
||||
import { Target } from '@ember/test-helpers';
|
||||
|
||||
export default function(target: Target): Promise<void>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/dom/blur' {
|
||||
import { Target } from '@ember/test-helpers';
|
||||
|
||||
export default function(target: Target): Promise<void>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/dom/trigger-event' {
|
||||
import { Target } from '@ember/test-helpers';
|
||||
|
||||
export default function(target: Target, eventType: string, options?: object): Promise<void>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/dom/trigger-key-event' {
|
||||
import { Target } from '@ember/test-helpers';
|
||||
|
||||
export type KeyEvent = 'keydown' | 'keyup' | 'keypress';
|
||||
|
||||
export interface KeyModifiers {
|
||||
ctrlKey?: boolean;
|
||||
altKey?: boolean;
|
||||
shiftKey?: boolean;
|
||||
metaKey?: boolean;
|
||||
}
|
||||
|
||||
export default function(target: Target, eventType: KeyEvent, key: number | string, modifiers?: KeyModifiers): Promise<void>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/dom/fill-in' {
|
||||
import { Target } from '@ember/test-helpers';
|
||||
|
||||
export default function(target: Target, text: string): Promise<void>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/dom/find' {
|
||||
export default function(selector: string): Element | null;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/dom/find-all' {
|
||||
export default function(selector: string): Element[];
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/dom/get-root-element' {
|
||||
export default function(): Element;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/setup-application-context' {
|
||||
export default function<Context extends object>(context: Context): Promise<Context>;
|
||||
export function visit(url: string): Promise<void>;
|
||||
export function currentRouteName(): string;
|
||||
export function currentURL(): string;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/setup-rendering-context' {
|
||||
import { TemplateFactory } from 'htmlbars-inline-precompile';
|
||||
|
||||
export default function<Context extends object>(context: Context): Promise<Context>;
|
||||
export function render(template: TemplateFactory): Promise<void>;
|
||||
export function clearRender(): Promise<void>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/dom/wait-for' {
|
||||
export interface Options {
|
||||
timeout?: number;
|
||||
count?: number;
|
||||
timeoutMessage?: string;
|
||||
}
|
||||
|
||||
export default function(selector: string, options?: Options): Promise<Element | Element[]>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/wait-until' {
|
||||
export interface Options {
|
||||
timeout?: number;
|
||||
timeoutMessage?: string;
|
||||
}
|
||||
|
||||
export default function<T>(callback: () => T, options?: Options): Promise<T>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/settled' {
|
||||
export interface SettledState {
|
||||
hasRunLoop: boolean;
|
||||
hasPendingTimers: boolean;
|
||||
hasPendingWaiters: boolean;
|
||||
hasPendingRequests: boolean;
|
||||
pendingRequestCount: number;
|
||||
}
|
||||
|
||||
export default function(): Promise<void>;
|
||||
export function isSettled(): boolean;
|
||||
export function getSettledState(): SettledState;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/setup-context' {
|
||||
import Resolver from '@ember/application/resolver';
|
||||
|
||||
export default function<C extends object>(context: C, options?: { resolver?: Resolver }): Promise<C>;
|
||||
export function getContext(): object;
|
||||
export function setContext(context: object): void;
|
||||
export function unsetContext(): void;
|
||||
|
||||
export function pauseTest(): Promise<void>;
|
||||
export function resumeTest(): void;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/resolver' {
|
||||
import Resolver from '@ember/application/resolver';
|
||||
|
||||
export function setResolver(resolver: Resolver): void;
|
||||
export function getResolver(): Resolver;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/teardown-context' {
|
||||
export default function(context: object): Promise<void>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/teardown-rendering-context' {
|
||||
export default function(context: object): Promise<void>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/teardown-application-context' {
|
||||
export default function(context: object): Promise<void>;
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/validate-error-handler' {
|
||||
import Error from '@ember/error';
|
||||
|
||||
export default function(callback?: (error: Error) => void): { isValid: boolean, message: string };
|
||||
}
|
||||
|
||||
declare module '@ember/test-helpers/application' {
|
||||
import Application from '@ember/application';
|
||||
|
||||
export function getApplication(): Application;
|
||||
export function setApplication(application: Application): void;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"paths": {
|
||||
"@ember/test-helpers": ["ember__test-helpers"]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ember__test-helpers-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"strict-export-declare-modifiers": false
|
||||
}
|
||||
}
|
||||
@@ -373,9 +373,9 @@ async () => {
|
||||
};
|
||||
|
||||
async () => {
|
||||
const result = await ImageManipulator.manipulate('url', {
|
||||
const result = await ImageManipulator.manipulate('url', [{
|
||||
rotate: 90
|
||||
}, {
|
||||
}], {
|
||||
compress: 0.75
|
||||
});
|
||||
|
||||
|
||||
Vendored
+22
-15
@@ -1513,6 +1513,27 @@ export namespace Gyroscope {
|
||||
* ImageManipulator
|
||||
*/
|
||||
export namespace ImageManipulator {
|
||||
type Action = Resize | Rotate | Flip | Crop;
|
||||
|
||||
interface Resize {
|
||||
resize: { width: number, height: number };
|
||||
}
|
||||
|
||||
interface Rotate {
|
||||
rotate: number;
|
||||
}
|
||||
|
||||
interface Flip {
|
||||
flip?: { vertical?: boolean; horizontal?: boolean };
|
||||
}
|
||||
|
||||
interface Crop {
|
||||
originX: number;
|
||||
originY: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
interface ImageResult {
|
||||
uri: string;
|
||||
width: number;
|
||||
@@ -1527,21 +1548,7 @@ export namespace ImageManipulator {
|
||||
format?: 'jpeg' | 'png';
|
||||
}
|
||||
|
||||
interface CropParameters {
|
||||
originX: number;
|
||||
originY: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
interface ImageManipulationOptions {
|
||||
resize?: { width?: number; height?: number };
|
||||
rotate?: number;
|
||||
flip?: { vertical?: boolean; horizontal?: boolean };
|
||||
crop?: CropParameters;
|
||||
}
|
||||
|
||||
function manipulate(uri: string, actions: ImageManipulationOptions, saveOptions?: SaveOptions): Promise<ImageResult>;
|
||||
function manipulate(uri: string, actions: Action[], saveOptions?: SaveOptions): Promise<ImageResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+1
-1
@@ -1867,7 +1867,7 @@ export class Image {
|
||||
* @param [callback] Callback to invoke when image is created (newly created image is passed as a first argument)
|
||||
* @param [imgOptions] Options object
|
||||
*/
|
||||
static fromURL(url: string, callback?: (image: Image) => void, objObjects?: IObjectOptions): Image;
|
||||
static fromURL(url: string, callback?: (image: Image) => void, imgOptions?: IImageOptions): Image;
|
||||
/**
|
||||
* Creates an instance of fabric.Image from its object representation
|
||||
* @param object Object to create an instance from
|
||||
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// Type definitions for JQuery Gray 1.6
|
||||
// Project: https://github.com/karlhorky/gray
|
||||
// Definitions by: Anderson Friaça <https://github.com/AndersonFriaca>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
export type Classes = Partial<{
|
||||
fade: string;
|
||||
}>;
|
||||
|
||||
export type Options = Partial<{
|
||||
fade: boolean;
|
||||
classes: Classes;
|
||||
}>;
|
||||
|
||||
declare global {
|
||||
interface JQuery {
|
||||
gray(options?: Options): JQuery;
|
||||
toggleClass(className: 'grayscale-off'): JQuery;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Options } from "jquery-gray";
|
||||
|
||||
// basic usage
|
||||
$('.images').gray();
|
||||
|
||||
$('.images').toggleClass('grayscale-off');
|
||||
|
||||
// with options
|
||||
const options: Options = {
|
||||
fade: true,
|
||||
classes: {
|
||||
fade: 'grayscale-fade'
|
||||
}
|
||||
};
|
||||
|
||||
$('.images').gray(options);
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jquery-gray-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"extends": "dtslint/dt.json"}
|
||||
Vendored
+2
-1
@@ -1,6 +1,7 @@
|
||||
// Type definitions for json-editor
|
||||
// Project: https://github.com/jdorn/json-editor
|
||||
// Definitions by: York Yao <https://github.com/plantain-00/>
|
||||
// Felipe Provenzano <https://github.com/felipeprov/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
type JSONEditorOptions<TValue> = {
|
||||
@@ -75,7 +76,7 @@ type JSONEditorOptions<TValue> = {
|
||||
/**
|
||||
* The CSS theme to use.
|
||||
*/
|
||||
theme?: "barebones" | "html" | "bootstrap2" | "bootstrap3" | "foundation3" | "foundation4" | "foundation5" | "foundation6" | "jqueryui";
|
||||
theme?: "barebones" | "html" | "bootstrap2" | "bootstrap3" | "bootstrap4" | "foundation3" | "foundation4" | "foundation5" | "foundation6" | "jqueryui";
|
||||
/**
|
||||
* If true, only required properties will be included by default.
|
||||
*/
|
||||
|
||||
Vendored
+3
-1
@@ -155,7 +155,7 @@ declare namespace Knex {
|
||||
pluck(column: string): QueryBuilder;
|
||||
|
||||
insert(data: any, returning?: string | string[]): QueryBuilder;
|
||||
modify(callback: QueryCallback, ...args: any[]): QueryBuilder;
|
||||
modify(callback: QueryCallbackWithArgs, ...args: any[]): QueryBuilder;
|
||||
update(data: any, returning?: string | string[]): QueryBuilder;
|
||||
update(columnName: string, value: Value, returning?: string | string[]): QueryBuilder;
|
||||
returning(column: string | string[]): QueryBuilder;
|
||||
@@ -360,6 +360,8 @@ declare namespace Knex {
|
||||
//
|
||||
|
||||
type QueryCallback = (this: QueryBuilder, builder: QueryBuilder) => void;
|
||||
type QueryCallbackWithArgs = (this: QueryBuilder, builder: QueryBuilder, ...args: any[]) => void;
|
||||
|
||||
interface QueryBuilder extends QueryInterface, ChainableInterface {
|
||||
or: QueryBuilder;
|
||||
and: QueryBuilder;
|
||||
|
||||
@@ -1045,10 +1045,10 @@ knex('users')
|
||||
}).unionAll(function(builder) {
|
||||
let self: Knex.QueryBuilder = this;
|
||||
self = builder;
|
||||
}).modify(function(builder) {
|
||||
}).modify(function(builder, aBool) {
|
||||
let self: Knex.QueryBuilder = this;
|
||||
self = builder;
|
||||
});
|
||||
}, true);
|
||||
|
||||
//
|
||||
// Migrations
|
||||
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
// Type definitions for micro-cors 0.1
|
||||
// Project: https://github.com/possibilities/micro-cors#readme
|
||||
// Definitions by: Callum Denby <https://github.com/CallumDenby>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import { RequestHandler } from "micro";
|
||||
|
||||
interface Options {
|
||||
maxAge?: string;
|
||||
origin?: string;
|
||||
allowHeaders?: string[];
|
||||
allowMethods?: string[];
|
||||
exposeHeaders?: string[];
|
||||
}
|
||||
|
||||
declare function micro_cors(options?: Options): (handler: RequestHandler) => RequestHandler;
|
||||
|
||||
export = micro_cors;
|
||||
@@ -0,0 +1,18 @@
|
||||
import cors = require('micro-cors');
|
||||
import micro from 'micro';
|
||||
|
||||
const handler = cors();
|
||||
|
||||
cors({ allowMethods: ['PUT', 'POST'] });
|
||||
|
||||
cors({
|
||||
maxAge: '1000',
|
||||
origin: '*',
|
||||
allowHeaders: [],
|
||||
allowMethods: [],
|
||||
exposeHeaders: []
|
||||
});
|
||||
|
||||
handler(async (req, res) => {});
|
||||
handler((req, res) => {});
|
||||
micro(handler((req, res) => {}));
|
||||
@@ -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",
|
||||
"micro-cors-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+320
-192
@@ -9,9 +9,6 @@
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export = Mocha;
|
||||
export as namespace Mocha;
|
||||
|
||||
/**
|
||||
* Mocha API
|
||||
*
|
||||
@@ -2623,234 +2620,365 @@ declare namespace Mocha {
|
||||
// #endregion
|
||||
}
|
||||
|
||||
declare global {
|
||||
// #region Test interface augmentations
|
||||
// #region Test interface augmentations
|
||||
|
||||
/**
|
||||
* Triggers root suite execution.
|
||||
*
|
||||
* - _Only available if flag --delay is passed into Mocha._
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#runWithSuite
|
||||
*/
|
||||
function run(): void;
|
||||
/**
|
||||
* Triggers root suite execution.
|
||||
*
|
||||
* - _Only available if flag --delay is passed into Mocha._
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#runWithSuite
|
||||
*/
|
||||
declare function run(): void;
|
||||
|
||||
/**
|
||||
* Execute before running tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#before
|
||||
*/
|
||||
var before: Mocha.HookFunction;
|
||||
/**
|
||||
* Execute before running tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#before
|
||||
*/
|
||||
declare var before: Mocha.HookFunction;
|
||||
|
||||
/**
|
||||
* Execute before running tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#before
|
||||
*/
|
||||
var suiteSetup: Mocha.HookFunction;
|
||||
/**
|
||||
* Execute before running tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#before
|
||||
*/
|
||||
declare var suiteSetup: Mocha.HookFunction;
|
||||
|
||||
/**
|
||||
* Execute after running tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#after
|
||||
*/
|
||||
var after: Mocha.HookFunction;
|
||||
/**
|
||||
* Execute after running tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#after
|
||||
*/
|
||||
declare var after: Mocha.HookFunction;
|
||||
|
||||
/**
|
||||
* Execute after running tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#after
|
||||
*/
|
||||
var suiteTeardown: Mocha.HookFunction;
|
||||
/**
|
||||
* Execute after running tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#after
|
||||
*/
|
||||
declare var suiteTeardown: Mocha.HookFunction;
|
||||
|
||||
/**
|
||||
* Execute before each test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#beforeEach
|
||||
*/
|
||||
var beforeEach: Mocha.HookFunction;
|
||||
/**
|
||||
* Execute before each test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#beforeEach
|
||||
*/
|
||||
declare var beforeEach: Mocha.HookFunction;
|
||||
|
||||
/**
|
||||
* Execute before each test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#beforeEach
|
||||
*/
|
||||
var setup: Mocha.HookFunction;
|
||||
/**
|
||||
* Execute before each test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#beforeEach
|
||||
*/
|
||||
declare var setup: Mocha.HookFunction;
|
||||
|
||||
/**
|
||||
* Execute after each test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#afterEach
|
||||
*/
|
||||
var afterEach: Mocha.HookFunction;
|
||||
/**
|
||||
* Execute after each test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#afterEach
|
||||
*/
|
||||
declare var afterEach: Mocha.HookFunction;
|
||||
|
||||
/**
|
||||
* Execute after each test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#afterEach
|
||||
*/
|
||||
var teardown: Mocha.HookFunction;
|
||||
/**
|
||||
* Execute after each test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*
|
||||
* @see https://mochajs.org/api/global.html#afterEach
|
||||
*/
|
||||
declare var teardown: Mocha.HookFunction;
|
||||
|
||||
/**
|
||||
* Describe a "suite" containing nested suites and tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
var describe: Mocha.SuiteFunction;
|
||||
/**
|
||||
* Describe a "suite" containing nested suites and tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
declare var describe: Mocha.SuiteFunction;
|
||||
|
||||
/**
|
||||
* Describe a "suite" containing nested suites and tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
var context: Mocha.SuiteFunction;
|
||||
/**
|
||||
* Describe a "suite" containing nested suites and tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
declare var context: Mocha.SuiteFunction;
|
||||
|
||||
/**
|
||||
* Describe a "suite" containing nested suites and tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
var suite: Mocha.SuiteFunction;
|
||||
/**
|
||||
* Describe a "suite" containing nested suites and tests.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
declare var suite: Mocha.SuiteFunction;
|
||||
|
||||
/**
|
||||
* Pending suite.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
var xdescribe: Mocha.PendingSuiteFunction;
|
||||
/**
|
||||
* Pending suite.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
declare var xdescribe: Mocha.PendingSuiteFunction;
|
||||
|
||||
/**
|
||||
* Pending suite.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
var xcontext: Mocha.PendingSuiteFunction;
|
||||
/**
|
||||
* Pending suite.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
declare var xcontext: Mocha.PendingSuiteFunction;
|
||||
|
||||
/**
|
||||
* Describes a test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
var it: Mocha.TestFunction;
|
||||
/**
|
||||
* Describes a test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
declare var it: Mocha.TestFunction;
|
||||
|
||||
/**
|
||||
* Describes a test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
var specify: Mocha.TestFunction;
|
||||
/**
|
||||
* Describes a test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
declare var specify: Mocha.TestFunction;
|
||||
|
||||
/**
|
||||
* Describes a test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
var test: Mocha.TestFunction;
|
||||
/**
|
||||
* Describes a test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
declare var test: Mocha.TestFunction;
|
||||
|
||||
/**
|
||||
* Describes a pending test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
var xit: Mocha.PendingTestFunction;
|
||||
/**
|
||||
* Describes a pending test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
declare var xit: Mocha.PendingTestFunction;
|
||||
|
||||
/**
|
||||
* Describes a pending test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
var xspecify: Mocha.PendingTestFunction;
|
||||
/**
|
||||
* Describes a pending test case.
|
||||
*
|
||||
* - _Only available when invoked via the mocha CLI._
|
||||
*/
|
||||
declare var xspecify: Mocha.PendingTestFunction;
|
||||
|
||||
// #endregion Test interface augmentations
|
||||
// #endregion Test interface augmentations
|
||||
|
||||
// #region Reporter augmentations
|
||||
// #region Reporter augmentations
|
||||
|
||||
// Forward declaration for `HTMLLIElement` from lib.dom.d.ts.
|
||||
// Required by Mocha.reporters.HTML.
|
||||
// NOTE: Mocha *must not* have a direct dependency on DOM types.
|
||||
// Forward declaration for `HTMLLIElement` from lib.dom.d.ts.
|
||||
// Required by Mocha.reporters.HTML.
|
||||
// NOTE: Mocha *must not* have a direct dependency on DOM types.
|
||||
// tslint:disable-next-line no-empty-interface
|
||||
interface HTMLLIElement { }
|
||||
|
||||
// Augments the DOM `Window` object when lib.dom.d.ts is loaded.
|
||||
// tslint:disable-next-line no-empty-interface
|
||||
interface Window extends Mocha.MochaGlobals { }
|
||||
|
||||
declare namespace NodeJS {
|
||||
// Forward declaration for `NodeJS.EventEmitter` from node.d.ts.
|
||||
// Required by Mocha.Runnable, Mocha.Runner, and Mocha.Suite.
|
||||
// NOTE: Mocha *must not* have a direct dependency on @types/node.
|
||||
// tslint:disable-next-line no-empty-interface
|
||||
interface HTMLLIElement { }
|
||||
interface EventEmitter { }
|
||||
|
||||
// Augments the DOM `Window` object when lib.dom.d.ts is loaded.
|
||||
// Augments NodeJS's `global` object when node.d.ts is loaded
|
||||
// tslint:disable-next-line no-empty-interface
|
||||
interface Window extends Mocha.MochaGlobals { }
|
||||
interface Global extends Mocha.MochaGlobals { }
|
||||
}
|
||||
|
||||
namespace NodeJS {
|
||||
// Forward declaration for `NodeJS.EventEmitter` from node.d.ts.
|
||||
// Required by Mocha.Runnable, Mocha.Runner, and Mocha.Suite.
|
||||
// NOTE: Mocha *must not* have a direct dependency on @types/node.
|
||||
// tslint:disable-next-line no-empty-interface
|
||||
interface EventEmitter { }
|
||||
// #endregion Reporter augmentations
|
||||
|
||||
// Augments NodeJS's `global` object when node.d.ts is loaded
|
||||
// tslint:disable-next-line no-empty-interface
|
||||
interface Global extends Mocha.MochaGlobals { }
|
||||
}
|
||||
// #region Browser augmentations
|
||||
|
||||
// #endregion Reporter augmentations
|
||||
|
||||
// #region Browser augmentations
|
||||
/**
|
||||
* Mocha global.
|
||||
*
|
||||
* - _Only supported in the browser._
|
||||
*/
|
||||
declare const mocha: BrowserMocha;
|
||||
|
||||
interface BrowserMocha extends Mocha {
|
||||
/**
|
||||
* Mocha global.
|
||||
* Function to allow assertion libraries to throw errors directly into mocha.
|
||||
* This is useful when running tests in a browser because window.onerror will
|
||||
* only receive the 'message' attribute of the Error.
|
||||
*
|
||||
* - _Only supported in the browser._
|
||||
*/
|
||||
const mocha: BrowserMocha;
|
||||
|
||||
interface BrowserMocha extends Mocha {
|
||||
/**
|
||||
* Function to allow assertion libraries to throw errors directly into mocha.
|
||||
* This is useful when running tests in a browser because window.onerror will
|
||||
* only receive the 'message' attribute of the Error.
|
||||
*
|
||||
* - _Only supported in the browser._
|
||||
*/
|
||||
throwError(err: any): never;
|
||||
|
||||
/**
|
||||
* Setup mocha with the given settings options.
|
||||
*
|
||||
* - _Only supported in the browser._
|
||||
*/
|
||||
setup(opts?: Mocha.Interface | MochaSetupOptions): this;
|
||||
}
|
||||
throwError(err: any): never;
|
||||
|
||||
/**
|
||||
* Options to pass to `mocha.setup` in the browser.
|
||||
* Setup mocha with the given settings options.
|
||||
*
|
||||
* - _Only supported in the browser._
|
||||
*/
|
||||
interface MochaSetupOptions extends Mocha.MochaOptions {
|
||||
// TODO: This does not seem to be supported according to the source. Should it be removed?
|
||||
require?: string[];
|
||||
fullTrace?: boolean;
|
||||
}
|
||||
setup(opts?: Mocha.Interface | MochaSetupOptions): this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Options to pass to `mocha.setup` in the browser.
|
||||
*/
|
||||
interface MochaSetupOptions extends Mocha.MochaOptions {
|
||||
/** @deprecated This is not used by Mocha. Use `files` instead. */
|
||||
require?: string[];
|
||||
fullTrace?: boolean;
|
||||
}
|
||||
|
||||
// #endregion Browser augmentations
|
||||
|
||||
// #region Deprecations
|
||||
|
||||
/** @deprecated use `Mocha.Done` instead. */
|
||||
type MochaDone = Mocha.Done;
|
||||
|
||||
/** @deprecated use `Mocha.ReporterConstructor` instead. */
|
||||
type ReporterConstructor = Mocha.ReporterConstructor;
|
||||
|
||||
// #endregion Deprecations
|
||||
|
||||
declare module "mocha" {
|
||||
export = Mocha;
|
||||
}
|
||||
|
||||
declare module "mocha/lib/ms" {
|
||||
export = milliseconds;
|
||||
/**
|
||||
* Parse the given `str` and return milliseconds.
|
||||
*
|
||||
* @see {@link https://mochajs.org/api/module-milliseconds.html}
|
||||
* @see {@link https://mochajs.org/api/module-milliseconds.html#~parse}
|
||||
*/
|
||||
function milliseconds(val: string): number;
|
||||
|
||||
/**
|
||||
* Format for `ms`.
|
||||
*
|
||||
* @see {@link https://mochajs.org/api/module-milliseconds.html}
|
||||
* @see {@link https://mochajs.org/api/module-milliseconds.html#~format}
|
||||
*/
|
||||
function milliseconds(val: number): string;
|
||||
}
|
||||
|
||||
declare module "mocha/lib/interfaces/common" {
|
||||
export = common;
|
||||
|
||||
function common(suites: Mocha.Suite[], context: Mocha.MochaGlobals, mocha: Mocha): common.CommonFunctions;
|
||||
|
||||
namespace common {
|
||||
interface CommonFunctions {
|
||||
/**
|
||||
* This is only present if flag --delay is passed into Mocha. It triggers
|
||||
* root suite execution.
|
||||
*/
|
||||
runWithSuite(suite: Mocha.Suite): () => void;
|
||||
|
||||
/**
|
||||
* Execute before running tests.
|
||||
*/
|
||||
before(fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute before running tests.
|
||||
*/
|
||||
before(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute after running tests.
|
||||
*/
|
||||
after(fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute after running tests.
|
||||
*/
|
||||
after(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute before each test case.
|
||||
*/
|
||||
beforeEach(fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute before each test case.
|
||||
*/
|
||||
beforeEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute after each test case.
|
||||
*/
|
||||
afterEach(fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute after each test case.
|
||||
*/
|
||||
afterEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
suite: SuiteFunctions;
|
||||
test: TestFunctions;
|
||||
}
|
||||
|
||||
interface CreateOptions {
|
||||
/** Title of suite */
|
||||
title: string;
|
||||
|
||||
/** Suite function */
|
||||
fn?: (this: Mocha.Suite) => void;
|
||||
|
||||
/** Is suite pending? */
|
||||
pending?: boolean;
|
||||
|
||||
/** Filepath where this Suite resides */
|
||||
file?: string;
|
||||
|
||||
/** Is suite exclusive? */
|
||||
isOnly?: boolean;
|
||||
}
|
||||
|
||||
interface SuiteFunctions {
|
||||
/**
|
||||
* Create an exclusive Suite; convenience function
|
||||
*/
|
||||
only(opts: CreateOptions): Mocha.Suite;
|
||||
|
||||
// #endregion Browser augmentations
|
||||
/**
|
||||
* Create a Suite, but skip it; convenience function
|
||||
*/
|
||||
skip(opts: CreateOptions): Mocha.Suite;
|
||||
|
||||
// #region Deprecations
|
||||
/**
|
||||
* Creates a suite.
|
||||
*/
|
||||
create(opts: CreateOptions): Mocha.Suite;
|
||||
}
|
||||
|
||||
/** @deprecated use `Mocha.Done` instead. */
|
||||
type MochaDone = Mocha.Done;
|
||||
interface TestFunctions {
|
||||
/**
|
||||
* Exclusive test-case.
|
||||
*/
|
||||
only(mocha: Mocha, test: Mocha.Test): Mocha.Test;
|
||||
|
||||
/** @deprecated use `Mocha.ReporterConstructor` instead. */
|
||||
type ReporterConstructor = Mocha.ReporterConstructor;
|
||||
/**
|
||||
* Pending test case.
|
||||
*/
|
||||
skip(title: string): void;
|
||||
|
||||
// #endregion Deprecations
|
||||
/**
|
||||
* Number of retry attempts
|
||||
*/
|
||||
retries(n: number): void;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-109
@@ -1,109 +0,0 @@
|
||||
import Mocha = require("../../");
|
||||
|
||||
export = common;
|
||||
|
||||
declare function common(suites: Mocha.Suite[], context: Mocha.MochaGlobals, mocha: Mocha): common.CommonFunctions;
|
||||
|
||||
declare namespace common {
|
||||
interface CommonFunctions {
|
||||
/**
|
||||
* This is only present if flag --delay is passed into Mocha. It triggers
|
||||
* root suite execution.
|
||||
*/
|
||||
runWithSuite(suite: Mocha.Suite): () => void;
|
||||
|
||||
/**
|
||||
* Execute before running tests.
|
||||
*/
|
||||
before(fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute before running tests.
|
||||
*/
|
||||
before(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute after running tests.
|
||||
*/
|
||||
after(fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute after running tests.
|
||||
*/
|
||||
after(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute before each test case.
|
||||
*/
|
||||
beforeEach(fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute before each test case.
|
||||
*/
|
||||
beforeEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute after each test case.
|
||||
*/
|
||||
afterEach(fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
/**
|
||||
* Execute after each test case.
|
||||
*/
|
||||
afterEach(name: string, fn?: Mocha.Func | Mocha.AsyncFunc): void;
|
||||
|
||||
suite: SuiteFunctions;
|
||||
test: TestFunctions;
|
||||
}
|
||||
|
||||
interface CreateOptions {
|
||||
/** Title of suite */
|
||||
title: string;
|
||||
|
||||
/** Suite function */
|
||||
fn?: (this: Mocha.Suite) => void;
|
||||
|
||||
/** Is suite pending? */
|
||||
pending?: boolean;
|
||||
|
||||
/** Filepath where this Suite resides */
|
||||
file?: string;
|
||||
|
||||
/** Is suite exclusive? */
|
||||
isOnly?: boolean;
|
||||
}
|
||||
|
||||
interface SuiteFunctions {
|
||||
/**
|
||||
* Create an exclusive Suite; convenience function
|
||||
*/
|
||||
only(opts: CreateOptions): Mocha.Suite;
|
||||
|
||||
/**
|
||||
* Create a Suite, but skip it; convenience function
|
||||
*/
|
||||
skip(opts: CreateOptions): Mocha.Suite;
|
||||
|
||||
/**
|
||||
* Creates a suite.
|
||||
*/
|
||||
create(opts: CreateOptions): Mocha.Suite;
|
||||
}
|
||||
|
||||
interface TestFunctions {
|
||||
/**
|
||||
* Exclusive test-case.
|
||||
*/
|
||||
only(mocha: Mocha, test: Mocha.Test): Mocha.Test;
|
||||
|
||||
/**
|
||||
* Pending test case.
|
||||
*/
|
||||
skip(title: string): void;
|
||||
|
||||
/**
|
||||
* Number of retry attempts
|
||||
*/
|
||||
retries(n: number): void;
|
||||
}
|
||||
}
|
||||
Vendored
-17
@@ -1,17 +0,0 @@
|
||||
export = milliseconds;
|
||||
|
||||
/**
|
||||
* Parse the given `str` and return milliseconds.
|
||||
*
|
||||
* @see {@link https://mochajs.org/api/module-milliseconds.html}
|
||||
* @see {@link https://mochajs.org/api/module-milliseconds.html#~parse}
|
||||
*/
|
||||
declare function milliseconds(val: string): number;
|
||||
|
||||
/**
|
||||
* Format for `ms`.
|
||||
*
|
||||
* @see {@link https://mochajs.org/api/module-milliseconds.html}
|
||||
* @see {@link https://mochajs.org/api/module-milliseconds.html#~format}
|
||||
*/
|
||||
declare function milliseconds(val: number): string;
|
||||
@@ -19,8 +19,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"lib/ms.d.ts",
|
||||
"lib/interfaces/common.d.ts",
|
||||
"mocha-tests.ts"
|
||||
]
|
||||
}
|
||||
+153
@@ -0,0 +1,153 @@
|
||||
// Type definitions for mongodb-memory-server 1.8
|
||||
// Project: https://github.com/nodkz/mongodb-memory-server
|
||||
// Definitions by: Dmitry Rogozhny <https://github.com/dmitryrogozhny>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { ChildProcess } from "child_process";
|
||||
|
||||
import MongoMemoryServer = _MongoMemoryServer.MongoMemoryServer;
|
||||
import MongoInstance = _MongoInstance.MongodbInstance;
|
||||
import MongoBinary = _MongoBinary.MongoBinary;
|
||||
|
||||
export default MongoMemoryServer;
|
||||
export { MongoMemoryServer, MongoInstance, MongoBinary };
|
||||
|
||||
// exports from the ./util/MongoBinary.js.flow file
|
||||
declare namespace _MongoBinary {
|
||||
interface MongoBinaryCache {
|
||||
[version: string]: string;
|
||||
}
|
||||
|
||||
interface MongoBinaryOpts {
|
||||
version?: string;
|
||||
downloadDir?: string;
|
||||
platform?: string;
|
||||
arch?: string;
|
||||
debug?: boolean | ((...args: any[]) => any);
|
||||
}
|
||||
|
||||
// disable error for a class with all static functions,
|
||||
// so the TypeScript declaration would map the implementation with flow types for easier support.
|
||||
// tslint:disable-next-line:no-unnecessary-class
|
||||
class MongoBinary {
|
||||
static cache: MongoBinaryCache;
|
||||
|
||||
static getPath(opts?: MongoBinaryOpts): Promise<string>;
|
||||
static hasValidBinPath(files: string[]): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
// exports from the ./util/MongoInstance.js.flow file
|
||||
declare namespace _MongoInstance {
|
||||
interface MongodOps {
|
||||
// instance options
|
||||
instance: {
|
||||
port: number,
|
||||
storageEngine?: string,
|
||||
dbPath: string,
|
||||
debug?: boolean | ((...args: any[]) => any),
|
||||
};
|
||||
|
||||
// mongo binary options
|
||||
binary?: _MongoBinary.MongoBinaryOpts;
|
||||
|
||||
// child process spawn options
|
||||
spawn?: {
|
||||
cwd?: string,
|
||||
env?: object,
|
||||
argv0?: string,
|
||||
stdio?: string | any[],
|
||||
detached?: boolean,
|
||||
uid?: number,
|
||||
gid?: number,
|
||||
shell?: boolean | string,
|
||||
};
|
||||
|
||||
debug?: boolean | ((...args: any[]) => any);
|
||||
}
|
||||
|
||||
class MongodbInstance {
|
||||
static childProcessList: ChildProcess[];
|
||||
|
||||
opts: MongodOps;
|
||||
debug: ((...args: any[]) => any);
|
||||
childProcess: ChildProcess;
|
||||
killerProcess: ChildProcess;
|
||||
instanceReady: ((...args: any[]) => any);
|
||||
instanceFailed: ((...args: any[]) => any);
|
||||
|
||||
static run(opts: MongodOps): Promise<MongodbInstance>;
|
||||
|
||||
constructor(opts: MongodOps);
|
||||
|
||||
prepareCommandArgs(): string[];
|
||||
run(): Promise<MongodbInstance>;
|
||||
kill(): Promise<MongodbInstance>;
|
||||
getPid(): number | undefined;
|
||||
_launchMongod(mongoBin: string): ChildProcess;
|
||||
_launchKiller(parentPid: number, childPid: number): ChildProcess;
|
||||
errorHandler(err: string): void;
|
||||
closeHandler(code: number): void;
|
||||
stderrHandler(message: string | Buffer): void;
|
||||
stdoutHandler(message: string | Buffer): void;
|
||||
}
|
||||
}
|
||||
|
||||
// exports from the MongoMemoryServer.js.flow file
|
||||
declare namespace _MongoMemoryServer {
|
||||
interface MongoMemoryServerOptsT {
|
||||
instance: {
|
||||
port?: number,
|
||||
dbPath?: string,
|
||||
dbName?: string,
|
||||
storageEngine?: string,
|
||||
debug?: boolean | ((...args: any[]) => any),
|
||||
};
|
||||
binary: {
|
||||
version?: string,
|
||||
downloadDir?: string,
|
||||
platform?: string,
|
||||
arch?: string,
|
||||
debug?: boolean | ((...args: any[]) => any),
|
||||
};
|
||||
debug?: boolean;
|
||||
spawn: any;
|
||||
autoStart?: boolean;
|
||||
}
|
||||
|
||||
interface MongoInstanceDataT {
|
||||
port: number;
|
||||
dbPath: string;
|
||||
dbName: string;
|
||||
uri: string;
|
||||
storageEngine: string;
|
||||
instance: _MongoInstance.MongodbInstance;
|
||||
childProcess: ChildProcess;
|
||||
tmpDir?: {
|
||||
name: string,
|
||||
removeCallback: ((...args: any[]) => any),
|
||||
};
|
||||
}
|
||||
|
||||
class MongoMemoryServer {
|
||||
isRunning: boolean;
|
||||
runningInstance: Promise<MongoInstanceDataT> | undefined;
|
||||
opts: MongoMemoryServerOptsT;
|
||||
debug: ((...args: any[]) => any);
|
||||
|
||||
constructor(opts?: Partial<MongoMemoryServerOptsT>);
|
||||
|
||||
start(): Promise<boolean>;
|
||||
_startUpInstance(): Promise<MongoInstanceDataT>;
|
||||
stop(): Promise<boolean>;
|
||||
getInstanceData(): Promise<MongoInstanceDataT>;
|
||||
getUri(otherDbName?: string | boolean): Promise<string>;
|
||||
getConnectionString(otherDbName?: string | boolean): Promise<string>;
|
||||
getPort(): Promise<number>;
|
||||
getDbPath(): Promise<string>;
|
||||
getDbName(): Promise<string>;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import MongodbMemoryServer from 'mongodb-memory-server';
|
||||
|
||||
// Simple server start example from https://www.npmjs.com/package/mongodb-memory-server
|
||||
async function simpleServerStart() {
|
||||
const mongod = new MongodbMemoryServer();
|
||||
|
||||
const uri = await mongod.getConnectionString();
|
||||
const port = await mongod.getPort();
|
||||
const dbPath = await mongod.getDbPath();
|
||||
const dbName = await mongod.getDbName();
|
||||
|
||||
// you may stop mongod manually
|
||||
mongod.stop();
|
||||
// or it will be stopped automatically when you exit from script
|
||||
}
|
||||
@@ -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",
|
||||
"mongodb-memory-server-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+245
-239
File diff suppressed because it is too large
Load Diff
@@ -27,7 +27,8 @@ let options: mongodb.MongoClientOptions = {
|
||||
sslCert: new Buffer(999),
|
||||
sslKey: new Buffer(999),
|
||||
sslPass: new Buffer(999),
|
||||
promoteBuffers: false
|
||||
promoteBuffers: false,
|
||||
useNewUrlParser: false
|
||||
}
|
||||
MongoClient.connect('mongodb://127.0.0.1:27017/test', options, function (err: mongodb.MongoError, client: mongodb.MongoClient) {
|
||||
if (err) throw err;
|
||||
@@ -121,6 +122,31 @@ MongoClient.connect('mongodb://127.0.0.1:27017/test', options, function (err: mo
|
||||
let payment: { total: number };
|
||||
type payment = typeof payment;
|
||||
let cursor: mongodb.AggregationCursor<payment> = collection.aggregate<payment>([{}])
|
||||
|
||||
collection.aggregate([{ $match: { bar: 1 } }, { $limit: 10 }])
|
||||
collection.aggregate([{ $match: { bar: 1 } }]).limit(10)
|
||||
collection.aggregate([]).match({ bar: 1 }).limit(10)
|
||||
collection.aggregate().match({ bar: 1 }).limit(10)
|
||||
|
||||
collection.aggregate<payment>(
|
||||
[{ $match: { bar: 1 } }],
|
||||
function (err: mongodb.MongoError, cursor: mongodb.AggregationCursor<payment>) {
|
||||
cursor.limit(10)
|
||||
}
|
||||
)
|
||||
|
||||
collection.aggregate<payment>(
|
||||
[],
|
||||
function (err: mongodb.MongoError, cursor: mongodb.AggregationCursor<payment>) {
|
||||
cursor.match({ bar: 1 }).limit(10)
|
||||
}
|
||||
)
|
||||
|
||||
collection.aggregate<payment>(
|
||||
function (err: mongodb.MongoError, cursor: mongodb.AggregationCursor<payment>) {
|
||||
cursor.match({ bar: 1 }).limit(10)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// test for new typings
|
||||
|
||||
Vendored
+11
-3
@@ -1,6 +1,12 @@
|
||||
// Type definitions for mssql 4.0.5
|
||||
// Project: https://www.npmjs.com/package/mssql
|
||||
// Definitions by: COLSA Corporation <http://www.colsa.com/>, Ben Farr <https://github.com/jaminfarr>, Vitor Buzinaro <https://github.com/buzinas>, Matt Richardson <https://github.com/mrrichar>, Jørgen Elgaard Larsen <https://github.com/elhaard>, Peter Keuter <https://github.com/pkeuter>
|
||||
// Definitions by: COLSA Corporation <http://www.colsa.com/>
|
||||
// Ben Farr <https://github.com/jaminfarr>
|
||||
// Vitor Buzinaro <https://github.com/buzinas>
|
||||
// Matt Richardson <https://github.com/mrrichar>
|
||||
// Jørgen Elgaard Larsen <https://github.com/elhaard>
|
||||
// Peter Keuter <https://github.com/pkeuter>
|
||||
// David Gasperoni <https://github.com/mcdado>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -311,8 +317,10 @@ export declare class PreparedStatement extends events.EventEmitter {
|
||||
public output(name: string, type: (() => ISqlType) | ISqlType): PreparedStatement;
|
||||
public prepare(statement?: string): Promise<void>;
|
||||
public prepare(statement?: string, callback?: (err?: Error) => void): PreparedStatement;
|
||||
public execute(values: Object): Promise<void>;
|
||||
public execute(values: Object, callback: (err?: Error) => void): Request;
|
||||
public execute(values: Object): Promise<IProcedureResult<any>>;
|
||||
public execute<Entity>(values: Object): Promise<IProcedureResult<Entity>>;
|
||||
public execute(values: Object, callback: (err?: Error, result?: IProcedureResult<any>) => void): Request;
|
||||
public execute<Entity>(values: Object, callback: (err?: Error, result?: IProcedureResult<Entity>) => void): Request;
|
||||
public unprepare(): Promise<void>;
|
||||
public unprepare(callback: (err?: Error) => void): PreparedStatement;
|
||||
}
|
||||
|
||||
Vendored
+11
-3
@@ -42,13 +42,21 @@ export interface DocumentProps {
|
||||
head?: Array<React.ReactElement<any>>;
|
||||
errorHtml?: string;
|
||||
styles?: Array<React.ReactElement<any>>;
|
||||
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export class Head extends React.Component<any> {}
|
||||
export interface HeadProps {
|
||||
nonce?: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export interface NextScriptProps {
|
||||
nonce?: string;
|
||||
}
|
||||
|
||||
export class Head extends React.Component<HeadProps> {}
|
||||
export class Main extends React.Component {}
|
||||
export class NextScript extends React.Component {}
|
||||
export class NextScript extends React.Component<NextScriptProps> {}
|
||||
export default class extends React.Component<DocumentProps> {
|
||||
static getInitialProps(ctx: NextDocumentContext): Promise<DocumentProps> | DocumentProps;
|
||||
}
|
||||
|
||||
Vendored
+1
@@ -5,6 +5,7 @@
|
||||
// James Hegedus <https://github.com/jthegedus>
|
||||
// Resi Respati <https://github.com/resir014>
|
||||
// Scott Jones <https://github.com/scottdj92>
|
||||
// Joao Vieira <https://github.com/joaovieira>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
|
||||
@@ -11,6 +11,13 @@ const basicResults = (
|
||||
</Document>
|
||||
);
|
||||
|
||||
const withNonce = (
|
||||
<Document>
|
||||
<Head nonce="12345" />
|
||||
<NextScript nonce="12345" />
|
||||
</Document>
|
||||
);
|
||||
|
||||
class MyDoc extends Document {
|
||||
static async getInitialProps({ renderPage }: NextDocumentContext) {
|
||||
// without callback
|
||||
|
||||
Vendored
+5
-2
@@ -1,17 +1,20 @@
|
||||
// Type definitions for nock v9.1.3
|
||||
// Type definitions for nock v9.3.3
|
||||
// Project: https://github.com/node-nock/nock
|
||||
// Definitions by: bonnici <https://github.com/bonnici>
|
||||
// Horiuchi_H <https://github.com/horiuchi>
|
||||
// afharo <https://github.com/afharo>
|
||||
// Matt R. Wilson <https://github.com/mastermatt>
|
||||
// Garanzha Dmitriy <https://github.com/damour>
|
||||
// GP <https://github.com/paambaati>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Url } from 'url';
|
||||
|
||||
export = nock;
|
||||
|
||||
declare function nock(basePath: string | RegExp, options?: nock.Options): nock.Scope;
|
||||
declare function nock(basePath: string | RegExp | Url, options?: nock.Options): nock.Scope;
|
||||
|
||||
declare namespace nock {
|
||||
export function cleanAll(): void;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import nock = require('nock');
|
||||
import * as fs from 'fs';
|
||||
import { URL } from 'url';
|
||||
|
||||
var scope: nock.Scope;
|
||||
var inst: nock.Interceptor;
|
||||
@@ -144,6 +145,11 @@ var couchdb = nock('http://myapp.iriscouch.com')
|
||||
email: 'pedro.teixeira@gmail.com'
|
||||
});
|
||||
|
||||
// Using URL as input
|
||||
var scope = nock(new URL('https://example.org/'))
|
||||
.get('/resource')
|
||||
.reply(200, 'url matched');
|
||||
|
||||
// Specifying hostname
|
||||
var scope = nock('http://www.example.com')
|
||||
.get('/resource')
|
||||
|
||||
Vendored
+4
-4
@@ -5894,10 +5894,10 @@ declare module "crypto" {
|
||||
export function pseudoRandomBytes(size: number): Buffer;
|
||||
export function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
|
||||
|
||||
export function randomFillSync(buffer: ArrayBufferView, offset?: number, size?: number): ArrayBufferView;
|
||||
export function randomFill(buffer: ArrayBufferView, callback: (err: Error | null, buf: ArrayBufferView) => void): void;
|
||||
export function randomFill(buffer: ArrayBufferView, offset: number, callback: (err: Error | null, buf: ArrayBufferView) => void): void;
|
||||
export function randomFill(buffer: ArrayBufferView, offset: number, size: number, callback: (err: Error | null, buf: ArrayBufferView) => void): void;
|
||||
export function randomFillSync<T extends Buffer | ArrayBufferView>(buffer: T, offset?: number, size?: number): T;
|
||||
export function randomFill<T extends Buffer | ArrayBufferView>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
|
||||
export function randomFill<T extends Buffer | ArrayBufferView>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
|
||||
export function randomFill<T extends Buffer | ArrayBufferView>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
|
||||
|
||||
export interface ScryptOptions {
|
||||
N?: number;
|
||||
|
||||
Vendored
+1003
-1073
File diff suppressed because it is too large
Load Diff
Vendored
+3
-2
@@ -1,6 +1,6 @@
|
||||
// Type definitions for overwatch-api 0.4
|
||||
// Type definitions for overwatch-api 0.5
|
||||
// Project: https://github.com/alfg/overwatch-api
|
||||
// Definitions by: JoshuaHall <https://github.com/JoshuaHall>
|
||||
// Definitions by: Joshua Hall <https://github.com/JoshuaHall>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// TypeScript Version: 2.1
|
||||
@@ -70,6 +70,7 @@ export interface OverwatchApiResponse {
|
||||
username: string;
|
||||
level: number;
|
||||
portrait: string;
|
||||
private: boolean;
|
||||
}
|
||||
|
||||
export interface ProfileApiResponse extends OverwatchApiResponse {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getProfile, OverwatchPlatform, OverwatchServerRegion, ProfileApiResponse, owl } from 'overwatch-api';
|
||||
import { getProfile, OverwatchPlatform, OverwatchServerRegion, ProfileApiResponse, owl, getStats, StatsApiResponse, CompetitiveTopHeroData } from 'overwatch-api';
|
||||
|
||||
const platform: OverwatchPlatform = 'pc';
|
||||
const region: OverwatchServerRegion = 'us';
|
||||
@@ -6,10 +6,36 @@ const battleTag = 'sparK#12434';
|
||||
|
||||
getProfile(platform, region, battleTag, (err: Error | null, data: ProfileApiResponse) => {
|
||||
if (err === null) {
|
||||
console.log(`Username: ${data.username}`);
|
||||
console.log(`Level: ${data.level}`);
|
||||
console.log(`Rank: ${data.competitive.rank} SR`);
|
||||
console.log(`Win Rate in Competitive: ${data.games.competitive.win_rate}`);
|
||||
if (data.private) {
|
||||
console.log(`Profile for battletag ${battleTag} is private, cannot retrieve profile`);
|
||||
} else {
|
||||
console.log(`Username: ${data.username}`);
|
||||
console.log(`Level: ${data.level}`);
|
||||
console.log(`Rank: ${data.competitive.rank} SR`);
|
||||
console.log(`Win Rate in Competitive: ${data.games.competitive.win_rate}`);
|
||||
}
|
||||
} else {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
|
||||
getStats(platform, region, battleTag, (err: Error | null, data: StatsApiResponse) => {
|
||||
if (err === null) {
|
||||
if (data.private) {
|
||||
console.log(`Profile for battletag ${battleTag} is private, cannot retrieve stats`);
|
||||
} else {
|
||||
console.log(`Username: ${data.username}`);
|
||||
console.log(`Level: ${data.level}`);
|
||||
console.log(`Competitive Stats`);
|
||||
const topHeroesComp: CompetitiveTopHeroData = data.stats.top_heroes.competitive;
|
||||
console.log(`Hero with most games won: ${topHeroesComp.games_won[0].hero}`);
|
||||
console.log(`Hero with highest winrate: ${topHeroesComp.win_rate[0].hero}`);
|
||||
console.log(`Hero with most time played ${topHeroesComp.played[0].hero}\n`);
|
||||
|
||||
for (const stat of data.stats.game.competitive) {
|
||||
console.log(`${stat.title}: ${stat.value}`);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -143,8 +143,8 @@ declare namespace Physijs {
|
||||
onSimulationResume():void;
|
||||
removeConstraint(constraint:Constraint):void;
|
||||
execute(cmd:string, params:any):void;
|
||||
add(object:THREE.Object3D):void;
|
||||
remove(object:THREE.Object3D):void;
|
||||
add(object:THREE.Object3D):this;
|
||||
remove(object:THREE.Object3D):this;
|
||||
setFixedTimeStep(fixedTimeStep:number):void;
|
||||
setGravity(gravity:THREE.Vector3):void;
|
||||
simulate(timeStep?:number, maxSubSteps?:number):boolean;
|
||||
|
||||
Vendored
+1
-1
@@ -355,7 +355,7 @@ export interface ModeBarButton {
|
||||
|
||||
// Data
|
||||
|
||||
export type Datum = string | number | Date;
|
||||
export type Datum = string | number | Date | null;
|
||||
export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array;
|
||||
|
||||
export type Dash = 'solid' | 'dot' | 'dash' | 'longdash' | 'dashdot' | 'longdashdot';
|
||||
|
||||
Vendored
+2
-7
@@ -4412,12 +4412,7 @@ declare namespace EngineAPI {
|
||||
/**
|
||||
* NxCellRows...
|
||||
*/
|
||||
interface INxCellRows {
|
||||
/**
|
||||
* Array of data.
|
||||
*/
|
||||
NxCellRows: INxCell[];
|
||||
}
|
||||
type INxCellRows = INxCell[];
|
||||
|
||||
/**
|
||||
* INxDataPage...
|
||||
@@ -8715,7 +8710,7 @@ declare namespace EngineAPI {
|
||||
/**
|
||||
* Information on the measure.
|
||||
*/
|
||||
qMeasureInfo: INxMeasureInfo;
|
||||
qMeasureInfo: INxMeasureInfo[];
|
||||
|
||||
/**
|
||||
* Sort order of the columns in the hypercube.
|
||||
|
||||
Vendored
+2
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for qrcode.react 0.6
|
||||
// Type definitions for qrcode.react 0.8
|
||||
// Project: https://github.com/zpao/qrcode.react
|
||||
// Definitions by: Mleko <https://github.com/mleko>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -13,6 +13,7 @@ declare namespace qrcode {
|
||||
bgColor?: string;
|
||||
fgColor?: string;
|
||||
level?: "L"|"M"|"Q"|"H";
|
||||
renderAs?: "svg" | "canvas";
|
||||
}
|
||||
|
||||
type QRCode = React.ComponentClass<QRCodeProps>;
|
||||
|
||||
@@ -9,4 +9,5 @@ const qrcodes = [
|
||||
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" level="L"/>,
|
||||
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" level="H"/>,
|
||||
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" size={256} bgColor="pink" fgColor="red" level="Q"/>,
|
||||
<QRCode value="https://github.com/DefinitelyTyped/DefinitelyTyped" renderAs="svg"/>,
|
||||
];
|
||||
|
||||
Vendored
+2
@@ -110,6 +110,8 @@ export interface OnDropData {
|
||||
node: InternalTreeNode;
|
||||
dragNode: InternalTreeNode;
|
||||
dragNodesKeys: string[];
|
||||
dropPosition: number;
|
||||
dropToGap?: boolean;
|
||||
}
|
||||
|
||||
export interface OnDragEndData {
|
||||
|
||||
+2
-2
@@ -44,8 +44,8 @@ declare module "react-custom-scrollbars" {
|
||||
universal?: boolean;
|
||||
|
||||
autoHeight?: boolean;
|
||||
autoHeightMin?: number;
|
||||
autoHeightMax?: number;
|
||||
autoHeightMin?: number | string;
|
||||
autoHeightMax?: number | string;
|
||||
}
|
||||
|
||||
export default class Scrollbars extends React.Component<ScrollbarProps> {
|
||||
|
||||
Vendored
+20
-18
@@ -5,12 +5,14 @@
|
||||
// Greg Smith <https://github.com/smrq>,
|
||||
// Platon Pronko <https://github.com/Rogach>
|
||||
// Roy Xue <https://github.com/royxue>
|
||||
// Koala Human <https://github.com/KoalaHuman>
|
||||
// Koala Human <https://github.com/KoalaHuman>
|
||||
// Sean Kelley <https://github.com/seansfkelley>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
import * as React from "react";
|
||||
import * as moment from "moment";
|
||||
import * as Popper from "popper.js";
|
||||
|
||||
export interface ReactDatePickerProps {
|
||||
adjustDateOnChange?: boolean;
|
||||
@@ -18,7 +20,7 @@ export interface ReactDatePickerProps {
|
||||
autoComplete?: string;
|
||||
autoFocus?: boolean;
|
||||
calendarClassName?: string;
|
||||
children?: any;
|
||||
children?: React.ReactNode;
|
||||
className?: string;
|
||||
customInput?: React.ReactNode;
|
||||
customInputRef?: string;
|
||||
@@ -29,24 +31,27 @@ export interface ReactDatePickerProps {
|
||||
disabledKeyboardNavigation?: boolean;
|
||||
dropdownMode?: 'scroll' | 'select';
|
||||
endDate?: moment.Moment;
|
||||
excludeDates?: any[];
|
||||
excludeDates?: moment.Moment[];
|
||||
excludeTimes?: moment.Moment[];
|
||||
filterDate?(date: moment.Moment): boolean;
|
||||
fixedHeight?: boolean;
|
||||
forceShowMonthNavigation?: boolean;
|
||||
formatWeekNumber?(date: moment.Moment): string | number;
|
||||
highlightDates?: any[];
|
||||
highlightDates?: moment.Moment[];
|
||||
id?: string;
|
||||
includeDates?: any[];
|
||||
includeTimes?: any[];
|
||||
includeDates?: moment.Moment[];
|
||||
includeTimes?: moment.Moment[];
|
||||
inline?: boolean;
|
||||
isClearable?: boolean;
|
||||
locale?: string;
|
||||
maxDate?: moment.Moment;
|
||||
maxTime?: moment.Moment;
|
||||
minDate?: moment.Moment;
|
||||
minTime?: moment.Moment;
|
||||
monthsShown?: number;
|
||||
name?: string;
|
||||
onBlur?(event: React.FocusEvent<HTMLInputElement>): void;
|
||||
onChange(date: moment.Moment | null, event: React.SyntheticEvent<any> | undefined): any;
|
||||
onChange(date: moment.Moment | null, event: React.SyntheticEvent<any> | undefined): void;
|
||||
onChangeRaw?(event: React.FocusEvent<HTMLInputElement>): void;
|
||||
onClickOutside?(event: React.MouseEvent<HTMLDivElement>): void;
|
||||
onFocus?(event: React.FocusEvent<HTMLInputElement>): void;
|
||||
@@ -60,41 +65,38 @@ export interface ReactDatePickerProps {
|
||||
placeholderText?: string;
|
||||
popperClassName?: string;
|
||||
popperContainer?(props: { children: React.ReactNode[] }): React.ReactNode;
|
||||
popperModifiers?: any;
|
||||
popperModifiers?: Popper.Modifiers;
|
||||
popperPlacement?: string;
|
||||
preventOpenOnFocus?: boolean;
|
||||
readOnly?: boolean;
|
||||
required?: boolean;
|
||||
scrollableYearDropdown?: boolean;
|
||||
scrollableMonthYearDropdown?: boolean;
|
||||
scrollableYearDropdown?: boolean;
|
||||
selected?: moment.Moment | null;
|
||||
selectsEnd?: boolean;
|
||||
selectsStart?: boolean;
|
||||
shouldCloseOnSelect?: boolean;
|
||||
showDisabledMonthNavigation?: boolean;
|
||||
showMonthDropdown?: boolean;
|
||||
showMonthYearDropdown?: boolean;
|
||||
showTimeSelect?: boolean;
|
||||
showTimeSelectOnly?: boolean;
|
||||
showWeekNumbers?: boolean;
|
||||
showYearDropdown?: boolean;
|
||||
startDate?: moment.Moment;
|
||||
startOpen?: boolean;
|
||||
tabIndex?: number;
|
||||
timeFormat?: string;
|
||||
timeIntervals?: number;
|
||||
title?: string;
|
||||
todayButton?: string;
|
||||
useWeekdaysShort?: boolean;
|
||||
useShortMonthInDropdown?: boolean;
|
||||
useWeekdaysShort?: boolean;
|
||||
utcOffset?: number;
|
||||
value?: string;
|
||||
weekLabel?: string;
|
||||
withPortal?: boolean;
|
||||
yearDropdownItemNumber?: number;
|
||||
shouldCloseOnSelect?: boolean;
|
||||
showTimeSelect?: boolean;
|
||||
showTimeSelectOnly?: boolean;
|
||||
timeFormat?: string;
|
||||
timeIntervals?: number;
|
||||
minTime?: moment.Moment;
|
||||
maxTime?: moment.Moment;
|
||||
excludeTimes?: any[];
|
||||
}
|
||||
declare const ReactDatePicker: React.ClassicComponentClass<ReactDatePickerProps>;
|
||||
export default ReactDatePicker;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"moment": ">=2.14.0"
|
||||
"moment": ">=2.14.0",
|
||||
"popper.js": "^1.14.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,36 +1,18 @@
|
||||
import * as React from 'react';
|
||||
import moment = require('moment');
|
||||
import * as moment from 'moment';
|
||||
import DatePicker from 'react-datepicker';
|
||||
|
||||
class ReactDatePicker extends React.Component<{}, { startDate: moment.Moment; displayName: string; }> {
|
||||
constructor(props: {}) {
|
||||
super(props);
|
||||
this.handleChange = this.handleChange.bind(this);
|
||||
}
|
||||
state = {
|
||||
startDate: moment(),
|
||||
displayName: 'Example'
|
||||
};
|
||||
|
||||
handleChange = function(date?: moment.Moment | null) {
|
||||
this.setState({
|
||||
startDate: date
|
||||
});
|
||||
};
|
||||
|
||||
handleYearChange = (date: moment.Moment) => {
|
||||
this.setState({
|
||||
startDate: date
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<DatePicker
|
||||
selected={this.state.startDate}
|
||||
onChange={this.handleChange}
|
||||
onYearChange={this.handleYearChange}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
<DatePicker
|
||||
selected={moment()}
|
||||
onChange={(date: moment.Moment | null) => {}}
|
||||
onYearChange={(date: moment.Moment) => {}}
|
||||
popperModifiers={{
|
||||
flip: {
|
||||
enabled: false
|
||||
}
|
||||
}}
|
||||
includeTimes={[moment()]}
|
||||
>
|
||||
<div/>
|
||||
<span/>
|
||||
</DatePicker>;
|
||||
|
||||
Vendored
+6
-2
@@ -18,6 +18,7 @@
|
||||
// Edward Sammut Alessi <https://github.com/Slessi>
|
||||
// Jérémy Magrin <https://github.com/magrinj>
|
||||
// Luca Campana <https://github.com/TizioFittizio>
|
||||
// Ullrich Schaefer <https://github.com/stigi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
@@ -1165,9 +1166,12 @@ export function withNavigation<T = {}>(
|
||||
Component: React.ComponentType<T & NavigationInjectedProps>
|
||||
): React.ComponentType<T & { onRef?: React.Ref<typeof Component> }>;
|
||||
|
||||
export interface NavigationFocusInjectedProps extends NavigationInjectedProps {
|
||||
isFocused: boolean;
|
||||
}
|
||||
export function withNavigationFocus<T = {}>(
|
||||
Component: React.ComponentType<T & NavigationInjectedProps>
|
||||
): React.ComponentType<T>;
|
||||
Component: React.ComponentType<T & NavigationFocusInjectedProps>
|
||||
): React.ComponentType<T & { onRef?: React.Ref<typeof Component> }>;
|
||||
|
||||
/**
|
||||
* SafeAreaView Component
|
||||
|
||||
@@ -42,6 +42,8 @@ import {
|
||||
NavigationContainerComponent,
|
||||
withNavigation,
|
||||
NavigationInjectedProps,
|
||||
withNavigationFocus,
|
||||
NavigationFocusInjectedProps
|
||||
} from 'react-navigation';
|
||||
|
||||
// Constants
|
||||
@@ -532,3 +534,19 @@ const BackButtonWithNavigation = withNavigation<BackButtonProps>(MyBackButton);
|
||||
const BackButtonInstance = <BackButtonWithNavigation
|
||||
title="Back" onRef={ref => { const backButtonRef = ref; }}
|
||||
/>;
|
||||
|
||||
// Test withNavigationFocus
|
||||
|
||||
interface MyFocusedComponentProps { expectsFocus: boolean; }
|
||||
class MyFocusedComponent extends React.Component<MyFocusedComponentProps & NavigationFocusInjectedProps> {
|
||||
render() {
|
||||
return <button title={`${this.props.expectsFocus} vs ${this.props.isFocused}`} onClick={() => { this.props.navigation.goBack(); }} />;
|
||||
}
|
||||
}
|
||||
|
||||
// withNavigationFocus returns a component that wraps MyFocusedComponent and passes in the
|
||||
// navigation and isFocused prop
|
||||
const MyFocusedComponentWithNavigationFocus = withNavigationFocus<MyFocusedComponentProps>(MyFocusedComponent);
|
||||
const MyFocusedComponentInstance = <MyFocusedComponentWithNavigationFocus
|
||||
expectsFocus={true} onRef={ref => { const backButtonRef = ref; }}
|
||||
/>;
|
||||
|
||||
+1
-1
@@ -34,8 +34,8 @@ export namespace ReactStripeElements {
|
||||
|
||||
interface StripeProps {
|
||||
createSource(sourceData?: SourceOptions): Promise<SourceResponse>;
|
||||
|
||||
createToken(options?: TokenOptions): Promise<PatchedTokenResponse>;
|
||||
paymentRequest: stripe.Stripe['paymentRequest'];
|
||||
}
|
||||
|
||||
interface InjectOptions {
|
||||
|
||||
@@ -110,6 +110,22 @@ interface ComponentProps {
|
||||
class WrappedComponent extends React.Component<
|
||||
ComponentProps & InjectedStripeProps
|
||||
> {
|
||||
constructor(props: ComponentProps & InjectedStripeProps) {
|
||||
super(props);
|
||||
// Test for paymentRequest
|
||||
const paymentRequest = props.stripe && props.stripe.paymentRequest({
|
||||
country: 'US',
|
||||
currency: 'usd',
|
||||
total: {
|
||||
label: 'Demo total',
|
||||
amount: 1
|
||||
}
|
||||
});
|
||||
if (paymentRequest) {
|
||||
paymentRequest.on('token', ({complete, token, ...data}) => undefined);
|
||||
paymentRequest.canMakePayment().then(res => undefined);
|
||||
}
|
||||
}
|
||||
onSubmit = () => {
|
||||
this.props.stripe!
|
||||
.createToken({
|
||||
|
||||
Vendored
+1
-1
@@ -306,7 +306,7 @@ declare namespace React {
|
||||
// In the future, if we can define its call signature conditionally
|
||||
// on the existence of `children` in `P`, then we should remove this.
|
||||
readonly props: Readonly<{ children?: ReactNode }> & Readonly<P>;
|
||||
state: null | Readonly<S>;
|
||||
state: Readonly<S>;
|
||||
/**
|
||||
* @deprecated
|
||||
* https://reactjs.org/docs/legacy-context.html
|
||||
|
||||
@@ -59,14 +59,7 @@ declare const container: Element;
|
||||
inputValue: string;
|
||||
seconds: number;
|
||||
}
|
||||
/**
|
||||
* This is a "pre EcmaScript class property era" style of setting state within constructor.
|
||||
* This occurs also if you need to provide som logic before mounting your component.
|
||||
* To mitigate this error you need to provide state property definition upfront.
|
||||
*/
|
||||
class SettingStateFromCtorComponent extends React.Component<Props, State, Snapshot> {
|
||||
// uncomenting this fixes the error :)
|
||||
// state: State;
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
// $ExpectError
|
||||
@@ -78,16 +71,17 @@ declare const container: Element;
|
||||
}
|
||||
|
||||
class BadlyInitializedState extends React.Component<Props, State, Snapshot> {
|
||||
// ExpectError -> this throws error on TS 2.6
|
||||
// $ExpectError -> this throws error on TS 2.6 uncomment once TS requirement is TS >= 2.7
|
||||
// state = {
|
||||
// secondz: 0,
|
||||
// inputValuez: 'hello'
|
||||
// };
|
||||
render() { return null; }
|
||||
}
|
||||
class BetterPropsAndStateChecksComponent extends React.Component<Props, State, Snapshot> {
|
||||
render() { return null; }
|
||||
componentDidMount() {
|
||||
// $ExpectError
|
||||
// $ExpectError -> this will be true in next BC release where state is gonna be `null | Readonly<S>`
|
||||
console.log(this.state.inputValue);
|
||||
}
|
||||
mutateState() {
|
||||
|
||||
Vendored
+11
-4
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/stellar/js-stellar-sdk
|
||||
// Definitions by: Carl Foster <https://github.com/carl-foster>
|
||||
// Triston Jones <https://github.com/tristonj>
|
||||
// Paul Selden <https://github.com/pselden>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
@@ -505,16 +506,22 @@ export class Memo {
|
||||
static return(hash: string): Memo;
|
||||
static text(text: string): Memo;
|
||||
|
||||
constructor(type: 'MemoNone')
|
||||
constructor(type: 'MemoID' | 'MemoText', value: string)
|
||||
constructor(type: 'MemoHash' | 'MemoReturn', value: Buffer)
|
||||
constructor(type: 'none');
|
||||
constructor(type: 'id' | 'text' | 'hash' | 'return', value: string)
|
||||
constructor(type: 'hash' | 'return', value: Buffer)
|
||||
|
||||
type: 'MemoNone' | 'MemoID' | 'MemoText' | 'MemoHash' | 'MemoReturn';
|
||||
type: string;
|
||||
value: null | string | Buffer;
|
||||
|
||||
toXDRObject(): xdr.Memo;
|
||||
}
|
||||
|
||||
export const MemoNone = 'none';
|
||||
export const MemoID = 'id';
|
||||
export const MemoText = 'text';
|
||||
export const MemoHash = 'hash';
|
||||
export const MemoReturn = 'return';
|
||||
|
||||
export enum Networks {
|
||||
PUBLIC = 'Public Global Stellar Network ; September 2015',
|
||||
TESTNET = 'Test SDF Network ; September 2015',
|
||||
|
||||
@@ -5,5 +5,6 @@ const destKey = StellarSdk.Keypair.random();
|
||||
const account = new StellarSdk.Account(sourceKey.publicKey(), 1);
|
||||
const transaction = new StellarSdk.TransactionBuilder(account)
|
||||
.addOperation(StellarSdk.Operation.accountMerge({destination: destKey.publicKey()}))
|
||||
.addMemo(new StellarSdk.Memo(StellarSdk.MemoText, "memo"))
|
||||
.build(); // $ExpectType () => Transaction
|
||||
transaction; // $ExpectType Transaction
|
||||
|
||||
Vendored
+6
-7
@@ -247,7 +247,7 @@ export interface Tap {
|
||||
export class Hook<T1 = any, T2 = any, T3 = any> {
|
||||
constructor(...args: any[]);
|
||||
taps: any[];
|
||||
interceptors: any[];
|
||||
interceptors: HookInterceptor[];
|
||||
call: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: any[]) => any;
|
||||
promise:(arg1?: T1, arg2?: T2, arg3?: T3, ...args: any[]) => Promise<any>;
|
||||
callAsync: (arg1?: T1, arg2?: T2, arg3?: T3, ...args: any[]) => any;
|
||||
@@ -271,12 +271,11 @@ export class AsyncSeriesBailHook<T1 = any, T2 = any, T3 = any> extends Hook<T1,
|
||||
export class AsyncSeriesWaterfallHook<T1 = any, T2 = any, T3 = any> extends Hook<T1, T2, T3> {}
|
||||
|
||||
export class HookInterceptor {
|
||||
call: (...args: any[]) => void;
|
||||
loop: (...args: any[]) => void;
|
||||
tap: (tap: Tap) => void;
|
||||
register: (tap: Tap) => Tap | undefined;
|
||||
context: boolean;
|
||||
name: string;
|
||||
call?: (...args: any[]) => void;
|
||||
loop?: (...args: any[]) => void;
|
||||
tap?: (tap: Tap) => void;
|
||||
register?: (tap: Tap) => Tap | undefined;
|
||||
context?: boolean;
|
||||
}
|
||||
|
||||
/** A HookMap is a helper class for a Map with Hooks */
|
||||
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
// Type definitions for test-listen 1.1
|
||||
// Project: https://github.com/zeit/test-listen
|
||||
// Definitions by: Stephen Mathieson <https://github.com/stephenmathieson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Server } from "net";
|
||||
|
||||
declare function testListen(srv: Server, hostname?: string): Promise<string>;
|
||||
|
||||
export = testListen;
|
||||
@@ -0,0 +1,25 @@
|
||||
import * as http from 'http';
|
||||
import testListen = require('test-listen');
|
||||
|
||||
const test = async (): Promise<void> => {
|
||||
const server = http.createServer((req: http.IncomingMessage, res: http.ServerResponse): void => {
|
||||
res.write('hello');
|
||||
res.end();
|
||||
});
|
||||
|
||||
const addr = await testListen(server);
|
||||
console.log(addr);
|
||||
};
|
||||
|
||||
const testWithHostname = async (): Promise<void> => {
|
||||
const server = http.createServer((req: http.IncomingMessage, res: http.ServerResponse): void => {
|
||||
res.write('hello');
|
||||
res.end();
|
||||
});
|
||||
|
||||
const addr = await testListen(server, '127.0.0.1');
|
||||
console.log(addr);
|
||||
};
|
||||
|
||||
test();
|
||||
testWithHostname();
|
||||
@@ -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",
|
||||
"test-listen-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+1
@@ -34,6 +34,7 @@ export * from "./three-examples";
|
||||
export * from "./three-fbxloader";
|
||||
export * from "./three-FirstPersonControls";
|
||||
export * from "./three-gltfexporter";
|
||||
export * from "./three-lensflare";
|
||||
export * from "./three-maskpass";
|
||||
export * from "./three-mtlloader";
|
||||
export * from "./three-objloader";
|
||||
|
||||
@@ -45,7 +45,9 @@
|
||||
|
||||
var geometry2 = new THREE.SphereGeometry(100, 14, 7);
|
||||
|
||||
var materials: THREE.Material[] = [
|
||||
type MeshMaterial = THREE.MeshBasicMaterial | THREE.MeshFaceMaterial | THREE.MeshLambertMaterial | THREE.MeshDepthMaterial | THREE.MeshNormalMaterial;
|
||||
|
||||
var materials: MeshMaterial[] = [
|
||||
|
||||
new THREE.MeshBasicMaterial({ color: 0x00ffff, wireframe: true, side: THREE.DoubleSide }),
|
||||
new THREE.MeshBasicMaterial({ color: 0xff0000, blending: THREE.AdditiveBlending }),
|
||||
@@ -199,4 +201,4 @@
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,18 +99,11 @@
|
||||
var flareColor = new THREE.Color(0xffffff);
|
||||
flareColor.setHSL(h, s, l + 0.5);
|
||||
|
||||
var lensFlare = new THREE.LensFlare(textureFlare0, 700, 0.0, THREE.AdditiveBlending, flareColor);
|
||||
var lensFlare = new THREE.LensFlare();
|
||||
|
||||
lensFlare.add(textureFlare2, 512, 0.0, THREE.AdditiveBlending);
|
||||
lensFlare.add(textureFlare2, 512, 0.0, THREE.AdditiveBlending);
|
||||
lensFlare.add(textureFlare2, 512, 0.0, THREE.AdditiveBlending);
|
||||
lensFlare.addElement(new THREE.LensFlareElement(textureFlare2, 512, 0.0));
|
||||
lensFlare.addElement(new THREE.LensFlareElement(textureFlare3, 512, 0.0));
|
||||
|
||||
lensFlare.add(textureFlare3, 60, 0.6, THREE.AdditiveBlending);
|
||||
lensFlare.add(textureFlare3, 70, 0.7, THREE.AdditiveBlending);
|
||||
lensFlare.add(textureFlare3, 120, 0.9, THREE.AdditiveBlending);
|
||||
lensFlare.add(textureFlare3, 70, 1.0, THREE.AdditiveBlending);
|
||||
|
||||
lensFlare.customUpdateCallback = lensFlareUpdateCallback;
|
||||
lensFlare.position.copy(light.position);
|
||||
|
||||
scene.add(lensFlare);
|
||||
@@ -143,32 +136,6 @@
|
||||
|
||||
//
|
||||
|
||||
function lensFlareUpdateCallback(object: THREE.LensFlare) {
|
||||
|
||||
var f: number, fl = object.lensFlares.length;
|
||||
var flare: THREE.LensFlareProperty;
|
||||
var vecX = -object.positionScreen.x * 2;
|
||||
var vecY = -object.positionScreen.y * 2;
|
||||
|
||||
|
||||
for (f = 0; f < fl; f++) {
|
||||
|
||||
flare = object.lensFlares[f];
|
||||
|
||||
flare.x = object.positionScreen.x + vecX * flare.distance;
|
||||
flare.y = object.positionScreen.y + vecY * flare.distance;
|
||||
|
||||
flare.rotation = 0;
|
||||
|
||||
}
|
||||
|
||||
object.lensFlares[2].y += 0.025;
|
||||
object.lensFlares[3].rotation = object.positionScreen.x * 0.5 + THREE.Math.degToRad(45);
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
function onWindowResize(event: Event) {
|
||||
|
||||
renderer.setSize(window.innerWidth, window.innerHeight);
|
||||
|
||||
Vendored
+143
-113
@@ -451,13 +451,23 @@ export class Camera extends Object3D {
|
||||
*/
|
||||
projectionMatrix: Matrix4;
|
||||
|
||||
isCamera: true;
|
||||
|
||||
copy(source: this, recursive?: boolean): this;
|
||||
|
||||
getWorldDirection(target: Vector3): Vector3;
|
||||
|
||||
updateMatrixWorld(force: boolean): void;
|
||||
|
||||
clone(): Camera;
|
||||
|
||||
}
|
||||
|
||||
export class CubeCamera extends Object3D {
|
||||
constructor(near?: number, far?: number, cubeResolution?: number);
|
||||
|
||||
type: "CubeCamera";
|
||||
|
||||
renderTarget: WebGLRenderTargetCube;
|
||||
|
||||
/**
|
||||
@@ -465,7 +475,7 @@ export class CubeCamera extends Object3D {
|
||||
*/
|
||||
updateCubeMap(renderer: Renderer, scene: Scene): void;
|
||||
|
||||
update(renderer: Renderer, scene: Scene): void;
|
||||
update(renderer: WebGLRenderer, scene: Scene): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -488,8 +498,12 @@ export class OrthographicCamera extends Camera {
|
||||
*/
|
||||
constructor(left: number, right: number, top: number, bottom: number, near?: number, far?: number);
|
||||
|
||||
type: "OrthographicCamera";
|
||||
|
||||
isOrthographicCamera: true;
|
||||
|
||||
zoom: number;
|
||||
view: {
|
||||
view: null | {
|
||||
enabled: boolean,
|
||||
fullWidth: number,
|
||||
fullHeight: number,
|
||||
@@ -556,6 +570,10 @@ export class PerspectiveCamera extends Camera {
|
||||
*/
|
||||
constructor(fov?: number, aspect?: number, near?: number, far?: number);
|
||||
|
||||
type: "PerspectiveCamera";
|
||||
|
||||
isPerspectiveCamera: true;
|
||||
|
||||
zoom: number;
|
||||
|
||||
/**
|
||||
@@ -579,7 +597,7 @@ export class PerspectiveCamera extends Camera {
|
||||
far: number;
|
||||
|
||||
focus: number;
|
||||
view: {
|
||||
view: null | {
|
||||
enabled: boolean,
|
||||
fullWidth: number,
|
||||
fullHeight: number,
|
||||
@@ -596,6 +614,7 @@ export class PerspectiveCamera extends Camera {
|
||||
getEffectiveFOV(): number;
|
||||
getFilmWidth(): number;
|
||||
getFilmHeight(): number;
|
||||
|
||||
/**
|
||||
* Sets an offset in a larger frustum. This is useful for multi-window or multi-monitor/multi-machine setups.
|
||||
* For example, if you have 3x2 monitors and each monitor is 1920x1080 and the monitors are in grid like this:
|
||||
@@ -651,6 +670,8 @@ export class PerspectiveCamera extends Camera {
|
||||
export class StereoCamera extends Camera {
|
||||
constructor();
|
||||
|
||||
type: "StereoCamera";
|
||||
|
||||
aspect: number;
|
||||
eyeSep: number;
|
||||
cameraL: PerspectiveCamera;
|
||||
@@ -1072,6 +1093,7 @@ export class DirectGeometry extends EventDispatcher {
|
||||
* @source src/core/EventDispatcher.js
|
||||
*/
|
||||
export class EventDispatcher {
|
||||
|
||||
/**
|
||||
* Creates eventDispatcher object. It needs to be call with '.call' to add the functionality to an object.
|
||||
*/
|
||||
@@ -1554,7 +1576,7 @@ export class Object3D extends EventDispatcher {
|
||||
/**
|
||||
* Object's parent in the scene graph.
|
||||
*/
|
||||
parent: Object3D;
|
||||
parent: Object3D | null;
|
||||
|
||||
/**
|
||||
* Array with object's children.
|
||||
@@ -1636,13 +1658,13 @@ export class Object3D extends EventDispatcher {
|
||||
/**
|
||||
* An object that can be used to store custom data about the Object3d. It should not hold references to functions as these will not be cloned.
|
||||
*/
|
||||
userData: any;
|
||||
userData: {[key: string]: any};
|
||||
|
||||
/**
|
||||
* Used to check whether this or derived classes are Object3Ds. Default is true.
|
||||
* You should not change this, as it is used internally for optimisation.
|
||||
*/
|
||||
isObject3D: boolean;
|
||||
isObject3D: true;
|
||||
|
||||
/**
|
||||
* Calls before rendering object
|
||||
@@ -1656,9 +1678,7 @@ export class Object3D extends EventDispatcher {
|
||||
onAfterRender: (renderer: WebGLRenderer, scene: Scene, camera: Camera, geometry: Geometry | BufferGeometry,
|
||||
material: Material, group: Group) => void;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
static DefaultUp: Vector3;
|
||||
static DefaultMatrixAutoUpdate: boolean;
|
||||
|
||||
@@ -1667,6 +1687,8 @@ export class Object3D extends EventDispatcher {
|
||||
*/
|
||||
applyMatrix(matrix: Matrix4): void;
|
||||
|
||||
applyQuaternion(quaternion: Quaternion): this;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -1692,56 +1714,56 @@ export class Object3D extends EventDispatcher {
|
||||
* @param axis A normalized vector in object space.
|
||||
* @param angle The angle in radians.
|
||||
*/
|
||||
rotateOnAxis(axis: Vector3, angle: number): Object3D;
|
||||
rotateOnAxis(axis: Vector3, angle: number): this;
|
||||
|
||||
/**
|
||||
* Rotate an object along an axis in world space. The axis is assumed to be normalized. Method Assumes no rotated parent.
|
||||
* @param axis A normalized vector in object space.
|
||||
* @param angle The angle in radians.
|
||||
*/
|
||||
rotateOnWorldAxis(axis: Vector3, angle: number): Object3D;
|
||||
rotateOnWorldAxis(axis: Vector3, angle: number): this;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param angle
|
||||
*/
|
||||
rotateX(angle: number): Object3D;
|
||||
rotateX(angle: number): this;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param angle
|
||||
*/
|
||||
rotateY(angle: number): Object3D;
|
||||
rotateY(angle: number): this;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param angle
|
||||
*/
|
||||
rotateZ(angle: number): Object3D;
|
||||
rotateZ(angle: number): this;
|
||||
|
||||
/**
|
||||
* @param axis A normalized vector in object space.
|
||||
* @param distance The distance to translate.
|
||||
*/
|
||||
translateOnAxis(axis: Vector3, distance: number): Object3D;
|
||||
translateOnAxis(axis: Vector3, distance: number): this;
|
||||
|
||||
/**
|
||||
* Translates object along x axis by distance.
|
||||
* @param distance Distance.
|
||||
*/
|
||||
translateX(distance: number): Object3D;
|
||||
translateX(distance: number): this;
|
||||
|
||||
/**
|
||||
* Translates object along y axis by distance.
|
||||
* @param distance Distance.
|
||||
*/
|
||||
translateY(distance: number): Object3D;
|
||||
translateY(distance: number): this;
|
||||
|
||||
/**
|
||||
* Translates object along z axis by distance.
|
||||
* @param distance Distance.
|
||||
*/
|
||||
translateZ(distance: number): Object3D;
|
||||
translateZ(distance: number): this;
|
||||
|
||||
/**
|
||||
* Updates the vector from local space to world space.
|
||||
@@ -1759,39 +1781,38 @@ export class Object3D extends EventDispatcher {
|
||||
* Rotates object to face point in space.
|
||||
* @param vector A world vector to look at.
|
||||
*/
|
||||
lookAt(vector: Vector3): void;
|
||||
lookAt(x: number, y: number, z: number): void;
|
||||
lookAt(vector: Vector3 | number, y?: number, z?: number): void;
|
||||
|
||||
/**
|
||||
* Adds object as child of this object.
|
||||
*/
|
||||
add(...object: Object3D[]): void;
|
||||
add(...object: Object3D[]): this;
|
||||
|
||||
/**
|
||||
* Removes object as child of this object.
|
||||
*/
|
||||
remove(...object: Object3D[]): void;
|
||||
remove(...object: Object3D[]): this;
|
||||
|
||||
/**
|
||||
* Searches through the object's children and returns the first with a matching id, optionally recursive.
|
||||
* Searches through the object's children and returns the first with a matching id.
|
||||
* @param id Unique number of the object instance
|
||||
*/
|
||||
getObjectById(id: number): Object3D;
|
||||
getObjectById(id: number): Object3D | undefined;
|
||||
|
||||
/**
|
||||
* Searches through the object's children and returns the first with a matching name, optionally recursive.
|
||||
* Searches through the object's children and returns the first with a matching name.
|
||||
* @param name String to match to the children's Object3d.name property.
|
||||
*/
|
||||
getObjectByName(name: string): Object3D;
|
||||
getObjectByName(name: string): Object3D | undefined;
|
||||
|
||||
getObjectByProperty( name: string, value: string ): Object3D;
|
||||
getObjectByProperty( name: string, value: string ): Object3D | undefined;
|
||||
|
||||
getWorldPosition(target: Vector3): Vector3;
|
||||
getWorldQuaternion(target: Quaternion): Quaternion;
|
||||
getWorldScale(target: Vector3): Vector3;
|
||||
getWorldDirection(target: Vector3): Vector3;
|
||||
|
||||
raycast(raycaster: Raycaster, intersects: any): void;
|
||||
raycast(raycaster: Raycaster, intersects: Intersection[]): void;
|
||||
|
||||
traverse(callback: (object: Object3D) => any): void;
|
||||
|
||||
@@ -1811,7 +1832,7 @@ export class Object3D extends EventDispatcher {
|
||||
|
||||
toJSON(meta?: { geometries: any, materials: any, textures: any, images: any }): any;
|
||||
|
||||
clone(recursive?: boolean): this;
|
||||
clone(recursive?: boolean): Object3D;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -1823,11 +1844,11 @@ export class Object3D extends EventDispatcher {
|
||||
|
||||
export interface Intersection {
|
||||
distance: number;
|
||||
distanceToRay: number;
|
||||
distanceToRay?: number;
|
||||
point: Vector3;
|
||||
index: number;
|
||||
face: Face3;
|
||||
faceIndex: number;
|
||||
index?: number;
|
||||
face?: Face3 | null;
|
||||
faceIndex?: number;
|
||||
object: Object3D;
|
||||
}
|
||||
|
||||
@@ -5150,20 +5171,26 @@ export class QuaternionLinearInterpolant extends Interpolant {
|
||||
|
||||
export class Bone extends Object3D {
|
||||
constructor();
|
||||
isBone: true;
|
||||
type: "Bone";
|
||||
}
|
||||
|
||||
export class Group extends Object3D {
|
||||
constructor();
|
||||
type: "Group";
|
||||
isGroup: true;
|
||||
}
|
||||
|
||||
export class LOD extends Object3D {
|
||||
constructor();
|
||||
|
||||
levels: any[];
|
||||
type: "LOD";
|
||||
|
||||
levels: {distance: number, object: Object3D}[];
|
||||
|
||||
addLevel(object: Object3D, distance?: number): void;
|
||||
getObjectForDistance(distance: number): Object3D;
|
||||
raycast(raycaster: Raycaster, intersects: any): void;
|
||||
raycast(raycaster: Raycaster, intersects: Intersection[]): void;
|
||||
update(camera: Camera): void;
|
||||
toJSON(meta: any): any;
|
||||
|
||||
@@ -5173,32 +5200,6 @@ export class LOD extends Object3D {
|
||||
objects: any[];
|
||||
}
|
||||
|
||||
export interface LensFlareProperty {
|
||||
texture: Texture; // Texture
|
||||
size: number; // size in pixels (-1 = use texture.width)
|
||||
distance: number; // distance (0-1) from light source (0=at light source)
|
||||
x: number;
|
||||
y: number;
|
||||
z: number; // screen position (-1 => 1) z = 0 is ontop z = 1 is back
|
||||
scale: number; // scale
|
||||
rotation: number; // rotation
|
||||
opacity: number; // opacity
|
||||
color: Color; // color
|
||||
blending: Blending;
|
||||
}
|
||||
|
||||
export class LensFlare extends Object3D {
|
||||
constructor(texture?: Texture, size?: number, distance?: number, blending?: Blending, color?: Color);
|
||||
|
||||
lensFlares: LensFlareProperty[];
|
||||
positionScreen: Vector3;
|
||||
customUpdateCallback: (object: LensFlare) => void;
|
||||
|
||||
add(object: Object3D): void;
|
||||
add(texture: Texture, size?: number, distance?: number, blending?: Blending, color?: Color): void;
|
||||
updateLensFlares(): void;
|
||||
}
|
||||
|
||||
export class Line extends Object3D {
|
||||
constructor(
|
||||
geometry?: Geometry | BufferGeometry,
|
||||
@@ -5207,10 +5208,14 @@ export class Line extends Object3D {
|
||||
);
|
||||
|
||||
geometry: Geometry|BufferGeometry;
|
||||
material: Material; // LineDashedMaterial or LineBasicMaterial or ShaderMaterial
|
||||
material: LineBasicMaterial | LineDashedMaterial | ShaderMaterial;
|
||||
|
||||
type: "Line";
|
||||
isLine: true;
|
||||
|
||||
computeLineDistances(): this;
|
||||
raycast(raycaster: Raycaster, intersects: any): void;
|
||||
raycast(raycaster: Raycaster, intersects: Intersection[]): void;
|
||||
clone(): Line;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5230,20 +5235,24 @@ export class LineSegments extends Line {
|
||||
);
|
||||
}
|
||||
|
||||
type MeshMaterial = MeshBasicMaterial | MeshLambertMaterial | MeshPhongMaterial | MeshDepthMaterial | MeshStandardMaterial | MeshPhysicalMaterial | MeshNormalMaterial | MeshFaceMaterial | ShaderMaterial;
|
||||
|
||||
export class Mesh extends Object3D {
|
||||
constructor(geometry?: Geometry | BufferGeometry, material?: Material | Material[]);
|
||||
constructor(geometry?: Geometry | BufferGeometry, material?: MeshMaterial | MeshMaterial[]);
|
||||
|
||||
geometry: Geometry|BufferGeometry;
|
||||
material: Material | Material[];
|
||||
material: MeshMaterial | MeshMaterial[];
|
||||
drawMode: TrianglesDrawModes;
|
||||
morphTargetInfluences?: number[];
|
||||
morphTargetDictionary?: { [key: string]: number; };
|
||||
isMesh: boolean;
|
||||
isMesh: true;
|
||||
type: "Mesh";
|
||||
|
||||
setDrawMode(drawMode: TrianglesDrawModes): void;
|
||||
updateMorphTargets(): void;
|
||||
getMorphTargetIndexByName(name: string): number;
|
||||
raycast(raycaster: Raycaster, intersects: any): void;
|
||||
raycast(raycaster: Raycaster, intersects: Intersection[]): void;
|
||||
copy(source: this, recursive?: boolean): this;
|
||||
clone(): Mesh;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5259,9 +5268,12 @@ export class Points extends Object3D {
|
||||
*/
|
||||
constructor(
|
||||
geometry?: Geometry | BufferGeometry,
|
||||
material?: Material
|
||||
material?: PointsMaterial | ShaderMaterial
|
||||
);
|
||||
|
||||
type: "Points";
|
||||
isPoints: true;
|
||||
|
||||
/**
|
||||
* An instance of Geometry or BufferGeometry, where each vertex designates the position of a particle in the system.
|
||||
*/
|
||||
@@ -5270,9 +5282,11 @@ export class Points extends Object3D {
|
||||
/**
|
||||
* An instance of Material, defining the object's appearance. Default is a PointsMaterial with randomised colour.
|
||||
*/
|
||||
material: Material;
|
||||
material: PointsMaterial | ShaderMaterial;
|
||||
|
||||
raycast(raycaster: Raycaster, intersects: any): void;
|
||||
raycast(raycaster: Raycaster, intersects: Intersection[]): void;
|
||||
|
||||
clone(): Points;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5328,10 +5342,15 @@ export class SkinnedMesh extends Mesh {
|
||||
export class Sprite extends Object3D {
|
||||
constructor(material?: Material);
|
||||
|
||||
geometry: BufferGeometry;
|
||||
material: SpriteMaterial;
|
||||
type: "Sprite";
|
||||
isSprite: true;
|
||||
|
||||
raycast(raycaster: Raycaster, intersects: any): void;
|
||||
material: SpriteMaterial;
|
||||
center: Vector2;
|
||||
|
||||
raycast(raycaster: Raycaster, intersects: Intersection[]): void;
|
||||
clone(): Sprite;
|
||||
copy(source: this, recursive?: boolean): this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -6364,13 +6383,6 @@ export class WebGLStencilBuffer {
|
||||
reset(): void;
|
||||
}
|
||||
|
||||
// Renderers / WebGL / Plugins /////////////////////////////////////////////////////////////////////
|
||||
export class LensFlarePlugin {
|
||||
constructor(renderer: WebGLRenderer, flares: any[]);
|
||||
|
||||
render(scene: Scene, camera: Camera, viewportWidth: number, viewportHeight: number): void;
|
||||
}
|
||||
|
||||
export class SpritePlugin {
|
||||
constructor(renderer: WebGLRenderer, sprites: any[]);
|
||||
|
||||
@@ -6385,6 +6397,8 @@ export class SpritePlugin {
|
||||
export class Scene extends Object3D {
|
||||
constructor();
|
||||
|
||||
type: "Scene";
|
||||
|
||||
/**
|
||||
* A fog instance defining the type of fog that affects everything rendered in the scene. Default is null.
|
||||
*/
|
||||
@@ -6395,8 +6409,9 @@ export class Scene extends Object3D {
|
||||
*/
|
||||
overrideMaterial: Material | null;
|
||||
autoUpdate: boolean;
|
||||
background: any;
|
||||
background: null | Color | Texture;
|
||||
|
||||
copy(source: this, recursive?: boolean): this;
|
||||
toJSON(meta?: any): any;
|
||||
}
|
||||
|
||||
@@ -6645,38 +6660,42 @@ export namespace ShapeUtils {
|
||||
|
||||
export class Audio extends Object3D {
|
||||
constructor(listener: AudioListener);
|
||||
type: "Audio";
|
||||
|
||||
type: string;
|
||||
context: AudioContext;
|
||||
source: AudioBufferSourceNode;
|
||||
gain: GainNode;
|
||||
autoplay: boolean;
|
||||
buffer: null | Audio;
|
||||
loop: boolean;
|
||||
startTime: number;
|
||||
offset: number;
|
||||
playbackRate: number;
|
||||
hasPlaybackControl: boolean;
|
||||
isPlaying: boolean;
|
||||
hasPlaybackControl: boolean;
|
||||
sourceType: string;
|
||||
source: AudioBufferSourceNode;
|
||||
filters: any[];
|
||||
|
||||
getOutput(): GainNode;
|
||||
setNodeSource(audioNode: AudioBufferSourceNode): Audio;
|
||||
setBuffer(audioBuffer: AudioBuffer): Audio;
|
||||
play(): Audio;
|
||||
pause(): Audio;
|
||||
stop(): Audio;
|
||||
connect(): Audio;
|
||||
disconnect(): Audio;
|
||||
getFilters(): any[];
|
||||
setFilter(value: any[]): Audio;
|
||||
getFilter(): any;
|
||||
setFilter(filter: any): Audio;
|
||||
setPlaybackRate(value: number): Audio;
|
||||
getPlaybackRate(): number;
|
||||
setNodeSource(audioNode: AudioBufferSourceNode): this;
|
||||
setMediaElementSource(mediaElement: MediaElementAudioSourceNode): this;
|
||||
setBuffer(audioBuffer: AudioBuffer): this;
|
||||
play(): this;
|
||||
onEnded(): void;
|
||||
pause(): this;
|
||||
stop(): this;
|
||||
connect(): this;
|
||||
disconnect(): this;
|
||||
getFilters(): any[];
|
||||
setFilter(value: any[]): this;
|
||||
getFilter(): any;
|
||||
setFilter(filter: any): this;
|
||||
setPlaybackRate(value: number): this;
|
||||
getPlaybackRate(): number;
|
||||
getLoop(): boolean;
|
||||
setLoop(value: boolean): void;
|
||||
getVolume(): number;
|
||||
setVolume(value: number): Audio;
|
||||
setVolume(value: number): this;
|
||||
/**
|
||||
* @deprecated Use {@link AudioLoader} instead.
|
||||
*/
|
||||
@@ -6729,9 +6748,10 @@ export class PositionalAudio extends Audio {
|
||||
export class AudioListener extends Object3D {
|
||||
constructor();
|
||||
|
||||
type: string;
|
||||
type: "AudioListener";
|
||||
context: AudioContext;
|
||||
gain: GainNode;
|
||||
filter: null | any;
|
||||
|
||||
getInput(): GainNode;
|
||||
removeFilter(): void;
|
||||
@@ -6739,6 +6759,7 @@ export class AudioListener extends Object3D {
|
||||
getFilter(): any;
|
||||
setMasterVolume(value: number): void;
|
||||
getMasterVolume(): number;
|
||||
updateMatrixWorld(force?: boolean): void;
|
||||
}
|
||||
|
||||
// Extras / Core /////////////////////////////////////////////////////////////////////
|
||||
@@ -7500,7 +7521,7 @@ export class ArrowHelper extends Object3D {
|
||||
|
||||
setDirection(dir: Vector3): void;
|
||||
setLength(length: number, headLength?: number, headWidth?: number): void;
|
||||
setColor(hex: number): void;
|
||||
setColor(color: Color): void;
|
||||
}
|
||||
|
||||
export class AxesHelper extends LineSegments {
|
||||
@@ -7535,11 +7556,14 @@ export class CameraHelper extends LineSegments {
|
||||
}
|
||||
|
||||
export class DirectionalLightHelper extends Object3D {
|
||||
constructor(light: Light, size?: number, color?: Color | string | number);
|
||||
constructor(light: DirectionalLight, size?: number, color?: Color | string | number);
|
||||
|
||||
light: Light;
|
||||
light: DirectionalLight;
|
||||
lightPlane: Line;
|
||||
color: Color | string | number;
|
||||
targetPlane: Line;
|
||||
color: Color | string | number | undefined;
|
||||
matrix: Matrix4;
|
||||
matrixAutoUpdate: boolean;
|
||||
|
||||
dispose(): void;
|
||||
update(): void;
|
||||
@@ -7570,22 +7594,26 @@ export class GridHelper extends LineSegments {
|
||||
}
|
||||
|
||||
export class HemisphereLightHelper extends Object3D {
|
||||
constructor(light: Light, sphereSize: number);
|
||||
constructor(light: HemisphereLight, size: number, color?: Color | number | string);
|
||||
|
||||
light: Light;
|
||||
colors: Color[];
|
||||
lightSphere: Mesh;
|
||||
light: HemisphereLight;
|
||||
matrix: Matrix4;
|
||||
matrixAutoUpdate: boolean;
|
||||
material: MeshBasicMaterial;
|
||||
|
||||
color: Color | string | number | undefined;
|
||||
|
||||
dispose(): void;
|
||||
update(): void;
|
||||
}
|
||||
|
||||
export class PointLightHelper extends Object3D {
|
||||
constructor(light: Light, sphereSize?: number, color?: Color | string | number);
|
||||
constructor(light: PointLight, sphereSize?: number, color?: Color | string | number);
|
||||
|
||||
light: Light;
|
||||
sphereSize: number;
|
||||
color: Color | string | number;
|
||||
light: PointLight;
|
||||
color: Color | string | number | undefined;
|
||||
matrix: Matrix4;
|
||||
matrixAutoUpdate: boolean;
|
||||
|
||||
dispose(): void;
|
||||
update(): void;
|
||||
@@ -7605,7 +7633,9 @@ export class SpotLightHelper extends Object3D {
|
||||
constructor(light: Light, color?: Color | string | number);
|
||||
|
||||
light: Light;
|
||||
color: Color | string | number;
|
||||
matrix: Matrix4;
|
||||
matrixAutoUpdate: boolean;
|
||||
color: Color | string | number | undefined;
|
||||
|
||||
dispose(): void;
|
||||
update(): void;
|
||||
|
||||
Vendored
+27
@@ -0,0 +1,27 @@
|
||||
import {Mesh, Camera, Scene, WebGLRenderer, Blending, Vector3, Color, Shader, Texture, BufferGeometry} from "./three-core";
|
||||
|
||||
export class LensFlare extends Mesh {
|
||||
|
||||
constructor();
|
||||
|
||||
type: 'LensFlare';
|
||||
frustumCulled: false;
|
||||
renderOrder: number;
|
||||
|
||||
addElement(element: LensFlareElement): this;
|
||||
onBeforeRender: (renderer: WebGLRenderer, scene: Scene, camera: Camera) => void;
|
||||
dispose(): void;
|
||||
|
||||
isLensflare: true;
|
||||
|
||||
}
|
||||
|
||||
export class LensFlareElement {
|
||||
constructor(texture: Texture, size?: number, distance?: number, color?: Color);
|
||||
texture: Texture;
|
||||
size: number;
|
||||
distance: number;
|
||||
color: Color;
|
||||
static Shader: Shader;
|
||||
static Geometry: BufferGeometry
|
||||
}
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
// Type definitions for triplesec 3.0
|
||||
// Project: https://github.com/keybase/triplesec
|
||||
// Definitions by: Ben Speakman <https://github.com/threesquared>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export interface WordArray {
|
||||
sigBytes: number;
|
||||
words: number[];
|
||||
to_hex: () => string;
|
||||
}
|
||||
|
||||
export interface Arguments {
|
||||
data: Buffer;
|
||||
key: Buffer;
|
||||
progress_hook?: (progress: Progress) => void;
|
||||
}
|
||||
|
||||
export interface Progress {
|
||||
what: string;
|
||||
i: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
export function encrypt(arg: Arguments, cb: (err: Error | null, buff: Buffer | null) => void): void;
|
||||
export function decrypt(arg: Arguments, cb: (err: Error | null, buff: Buffer | null) => void): void;
|
||||
|
||||
export namespace prng {
|
||||
function generate(n: number, cb: (words: WordArray) => void): void;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import * as triplesec from 'triplesec';
|
||||
|
||||
const progressHook = (progress: triplesec.Progress) => {
|
||||
progress.what; // $ExpectType string
|
||||
progress.i; // $ExpectType number
|
||||
progress.total; // $ExpectType number
|
||||
};
|
||||
|
||||
triplesec.encrypt({
|
||||
data: new Buffer('data'),
|
||||
key: new Buffer('key'),
|
||||
progress_hook: progressHook,
|
||||
}, (err, buff) => {
|
||||
if (err === null) {
|
||||
buff; // $ExpectType Buffer | null
|
||||
} else {
|
||||
err; // $ExpectType Error
|
||||
}
|
||||
});
|
||||
|
||||
triplesec.decrypt({
|
||||
data: new Buffer('data'),
|
||||
key: new Buffer('key'),
|
||||
progress_hook: progressHook,
|
||||
}, (err, buff) => {
|
||||
if (err === null) {
|
||||
buff; // $ExpectType Buffer | null
|
||||
} else {
|
||||
err; // $ExpectType Error
|
||||
}
|
||||
});
|
||||
|
||||
triplesec.prng.generate(24, words => {
|
||||
words.sigBytes; // $ExpectType number
|
||||
words.words; // $ExpectType number[]
|
||||
words.to_hex(); // $ExpectType string
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"triplesec-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Vendored
+1
-1
@@ -62,7 +62,7 @@ export class ConfigDescriptor {
|
||||
}
|
||||
|
||||
export class Interface {
|
||||
interface: number;
|
||||
interfaceNumber: number;
|
||||
altSetting: number;
|
||||
descriptor: InterfaceDescriptor;
|
||||
endpoints: Endpoint[];
|
||||
|
||||
@@ -57,7 +57,7 @@ device.allConfigDescriptors = [configDesc];
|
||||
|
||||
const iface = new usb.Interface(device, 1);
|
||||
|
||||
iface.interface = 1;
|
||||
iface.interfaceNumber = 1;
|
||||
iface.altSetting = 0;
|
||||
iface.claim();
|
||||
iface.release((error: string) => null);
|
||||
|
||||
Vendored
+46
-18
@@ -6,6 +6,7 @@
|
||||
// Christoph Wagner <https://github.com/IgelCampus>
|
||||
// Gio Freitas <https://github.com/giofreitas>
|
||||
// Grzegorz Błaszczyk <https://github.com/gjanblaszczyk>
|
||||
// Stéphane Roucheray <https://github.com/sroucheray>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// The Video.js API allows you to interact with the video through
|
||||
@@ -19,6 +20,7 @@ export as namespace videojs;
|
||||
declare namespace videojs {
|
||||
const getComponent: typeof Component.getComponent;
|
||||
const registerComponent: typeof Component.registerComponent;
|
||||
const getPlugin: typeof Plugin.getPlugin;
|
||||
|
||||
interface PlayerOptions {
|
||||
techOrder?: string[];
|
||||
@@ -53,15 +55,27 @@ declare namespace videojs {
|
||||
height: number;
|
||||
}
|
||||
|
||||
class Component {
|
||||
class EventTarget {
|
||||
addEventListener(type: string | string[], callback: (eventObject: Event) => void): void;
|
||||
dispatchEvent(event: string | Event | { [key: string]: any }): void;
|
||||
off(type?: string | string[], callback?: (eventObject: Event) => void): void;
|
||||
on(type: string | string[], callback: (eventObject: Event) => void): void;
|
||||
one(type: string | string[], callback: (eventObject: Event) => void): void;
|
||||
removeEventListener(type?: string | string[], callback?: (eventObject: Event) => void): void;
|
||||
trigger(event: string | Event | { [key: string]: any }): void;
|
||||
}
|
||||
|
||||
class Component extends EventTarget {
|
||||
constructor(player: Player, options: any);
|
||||
|
||||
static getComponent(name: 'Player'|'player'): typeof Player;
|
||||
static getComponent(name: 'Component'|'component' | string): typeof Component;
|
||||
static registerComponent(name: string, ComponentToRegister: typeof Component): typeof Component;
|
||||
static getComponent(name: 'Player' | 'player'): Player;
|
||||
static getComponent(name: 'Button' | 'button'): Button;
|
||||
static getComponent(name: 'Component' | 'component' | string): Component;
|
||||
static registerComponent(name: string, ComponentToRegister: Component): Component;
|
||||
|
||||
$(selector: string, context?: string|Element): Element;
|
||||
$$(selector: string, context?: string|Element): NodeList;
|
||||
$(selector: string, context?: string | Element): Element;
|
||||
$$(selector: string, context?: string | Element): NodeList;
|
||||
addChild(child: string | Component, optionsopt?: any, indexopt?: number): Component;
|
||||
addClass(classToAdd: string): void;
|
||||
blur(): void;
|
||||
cancelAnimationFrame(id: number): number;
|
||||
@@ -70,31 +84,28 @@ declare namespace videojs {
|
||||
clearTimeout(timeoutId: number): number;
|
||||
contentEl(): Element;
|
||||
createEl(tagNameopt?: string, properties?: any, attributes?: any): Element;
|
||||
currentDimension(widthOrHeight: 'width'|'height'): number;
|
||||
currentDimension(widthOrHeight: 'width' | 'height'): number;
|
||||
currentDimensions(): Dimensions;
|
||||
currentHeight(): number;
|
||||
currentWidth(): number;
|
||||
dimension(widthOrHeight: 'width'|'height'): number;
|
||||
dimension(widthOrHeight: 'width'|'height', num: string|number, skipListenersopt?: boolean): void;
|
||||
dimensions(width: string|number, height: string|number): void;
|
||||
dimension(widthOrHeight: 'width' | 'height'): number;
|
||||
dimension(widthOrHeight: 'width' | 'height', num: string | number, skipListenersopt?: boolean): void;
|
||||
dimensions(width: string | number, height: string | number): void;
|
||||
dispose(): void;
|
||||
el(): Element;
|
||||
enableTouchActivity(): void;
|
||||
focus(): void;
|
||||
getAttribute(attribute: string): string|null;
|
||||
getChild(name: string): Component|undefined;
|
||||
getChildById(id: string): Component|undefined;
|
||||
getAttribute(attribute: string): string | null;
|
||||
getChild(name: string): Component | undefined;
|
||||
getChildById(id: string): Component | undefined;
|
||||
hasClass(classToCheck: string): boolean;
|
||||
height(): number|string;
|
||||
height(num: number|string, skipListeners?: boolean): void;
|
||||
height(): number | string;
|
||||
height(num: number | string, skipListeners?: boolean): void;
|
||||
hide(): void;
|
||||
id(): string;
|
||||
initChildren(): void;
|
||||
localize(key: string, tokens?: string[], defaultValue?: string): string;
|
||||
name(): string;
|
||||
off(eventName?: string, callback?: (eventObject: Event) => void): void;
|
||||
on(eventName: string, callback: (eventObject: Event) => void): void;
|
||||
one(eventName: string, callback: (eventObject: Event) => void): void;
|
||||
options(obj: any): any;
|
||||
player(): Player;
|
||||
ready(callback: (this: this) => void): this;
|
||||
@@ -112,6 +123,11 @@ declare namespace videojs {
|
||||
width(num: number, skipListeners?: number): void;
|
||||
}
|
||||
|
||||
class Button extends Component {
|
||||
controlText(textopt?: string, elopt?: Element): string;
|
||||
createControlTextEl(elopt: Element): Element;
|
||||
}
|
||||
|
||||
class Player extends Component {
|
||||
autoplay(value?: boolean): string;
|
||||
addRemoteTextTrack(options: {}, manualCleanup?: boolean): HTMLTrackElement;
|
||||
@@ -144,6 +160,18 @@ declare namespace videojs {
|
||||
width(num: number): void;
|
||||
}
|
||||
|
||||
class Plugin {
|
||||
static deregisterPlugin(name: string): void;
|
||||
static getPlugin(name: string): Plugin;
|
||||
static getPlugins(namesopt?: string[]): { [key: string]: Plugin };
|
||||
static getPluginVersion(name: string): string;
|
||||
static isBasic(plugin: Plugin | (() => void)): boolean;
|
||||
static registerPlugin(name: string, plugin: Plugin | (() => void)): void;
|
||||
dispose(): void;
|
||||
getEventHash(hashopt: any): any;
|
||||
version(): string;
|
||||
}
|
||||
|
||||
namespace dom {
|
||||
function appendContent(element: Element, content: any): Element;
|
||||
}
|
||||
|
||||
@@ -14,9 +14,9 @@ videojs("example_video_1").ready(function() {
|
||||
this.src({ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" });
|
||||
|
||||
this.src([
|
||||
{ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" },
|
||||
{ type: "video/webm", src: "http://www.example.com/path/to/video.webm" },
|
||||
{ type: "video/ogg", src: "http://www.example.com/path/to/video.ogv" }
|
||||
{ type: "video/mp4", src: "http://www.example.com/path/to/video.mp4" },
|
||||
{ type: "video/webm", src: "http://www.example.com/path/to/video.webm" },
|
||||
{ type: "video/ogg", src: "http://www.example.com/path/to/video.ogv" }
|
||||
]);
|
||||
|
||||
const whereYouAt: number = this.currentTime();
|
||||
@@ -79,3 +79,20 @@ function testEvents(myPlayer: videojs.Player) {
|
||||
// Removes all listeners.
|
||||
myPlayer.off();
|
||||
}
|
||||
|
||||
function testComponents() {
|
||||
let component = videojs.getComponent('Component');
|
||||
component = videojs.Component.getComponent('Component');
|
||||
|
||||
const button = videojs.getComponent('Button');
|
||||
button.controlText('Button Text');
|
||||
const player = videojs.getComponent('Player');
|
||||
player.play();
|
||||
}
|
||||
|
||||
function testPlugin() {
|
||||
let plugin = videojs.getPlugin('plugin_name');
|
||||
plugin = videojs.getPlugin('plugin_name');
|
||||
|
||||
plugin.dispose();
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -154,7 +154,7 @@ export class ReplaceSource extends Source implements SourceAndMapMixin {
|
||||
_name: string;
|
||||
replacements: any[][];
|
||||
|
||||
constructor(source: Source, name: string);
|
||||
constructor(source: Source, name?: string);
|
||||
|
||||
replace(start: number, end: number, newValue: string): void;
|
||||
|
||||
|
||||
Vendored
+3
-8
@@ -1,3 +1,5 @@
|
||||
import { PageConfig } from "./page";
|
||||
|
||||
export interface AppConfig {
|
||||
appEvents?: string[];
|
||||
pageEvents?: string[];
|
||||
@@ -11,16 +13,9 @@ export interface AppConstructor {
|
||||
/* the supported add-ons */
|
||||
export type AddOn = "requestfix" | "promisify";
|
||||
|
||||
export interface WindowConfig {
|
||||
backgroundTextStyle: string;
|
||||
navigationBarBackgroundColor: string;
|
||||
navigationBarTitleText: string;
|
||||
navigationBarTextStyle: string;
|
||||
}
|
||||
|
||||
export default class app {
|
||||
config: {
|
||||
window: WindowConfig;
|
||||
window: PageConfig;
|
||||
pages: string[];
|
||||
};
|
||||
$init(wepy: any, config: AppConfig): void;
|
||||
|
||||
Vendored
+13
-1
@@ -8,8 +8,20 @@ export interface PageConstructor {
|
||||
new (): page;
|
||||
}
|
||||
|
||||
export interface PageConfig {
|
||||
navigationBarBackgroundColor?: string;
|
||||
navigationBarTextStyle?: string;
|
||||
navigationBarTitleText?: string;
|
||||
backgroundColor?: string;
|
||||
backgroundTextStyle?: string;
|
||||
enablePullDownRefresh?: boolean;
|
||||
disableScroll?: boolean;
|
||||
onReachBottomDistance?: number;
|
||||
}
|
||||
|
||||
export default class page extends component {
|
||||
$preloadData: { [key: string]: any };
|
||||
config?: PageConfig;
|
||||
$preloadData?: { [key: string]: any };
|
||||
$init(wxpage: any, $parent: any): any;
|
||||
$route(
|
||||
type: "redirectTo" | "navigateTo",
|
||||
|
||||
@@ -17,6 +17,8 @@ export class MyComponent extends wepy.component {
|
||||
titleClassName: ""
|
||||
};
|
||||
|
||||
config = {};
|
||||
|
||||
methods = {};
|
||||
|
||||
onLoad() {
|
||||
|
||||
Reference in New Issue
Block a user