mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 07:40:10 +00:00
Merge remote-tracking branch 'upstream/types-2.0' into resemblejs
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
/// <reference path="activex-data-objects.d.ts" />
|
||||
|
||||
|
||||
//open connection to an Excel file
|
||||
var pathToExcelFile = 'C:\\path\\to\\excel\\file.xlsx';
|
||||
var conn = new ActiveXObject('ADODB.Connection');
|
||||
@@ -3,8 +3,6 @@
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="jscript-extensions.d.ts" />
|
||||
|
||||
declare namespace ADODB {
|
||||
|
||||
//Enums
|
||||
19
activex-data-objects/tsconfig.json
Normal file
19
activex-data-objects/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"activex-data-objects-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,3 @@
|
||||
/// <reference path="microsoft-scripting-runtime.d.ts" />
|
||||
|
||||
|
||||
//source -- https://msdn.microsoft.com/en-us/library/ebkhfaaz.aspx
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="jscript-extensions.d.ts" />
|
||||
|
||||
declare namespace Scripting {
|
||||
|
||||
//Enums
|
||||
19
activex-scripting-runtime/tsconfig.json
Normal file
19
activex-scripting-runtime/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"activex-scripting-runtime-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,3 @@
|
||||
/// <reference path="windows-image-acquisition.d.ts" />
|
||||
|
||||
//source -- https://msdn.microsoft.com/en-us/library/windows/desktop/ms630826(v=vs.85).aspx
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="jscript-extensions.d.ts" />
|
||||
|
||||
declare namespace WIA {
|
||||
|
||||
//Enums
|
||||
19
activex-windows-image-acquisition/tsconfig.json
Normal file
19
activex-windows-image-acquisition/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"activex-windows-image-acquisition-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"moment": "2.14.*"
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import fs = require("fs");
|
||||
|
||||
var fs, path;
|
||||
var path: {
|
||||
exists: (path: string, callback?: (err: string, exists: boolean) => any) => void;
|
||||
};
|
||||
|
||||
function callback() {}
|
||||
function callback() { }
|
||||
|
||||
async.map(['file1', 'file2', 'file3'], fs.stat, function (err, results) { });
|
||||
async.mapSeries(['file1', 'file2', 'file3'], fs.stat, function (err, results) { });
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"moment": "2.14.*"
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"moment": "2.14.*"
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"moment": "2.14.*"
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
5
detect-browser/detect-browser-tests.ts
Normal file
5
detect-browser/detect-browser-tests.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
import detectBrowser = require("detect-browser");
|
||||
|
||||
const n: string = detectBrowser.name;
|
||||
const v: string = detectBrowser.version;
|
||||
14
detect-browser/index.d.ts
vendored
Normal file
14
detect-browser/index.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
// Type definitions for detect-browser v1.3.3
|
||||
// Project: https://github.com/DamonOehlman/detect-browser
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Browser name
|
||||
*/
|
||||
export const name: string;
|
||||
|
||||
/**
|
||||
* Browser version
|
||||
*/
|
||||
export const version: string;
|
||||
19
detect-browser/tsconfig.json
Normal file
19
detect-browser/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"detect-browser-tests.ts"
|
||||
]
|
||||
}
|
||||
8
electron/index.d.ts
vendored
8
electron/index.d.ts
vendored
@@ -3967,9 +3967,13 @@ declare namespace Electron {
|
||||
*/
|
||||
getTitle(): string;
|
||||
/**
|
||||
* @returns The favicon of the web page.
|
||||
* @returns Whether the web page is destroyed.
|
||||
*/
|
||||
getFavicon(): NativeImage;
|
||||
isDestroyed(): boolean;
|
||||
/**
|
||||
* @returns Whether the web page is focused.
|
||||
*/
|
||||
isFocused(): boolean;
|
||||
/**
|
||||
* @returns Whether web page is still loading resources.
|
||||
*/
|
||||
|
||||
9
ent/ent-tests.ts
Normal file
9
ent/ent-tests.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
|
||||
import ent = require("ent");
|
||||
|
||||
// encode
|
||||
const s: string = ent.encode("foo");
|
||||
const s2: string = ent.encode("foo", { numeric: true, named: true, special: { foo: true } });
|
||||
|
||||
// decode
|
||||
const t: string = ent.decode("foo");
|
||||
36
ent/index.d.ts
vendored
Normal file
36
ent/index.d.ts
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
// Type definitions for ent 2.2.0
|
||||
// Project: https://github.com/substack/node-ent
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
/**
|
||||
* Options for the encode() function
|
||||
*/
|
||||
export interface EntOpts {
|
||||
/**
|
||||
* If opts.numeric is false or opts.named is true, encoding will used named codes like π.
|
||||
*/
|
||||
numeric?: boolean;
|
||||
|
||||
/**
|
||||
* If opts.numeric is false or opts.named is true, encoding will used named codes like π.
|
||||
*/
|
||||
named?: boolean;
|
||||
|
||||
/**
|
||||
* If opts.special is set to an Object, the key names will be forced to be encoded (defaults to forcing: <>'"&)
|
||||
*/
|
||||
special?: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Escape unsafe characters in str with html entities. By default, entities are encoded with numeric decimal codes
|
||||
*/
|
||||
export function encode(s: string, opts?: EntOpts): string;
|
||||
|
||||
/**
|
||||
* Convert html entities in str back to raw text.
|
||||
*/
|
||||
export function decode(s: string): string;
|
||||
@@ -14,6 +14,6 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ng-table-tests.ts"
|
||||
"ent-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"moment": "2.14.*"
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"moment": "2.14.*"
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -889,7 +889,7 @@ describe("Jasmine Mock Ajax (for toplevel)", function() {
|
||||
client.send();
|
||||
|
||||
request = mockAjax.requests.mostRecent();
|
||||
response = { status: 200, statusText: "OK", contentType: "text/html", responseText: "OK!" };
|
||||
response = { status: 200, statusText: "OK", contentType: "text/html", responseText: "OK!", responseType: "json" };
|
||||
request.respondWith(response);
|
||||
|
||||
sharedContext.responseCallback = success;
|
||||
@@ -1102,7 +1102,7 @@ describe("Jasmine Mock Ajax (for toplevel)", function() {
|
||||
client.send();
|
||||
|
||||
request = mockAjax.requests.mostRecent();
|
||||
response = { status: 0, statusText: "ABORT", responseText: '{"foo": "whoops!"}' };
|
||||
response = { status: 0, statusText: "ABORT", responseText: '{"foo": "whoops!"}', responseType: "json"};
|
||||
request.respondWith(response);
|
||||
|
||||
sharedContext.responseCallback = error;
|
||||
@@ -1138,7 +1138,7 @@ describe("Jasmine Mock Ajax (for toplevel)", function() {
|
||||
client.send();
|
||||
|
||||
request = mockAjax.requests.mostRecent();
|
||||
response = { status: 500, statusText: "SERVER ERROR", contentType: "text/html", responseText: "(._){" };
|
||||
response = { status: 500, statusText: "SERVER ERROR", contentType: "text/html", responseText: "(._){",responseType: "json"};
|
||||
request.respondWith(response);
|
||||
|
||||
sharedContext.responseCallback = error;
|
||||
@@ -1175,7 +1175,7 @@ describe("Jasmine Mock Ajax (for toplevel)", function() {
|
||||
client.send();
|
||||
|
||||
request = mockAjax.requests.mostRecent();
|
||||
response = { contentType: "text/html", response: "(._){response", responseText: "(._){", responseType: "text" };
|
||||
response = { contentType: "text/html", response: "(._){response", responseText: "(._){", responseType: "text", status: 200, statusText: 'OK' };
|
||||
request.responseTimeout(response);
|
||||
|
||||
sharedContext.responseCallback = error;
|
||||
|
||||
84
jcanvas/index.d.ts
vendored
Normal file
84
jcanvas/index.d.ts
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
// Type definitions for jCanvas 15.02.07
|
||||
// Project: http://projects.calebevans.me/jcanvas/
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference types="jquery"/>
|
||||
|
||||
interface JCanvasRect {
|
||||
x: number;
|
||||
y: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
interface JCanvasSliceDef {
|
||||
fillStyle: string;
|
||||
x: number;
|
||||
y: number;
|
||||
/**
|
||||
* Radius in pixels
|
||||
*/
|
||||
radius: number;
|
||||
/**
|
||||
* Start angle in degrees from north
|
||||
*/
|
||||
start: number;
|
||||
/**
|
||||
* End angle in degrees from north
|
||||
*/
|
||||
end: number;
|
||||
/**
|
||||
* Distance between slices as a fraction of the radius
|
||||
*/
|
||||
spread?: number;
|
||||
|
||||
layer?: boolean;
|
||||
name?: string;
|
||||
groups?: string[];
|
||||
}
|
||||
|
||||
interface JCanvasTextDef {
|
||||
fillStyle: string;
|
||||
strokeStyle: string;
|
||||
strokeWidth: number;
|
||||
x: number;
|
||||
y: number;
|
||||
fontSize: number;
|
||||
fontFamily: string;
|
||||
text: string;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
|
||||
/**
|
||||
* This clearCanvas() clears all or any part of the canvas
|
||||
* If nothing is passed, the entire canvas is cleared.
|
||||
* Clearing a section works in the same way as drawing a rectangle,
|
||||
* with the rectangle being drawn from its center (by default).
|
||||
*/
|
||||
clearCanvas(rect?: JCanvasRect): void;
|
||||
|
||||
/**
|
||||
* A slice in jCanvas is, essentially, a slice of a circle (similar to a pizza slice).
|
||||
* You can draw a slice using the drawSlice() method. The size of a slice is determined by its start, end, and radius properties.
|
||||
* The position of a slice is determined by its x and y properties. These coordinates lie at the tip of the slice.
|
||||
*/
|
||||
drawSlice(def: JCanvasSliceDef): void;
|
||||
|
||||
/**
|
||||
* To draw text on the canvas, use the drawText() method.
|
||||
* The resulting text on the canvas is determined by the value of the text property, as well as any of the following font properties:
|
||||
* fontStyle
|
||||
* fontSize
|
||||
* fontFamily
|
||||
*/
|
||||
drawText(def: JCanvasTextDef): void;
|
||||
}
|
||||
|
||||
// note this declare module is necessary to tell TypeScript not to interpret the whole file as one module;
|
||||
// the JQuery interface below should extend the existing jquery module interface
|
||||
declare module "jcanvas" {
|
||||
function jcanvas(jquery: JQueryStatic, window: Window): void;
|
||||
export = jcanvas;
|
||||
}
|
||||
23
jcanvas/jcanvas-tests.ts
Normal file
23
jcanvas/jcanvas-tests.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
import $ = require("jquery");
|
||||
import jcanvas = require("jcanvas");
|
||||
jcanvas($, window);
|
||||
|
||||
|
||||
const elt = $(".foo");
|
||||
elt.clearCanvas();
|
||||
elt.drawSlice({
|
||||
fillStyle: "blue",
|
||||
x: 100, y: 100,
|
||||
radius: 80,
|
||||
start: 0, end: 359.9
|
||||
});
|
||||
elt.drawText({
|
||||
fillStyle: "white",
|
||||
strokeStyle: "red",
|
||||
strokeWidth: 2,
|
||||
x: 100, y: 100,
|
||||
fontSize: 48,
|
||||
fontFamily: "Arial",
|
||||
text: "bar"
|
||||
});
|
||||
21
jcanvas/tsconfig.json
Normal file
21
jcanvas/tsconfig.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [
|
||||
"node"
|
||||
],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jcanvas-tests.ts"
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"moment": "2.14.*"
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -816,11 +816,7 @@ function test_autocomplete() {
|
||||
}, response);
|
||||
},
|
||||
search: () => {
|
||||
// custom minLength
|
||||
var term = null
|
||||
if (term.length < 2) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
focus: () => {
|
||||
return false;
|
||||
|
||||
2
jsonwebtoken/index.d.ts
vendored
2
jsonwebtoken/index.d.ts
vendored
@@ -46,7 +46,7 @@ export interface SignOptions {
|
||||
issuer?: string;
|
||||
jwtid?: string;
|
||||
noTimestamp?: boolean;
|
||||
headers?: Object;
|
||||
header?: Object;
|
||||
encoding?: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ describe('Templating', function() {
|
||||
});
|
||||
|
||||
it('Should be able to access newly rendered/inserted elements in \'afterRender\' callaback', function () {
|
||||
var passedElement, passedDataItem;
|
||||
var passedElement:any, passedDataItem;
|
||||
var myCallback = function(elementsArray, dataItem) {
|
||||
expect(elementsArray.length).toEqual(1);
|
||||
passedElement = elementsArray[0];
|
||||
|
||||
@@ -242,7 +242,13 @@ function test_bindings() {
|
||||
}
|
||||
};
|
||||
|
||||
var node, containerElem, nodeToInsert, insertAfter, nodeToPrepend, arrayOfNodes;
|
||||
var node: Node = <any>{};
|
||||
var insertAfter: Node = <any>{};
|
||||
var nodeToPrepend: Node = <any>{};
|
||||
var arrayOfNodes: Node[] = <any>[];
|
||||
var containerElem: KnockoutVirtualElement = <any>{};
|
||||
var nodeToInsert: Node = <any>{}
|
||||
|
||||
ko.virtualElements.emptyNode(containerElem);
|
||||
ko.virtualElements.firstChild(containerElem);
|
||||
ko.virtualElements.insertAfter(containerElem, nodeToInsert, insertAfter);
|
||||
@@ -568,7 +574,7 @@ function test_misc() {
|
||||
|
||||
var x = ko.observableArray([1, 2, 3]);
|
||||
|
||||
var element;
|
||||
var element: Element = <any>{};
|
||||
ko.utils.domNodeDisposal.addDisposeCallback(element, function () {
|
||||
$(element).datepicker("destroy");
|
||||
});
|
||||
|
||||
@@ -7,11 +7,11 @@ function test_activityDefaults() {
|
||||
container: 'i',
|
||||
inactiveClass: ''
|
||||
};
|
||||
|
||||
|
||||
ko.bindingHandlers.activity.defaultOptions = {
|
||||
activityClass: 'some Value'
|
||||
};
|
||||
|
||||
|
||||
ko.bindingHandlers.activity.defaultOptions = {
|
||||
};
|
||||
}
|
||||
@@ -60,12 +60,12 @@ function test_asyncCommand_isExecuting() {
|
||||
}
|
||||
|
||||
function test_dirtyFlag() {
|
||||
var viewModel;
|
||||
var viewModel: any;
|
||||
viewModel.dirtyFlag = new ko.DirtyFlag(viewModel.model);
|
||||
viewModel.dirtyFlag().isDirty();
|
||||
viewModel.dirtyFlag().reset();
|
||||
|
||||
var self;
|
||||
var self: any;
|
||||
this.dirtyFlag = new ko.DirtyFlag(
|
||||
self.firstName,
|
||||
self.lastName);
|
||||
|
||||
93
ldapjs/index.d.ts
vendored
Normal file
93
ldapjs/index.d.ts
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
// Type definitions for ldapjs v0.7.1
|
||||
// Project: http://ldapjs.org
|
||||
// Definitions by: Peter Kooijmans <https://github.com/peterkooijmans/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export interface Error {
|
||||
code: number;
|
||||
name: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface CallBack {
|
||||
(error: Error, result?: any): void;
|
||||
}
|
||||
|
||||
export interface ClientOptions {
|
||||
url: string;
|
||||
socketPath?: string;
|
||||
log?: any;
|
||||
timeout?: number;
|
||||
connectTimeout?: number;
|
||||
maxConnections?: number;
|
||||
bindDN?: string;
|
||||
bindCredentials?: string;
|
||||
checkInterval?: number;
|
||||
maxIdleTime?: number;
|
||||
}
|
||||
|
||||
export interface SearchOptions {
|
||||
scope?: string;
|
||||
filter?: string;
|
||||
attributes?: string[];
|
||||
attrsOnly?: boolean;
|
||||
sizeLimit?: number;
|
||||
timeLimit?: number;
|
||||
}
|
||||
|
||||
export interface SearchCallBack {
|
||||
(error: Error, result: NodeJS.EventEmitter): void;
|
||||
}
|
||||
|
||||
export interface Client {
|
||||
/**
|
||||
* Performs a simple authentication against the server.
|
||||
*
|
||||
* @param name the DN to bind as.
|
||||
* @param credentials the userPassword associated with name.
|
||||
* @param controls (optional) either a Control or [Control].
|
||||
* @param callback callback of the form f(err, res).
|
||||
* @throws {TypeError} on invalid input.
|
||||
*/
|
||||
bind(dn: string, password: string, callback: CallBack): void;
|
||||
|
||||
/**
|
||||
* Performs an LDAP search against the server.
|
||||
*
|
||||
* Note that the defaults for options are a 'base' search, if that's what
|
||||
* you want you can just pass in a string for options and it will be treated
|
||||
* as the search filter. Also, you can either pass in programatic Filter
|
||||
* objects or a filter string as the filter option.
|
||||
*
|
||||
* Note that this method is 'special' in that the callback 'res' param will
|
||||
* have two important events on it, namely 'entry' and 'end' that you can hook
|
||||
* to. The former will emit a SearchEntry object for each record that comes
|
||||
* back, and the latter will emit a normal LDAPResult object.
|
||||
*
|
||||
* @param {String} base the DN in the tree to start searching at.
|
||||
* @param {Object} options parameters:
|
||||
* - {String} scope default of 'base'.
|
||||
* - {String} filter default of '(objectclass=*)'.
|
||||
* - {Array} attributes [string] to return.
|
||||
* - {Boolean} attrsOnly whether to return values.
|
||||
* @param {Control} controls (optional) either a Control or [Control].
|
||||
* @param {Function} callback of the form f(err, res).
|
||||
* @throws {TypeError} on invalid input.
|
||||
*/
|
||||
search(base: string, options: SearchOptions, callback: SearchCallBack): void;
|
||||
|
||||
/**
|
||||
* Unbinds this client from the LDAP server.
|
||||
*
|
||||
* Note that unbind does not have a response, so this callback is actually
|
||||
* optional; either way, the client is disconnected.
|
||||
*
|
||||
* @param {Function} callback of the form f(err).
|
||||
* @throws {TypeError} if you pass in callback as not a function.
|
||||
*/
|
||||
unbind(callback: CallBack): void;
|
||||
}
|
||||
|
||||
export function createClient(options? : ClientOptions): Client;
|
||||
20
ldapjs/ldapjs-tests.ts
Normal file
20
ldapjs/ldapjs-tests.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
import ldap = require("ldapjs");
|
||||
|
||||
let client = ldap.createClient({
|
||||
url: 'ldap://127.0.0.1:1389'
|
||||
});
|
||||
|
||||
client.bind('cn=root', 'secret', (err: Error): void => {
|
||||
// nothing
|
||||
});
|
||||
|
||||
let opts: ldap.SearchOptions = {
|
||||
filter: '(&(l=Seattle)(email=*@foo.com))',
|
||||
scope: 'sub',
|
||||
attributes: ['dn', 'sn', 'cn']
|
||||
};
|
||||
|
||||
client.search('o=example', opts, (err: Error, res: NodeJS.EventEmitter): void => {
|
||||
// nothing
|
||||
});
|
||||
19
ldapjs/tsconfig.json
Normal file
19
ldapjs/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ldapjs-tests.ts"
|
||||
]
|
||||
}
|
||||
7
lolex/index.d.ts
vendored
7
lolex/index.d.ts
vendored
@@ -1,10 +1,12 @@
|
||||
// Type definitions for lolex 1.2.1
|
||||
// Type definitions for lolex 1.5.1
|
||||
// Project: https://github.com/sinonjs/lolex
|
||||
// Definitions by: Wim Looman <https://github.com/Nemo157>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
export interface Clock {
|
||||
now: number;
|
||||
|
||||
setTimeout(callback: () => any, timeout: number): number;
|
||||
setInterval(callback: () => any, timeout: number): number;
|
||||
setImmediate(callback: () => any): number;
|
||||
@@ -13,6 +15,9 @@ export interface Clock {
|
||||
clearInterval(id: number): void;
|
||||
clearImmediate(id: number): void;
|
||||
|
||||
setSystemTime(now: number): void;
|
||||
setSystemTime(date: Date): void;
|
||||
|
||||
tick(ms: number): void;
|
||||
uninstall(): void;
|
||||
}
|
||||
|
||||
@@ -57,6 +57,11 @@ clock = lolex.install(window, Date.now(), ['setTimeout', 'clearTimeout']);
|
||||
clock = lolex.install(Date.now());
|
||||
clock = lolex.install(Date.now(), ['setTimeout', 'clearTimeout']);
|
||||
|
||||
/**
|
||||
* clock.now
|
||||
*/
|
||||
var n: number = clock.now;
|
||||
|
||||
|
||||
var id: number;
|
||||
/**
|
||||
@@ -100,6 +105,11 @@ id = clock.setImmediate(() => {});
|
||||
|
||||
clock.clearImmediate(id);
|
||||
|
||||
/**
|
||||
* clock.setSystemTime
|
||||
*/
|
||||
clock.setSystemTime(0);
|
||||
clock.setSystemTime(new Date());
|
||||
|
||||
/**
|
||||
* clock.tick(time)
|
||||
@@ -113,3 +123,4 @@ clock.tick(1000);
|
||||
*/
|
||||
|
||||
clock.uninstall();
|
||||
|
||||
|
||||
3
mobile-detect/index.d.ts
vendored
3
mobile-detect/index.d.ts
vendored
@@ -18,3 +18,6 @@ declare class MobileDetect {
|
||||
version(value: string): number;
|
||||
versionStr(value: string): string;
|
||||
}
|
||||
|
||||
export = MobileDetect;
|
||||
export as namespace MobileDetect;
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"moment": "2.14.*"
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"moment": "2.14.*"
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
11
moment-timezone/index.d.ts
vendored
11
moment-timezone/index.d.ts
vendored
@@ -20,19 +20,16 @@ declare namespace MomentTimezone {
|
||||
parse(timestamp: number): number
|
||||
}
|
||||
|
||||
type MomentFormatSpecification =
|
||||
string | (() => void) | (string | (() => void))[];
|
||||
|
||||
interface MomentTimezone {
|
||||
(): moment.Moment;
|
||||
(timezone: string): moment.Moment;
|
||||
(date: number, timezone: string): moment.Moment;
|
||||
(date: number[], timezone: string): moment.Moment;
|
||||
(date: string, timezone: string): moment.Moment;
|
||||
(date: string, format: MomentFormatSpecification, timezone: string): moment.Moment;
|
||||
(date: string, format: MomentFormatSpecification, strict: boolean, timezone: string): moment.Moment;
|
||||
(date: string, format: MomentFormatSpecification, language: string, timezone: string): moment.Moment;
|
||||
(date: string, format: MomentFormatSpecification, language: string, strict: boolean, timezone: string): moment.Moment;
|
||||
(date: string, format: moment.MomentFormatSpecification, timezone: string): moment.Moment;
|
||||
(date: string, format: moment.MomentFormatSpecification, strict: boolean, timezone: string): moment.Moment;
|
||||
(date: string, format: moment.MomentFormatSpecification, language: string, timezone: string): moment.Moment;
|
||||
(date: string, format: moment.MomentFormatSpecification, language: string, strict: boolean, timezone: string): moment.Moment;
|
||||
(date: Date, timezone: string): moment.Moment;
|
||||
(date: moment.Moment, timezone: string): moment.Moment;
|
||||
(date: Object, timezone: string): moment.Moment;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"moment": "2.14.*"
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
|
||||
838
ng-table/index.d.ts
vendored
838
ng-table/index.d.ts
vendored
@@ -1,838 +0,0 @@
|
||||
// Type definitions for ng-table
|
||||
// Project: https://github.com/esvit/ng-table
|
||||
// Definitions by: Christian Crowhurst <https://github.com/christianacca>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="angular" />
|
||||
|
||||
/**
|
||||
* Parameters manager for an ngTable directive
|
||||
*/
|
||||
declare class NgTableParams<T> {
|
||||
/**
|
||||
* The page of data rows currently being displayed in the table
|
||||
*/
|
||||
data: T[];
|
||||
|
||||
constructor(baseParameters?: NgTable.IParamValues<T>, baseSettings?: NgTable.ISettings<T>)
|
||||
|
||||
/**
|
||||
* Returns the number of data rows per page
|
||||
*/
|
||||
count(): number
|
||||
/**
|
||||
* Sets the number of data rows per page.
|
||||
* Changes to count will cause `isDataReloadRequired` to return true
|
||||
*/
|
||||
count(count: number): NgTableParams<T>
|
||||
|
||||
/**
|
||||
* Returns the current filter values used to restrict the set of data rows.
|
||||
* @param trim supply true to return the current filter minus any insignificant values
|
||||
* (null, undefined and empty string)
|
||||
*/
|
||||
filter(trim?: boolean): NgTable.IFilterValues
|
||||
/**
|
||||
* Sets filter values to the `filter` supplied; any existing filter will be removed
|
||||
* Changes to filter will cause `isDataReloadRequired` to return true and the current `page` to be set to 1
|
||||
*/
|
||||
filter(filter: NgTable.IFilterValues): NgTableParams<T>
|
||||
/**
|
||||
* Generate array of pages.
|
||||
* When no arguments supplied, the current parameter state of this `NgTableParams` instance will be used
|
||||
*/
|
||||
generatePagesArray(currentPage?: number, totalItems?: number, pageSize?: number, maxBlocks?: number): NgTable.IPageButton[]
|
||||
/**
|
||||
* Returns the current grouping used to group the data rows
|
||||
*/
|
||||
group(): NgTable.Grouping<T>
|
||||
/**
|
||||
* Sets grouping to the `field` and `sortDirection` supplied; any existing grouping will be removed
|
||||
* Changes to group will cause `isDataReloadRequired` to return true and the current `page` to be set to 1
|
||||
*/
|
||||
group(field: string, sortDirection?: string): NgTableParams<T>
|
||||
/**
|
||||
* Sets grouping to the `group` supplied; any existing grouping will be removed.
|
||||
* Changes to group will cause `isDataReloadRequired` to return true and the current `page` to be set to 1
|
||||
*/
|
||||
group(group: NgTable.Grouping<T>): NgTableParams<T>
|
||||
/**
|
||||
* Returns true when an attempt to `reload` the current `parameter` values have resulted in a failure.
|
||||
* This method will continue to return true until the `reload` is successfully called or when the
|
||||
* `parameter` values have changed
|
||||
*/
|
||||
hasErrorState(): boolean
|
||||
/**
|
||||
* Returns true if `filter` has significant filter value(s) (any value except null, undefined, or empty string),
|
||||
* otherwise false
|
||||
*/
|
||||
hasFilter(): boolean
|
||||
/**
|
||||
* Return true when a change to `filters` require the `reload` method
|
||||
* to be run so as to ensure the data presented to the user reflects these filters
|
||||
*/
|
||||
hasFilterChanges(): boolean
|
||||
/**
|
||||
* Returns true when at least one group has been set
|
||||
*/
|
||||
hasGroup(): boolean
|
||||
/**
|
||||
* Returns true when the `group` and when supplied, the `sortDirection` matches an existing group
|
||||
*/
|
||||
hasGroup(group: string | NgTable.IGroupingFunc<T>, sortDirection?: string): boolean
|
||||
/**
|
||||
* Return true when a change to this instance should require the `reload` method
|
||||
* to be run so as to ensure the data rows presented to the user reflects the current state.
|
||||
*
|
||||
* Note that this method will return false when the `reload` method has run but fails. In this case
|
||||
* `hasErrorState` will return true.
|
||||
*
|
||||
* The built-in `ngTable` directives will watch for when this function returns true and will then call
|
||||
* the `reload` method to load its data rows
|
||||
*/
|
||||
isDataReloadRequired(): boolean
|
||||
/**
|
||||
* Returns sorting values in a format that can be consumed by the angular `$orderBy` filter service
|
||||
*/
|
||||
orderBy(): string[]
|
||||
/**
|
||||
* Trigger a reload of the data rows
|
||||
*/
|
||||
reload<TResult extends NgTable.Data.DataResult<T>>(): ng.IPromise<TResult[]>
|
||||
/**
|
||||
* Returns the settings for the table.
|
||||
*/
|
||||
settings(): NgTable.ISettings<T>
|
||||
/**
|
||||
* Sets the settings for the table; new setting values will be merged with the existing settings.
|
||||
* Supplying a new `dataset` will cause `isDataReloadRequired` to return true and the `ngTableEventsChannel`
|
||||
* to fire its `datasetChanged` event
|
||||
*/
|
||||
settings(newSettings: NgTable.ISettings<T>): NgTableParams<T>
|
||||
/**
|
||||
* Returns the current sorting used to order the data rows.
|
||||
* Changes to sorting will cause `isDataReloadRequired` to return true
|
||||
*/
|
||||
sorting(): NgTable.ISortingValues
|
||||
/**
|
||||
* Sets sorting values to the `sorting` supplied; any existing sorting will be removed.
|
||||
* Changes to sorting will cause `isDataReloadRequired` to return true
|
||||
*/
|
||||
sorting(sorting: NgTable.ISortingValues): NgTableParams<T>
|
||||
/**
|
||||
* Sets sorting to the `field` and `direction` supplied; any existing sorting will be removed
|
||||
*/
|
||||
sorting(field: string, direction: string): NgTableParams<T>
|
||||
/**
|
||||
* Returns the index of the current "slice" of data rows
|
||||
*/
|
||||
page(): number
|
||||
/**
|
||||
* Sets the index of the current "slice" of data rows. The index starts at 1.
|
||||
* Changing the page number will cause `isDataReloadRequired` to return true
|
||||
*/
|
||||
page(page: number): NgTableParams<T>
|
||||
/**
|
||||
* Returns the count of the data rows that match the current `filter`
|
||||
*/
|
||||
total(): number
|
||||
/**
|
||||
* Sets `settings().total` to the value supplied.
|
||||
* Typically you will need to set a `total` in the body of any custom `getData` function
|
||||
* you supply as a setting value to this instance.
|
||||
* @example
|
||||
* var tp = new NgTableParams({}, { getData: customGetData })
|
||||
* function customGetData(params) {
|
||||
* var queryResult = /* code to fetch current data rows and total *\/
|
||||
* params.total(queryResult.total);
|
||||
* return queryResult.dataRowsPage;
|
||||
* }
|
||||
*/
|
||||
total(total: number): NgTableParams<T>
|
||||
/**
|
||||
* Returns the current parameter values uri-encoded. Set `asString` to
|
||||
* true for the parameters to be returned as an array of strings of the form 'paramName=value'
|
||||
* otherwise parameters returned as a key-value object
|
||||
*/
|
||||
url(asString?: boolean): { [name: string]: string } | string[]
|
||||
}
|
||||
|
||||
declare namespace NgTable {
|
||||
|
||||
interface IDataSettings {
|
||||
applyPaging?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* An angular value object that allow for overriding of the initial default values used when constructing
|
||||
* an instance of `NgTableParams`
|
||||
*/
|
||||
interface IDefaults {
|
||||
params?: IParamValues<any>;
|
||||
settings?: ISettings<any>
|
||||
}
|
||||
|
||||
/**
|
||||
* Map of the names of fields declared on a data row and the corrosponding filter value
|
||||
*/
|
||||
interface IFilterValues { [name: string]: any }
|
||||
|
||||
/**
|
||||
* Map of the names of fields on a data row and the corrosponding sort direction;
|
||||
* Set the value of a key to undefined to let value of `ISettings.defaultSort` apply
|
||||
*/
|
||||
interface ISortingValues { [name: string]: string }
|
||||
|
||||
type Grouping<T> = IGroupValues | IGroupingFunc<T>;
|
||||
|
||||
/**
|
||||
* Map of the names of fields on a data row and the corrosponding sort direction
|
||||
*/
|
||||
interface IGroupValues { [name: string]: string }
|
||||
|
||||
/**
|
||||
* Signature of a function that should return the name of the group
|
||||
* that the `item` should be placed within
|
||||
*/
|
||||
interface IGroupingFunc<T> {
|
||||
(item: T): string;
|
||||
/**
|
||||
* 'asc' or 'desc'; leave undefined to let the value of `ISettings.groupOptions.defaultSort` apply
|
||||
*/
|
||||
sortDirection?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* The runtime values for `NgTableParams` that determine the set of data rows and
|
||||
* how they are to be displayed in a table
|
||||
*/
|
||||
interface IParamValues<T> {
|
||||
/**
|
||||
* The index of the "slice" of data rows, starting at 1, to be displayed by the table.
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
* The number of data rows per page
|
||||
*/
|
||||
count?: number;
|
||||
/**
|
||||
* The filter that should be applied to restrict the set of data rows
|
||||
*/
|
||||
filter?: IFilterValues;
|
||||
/**
|
||||
* The sort order that should be applied to the data rows.
|
||||
*/
|
||||
sorting?: ISortingValues;
|
||||
/**
|
||||
* The grouping that should be applied to the data rows
|
||||
*/
|
||||
group?: string | Grouping<T>;
|
||||
}
|
||||
|
||||
|
||||
type FilterComparator<T> = boolean | IFilterComparatorFunc<T>;
|
||||
|
||||
interface IFilterComparatorFunc<T> {
|
||||
(actual: T, expected: T): boolean;
|
||||
}
|
||||
|
||||
interface IFilterFunc<T> {
|
||||
(data: T[], filter: IFilterValues, filterComparator: FilterComparator<T>): T[]
|
||||
}
|
||||
|
||||
|
||||
interface IFilterSettings<T> {
|
||||
/**
|
||||
* Use this to determine how items are matched against the filter values.
|
||||
* This setting is identical to the `comparator` parameter supported by the angular
|
||||
* `$filter` filter service
|
||||
*
|
||||
* Defaults to `undefined` which will result in a case insensitive susbstring match when
|
||||
* `IDefaultGetData` service is supplying the implementation for the
|
||||
* `ISettings.getData` function
|
||||
*/
|
||||
filterComparator?: FilterComparator<T>;
|
||||
/**
|
||||
* A duration to wait for the user to stop typing before applying the filter.
|
||||
* - Defaults to 0 for small managed inmemory arrays ie where a `ISettings.dataset` argument is
|
||||
* supplied to `NgTableParams.settings`.
|
||||
* - Defaults to 500 milliseconds otherwise.
|
||||
*/
|
||||
filterDelay?: number;
|
||||
/**
|
||||
* The number of elements up to which a managed inmemory array is considered small. Defaults to 10000.
|
||||
*/
|
||||
filterDelayThreshold?: number;
|
||||
/**
|
||||
* Overrides `IDefaultGetDataProvider.filterFilterName`.
|
||||
* The value supplied should be the name of the angular `$filter` service that will be selected to perform
|
||||
* the actual filter logic.
|
||||
* Defaults to 'filter'.
|
||||
*/
|
||||
filterFilterName?: string;
|
||||
/**
|
||||
* Tells `IDefaultGetData` to use this function supplied to perform the filtering instead of selecting an angular $filter.
|
||||
*/
|
||||
filterFn?: IFilterFunc<T>;
|
||||
/**
|
||||
* The layout to use when multiple html templates are to rendered in a single table header column.
|
||||
* Available values:
|
||||
* - stack (the default)
|
||||
* - horizontal
|
||||
*/
|
||||
filterLayout?: string
|
||||
}
|
||||
|
||||
interface IGroupSettings {
|
||||
/**
|
||||
* The default sort direction that will be used whenever a group is supplied that
|
||||
* does not define its own sort direction
|
||||
*/
|
||||
defaultSort?: string;
|
||||
/**
|
||||
* Determines whether groups should be displayed expanded to show their items. Defaults to true
|
||||
*/
|
||||
isExpanded?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition of the buttons rendered by the data row pager directive
|
||||
*/
|
||||
interface IPageButton {
|
||||
type: string;
|
||||
number?: number;
|
||||
active: boolean;
|
||||
current?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration settings for `NgTableParams`
|
||||
*/
|
||||
interface ISettings<T> {
|
||||
/**
|
||||
* Returns true whenever a call to `getData` is in progress
|
||||
*/
|
||||
$loading?: boolean;
|
||||
/**
|
||||
* An array that contains all the data rows that NgTable should manage.
|
||||
* The `gateData` function will be used to manage the data rows
|
||||
* that ultimately will be displayed.
|
||||
*/
|
||||
dataset?: T[];
|
||||
dataOptions?: {};
|
||||
/**
|
||||
* The total number of data rows before paging has been applied.
|
||||
* Typically you will not need to supply this yourself
|
||||
*/
|
||||
total?: number;
|
||||
/**
|
||||
* The default sort direction that will be used whenever a sorting is supplied that
|
||||
* does not define its own sort direction
|
||||
*/
|
||||
defaultSort?: string;
|
||||
filterOptions?: IFilterSettings<T>;
|
||||
groupOptions?: IGroupSettings;
|
||||
/**
|
||||
* The page size buttons that should be displayed. Each value defined in the array
|
||||
* determines the possible values that can be supplied to `NgTableParams.page()`
|
||||
*/
|
||||
counts?: number[];
|
||||
/**
|
||||
* The collection of interceptors that should apply to the results of a call to
|
||||
* the `getData` function before the data rows are displayed in the table
|
||||
*/
|
||||
interceptors?: IInterceptor<T>[];
|
||||
/**
|
||||
* Configuration for the template that will display the page size buttons
|
||||
*/
|
||||
paginationMaxBlocks?: number;
|
||||
/**
|
||||
* Configuration for the template that will display the page size buttons
|
||||
*/
|
||||
paginationMinBlocks?: number;
|
||||
/**
|
||||
* The html tag that will be used to display the sorting indicator in the table header
|
||||
*/
|
||||
sortingIndicator?: string;
|
||||
/**
|
||||
* The function that will be used fetch data rows. Leave undefined to let the `IDefaultGetData`
|
||||
* service provide a default implementation that will work with the `dataset` array you supply.
|
||||
*
|
||||
* Typically you will supply a custom function when you need to execute filtering, paging and sorting
|
||||
* on the server
|
||||
*/
|
||||
getData?: Data.IGetDataFunc<T> | Data.IInterceptableGetDataFunc<T>;
|
||||
/**
|
||||
* The function that will be used group data rows according to the groupings returned by `NgTableParams.group()`
|
||||
*/
|
||||
getGroups?: Data.IGetGroupFunc<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration values that determine the behaviour of the `ngTableFilterConfig` service
|
||||
*/
|
||||
interface IFilterConfigValues {
|
||||
/**
|
||||
* The default base url to use when deriving the url for a filter template given just an alias name
|
||||
* Defaults to 'ng-table/filters/'
|
||||
*/
|
||||
defaultBaseUrl?: string;
|
||||
/**
|
||||
* The extension to use when deriving the url of a filter template when given just an alias name
|
||||
*/
|
||||
defaultExt?: string;
|
||||
/**
|
||||
* A map of alias names and their corrosponding urls. A lookup against this map will be used
|
||||
* to find the url matching an alias name.
|
||||
* If no match is found then a url will be derived using the following pattern `${defaultBaseUrl}${aliasName}.${defaultExt}`
|
||||
*/
|
||||
aliasUrls?: { [name: string]: string };
|
||||
}
|
||||
|
||||
/**
|
||||
* The angular provider used to configure the behaviour of the `ngTableFilterConfig` service
|
||||
*/
|
||||
interface IFilterConfigProvider {
|
||||
$get: IFilterConfig;
|
||||
/**
|
||||
* Reset back to factory defaults the config values that `ngTableFilterConfig` service will use
|
||||
*/
|
||||
resetConfigs(): void;
|
||||
/**
|
||||
* Set the config values used by `ngTableFilterConfig` service
|
||||
*/
|
||||
setConfig(customConfig: IFilterConfigValues): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* A key value-pair map where the key is the name of a field in a data row and the value is the definition
|
||||
* for the template used to render a filter cell in the header of a html table.
|
||||
* Where the value is supplied as a string this should either be url to a html template or an alias to a url registered
|
||||
* using the `ngTableFilterConfigProvider`
|
||||
* @example
|
||||
* vm.ageFilter = { "age": "number" }
|
||||
* @example
|
||||
* vm.ageFilter = { "age": "my/custom/ageTemplate.html" }
|
||||
* @example
|
||||
* vm.ageFilter = { "age": { id: "number", placeholder: "Age of person"} }
|
||||
*/
|
||||
interface IFilterTemplateDefMap {
|
||||
[name: string]: string | IFilterTemplateDef
|
||||
}
|
||||
|
||||
/**
|
||||
* A fully qualified template definition for a single filter
|
||||
*/
|
||||
interface IFilterTemplateDef {
|
||||
/**
|
||||
* A url to a html template of an alias to a url registered using the `ngTableFilterConfigProvider`
|
||||
*/
|
||||
id: string,
|
||||
/**
|
||||
* The text that should be rendered as a prompt to assist the user when entering a filter value
|
||||
*/
|
||||
placeholder: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Exposes configuration values and methods used to return the location of the html
|
||||
* templates used to render the filter row of an ng-table directive
|
||||
*/
|
||||
interface IFilterConfig {
|
||||
/**
|
||||
* Readonly copy of the final values used to configure the service.
|
||||
*/
|
||||
config: IFilterConfigValues,
|
||||
/**
|
||||
* Return the url of the html filter template for the supplied definition and key.
|
||||
* For more information see the documentation for `IFilterTemplateMap`
|
||||
*/
|
||||
getTemplateUrl(filterDef: string | IFilterTemplateDef, filterKey?: string): string,
|
||||
/**
|
||||
* Return the url of the html filter template registered with the alias supplied
|
||||
*/
|
||||
getUrlForAlias(aliasName: string, filterKey?: string): string
|
||||
}
|
||||
|
||||
interface InternalTableParams<T> extends NgTableParams<T> {
|
||||
isNullInstance: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* A custom object that can be registered with an NgTableParams instance that can be used
|
||||
* to post-process the results (and failures) returned by its `getData` function
|
||||
*/
|
||||
interface IInterceptor<T> {
|
||||
response?: <TData>(data: TData, params: NgTableParams<T>) => TData;
|
||||
responseError?: (reason: any, params: NgTableParams<T>) => any;
|
||||
}
|
||||
|
||||
type SelectData = ISelectOption[] | ISelectDataFunc
|
||||
|
||||
interface ISelectOption {
|
||||
id: string | number;
|
||||
title: string;
|
||||
}
|
||||
|
||||
interface ISelectDataFunc {
|
||||
(): ISelectOption[] | ng.IPromise<ISelectOption[]>
|
||||
}
|
||||
|
||||
/**
|
||||
* Definition of the constructor function that will construct new instances of `NgTableParams`.
|
||||
* On construction of `NgTableParams` the `ngTableEventsChannel` will fire its `afterCreated` event.
|
||||
*/
|
||||
interface ITableParamsConstructor<T> {
|
||||
new (baseParameters?: IParamValues<T>, baseSettings?: ISettings<T>): NgTableParams<T>
|
||||
}
|
||||
|
||||
|
||||
namespace Data {
|
||||
|
||||
type DataResult<T> = T | IDataRowGroup<T>;
|
||||
|
||||
interface IDataRowGroup<T> {
|
||||
data: T[];
|
||||
$hideRows: boolean;
|
||||
value: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* A default implementation of the getData function that will apply the `filter`, `orderBy` and
|
||||
* paging values from the `NgTableParams` instance supplied to the data array supplied.
|
||||
*
|
||||
* A call to this function will:
|
||||
* - return the resulting array
|
||||
* - assign the total item count after filtering to the `total` of the `NgTableParams` instance supplied
|
||||
*/
|
||||
interface IDefaultGetData<T> {
|
||||
(data: T[], params: NgTableParams<T>): T[];
|
||||
/**
|
||||
* Convenience function that this service will use to apply paging to the data rows.
|
||||
*
|
||||
* Returns a slice of rows from the `data` array supplied and sets the `NgTableParams.total()`
|
||||
* on the `params` instance supplied to `data.length`
|
||||
*/
|
||||
applyPaging(data: T[], params: NgTableParams<T>): T[],
|
||||
/**
|
||||
* Returns a reference to the function that this service will use to filter data rows
|
||||
*/
|
||||
getFilterFn(params: NgTableParams<T>): IFilterFunc<T>,
|
||||
/**
|
||||
* Returns a reference to the function that this service will use to sort data rows
|
||||
*/
|
||||
getOrderByFn(params?: NgTableParams<T>): void
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows for the configuration of the ngTableDefaultGetData service.
|
||||
*/
|
||||
interface IDefaultGetDataProvider {
|
||||
$get<T>(): IDefaultGetData<T>;
|
||||
/**
|
||||
* The name of a angular filter that knows how to apply the values returned by
|
||||
* `NgTableParams.filter()` to restrict an array of data.
|
||||
* (defaults to the angular `filter` filter service)
|
||||
*/
|
||||
filterFilterName: string,
|
||||
/**
|
||||
* The name of a angular filter that knows how to apply the values returned by
|
||||
* `NgTableParams.orderBy()` to sort an array of data.
|
||||
* (defaults to the angular `orderBy` filter service)
|
||||
*/
|
||||
sortingFilterName: string
|
||||
}
|
||||
|
||||
interface IGetDataBcShimFunc<T> {
|
||||
(originalFunc: ILegacyGetDataFunc<T>): { (params: NgTableParams<T>): ng.IPromise<T[]> }
|
||||
}
|
||||
|
||||
/**
|
||||
* Signature of a function that will called whenever NgTable requires to load data rows
|
||||
* into the table.
|
||||
* `params` is the table requesting the data rows
|
||||
*/
|
||||
interface IGetDataFunc<T> {
|
||||
(params: NgTableParams<T>): T[] | ng.IPromise<T[]>;
|
||||
}
|
||||
|
||||
interface IGetGroupFunc<T> {
|
||||
(params: NgTableParams<T>): { [name: string]: IDataRowGroup<T>[] }
|
||||
}
|
||||
|
||||
/**
|
||||
* Variation of the `IGetDataFunc` function signature that allows for flexibility for
|
||||
* the shape of the return value.
|
||||
* Typcially you will use this function signature when you want to configure `NgTableParams` with
|
||||
* interceptors that will return the final data rows array.
|
||||
*/
|
||||
interface IInterceptableGetDataFunc<T> {
|
||||
<TResult>(params: NgTableParams<T>): TResult;
|
||||
}
|
||||
|
||||
interface ILegacyGetDataFunc<T> {
|
||||
($defer: ng.IDeferred<T[]>, params: NgTableParams<T>): void
|
||||
}
|
||||
}
|
||||
|
||||
namespace Events {
|
||||
interface IEventSelectorFunc {
|
||||
(publisher: NgTableParams<any>): boolean
|
||||
}
|
||||
|
||||
type EventSelector<T> = NgTableParams<T> | IEventSelectorFunc
|
||||
|
||||
interface IDatasetChangedListener<T> {
|
||||
(publisher: NgTableParams<T>, newDataset: T[], oldDataset: T[]): any
|
||||
}
|
||||
interface IAfterCreatedListener {
|
||||
(publisher: NgTableParams<any>): any
|
||||
}
|
||||
interface IAfterReloadDataListener<T> {
|
||||
(publisher: NgTableParams<T>, newData: NgTable.Data.DataResult<T>[], oldData: NgTable.Data.DataResult<T>[]): any
|
||||
}
|
||||
interface IPagesChangedListener {
|
||||
(publisher: NgTableParams<any>, newPages: NgTable.IPageButton[], oldPages: NgTable.IPageButton[]): any
|
||||
}
|
||||
|
||||
interface IUnregistrationFunc {
|
||||
(): void
|
||||
}
|
||||
|
||||
interface IEventsChannel {
|
||||
/**
|
||||
* Subscribe to receive notification whenever a new `NgTableParams` instance has finished being constructed.
|
||||
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a
|
||||
* `scope` to have angular automatically unregister the listener when the `scope` is destroyed.
|
||||
*
|
||||
* @param listener the function that will be called when the event fires
|
||||
* @param scope the angular `$scope` that will limit the lifetime of the event subscription
|
||||
* @param eventFilter a predicate function that should return true to receive the event
|
||||
* @return a unregistration function that when called will unregister the `listener`
|
||||
*/
|
||||
onAfterCreated(listener: Events.IAfterCreatedListener, scope: ng.IScope, eventFilter?: Events.IEventSelectorFunc): IUnregistrationFunc;
|
||||
/**
|
||||
* Subscribe to receive notification whenever a new `NgTableParams` instance has finished being constructed.
|
||||
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called.
|
||||
*
|
||||
* @param listener the function that will be called when the event fires
|
||||
* @param eventFilter a predicate function that should return true to receive the event
|
||||
* @return a unregistration function that when called will unregister the `listener`
|
||||
*/
|
||||
onAfterCreated(listener: Events.IAfterCreatedListener, eventFilter?: Events.IEventSelectorFunc): IUnregistrationFunc;
|
||||
/**
|
||||
* Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed
|
||||
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a
|
||||
* `scope` to have angular automatically unregister the listener when the `scope` is destroyed.
|
||||
*
|
||||
* @param listener the function that will be called when the event fires
|
||||
* @param scope the angular `$scope` that will limit the lifetime of the event subscription
|
||||
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
|
||||
* @return a unregistration function that when called will unregister the `listener`
|
||||
*/
|
||||
onAfterReloadData<T>(listener: Events.IAfterReloadDataListener<T>, scope: ng.IScope, eventFilter?: Events.EventSelector<T>): IUnregistrationFunc;
|
||||
/**
|
||||
* Subscribe to receive notification whenever the `reload` method of an `NgTableParams` instance has successfully executed
|
||||
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called.
|
||||
*
|
||||
* @param listener the function that will be called when the event fires
|
||||
* @param eventFilter a predicate function that should return true to receive the event
|
||||
* @return a unregistration function that when called will unregister the `listener`
|
||||
*/
|
||||
onAfterReloadData<T>(listener: Events.IAfterReloadDataListener<T>, eventFilter?: Events.EventSelector<T>): IUnregistrationFunc;
|
||||
|
||||
/**
|
||||
* Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance.
|
||||
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a
|
||||
* `scope` to have angular automatically unregister the listener when the `scope` is destroyed.
|
||||
*
|
||||
* @param listener the function that will be called when the event fires
|
||||
* @param scope the angular `$scope` that will limit the lifetime of the event subscription
|
||||
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
|
||||
* @return a unregistration function that when called will unregister the `listener`
|
||||
*/
|
||||
onDatasetChanged<T>(listener: Events.IDatasetChangedListener<T>, scope: ng.IScope, eventFilter?: Events.EventSelector<T>): IUnregistrationFunc;
|
||||
/**
|
||||
* Subscribe to receive notification whenever a new data rows *array* is supplied as a `settings` value to a `NgTableParams` instance.
|
||||
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called.
|
||||
*
|
||||
* @param listener the function that will be called when the event fires
|
||||
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
|
||||
* @return a unregistration function that when called will unregister the `listener`
|
||||
*/
|
||||
onDatasetChanged<T>(listener: Events.IDatasetChangedListener<T>, eventFilter?: Events.EventSelector<T>): IUnregistrationFunc;
|
||||
|
||||
/**
|
||||
* Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change
|
||||
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called. Supply a
|
||||
* `scope` to have angular automatically unregister the listener when the `scope` is destroyed.
|
||||
*
|
||||
* @param listener the function that will be called when the event fires
|
||||
* @param scope the angular `$scope` that will limit the lifetime of the event subscription
|
||||
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
|
||||
* @return a unregistration function that when called will unregister the `listener`
|
||||
*/
|
||||
onPagesChanged<T>(listener: Events.IPagesChangedListener, scope: ng.IScope, eventFilter?: Events.EventSelector<T>): IUnregistrationFunc;
|
||||
/**
|
||||
* Subscribe to receive notification whenever the paging buttons for an `NgTableParams` instance change
|
||||
* Optionally supply an `eventFilter` to restrict which events that should trigger the `listener` to be called.
|
||||
*
|
||||
* @param listener the function that will be called when the event fires
|
||||
* @param eventFilter either the specific `NgTableParams` instance you want to receive events for or a predicate function that should return true to receive the event
|
||||
* @return a unregistration function that when called will unregister the `listener`
|
||||
*/
|
||||
onPagesChanged<T>(listener: Events.IPagesChangedListener, eventFilter?: Events.EventSelector<T>): IUnregistrationFunc;
|
||||
|
||||
publishAfterCreated<T>(publisher: NgTableParams<T>): void;
|
||||
publishAfterReloadData<T>(publisher: NgTableParams<T>, newData: T[], oldData: T[]): void;
|
||||
publishDatasetChanged<T>(publisher: NgTableParams<T>, newDataset: T[], oldDataset: T[]): void;
|
||||
publishPagesChanged<T>(publisher: NgTableParams<T>, newPages: NgTable.IPageButton[], oldPages: NgTable.IPageButton[]): void;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Columns {
|
||||
|
||||
type ColumnFieldContext = ng.IScope & {
|
||||
$column: IColumnDef;
|
||||
$columns: IColumnDef[];
|
||||
}
|
||||
|
||||
interface IColumnField<T> {
|
||||
(context?: ColumnFieldContext): T;
|
||||
assign($scope: ng.IScope, value: T): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* The definition of the column within a ngTable.
|
||||
* When using `ng-table` directive a column definition will be parsed from each `td` tag found in the
|
||||
* `tr` data row tag.
|
||||
*
|
||||
* @example
|
||||
* <tr>
|
||||
* <td data-title="'Name of User'" filter="{ username: 'text'}" sortable="'username'" />
|
||||
* <td data-title="'Age of User'" filter="{ age: 'number'}" sortable="'age'" />
|
||||
* </tr>
|
||||
*/
|
||||
interface IColumnDef {
|
||||
/**
|
||||
* Custom CSS class that should be added to the `th` tag(s) of this column in the table header
|
||||
*
|
||||
* To set this on the `td` tag of a html table use the attribute `header-class` or `data-header-class`
|
||||
*/
|
||||
class: IColumnField<string>;
|
||||
/**
|
||||
* The `ISelectOption`s that can be used in a html filter template for this colums.
|
||||
*/
|
||||
data?: SelectData;
|
||||
/**
|
||||
* The index position of this column within the `$columns` container array
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* The definition of 0 or more html filter templates that should be rendered for this column in
|
||||
* the table header
|
||||
*/
|
||||
filter: IColumnField<IFilterTemplateDefMap>;
|
||||
/**
|
||||
* Supplies the `ISelectOption`s that can be used in a html filter template for this colums.
|
||||
* At the creation of the `NgTableParams` this field will be called and the result then assigned
|
||||
* to the `data` field of this column.
|
||||
*/
|
||||
filterData: IColumnField<ng.IPromise<SelectData> | SelectData>;
|
||||
/**
|
||||
* The name of the data row field that will be used to group on, or false when this column
|
||||
* does not support grouping
|
||||
*/
|
||||
groupable: IColumnField<string | boolean>;
|
||||
/**
|
||||
* The url of a custom html template that should be used to render a table header for this column
|
||||
*
|
||||
* To set this on the `td` tag for a html table use the attribute `header` or `data-header`
|
||||
*/
|
||||
headerTemplateURL: IColumnField<string | boolean>;
|
||||
/**
|
||||
* The text that should be used as a tooltip for this column in the table header
|
||||
*/
|
||||
headerTitle: IColumnField<string>;
|
||||
/**
|
||||
* Determines whether this column should be displayed in the table
|
||||
*
|
||||
* To set this on the `td` tag for a html table use the attribute `ng-if`
|
||||
*/
|
||||
show: IColumnField<boolean>;
|
||||
/**
|
||||
* The name of the data row field that will be used to sort on, or false when this column
|
||||
* does not support sorting
|
||||
*/
|
||||
sortable: IColumnField<string | boolean>;
|
||||
/**
|
||||
* The title of this column that should be displayed in the table header
|
||||
*/
|
||||
title: IColumnField<string>;
|
||||
/**
|
||||
* An alternate column title. Typically this can be used for responsive table layouts
|
||||
* where the titleAlt should be used for small screen sizes
|
||||
*/
|
||||
titleAlt: IColumnField<string>;
|
||||
}
|
||||
|
||||
type DynamicTableColField<T> = IDynamicTableColFieldFunc<T> | T;
|
||||
|
||||
interface IDynamicTableColFieldFunc<T> {
|
||||
(context: ColumnFieldContext): T;
|
||||
}
|
||||
|
||||
/**
|
||||
* The definition of the column supplied to a ngTableDynamic directive.
|
||||
*/
|
||||
interface IDynamicTableColDef {
|
||||
/**
|
||||
* Custom CSS class that should be added to the `th` tag(s) of this column in the table header
|
||||
*/
|
||||
class?: DynamicTableColField<string>;
|
||||
/**
|
||||
* The definition of 0 or more html filter templates that should be rendered for this column in
|
||||
* the table header
|
||||
*/
|
||||
filter?: DynamicTableColField<IFilterTemplateDefMap>;
|
||||
/**
|
||||
* Supplies the `ISelectOption`s that can be used in a html filter template for this colums.
|
||||
* At the creation of the `NgTableParams` this field will be called and the result then assigned
|
||||
* to the `data` field of this column.
|
||||
*/
|
||||
filterData?: DynamicTableColField<ng.IPromise<SelectData> | SelectData>;
|
||||
/**
|
||||
* The name of the data row field that will be used to group on, or false when this column
|
||||
* does not support grouping
|
||||
*/
|
||||
groupable?: DynamicTableColField<string | boolean>;
|
||||
/**
|
||||
* The url of a custom html template that should be used to render a table header for this column
|
||||
*/
|
||||
headerTemplateURL?: DynamicTableColField<string | boolean>;
|
||||
/**
|
||||
* The text that should be used as a tooltip for this column in the table header
|
||||
*/
|
||||
headerTitle?: DynamicTableColField<string>;
|
||||
/**
|
||||
* Determines whether this column should be displayed in the table
|
||||
*/
|
||||
show?: DynamicTableColField<boolean>;
|
||||
/**
|
||||
* The name of the data row field that will be used to sort on, or false when this column
|
||||
* does not support sorting
|
||||
*/
|
||||
sortable?: DynamicTableColField<string|boolean>;
|
||||
/**
|
||||
* The title of this column that should be displayed in the table header
|
||||
*/
|
||||
title?: DynamicTableColField<string>;
|
||||
/**
|
||||
* An alternate column title. Typically this can be used for responsive table layouts
|
||||
* where the titleAlt should be used for small screen sizes
|
||||
*/
|
||||
titleAlt?: DynamicTableColField<string>;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
|
||||
|
||||
interface IPerson {
|
||||
age: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
function printPerson(p: IPerson) {
|
||||
console.log('age: ' + p.age);
|
||||
console.log('name: ' + p.name);
|
||||
}
|
||||
|
||||
// NgTableParams signature tests
|
||||
namespace NgTableParamsTests {
|
||||
|
||||
let initialParams: NgTable.IParamValues<IPerson> = {
|
||||
filter: { name: 'Christian' },
|
||||
sorting: { age: 'asc' }
|
||||
};
|
||||
let settings: NgTable.ISettings<IPerson> = {
|
||||
dataset: [{ age: 1, name: 'Christian' }, { age: 2, name: 'Lee' }, { age: 40, name: 'Christian' }],
|
||||
filterOptions: {
|
||||
filterComparator: true,
|
||||
filterDelay: 100
|
||||
},
|
||||
counts: [10, 20, 50]
|
||||
};
|
||||
|
||||
export let tableParams = new NgTableParams(initialParams, settings);
|
||||
|
||||
// modify parameters
|
||||
tableParams.filter({ name: 'Lee' });
|
||||
tableParams.sorting('age', 'desc');
|
||||
tableParams.count(10);
|
||||
tableParams.group(item => (item.age * 10).toString());
|
||||
|
||||
// modify settings at runtime
|
||||
tableParams.settings({
|
||||
dataset: [{ age: 1, name: 'Brandon' }, { age: 2, name: 'Lee' }]
|
||||
});
|
||||
|
||||
tableParams.reload<IPerson>().then(rows => {
|
||||
rows.forEach(printPerson);
|
||||
});
|
||||
}
|
||||
|
||||
// Dynamic table column signature tests
|
||||
namespace ColumnTests {
|
||||
interface ICustomColFields {
|
||||
field: string;
|
||||
}
|
||||
let dynamicCols: (NgTable.Columns.IDynamicTableColDef & ICustomColFields)[];
|
||||
|
||||
dynamicCols.push({
|
||||
class: () => 'table',
|
||||
field: 'age',
|
||||
filter: { age: 'number' },
|
||||
sortable: true,
|
||||
show: true,
|
||||
title: 'Age of Person',
|
||||
titleAlt: 'Age'
|
||||
});
|
||||
}
|
||||
|
||||
namespace EventsTests {
|
||||
declare let events: NgTable.Events.IEventsChannel;
|
||||
|
||||
let unregistrationFuncs: NgTable.Events.IUnregistrationFunc[] = [];
|
||||
let x: NgTable.Events.IUnregistrationFunc;
|
||||
|
||||
x = events.onAfterCreated(params => {
|
||||
// do stuff
|
||||
});
|
||||
unregistrationFuncs.push(x);
|
||||
|
||||
x = events.onAfterReloadData((params, newData, oldData) => {
|
||||
newData.forEach(row => {
|
||||
if (isDataGroup(row)) {
|
||||
row.data.forEach(printPerson)
|
||||
} else {
|
||||
printPerson(row);
|
||||
}
|
||||
});
|
||||
}, NgTableParamsTests.tableParams);
|
||||
unregistrationFuncs.push(x);
|
||||
|
||||
x = events.onDatasetChanged((params, newDataset, oldDataset) => {
|
||||
if (newDataset != null) {
|
||||
newDataset.forEach(printPerson);
|
||||
}
|
||||
}, NgTableParamsTests.tableParams);
|
||||
unregistrationFuncs.push(x);
|
||||
|
||||
x = events.onPagesChanged((params, newButtons, oldButtons) => {
|
||||
newButtons.forEach(printPageButton);
|
||||
}, NgTableParamsTests.tableParams);
|
||||
unregistrationFuncs.push(x);
|
||||
|
||||
unregistrationFuncs.forEach(f => {
|
||||
f();
|
||||
});
|
||||
|
||||
|
||||
function printPageButton(btn: NgTable.IPageButton) {
|
||||
console.log('type: ' + btn.type);
|
||||
console.log('number: ' + btn['number']);
|
||||
console.log('current: ' + btn.current);
|
||||
console.log('active: ' + btn.active);
|
||||
}
|
||||
|
||||
function isDataGroup(row: any): row is NgTable.Data.IDataRowGroup<any> {
|
||||
return ('$hideRows' in row);
|
||||
}
|
||||
}
|
||||
7
node-forge/index.d.ts
vendored
7
node-forge/index.d.ts
vendored
@@ -34,4 +34,11 @@ declare module "node-forge" {
|
||||
export function generateKeyPair(options?: GenerateKeyPairOptions, callback?: (err: Error, keypair: KeyPair) => void): KeyPair;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace ssh {
|
||||
/**
|
||||
* Encodes a private RSA key as an OpenSSH file.
|
||||
*/
|
||||
export function privateKeyToOpenSSH(privateKey?: string, passphrase?: string): string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,3 +3,5 @@ import * as forge from "node-forge";
|
||||
let keypair = forge.pki.rsa.generateKeyPair({bits: 512});
|
||||
let privateKeyPem = forge.pki.privateKeyToPem(keypair.privateKey);
|
||||
let publicKeyPem = forge.pki.publicKeyToPem(keypair.publicKey);
|
||||
|
||||
let x: string = forge.ssh.privateKeyToOpenSSH();
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
"typingsPackageName": "moment",
|
||||
"sourceRepoURL": "https://github.com/moment/moment",
|
||||
"asOfVersion": "2.13.0"
|
||||
},
|
||||
{
|
||||
"libraryName": "ng-table",
|
||||
"typingsPackageName": "ng-table",
|
||||
"sourceRepoURL": "https://github.com/esvit/ng-table",
|
||||
"asOfVersion": "2.0.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
4
openlayers/index.d.ts
vendored
4
openlayers/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for OpenLayers v3.6.0
|
||||
// Type definitions for OpenLayers v3.18.2
|
||||
// Project: http://openlayers.org/
|
||||
// Definitions by: Olivier Sechet <https://github.com/osechet>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -13786,4 +13786,4 @@ declare module olx {
|
||||
|
||||
declare module "openlayers" {
|
||||
export = ol;
|
||||
}
|
||||
}
|
||||
|
||||
1251
oracledb/index.d.ts
vendored
1251
oracledb/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@@ -13,20 +13,20 @@ initScene = function() {
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
renderer.shadowMapEnabled = true;
|
||||
renderer.shadowMapSoft = true;
|
||||
// // renderer.shadowMapSoft = true;
|
||||
document.getElementById( 'viewport' ).appendChild( renderer.domElement );
|
||||
|
||||
render_stats = new Stats();
|
||||
render_stats.domElement.style.position = 'absolute';
|
||||
render_stats.domElement.style.top = '1px';
|
||||
render_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.domElement );
|
||||
render_stats.dom.style.position = 'absolute';
|
||||
render_stats.dom.style.top = '1px';
|
||||
render_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.dom );
|
||||
|
||||
physics_stats = new Stats();
|
||||
physics_stats.domElement.style.position = 'absolute';
|
||||
physics_stats.domElement.style.top = '50px';
|
||||
physics_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.domElement );
|
||||
physics_stats.dom.style.position = 'absolute';
|
||||
physics_stats.dom.style.top = '50px';
|
||||
physics_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.dom );
|
||||
|
||||
scene = new Physijs.Scene();
|
||||
scene.setGravity(new THREE.Vector3( 0, -30, 0 ));
|
||||
@@ -62,7 +62,7 @@ initScene = function() {
|
||||
light.shadowCameraFar = 200;
|
||||
light.shadowBias = -.0001
|
||||
light.shadowMapWidth = light.shadowMapHeight = 2048;
|
||||
light.shadowDarkness = .7;
|
||||
//// light.shadowDarkness = .7;
|
||||
scene.add( light );
|
||||
|
||||
// Materials
|
||||
@@ -71,16 +71,16 @@ initScene = function() {
|
||||
.8, // high friction
|
||||
.4 // low restitution
|
||||
);
|
||||
ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
ground_material.map.repeat.set( 3, 3 );
|
||||
// ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// ground_material.map.repeat.set( 3, 3 );
|
||||
|
||||
box_material = Physijs.createMaterial(
|
||||
new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/plywood.jpg' ) }),
|
||||
.4, // low friction
|
||||
.6 // high restitution
|
||||
);
|
||||
box_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
box_material.map.repeat.set( .25, .25 );
|
||||
// box_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// box_material.map.repeat.set( .25, .25 );
|
||||
|
||||
// Ground
|
||||
ground = new Physijs.BoxMesh(
|
||||
@@ -131,8 +131,8 @@ render = function() {
|
||||
setMousePosition = function( evt ) {
|
||||
// Find where mouse cursor intersects the ground plane
|
||||
var vector = new THREE.Vector3(
|
||||
( evt.clientX / renderer.domElement.clientWidth ) * 2 - 1,
|
||||
-( ( evt.clientY / renderer.domElement.clientHeight ) * 2 - 1 ),
|
||||
( evt.clientX / renderer.dom.clientWidth ) * 2 - 1,
|
||||
-( ( evt.clientY / renderer.dom.clientHeight ) * 2 - 1 ),
|
||||
.5
|
||||
);
|
||||
projector.unprojectVector( vector, camera );
|
||||
|
||||
@@ -12,20 +12,20 @@ initScene = function() {
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
renderer.shadowMapEnabled = true;
|
||||
renderer.shadowMapSoft = true;
|
||||
// // renderer.shadowMapSoft = true;
|
||||
document.getElementById( 'viewport' ).appendChild( renderer.domElement );
|
||||
|
||||
render_stats = new Stats();
|
||||
render_stats.domElement.style.position = 'absolute';
|
||||
render_stats.domElement.style.top = '0px';
|
||||
render_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.domElement );
|
||||
render_stats.dom.style.position = 'absolute';
|
||||
render_stats.dom.style.top = '0px';
|
||||
render_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.dom );
|
||||
|
||||
physics_stats = new Stats();
|
||||
physics_stats.domElement.style.position = 'absolute';
|
||||
physics_stats.domElement.style.top = '50px';
|
||||
physics_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.domElement );
|
||||
physics_stats.dom.style.position = 'absolute';
|
||||
physics_stats.dom.style.top = '50px';
|
||||
physics_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.dom );
|
||||
|
||||
scene = new Physijs.Scene;
|
||||
scene.setGravity(new THREE.Vector3( 0, -30, 0 ));
|
||||
@@ -60,7 +60,7 @@ initScene = function() {
|
||||
light.shadowCameraFar = 200;
|
||||
light.shadowBias = -.0001
|
||||
light.shadowMapWidth = light.shadowMapHeight = 2048;
|
||||
light.shadowDarkness = .7;
|
||||
//// light.shadowDarkness = .7;
|
||||
scene.add( light );
|
||||
|
||||
// Ground
|
||||
@@ -69,8 +69,8 @@ initScene = function() {
|
||||
.8, // high friction
|
||||
.3 // low restitution
|
||||
);
|
||||
ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
ground_material.map.repeat.set( 3, 3 );
|
||||
//ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// ground_material.map.repeat.set( 3, 3 );
|
||||
|
||||
ground = new Physijs.BoxMesh(
|
||||
new THREE.BoxGeometry(100, 1, 100),
|
||||
@@ -89,7 +89,7 @@ initScene = function() {
|
||||
spawnBox = (function() {
|
||||
|
||||
var box_geometry = new THREE.BoxGeometry( 4, 4, 4 ),
|
||||
handleCollision = function( collided_with, linearVelocity, angularVelocity ) {
|
||||
handleCollision = function( collided_with ) {
|
||||
var target = <any>this;
|
||||
target.collisions = 0;
|
||||
switch (++target.collisions) {
|
||||
@@ -127,8 +127,8 @@ spawnBox = (function() {
|
||||
.6, // medium friction
|
||||
.3 // low restitution
|
||||
);
|
||||
material.map.wrapS = material.map.wrapT = THREE.RepeatWrapping;
|
||||
material.map.repeat.set( .5, .5 );
|
||||
// material.map.wrapS = material.map.wrapT = THREE.RepeatWrapping;
|
||||
// material.map.repeat.set( .5, .5 );
|
||||
|
||||
//material = new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/rocks.jpg' ) });
|
||||
|
||||
@@ -137,7 +137,7 @@ spawnBox = (function() {
|
||||
material
|
||||
);
|
||||
|
||||
box.collisions = 0;
|
||||
// box.collisions = 0;
|
||||
|
||||
box.position.set(
|
||||
Math.random() * 15 - 7.5,
|
||||
|
||||
@@ -12,20 +12,20 @@ initScene = function() {
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
renderer.shadowMapEnabled = true;
|
||||
renderer.shadowMapSoft = true;
|
||||
// renderer.shadowMapSoft = true;
|
||||
document.getElementById( 'viewport' ).appendChild( renderer.domElement );
|
||||
|
||||
render_stats = new Stats();
|
||||
render_stats.domElement.style.position = 'absolute';
|
||||
render_stats.domElement.style.top = '0px';
|
||||
render_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.domElement );
|
||||
render_stats.dom.style.position = 'absolute';
|
||||
render_stats.dom.style.top = '0px';
|
||||
render_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.dom );
|
||||
|
||||
physics_stats = new Stats();
|
||||
physics_stats.domElement.style.position = 'absolute';
|
||||
physics_stats.domElement.style.top = '50px';
|
||||
physics_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.domElement );
|
||||
physics_stats.dom.style.position = 'absolute';
|
||||
physics_stats.dom.style.top = '50px';
|
||||
physics_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.dom );
|
||||
|
||||
scene = new Physijs.Scene;
|
||||
scene.setGravity(new THREE.Vector3( 0, -50, 0 ));
|
||||
@@ -60,7 +60,7 @@ initScene = function() {
|
||||
light.shadowCameraFar = 200;
|
||||
light.shadowBias = -.0001
|
||||
light.shadowMapWidth = light.shadowMapHeight = 2048;
|
||||
light.shadowDarkness = .7;
|
||||
// light.shadowDarkness = .7;
|
||||
scene.add( light );
|
||||
|
||||
// Materials
|
||||
@@ -69,16 +69,16 @@ initScene = function() {
|
||||
.8, // high friction
|
||||
.4 // low restitution
|
||||
);
|
||||
ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
ground_material.map.repeat.set( 3, 3 );
|
||||
// ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// ground_material.map.repeat.set( 3, 3 );
|
||||
|
||||
chair_material = Physijs.createMaterial(
|
||||
new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/wood.jpg' ) }),
|
||||
.6, // medium friction
|
||||
.2 // low restitution
|
||||
);
|
||||
chair_material.map.wrapS = chair_material.map.wrapT = THREE.RepeatWrapping;
|
||||
chair_material.map.repeat.set( .25, .25 );
|
||||
// chair_material.map.wrapS = chair_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// chair_material.map.repeat.set( .25, .25 );
|
||||
|
||||
// Ground
|
||||
ground = new Physijs.BoxMesh(
|
||||
|
||||
@@ -14,20 +14,20 @@ initScene = function() {
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
renderer.shadowMapEnabled = true;
|
||||
renderer.shadowMapSoft = true;
|
||||
// // renderer.shadowMapSoft = true;
|
||||
document.getElementById( 'viewport' ).appendChild( renderer.domElement );
|
||||
|
||||
render_stats = new Stats();
|
||||
render_stats.domElement.style.position = 'absolute';
|
||||
render_stats.domElement.style.top = '0px';
|
||||
render_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.domElement );
|
||||
render_stats.dom.style.position = 'absolute';
|
||||
render_stats.dom.style.top = '0px';
|
||||
render_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.dom );
|
||||
|
||||
physics_stats = new Stats();
|
||||
physics_stats.domElement.style.position = 'absolute';
|
||||
physics_stats.domElement.style.top = '50px';
|
||||
physics_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.domElement );
|
||||
physics_stats.dom.style.position = 'absolute';
|
||||
physics_stats.dom.style.top = '50px';
|
||||
physics_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.dom );
|
||||
|
||||
scene = new Physijs.Scene;
|
||||
scene.setGravity(new THREE.Vector3( 0, -30, 0 ));
|
||||
@@ -62,7 +62,7 @@ initScene = function() {
|
||||
light.shadowCameraFar = 200;
|
||||
light.shadowBias = -.0001
|
||||
light.shadowMapWidth = light.shadowMapHeight = 2048;
|
||||
light.shadowDarkness = .7;
|
||||
//// light.shadowDarkness = .7;
|
||||
scene.add( light );
|
||||
|
||||
// Materials
|
||||
@@ -71,8 +71,8 @@ initScene = function() {
|
||||
.8, // high friction
|
||||
.4 // low restitution
|
||||
);
|
||||
ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
ground_material.map.repeat.set( 3, 3 );
|
||||
// ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// ground_material.map.repeat.set( 3, 3 );
|
||||
|
||||
// Ground
|
||||
ground = new Physijs.BoxMesh(
|
||||
|
||||
@@ -17,20 +17,20 @@ initScene = function() {
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
renderer.shadowMapEnabled = true;
|
||||
renderer.shadowMapSoft = true;
|
||||
// // renderer.shadowMapSoft = true;
|
||||
document.getElementById( 'viewport' ).appendChild( renderer.domElement );
|
||||
|
||||
render_stats = new Stats();
|
||||
render_stats.domElement.style.position = 'absolute';
|
||||
render_stats.domElement.style.top = '0px';
|
||||
render_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.domElement );
|
||||
render_stats.dom.style.position = 'absolute';
|
||||
render_stats.dom.style.top = '0px';
|
||||
render_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.dom );
|
||||
|
||||
physics_stats = new Stats();
|
||||
physics_stats.domElement.style.position = 'absolute';
|
||||
physics_stats.domElement.style.top = '50px';
|
||||
physics_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.domElement );
|
||||
physics_stats.dom.style.position = 'absolute';
|
||||
physics_stats.dom.style.top = '50px';
|
||||
physics_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.dom );
|
||||
|
||||
scene = new Physijs.Scene({ fixedTimeStep: 1 / 120 });
|
||||
scene.setGravity(new THREE.Vector3( 0, -30, 0 ));
|
||||
@@ -65,7 +65,7 @@ initScene = function() {
|
||||
light.shadowCameraFar = 200;
|
||||
light.shadowBias = -.0001
|
||||
light.shadowMapWidth = light.shadowMapHeight = 2048;
|
||||
light.shadowDarkness = .7;
|
||||
// // light.shadowDarkness = .7;
|
||||
scene.add( light );
|
||||
|
||||
// Materials
|
||||
@@ -74,8 +74,8 @@ initScene = function() {
|
||||
.8, // high friction
|
||||
.4 // low restitution
|
||||
);
|
||||
ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
ground_material.map.repeat.set( 2.5, 2.5 );
|
||||
// ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// ground_material.map.repeat.set( 2.5, 2.5 );
|
||||
|
||||
// Ground
|
||||
NoiseGen = new SimplexNoise;
|
||||
@@ -155,7 +155,7 @@ createShape = (function() {
|
||||
break;
|
||||
}
|
||||
|
||||
shape.material.color.setRGB( Math.random() * 100 / 100, Math.random() * 100 / 100, Math.random() * 100 / 100 );
|
||||
// shape.material.color.setRGB( Math.random() * 100 / 100, Math.random() * 100 / 100, Math.random() * 100 / 100 );
|
||||
shape.castShadow = true;
|
||||
shape.receiveShadow = true;
|
||||
|
||||
|
||||
@@ -12,20 +12,20 @@ initScene = function() {
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
renderer.shadowMapEnabled = true;
|
||||
renderer.shadowMapSoft = true;
|
||||
// // renderer.shadowMapSoft = true;
|
||||
document.getElementById( 'viewport' ).appendChild( renderer.domElement );
|
||||
|
||||
render_stats = new Stats();
|
||||
render_stats.domElement.style.position = 'absolute';
|
||||
render_stats.domElement.style.top = '1px';
|
||||
render_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.domElement );
|
||||
render_stats.dom.style.position = 'absolute';
|
||||
render_stats.dom.style.top = '1px';
|
||||
render_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.dom );
|
||||
|
||||
physics_stats = new Stats();
|
||||
physics_stats.domElement.style.position = 'absolute';
|
||||
physics_stats.domElement.style.top = '50px';
|
||||
physics_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.domElement );
|
||||
physics_stats.dom.style.position = 'absolute';
|
||||
physics_stats.dom.style.top = '50px';
|
||||
physics_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.dom );
|
||||
|
||||
scene = new Physijs.Scene({ fixedTimeStep: 1 / 120 });
|
||||
scene.setGravity(new THREE.Vector3( 0, -30, 0 ));
|
||||
@@ -78,7 +78,7 @@ initScene = function() {
|
||||
dir_light.shadowCameraFar = 200;
|
||||
dir_light.shadowBias = -.001
|
||||
dir_light.shadowMapWidth = dir_light.shadowMapHeight = 2048;
|
||||
dir_light.shadowDarkness = .5;
|
||||
// dir_light.shadowDarkness = .5;
|
||||
scene.add( dir_light );
|
||||
|
||||
// Materials
|
||||
@@ -87,16 +87,16 @@ initScene = function() {
|
||||
.9, // high friction
|
||||
.2 // low restitution
|
||||
);
|
||||
table_material.map.wrapS = table_material.map.wrapT = THREE.RepeatWrapping;
|
||||
table_material.map.repeat.set( 5, 5 );
|
||||
// table_material.map.wrapS = table_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// table_material.map.repeat.set( 5, 5 );
|
||||
|
||||
block_material = Physijs.createMaterial(
|
||||
new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/plywood.jpg' ) }),
|
||||
.4, // medium friction
|
||||
.4 // medium restitution
|
||||
);
|
||||
block_material.map.wrapS = block_material.map.wrapT = THREE.RepeatWrapping;
|
||||
block_material.map.repeat.set( 1, .5 );
|
||||
// block_material.map.wrapS = block_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// block_material.map.repeat.set( 1, .5 );
|
||||
|
||||
// Table
|
||||
table = new Physijs.BoxMesh(
|
||||
@@ -179,10 +179,10 @@ initEventHandling = (function() {
|
||||
selected_block = intersections[0].object;
|
||||
|
||||
_vector.set( 0, 0, 0 );
|
||||
selected_block.setAngularFactor( _vector );
|
||||
selected_block.setAngularVelocity( _vector );
|
||||
selected_block.setLinearFactor( _vector );
|
||||
selected_block.setLinearVelocity( _vector );
|
||||
// selected_block.setAngularFactor( _vector );
|
||||
// selected_block.setAngularVelocity( _vector );
|
||||
// selected_block.setLinearFactor( _vector );
|
||||
// selected_block.setLinearVelocity( _vector );
|
||||
|
||||
mouse_pos.copy( intersections[0].point );
|
||||
block_offset.subVectors( selected_block.position, mouse_pos );
|
||||
@@ -225,9 +225,9 @@ initEventHandling = (function() {
|
||||
};
|
||||
|
||||
return function() {
|
||||
renderer.domElement.addEventListener( 'mousedown', handleMouseDown );
|
||||
renderer.domElement.addEventListener( 'mousemove', handleMouseMove );
|
||||
renderer.domElement.addEventListener( 'mouseup', handleMouseUp );
|
||||
renderer.dom.addEventListener( 'mousedown', handleMouseDown );
|
||||
renderer.dom.addEventListener( 'mousemove', handleMouseMove );
|
||||
renderer.dom.addEventListener( 'mouseup', handleMouseUp );
|
||||
};
|
||||
})();
|
||||
|
||||
|
||||
@@ -17,20 +17,20 @@ initScene = function() {
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
renderer.shadowMapEnabled = true;
|
||||
renderer.shadowMapSoft = true;
|
||||
// // renderer.shadowMapSoft = true;
|
||||
document.getElementById( 'viewport' ).appendChild( renderer.domElement );
|
||||
|
||||
render_stats = new Stats();
|
||||
render_stats.domElement.style.position = 'absolute';
|
||||
render_stats.domElement.style.top = '0px';
|
||||
render_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.domElement );
|
||||
render_stats.dom.style.position = 'absolute';
|
||||
render_stats.dom.style.top = '0px';
|
||||
render_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.dom );
|
||||
|
||||
physics_stats = new Stats();
|
||||
physics_stats.domElement.style.position = 'absolute';
|
||||
physics_stats.domElement.style.top = '50px';
|
||||
physics_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.domElement );
|
||||
physics_stats.dom.style.position = 'absolute';
|
||||
physics_stats.dom.style.top = '50px';
|
||||
physics_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.dom );
|
||||
|
||||
scene = new Physijs.Scene;
|
||||
scene.setGravity(new THREE.Vector3( 0, -30, 0 ));
|
||||
@@ -81,7 +81,7 @@ initScene = function() {
|
||||
light.shadowCameraFar = 200;
|
||||
light.shadowBias = -.0001
|
||||
light.shadowMapWidth = light.shadowMapHeight = 2048;
|
||||
light.shadowDarkness = .7;
|
||||
// // light.shadowDarkness = .7;
|
||||
scene.add( light );
|
||||
|
||||
// Ground
|
||||
@@ -90,8 +90,8 @@ initScene = function() {
|
||||
.8, // high friction
|
||||
.3 // low restitution
|
||||
);
|
||||
ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
ground_material.map.repeat.set( 3, 3 );
|
||||
// ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// ground_material.map.repeat.set( 3, 3 );
|
||||
|
||||
ground = new Physijs.BoxMesh(
|
||||
new THREE.BoxGeometry(100, 1, 100),
|
||||
@@ -119,7 +119,7 @@ spawnBox = (function() {
|
||||
.3 // low restitution
|
||||
);
|
||||
|
||||
material.color.setRGB(Math.random() * 100 / 100, Math.random() * 100 / 100, Math.random() * 100 / 100);
|
||||
// material.color.setRGB(Math.random() * 100 / 100, Math.random() * 100 / 100, Math.random() * 100 / 100);
|
||||
|
||||
box = new Physijs.BoxMesh(
|
||||
box_geometry,
|
||||
@@ -130,8 +130,8 @@ spawnBox = (function() {
|
||||
material
|
||||
);
|
||||
|
||||
childBox.collisions = 0;
|
||||
box.collisions = 0;
|
||||
// childBox.collisions = 0;
|
||||
// box.collisions = 0;
|
||||
box.add(childBox);
|
||||
|
||||
box.position.set(
|
||||
|
||||
@@ -17,20 +17,20 @@ initScene = function() {
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
renderer.shadowMapEnabled = true;
|
||||
renderer.shadowMapSoft = true;
|
||||
// renderer.shadowMapSoft = true;
|
||||
document.getElementById( 'viewport' ).appendChild( renderer.domElement );
|
||||
|
||||
render_stats = new Stats();
|
||||
render_stats.domElement.style.position = 'absolute';
|
||||
render_stats.domElement.style.top = '0px';
|
||||
render_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.domElement );
|
||||
render_stats.dom.style.position = 'absolute';
|
||||
render_stats.dom.style.top = '0px';
|
||||
render_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.dom );
|
||||
|
||||
physics_stats = new Stats();
|
||||
physics_stats.domElement.style.position = 'absolute';
|
||||
physics_stats.domElement.style.top = '50px';
|
||||
physics_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.domElement );
|
||||
physics_stats.dom.style.position = 'absolute';
|
||||
physics_stats.dom.style.top = '50px';
|
||||
physics_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.dom );
|
||||
|
||||
scene = new Physijs.Scene;
|
||||
scene.setGravity(new THREE.Vector3( 0, -30, 0 ));
|
||||
@@ -81,7 +81,7 @@ initScene = function() {
|
||||
light.shadowCameraFar = 200;
|
||||
light.shadowBias = -.0001
|
||||
light.shadowMapWidth = light.shadowMapHeight = 2048;
|
||||
light.shadowDarkness = .7;
|
||||
// light.shadowDarkness = .7;
|
||||
scene.add( light );
|
||||
|
||||
// Ground
|
||||
@@ -90,8 +90,8 @@ initScene = function() {
|
||||
.8, // high friction
|
||||
.3 // low restitution
|
||||
);
|
||||
ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
ground_material.map.repeat.set( 3, 3 );
|
||||
// ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// ground_material.map.repeat.set( 3, 3 );
|
||||
|
||||
ground = new Physijs.BoxMesh(
|
||||
new THREE.BoxGeometry(100, 1, 100),
|
||||
@@ -119,13 +119,13 @@ spawnBox = (function() {
|
||||
.3 // low restitution
|
||||
);
|
||||
|
||||
material.color.setRGB(Math.random() * 100 / 100, Math.random() * 100 / 100, Math.random() * 100 / 100);
|
||||
// material.color.setRGB(Math.random() * 100 / 100, Math.random() * 100 / 100, Math.random() * 100 / 100);
|
||||
|
||||
box = new Physijs.ConvexMesh(
|
||||
box_geometry,
|
||||
material
|
||||
);
|
||||
box.collisions = 0;
|
||||
// box.collisions = 0;
|
||||
|
||||
box.position.set(
|
||||
Math.random() * 15 - 7.5,
|
||||
|
||||
@@ -17,20 +17,20 @@ initScene = function() {
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
renderer.shadowMapEnabled = true;
|
||||
renderer.shadowMapSoft = true;
|
||||
// renderer.shadowMapSoft = true;
|
||||
document.getElementById( 'viewport' ).appendChild( renderer.domElement );
|
||||
|
||||
render_stats = new Stats();
|
||||
render_stats.domElement.style.position = 'absolute';
|
||||
render_stats.domElement.style.top = '0px';
|
||||
render_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.domElement );
|
||||
render_stats.dom.style.position = 'absolute';
|
||||
render_stats.dom.style.top = '0px';
|
||||
render_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.dom );
|
||||
|
||||
physics_stats = new Stats();
|
||||
physics_stats.domElement.style.position = 'absolute';
|
||||
physics_stats.domElement.style.top = '50px';
|
||||
physics_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.domElement );
|
||||
physics_stats.dom.style.position = 'absolute';
|
||||
physics_stats.dom.style.top = '50px';
|
||||
physics_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.dom );
|
||||
|
||||
scene = new Physijs.Scene;
|
||||
scene.setGravity(new THREE.Vector3( 0, -30, 0 ));
|
||||
@@ -81,7 +81,7 @@ initScene = function() {
|
||||
light.shadowCameraFar = 200;
|
||||
light.shadowBias = -.0001
|
||||
light.shadowMapWidth = light.shadowMapHeight = 2048;
|
||||
light.shadowDarkness = .7;
|
||||
// light.shadowDarkness = .7;
|
||||
scene.add( light );
|
||||
|
||||
// Ground
|
||||
@@ -90,8 +90,8 @@ initScene = function() {
|
||||
.8, // high friction
|
||||
.3 // low restitution
|
||||
);
|
||||
ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
ground_material.map.repeat.set( 3, 3 );
|
||||
// ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// ground_material.map.repeat.set( 3, 3 );
|
||||
|
||||
ground = new Physijs.BoxMesh(
|
||||
new THREE.BoxGeometry(100, 1, 100),
|
||||
@@ -119,13 +119,13 @@ spawnBox = (function() {
|
||||
.3 // low restitution
|
||||
);
|
||||
|
||||
material.color.setRGB(Math.random() * 100 / 100, Math.random() * 100 / 100, Math.random() * 100 / 100);
|
||||
// material.color.setRGB(Math.random() * 100 / 100, Math.random() * 100 / 100, Math.random() * 100 / 100);
|
||||
|
||||
box = new Physijs.BoxMesh(
|
||||
box_geometry,
|
||||
material
|
||||
);
|
||||
box.collisions = 0;
|
||||
// box.collisions = 0;
|
||||
|
||||
box.position.set(
|
||||
Math.random() * 15 - 7.5,
|
||||
|
||||
@@ -18,20 +18,20 @@ initScene = function() {
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
renderer.shadowMapEnabled = true;
|
||||
renderer.shadowMapSoft = true;
|
||||
// renderer.shadowMapSoft = true;
|
||||
document.getElementById( 'viewport' ).appendChild( renderer.domElement );
|
||||
|
||||
render_stats = new Stats();
|
||||
render_stats.domElement.style.position = 'absolute';
|
||||
render_stats.domElement.style.top = '0px';
|
||||
render_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.domElement );
|
||||
render_stats.dom.style.position = 'absolute';
|
||||
render_stats.dom.style.top = '0px';
|
||||
render_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.dom );
|
||||
|
||||
physics_stats = new Stats();
|
||||
physics_stats.domElement.style.position = 'absolute';
|
||||
physics_stats.domElement.style.top = '50px';
|
||||
physics_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.domElement );
|
||||
physics_stats.dom.style.position = 'absolute';
|
||||
physics_stats.dom.style.top = '50px';
|
||||
physics_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.dom );
|
||||
|
||||
scene = new Physijs.Scene({ fixedTimeStep: 1 / 120 });
|
||||
scene.setGravity(new THREE.Vector3( 0, -30, 0 ));
|
||||
@@ -66,7 +66,7 @@ initScene = function() {
|
||||
light.shadowCameraFar = 200;
|
||||
light.shadowBias = -.0001
|
||||
light.shadowMapWidth = light.shadowMapHeight = 2048;
|
||||
light.shadowDarkness = .7;
|
||||
// light.shadowDarkness = .7;
|
||||
scene.add( light );
|
||||
|
||||
// Materials
|
||||
@@ -75,8 +75,8 @@ initScene = function() {
|
||||
.8, // high friction
|
||||
.4 // low restitution
|
||||
);
|
||||
ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
ground_material.map.repeat.set( 2.5, 2.5 );
|
||||
// ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// ground_material.map.repeat.set( 2.5, 2.5 );
|
||||
|
||||
// Ground
|
||||
ground = new Physijs.BoxMesh(
|
||||
@@ -204,7 +204,7 @@ createShape = (function() {
|
||||
break;
|
||||
}
|
||||
|
||||
shape.material.color.setRGB( Math.random() * 100 / 100, Math.random() * 100 / 100, Math.random() * 100 / 100 );
|
||||
// shape.material.color.setRGB( Math.random() * 100 / 100, Math.random() * 100 / 100, Math.random() * 100 / 100 );
|
||||
shape.castShadow = true;
|
||||
shape.receiveShadow = true;
|
||||
|
||||
|
||||
@@ -18,20 +18,20 @@ initScene = function() {
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
renderer.setSize( window.innerWidth, window.innerHeight );
|
||||
renderer.shadowMapEnabled = true;
|
||||
renderer.shadowMapSoft = true;
|
||||
// renderer.shadowMapSoft = true;
|
||||
document.getElementById( 'viewport' ).appendChild( renderer.domElement );
|
||||
|
||||
render_stats = new Stats();
|
||||
render_stats.domElement.style.position = 'absolute';
|
||||
render_stats.domElement.style.top = '1px';
|
||||
render_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.domElement );
|
||||
render_stats.dom.style.position = 'absolute';
|
||||
render_stats.dom.style.top = '1px';
|
||||
render_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( render_stats.dom );
|
||||
|
||||
physics_stats = new Stats();
|
||||
physics_stats.domElement.style.position = 'absolute';
|
||||
physics_stats.domElement.style.top = '50px';
|
||||
physics_stats.domElement.style.zIndex = 100;
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.domElement );
|
||||
physics_stats.dom.style.position = 'absolute';
|
||||
physics_stats.dom.style.top = '50px';
|
||||
physics_stats.dom.style.zIndex = '100';
|
||||
document.getElementById( 'viewport' ).appendChild( physics_stats.dom );
|
||||
|
||||
scene = new Physijs.Scene;
|
||||
scene.setGravity(new THREE.Vector3( 0, -30, 0 ));
|
||||
@@ -84,7 +84,7 @@ initScene = function() {
|
||||
light.shadowCameraFar = 400;
|
||||
light.shadowBias = -.0001
|
||||
light.shadowMapWidth = light.shadowMapHeight = 2048;
|
||||
light.shadowDarkness = .7;
|
||||
// light.shadowDarkness = .7;
|
||||
scene.add( light );
|
||||
|
||||
|
||||
@@ -97,16 +97,16 @@ initScene = function() {
|
||||
.8, // high friction
|
||||
.4 // low restitution
|
||||
);
|
||||
ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
ground_material.map.repeat.set( 3, 3 );
|
||||
// ground_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// ground_material.map.repeat.set( 3, 3 );
|
||||
|
||||
box_material = Physijs.createMaterial(
|
||||
new THREE.MeshLambertMaterial({ map: THREE.ImageUtils.loadTexture( 'images/plywood.jpg' ) }),
|
||||
.4, // low friction
|
||||
.6 // high restitution
|
||||
);
|
||||
box_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
box_material.map.repeat.set( .25, .25 );
|
||||
// box_material.map.wrapS = ground_material.map.wrapT = THREE.RepeatWrapping;
|
||||
// box_material.map.repeat.set( .25, .25 );
|
||||
|
||||
// Ground
|
||||
var NoiseGen = new SimplexNoise;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"moment": "2.14.*"
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
|
||||
111
random-js/index.d.ts
vendored
111
random-js/index.d.ts
vendored
@@ -3,60 +3,67 @@
|
||||
// Definitions by: Gustavo Di Pietro <https://github.com/pistacchio>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare namespace random {
|
||||
export function Engine(): number;
|
||||
export interface Engine {
|
||||
|
||||
}
|
||||
declare module TemporaryName {
|
||||
|
||||
export interface Engine {
|
||||
|
||||
export function MT19937 (): number;
|
||||
export interface MT19937 extends Engine{
|
||||
seed (value: number): Engine;
|
||||
seedWithArray(array: Array<number>): Engine
|
||||
autoSeed(): Engine;
|
||||
discard(count: number): Engine;
|
||||
getUseCount(): Engine;
|
||||
}
|
||||
}
|
||||
|
||||
export class Random {
|
||||
constructor (engine?: Engine);
|
||||
export interface MT19937 extends Engine{
|
||||
seed (value: number): Engine;
|
||||
seedWithArray(array: Array<number>): Engine
|
||||
autoSeed(): Engine;
|
||||
discard(count: number): Engine;
|
||||
getUseCount(): Engine;
|
||||
}
|
||||
|
||||
static engines: {
|
||||
nativeMath: Engine,
|
||||
browserCrypto: Engine,
|
||||
mt19937: () => MT19937
|
||||
}
|
||||
|
||||
static integer(min: number, max: number): (engine: Engine) => number;
|
||||
static real(min: number, max: number, inclusive: boolean): (engine: Engine) => number;
|
||||
static bool(percentage?: number): (engine: Engine) => boolean;
|
||||
static bool(numerator: number, denominator: number): (engine: Engine) => boolean;
|
||||
static pick<T>(engine: Engine, array: Array<T>, begin?: number, end?: number): T;
|
||||
static picker<T>(array: Array<T>, begin?: number, end?: number): (engine: Engine) => T;
|
||||
static shuffle<T>(engine: Engine, array: Array<T>): Array<T>;
|
||||
static sample<T>(engine: Engine, population: Array<T>, sampleSize: number): Array<T>;
|
||||
static die(sideCount: number): (engine: Engine) => number;
|
||||
static dice(sideCount: number, dieCount: number): (engine: Engine) => number;
|
||||
static uuid4(engine: Engine): string;
|
||||
static string(engine: Engine, length: number): string;
|
||||
static string(pool: string, length: number): (engine: Engine, length: number) => string;
|
||||
static hex(upperCase?: boolean): (engine: Engine, length: number) => string;
|
||||
static date(start: Date, end: Date): (engine: Engine) => Date;
|
||||
|
||||
integer(min: number, max: number): number;
|
||||
real(min: number, max: number, inclusive: boolean): number;
|
||||
bool(percentage?: number): (engine: Engine) => boolean;
|
||||
bool(numerator: number, denominator: number): boolean;
|
||||
pick<T>(engine: Engine, array: Array<T>, begin?: number, end?: number): T;
|
||||
picker<T>(array: Array<T>, begin?: number, end?: number): (engine: Engine) => T;
|
||||
shuffle<T>(engine: Engine, array: Array<T>): Array<T>;
|
||||
sample<T>(engine: Engine, population: Array<T>, sampleSize: number): Array<T>;
|
||||
die(sideCount: number): (engine: Engine) => number;
|
||||
dice(sideCount: number, dieCount: number): number;
|
||||
uuid4(engine: Engine): string;
|
||||
string(engine: Engine, length: number): string;
|
||||
string(pool: string, length: number): string;
|
||||
hex(upperCase?: boolean): string;
|
||||
date(start: Date, end: Date): Date;
|
||||
}
|
||||
}
|
||||
|
||||
declare class TemporaryName {
|
||||
constructor (engine?: TemporaryName.Engine);
|
||||
|
||||
static engines: {
|
||||
nativeMath: TemporaryName.Engine,
|
||||
browserCrypto: TemporaryName.Engine,
|
||||
mt19937: () => TemporaryName.MT19937
|
||||
}
|
||||
|
||||
static Engine(): number;
|
||||
static MT19937 (): number;
|
||||
|
||||
static integer(min: number, max: number): (engine: TemporaryName.Engine) => number;
|
||||
static real(min: number, max: number, inclusive: boolean): (engine: TemporaryName.Engine) => number;
|
||||
static bool(percentage?: number): (engine: TemporaryName.Engine) => boolean;
|
||||
static bool(numerator: number, denominator: number): (engine: TemporaryName.Engine) => boolean;
|
||||
static pick<T>(engine: TemporaryName.Engine, array: Array<T>, begin?: number, end?: number): T;
|
||||
static picker<T>(array: Array<T>, begin?: number, end?: number): (engine: TemporaryName.Engine) => T;
|
||||
static shuffle<T>(engine: TemporaryName.Engine, array: Array<T>): Array<T>;
|
||||
static sample<T>(engine: TemporaryName.Engine, population: Array<T>, sampleSize: number): Array<T>;
|
||||
static die(sideCount: number): (engine: TemporaryName.Engine) => number;
|
||||
static dice(sideCount: number, dieCount: number): (engine: TemporaryName.Engine) => number;
|
||||
static uuid4(engine: TemporaryName.Engine): string;
|
||||
static string(engine: TemporaryName.Engine, length: number): string;
|
||||
static string(pool: string, length: number): (engine: TemporaryName.Engine, length: number) => string;
|
||||
static hex(upperCase?: boolean): (engine: TemporaryName.Engine, length: number) => string;
|
||||
static date(start: Date, end: Date): (engine: TemporaryName.Engine) => Date;
|
||||
|
||||
integer(min: number, max: number): number;
|
||||
real(min: number, max: number, inclusive: boolean): number;
|
||||
bool(percentage?: number): (engine: TemporaryName.Engine) => boolean;
|
||||
bool(numerator: number, denominator: number): boolean;
|
||||
pick<T>(engine: TemporaryName.Engine, array: Array<T>, begin?: number, end?: number): T;
|
||||
picker<T>(array: Array<T>, begin?: number, end?: number): (engine: TemporaryName.Engine) => T;
|
||||
shuffle<T>(engine: TemporaryName.Engine, array: Array<T>): Array<T>;
|
||||
sample<T>(engine: TemporaryName.Engine, population: Array<T>, sampleSize: number): Array<T>;
|
||||
die(sideCount: number): (engine: TemporaryName.Engine) => number;
|
||||
dice(sideCount: number, dieCount: number): number;
|
||||
uuid4(engine: TemporaryName.Engine): string;
|
||||
string(engine: TemporaryName.Engine, length: number): string;
|
||||
string(pool: string, length: number): string;
|
||||
hex(upperCase?: boolean): string;
|
||||
date(start: Date, end: Date): Date;
|
||||
}
|
||||
|
||||
export = TemporaryName;
|
||||
export as namespace Random;
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
// Examples taken from the documentation at https://github.com/ckknight/random-js
|
||||
// create a Mersenne Twister-19937 that is auto-seeded based on time and other random values
|
||||
import Engine = random.Engine;
|
||||
import Random = random.Random;
|
||||
import Engine = Random.Engine;
|
||||
|
||||
var engine: Engine = Random.engines.mt19937().autoSeed();
|
||||
// create a distribution that will consistently produce integers within inclusive range [0, 99].
|
||||
29
random-js/random-js-commonjs-tests.ts
Normal file
29
random-js/random-js-commonjs-tests.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/// <reference types="node"/>
|
||||
|
||||
import Random = require('random-js');
|
||||
|
||||
// Examples taken from the documentation at https://github.com/ckknight/random-js
|
||||
// create a Mersenne Twister-19937 that is auto-seeded based on time and other random values
|
||||
import Engine = Random.Engine;
|
||||
|
||||
var engine: Engine = Random.engines.mt19937().autoSeed();
|
||||
// create a distribution that will consistently produce integers within inclusive range [0, 99].
|
||||
var distribution: Function = Random.integer(0, 99);
|
||||
// generate a number that is guaranteed to be within [0, 99] without any particular bias.
|
||||
function generateNaturalLessThan100(): number {
|
||||
return distribution(engine);
|
||||
}
|
||||
|
||||
// using essentially Math.random()
|
||||
var engine2: Engine = Random.engines.nativeMath;
|
||||
// lower-case Hex string distribution
|
||||
var distribution2: Function = Random.hex(false);
|
||||
// generate a 40-character hex string
|
||||
function generateSHA1(): string {
|
||||
return distribution(40);
|
||||
}
|
||||
|
||||
var r: Random = new Random(Random.engines.mt19937().seedWithArray([0x12345678, 0x90abcdef]));
|
||||
var value = r.integer(0, 99);
|
||||
|
||||
r = new Random(); // same as new Random(Random.engines.nativeMath)
|
||||
@@ -14,6 +14,7 @@
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"random-js-tests.ts"
|
||||
"random-js-ambient-tests.ts",
|
||||
"random-js-commonjs-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"moment": "2.14.*"
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"scripts": {
|
||||
"postinstall": "cd ../moment-range && npm install"
|
||||
}
|
||||
}
|
||||
"dependencies": {
|
||||
"moment": ">=2.14.0"
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,9 @@
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"paths": {
|
||||
"*": ["*", "react-daterange-picker/node_modules/*"]
|
||||
},
|
||||
"types": ["moment-range", "react"],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
|
||||
6
samchon-collection/samchon-collection.d.ts
vendored
6
samchon-collection/samchon-collection.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Samchon Collection v0.0.2
|
||||
// Type definitions for Samchon Collection v0.0.4
|
||||
// Project: https://github.com/samchon/framework
|
||||
// Definitions by: Jeongho Nam <http://samchon.org>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
declare module "samchon-collection"
|
||||
{
|
||||
import collection = samchon.collection;
|
||||
export = collection;
|
||||
import collections = samchon.collections;
|
||||
export = collections;
|
||||
}
|
||||
|
||||
|
||||
10266
samchon-framework/index.d.ts
vendored
10266
samchon-framework/index.d.ts
vendored
File diff suppressed because it is too large
Load Diff
4
selenium-webdriver/index.d.ts
vendored
4
selenium-webdriver/index.d.ts
vendored
@@ -2174,7 +2174,7 @@ declare namespace webdriver {
|
||||
* {@code fn}.
|
||||
* @template TYPE, SELF
|
||||
*/
|
||||
function map<T>(arr: Array<T>|Promise<Array<T>>, fn: (self: any, type: any, index: number, array: any[]) => any, opt_self?: any): Promise<T[]>
|
||||
function map<T>(arr: Array<T>|Promise<Array<T>>, fn: (self: any, type: any, index: number, array: T[]) => any, opt_self?: any): Promise<any[]>
|
||||
|
||||
/**
|
||||
* Creates a promise that has been rejected with the given reason.
|
||||
@@ -2250,7 +2250,7 @@ declare namespace webdriver {
|
||||
* rejected.
|
||||
* @return {!ManagedPromise} A new promise.
|
||||
*/
|
||||
function when<T,R>(value: T|Promise<T>, opt_callback?: (value: T) => any, opt_errback?: (error: any) => any): Promise<R>;
|
||||
function when<T>(value: T|Promise<T>, opt_callback?: (value: T) => any, opt_errback?: (error: any) => any): Promise<any>;
|
||||
|
||||
/**
|
||||
* Returns a promise that will be resolved with the input value in a
|
||||
|
||||
152
simplesmtp/index.d.ts
vendored
Normal file
152
simplesmtp/index.d.ts
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
// Type definitions for simplesmtp 0.3.35
|
||||
// Project: https://github.com/andris9/simplesmtp
|
||||
// Definitions by: Rogier Schouten <https://github.com/rogierschouten/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import events = require("events");
|
||||
|
||||
export interface SmtpServerOptions {
|
||||
/**
|
||||
* the hostname of the server, will be used for informational messages
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* if set to true, print out messages about the connection
|
||||
*/
|
||||
debug?: boolean;
|
||||
/**
|
||||
* client timeout in milliseconds, defaults to 60 000
|
||||
*/
|
||||
timeout?: number;
|
||||
/**
|
||||
* start a server on secure connection
|
||||
*/
|
||||
secureConnection?: boolean;
|
||||
/**
|
||||
* greeting banner that is sent to the client on connection
|
||||
*/
|
||||
SMTPBanner?: string;
|
||||
/**
|
||||
* if set to true, require that the client must authenticate itself
|
||||
*/
|
||||
requireAuthentication?: boolean;
|
||||
/**
|
||||
* if set to true, client may authenticate itself but don't have to
|
||||
*/
|
||||
enableAuthentication?: boolean;
|
||||
/**
|
||||
* maximum size of an e-mail in bytes
|
||||
*/
|
||||
maxSize?: number;
|
||||
/**
|
||||
* TLS credentials
|
||||
*/
|
||||
credentials?: any;
|
||||
/**
|
||||
* allowed authentication methods, defaults to <code>['PLAIN', 'LOGIN']</code>
|
||||
*/
|
||||
authMethods?: string[];
|
||||
/**
|
||||
* if set, support HELO only
|
||||
*/
|
||||
disableEHLO?: boolean;
|
||||
/**
|
||||
* if set, allow client do not use STARTTLS
|
||||
*/
|
||||
ignoreTLS?: boolean;
|
||||
/**
|
||||
* if set, do not validate sender domains
|
||||
*/
|
||||
disableDNSValidation?: boolean;
|
||||
/**
|
||||
* if set, limit the number of simultaneous connections to the server
|
||||
*/
|
||||
maxClients?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Constructs a SMTP server</p>
|
||||
*
|
||||
* @constructor
|
||||
* @namespace SMTP Server module
|
||||
* @param {Object} [options] Options object
|
||||
*/
|
||||
export class SMTPServer extends events.EventEmitter {
|
||||
|
||||
constructor(options?: SmtpServerOptions);
|
||||
|
||||
/**
|
||||
* Server starts listening on defined port and hostname
|
||||
*
|
||||
* @param {Number} port The port number to listen
|
||||
* @param {String} [host] The hostname to listen
|
||||
* @param {Function} callback The callback function to run when the server is listening
|
||||
*/
|
||||
public listen(port: number, host: string, callback?: (error: Error) => void): void;
|
||||
|
||||
/**
|
||||
* <p>Closes the server</p>
|
||||
*
|
||||
* @param {Function} callback The callback function to run when the server is closed
|
||||
*/
|
||||
public end(callback: () => void): void;
|
||||
|
||||
|
||||
}
|
||||
|
||||
export class SimpleServer extends events.EventEmitter {
|
||||
|
||||
constructor(callback?: (connection: SimpleServerConnection) => void);
|
||||
constructor(options?: SmtpServerOptions, callback?: (connection: SimpleServerConnection) => void);
|
||||
|
||||
|
||||
public server: SMTPServer;
|
||||
|
||||
/**
|
||||
* Server starts listening on defined port and hostname
|
||||
*
|
||||
* @param {Number} port The port number to listen
|
||||
* @param {String} [host] The hostname to listen
|
||||
* @param {Function} callback The callback function to run when the server is listening
|
||||
*/
|
||||
public listen(port: number, host: string, callback?: (error: Error) => void): void;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Events:
|
||||
* 'data' (chunk) - A chunk (Buffer) of the message.
|
||||
* 'end' - The message has been transferred
|
||||
*/
|
||||
export interface SimpleServerConnection extends NodeJS.ReadableStream {
|
||||
/**
|
||||
* From address
|
||||
*/
|
||||
from: string;
|
||||
/**
|
||||
* an array of To addresses
|
||||
*/
|
||||
to: string[];
|
||||
/**
|
||||
* hostname reported by the client
|
||||
*/
|
||||
host: string;
|
||||
/**
|
||||
* client IP address
|
||||
*/
|
||||
remoteAddress: string;
|
||||
/**
|
||||
* Accept the message with the selected ID
|
||||
*/
|
||||
accept(id?: string): void;
|
||||
/**
|
||||
* Reject the message with the selected message
|
||||
*/
|
||||
reject(reason?: string): void;
|
||||
}
|
||||
|
||||
|
||||
export function createSimpleServer(callback?: (connection: SimpleServerConnection) => void): SimpleServer;
|
||||
export function createSimpleServer(options?: SmtpServerOptions, callback?: (connection: SimpleServerConnection) => void): SimpleServer;
|
||||
30
simplesmtp/simplesmtp-tests.ts
Normal file
30
simplesmtp/simplesmtp-tests.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
|
||||
import simplesmtp = require("simplesmtp");
|
||||
|
||||
let server: simplesmtp.SimpleServer;
|
||||
|
||||
server = simplesmtp.createSimpleServer({
|
||||
disableDNSValidation: true,
|
||||
enableAuthentication: true,
|
||||
requireAuthentication: false,
|
||||
name: "localhost",
|
||||
secureConnection: false,
|
||||
SMTPBanner: "Hoi dit is de test server",
|
||||
timeout: this.timeout,
|
||||
ignoreTLS: true
|
||||
}, (req: simplesmtp.SimpleServerConnection) => {
|
||||
req.on("data", (chunk: Buffer): void => {
|
||||
//
|
||||
});
|
||||
req.on("end", (): void => {
|
||||
//
|
||||
});
|
||||
req.accept("12");
|
||||
});
|
||||
this._server.server.on("authorizeUser",
|
||||
(envelope: any, username: string|Buffer, password: string, callback: (error: Error, success: boolean) => void
|
||||
): void => {
|
||||
callback(null, true);
|
||||
});
|
||||
this._server.listen(this.port, "0.0.0.0", (error?: Error): void => {
|
||||
});
|
||||
19
simplesmtp/tsconfig.json
Normal file
19
simplesmtp/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": false,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"simplesmtp-tests.ts"
|
||||
]
|
||||
}
|
||||
45
temp/index.d.ts
vendored
45
temp/index.d.ts
vendored
@@ -8,34 +8,45 @@
|
||||
import * as temp from "temp";
|
||||
import * as fs from "fs";
|
||||
|
||||
export interface OpenFile {
|
||||
path: string;
|
||||
fd: number;
|
||||
}
|
||||
|
||||
export interface Stats {
|
||||
files: number;
|
||||
dirs: number;
|
||||
}
|
||||
|
||||
export interface AffixOptions {
|
||||
prefix?: string;
|
||||
suffix?: string;
|
||||
dir?: string;
|
||||
prefix?: string;
|
||||
suffix?: string;
|
||||
dir?: string;
|
||||
}
|
||||
|
||||
export declare var dir: string;
|
||||
|
||||
export declare function track(value?: boolean): typeof temp;
|
||||
|
||||
export declare function mkdir(affixes: string, callback?: (err: any, dirPath: string) => void): void;
|
||||
export declare function mkdir(affixes: AffixOptions, callback?: (err: any, dirPath: string) => void): void;
|
||||
export declare function mkdir(affixes?: string, callback?: (err: any, dirPath: string) => void): void;
|
||||
export declare function mkdir(affixes?: AffixOptions, callback?: (err: any, dirPath: string) => void): void;
|
||||
|
||||
export declare function mkdirSync(affixes: string): string;
|
||||
export declare function mkdirSync(affixes: AffixOptions): string;
|
||||
export declare function mkdirSync(affixes?: string): string;
|
||||
export declare function mkdirSync(affixes?: AffixOptions): string;
|
||||
|
||||
export declare function open(affixes: string, callback?: (err: any, result: { path: string, fd: number }) => void): void;
|
||||
export declare function open(affixes: AffixOptions, callback?: (err: any, result: { path: string, fd: number }) => void): void;
|
||||
export declare function open(affixes?: string, callback?: (err: any, result: OpenFile) => void): void;
|
||||
export declare function open(affixes?: AffixOptions, callback?: (err: any, result: OpenFile) => void): void;
|
||||
|
||||
export declare function openSync(affixes: string): { path: string, fd: number };
|
||||
export declare function openSync(affixes: AffixOptions): { path: string, fd: number };
|
||||
export declare function openSync(affixes?: string): OpenFile;
|
||||
export declare function openSync(affixes?: AffixOptions): OpenFile;
|
||||
|
||||
export declare function path(affixes: string, defaultPrefix?: string): string;
|
||||
export declare function path(affixes: AffixOptions, defaultPrefix?: string): string;
|
||||
export declare function path(affixes?: string, defaultPrefix?: string): string;
|
||||
export declare function path(affixes?: AffixOptions, defaultPrefix?: string): string;
|
||||
|
||||
export declare function cleanup(callback?: (result: boolean | { files: number, dirs?: number }) => void): void;
|
||||
export declare function cleanup(callback?: (result: boolean | Stats) => void): void;
|
||||
|
||||
export declare function cleanupSync(): boolean | { files: number, dirs: number };
|
||||
export declare function cleanupSync(): boolean | Stats;
|
||||
|
||||
export declare function createWriteStream(affixes?: string): fs.WriteStream;
|
||||
export declare function createWriteStream(affixes?: AffixOptions): fs.WriteStream;
|
||||
|
||||
export declare function createWriteStream(affixes: string): fs.WriteStream;
|
||||
export declare function createWriteStream(affixes: AffixOptions): fs.WriteStream;
|
||||
|
||||
@@ -16,7 +16,7 @@ function testCleanup() {
|
||||
}
|
||||
|
||||
function testCleanupSync() {
|
||||
const cleanupResult = temp.cleanupSync()
|
||||
const cleanupResult: boolean | temp.Stats = temp.cleanupSync()
|
||||
if (typeof cleanupResult === "boolean") {
|
||||
const x = cleanupResult === true;
|
||||
}
|
||||
@@ -42,13 +42,14 @@ function testOpen() {
|
||||
}
|
||||
|
||||
function testOpenSync() {
|
||||
const { fd: openFd1, path: openPath1 } = temp.openSync({ dir: "tempDir", prefix: "pref", suffix: "suff" });
|
||||
const { fd: openFd2, path: openPath2 } = temp.openSync("str");
|
||||
const f1: temp.OpenFile = temp.openSync({ dir: "tempDir", prefix: "pref", suffix: "suff" });
|
||||
const f2: temp.OpenFile = temp.openSync("str");
|
||||
}
|
||||
|
||||
function testCreateWriteStream() {
|
||||
const stream = temp.createWriteStream("HelloStreamAffix");
|
||||
stream.write("data");
|
||||
const stream2 = temp.createWriteStream();
|
||||
}
|
||||
|
||||
function testMkdir() {
|
||||
@@ -73,4 +74,4 @@ function testTrack() {
|
||||
const tempChained = temp.track().track(true).track(false);
|
||||
tempChained.dir;
|
||||
tempChained.cleanupSync();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,9 +96,9 @@
|
||||
container.appendChild(renderer.domElement);
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
container.appendChild(stats.domElement);
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
//
|
||||
|
||||
|
||||
@@ -76,9 +76,9 @@
|
||||
container.appendChild(renderer.domElement);
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
container.appendChild(stats.domElement);
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
document.addEventListener('mousedown', onDocumentMouseDown, false);
|
||||
document.addEventListener('touchstart', onDocumentTouchStart, false);
|
||||
|
||||
@@ -63,9 +63,9 @@
|
||||
container.appendChild(renderer.domElement);
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
container.appendChild(stats.domElement);
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
document.addEventListener('mousedown', onDocumentMouseDown, false);
|
||||
document.addEventListener('touchstart', onDocumentTouchStart, false);
|
||||
|
||||
@@ -135,9 +135,9 @@
|
||||
debugContext.strokeStyle = '#000000';
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
container.appendChild(stats.domElement);
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
//
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@
|
||||
container.appendChild(renderer.domElement);
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
container.appendChild(stats.domElement);
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
document.addEventListener('mousemove', onDocumentMouseMove, false);
|
||||
document.addEventListener('touchstart', onDocumentTouchStart, false);
|
||||
|
||||
@@ -43,13 +43,16 @@
|
||||
|
||||
if (!Detector.webgl) Detector.addGetWebGLMessage();
|
||||
|
||||
var container, stats;
|
||||
var camera, scene, renderer;
|
||||
|
||||
var clothGeometry;
|
||||
var sphere;
|
||||
var object, arrow;
|
||||
|
||||
var container: HTMLElement;
|
||||
var stats: Stats;
|
||||
var camera: THREE.PerspectiveCamera;
|
||||
var scene: THREE.Scene;
|
||||
var renderer: THREE.WebGLRenderer;
|
||||
var clothGeometry: THREE.ParametricGeometry;
|
||||
var sphere: THREE.Mesh;
|
||||
var object: THREE.Mesh;
|
||||
var arrow: THREE.ArrowHelper;
|
||||
var light: THREE.DirectionalLight, materials;
|
||||
var rotate = true;
|
||||
|
||||
init();
|
||||
@@ -75,8 +78,6 @@
|
||||
|
||||
// lights
|
||||
|
||||
var light, materials;
|
||||
|
||||
scene.add(new THREE.AmbientLight(0x666666));
|
||||
|
||||
light = new THREE.DirectionalLight(0xdfebff, 1.75);
|
||||
@@ -97,7 +98,7 @@
|
||||
light.shadowCameraBottom = -d;
|
||||
|
||||
light.shadowCameraFar = 1000;
|
||||
light.shadowDarkness = 0.5;
|
||||
//light.shadowDarkness = 0.5;
|
||||
|
||||
scene.add(light);
|
||||
|
||||
@@ -111,7 +112,7 @@
|
||||
|
||||
// cloth geometry
|
||||
clothGeometry = new THREE.ParametricGeometry(clothFunction, cloth.w, cloth.h);
|
||||
clothGeometry.dynamic = true;
|
||||
//clothGeometry.dynamic = true;
|
||||
clothGeometry.computeFaceNormals();
|
||||
|
||||
var uniforms = { texture: { value: clothTexture } };
|
||||
@@ -126,7 +127,7 @@
|
||||
object.receiveShadow = true;
|
||||
scene.add(object);
|
||||
|
||||
object.customDepthMaterial = new THREE.ShaderMaterial({ uniforms: uniforms, vertexShader: vertexShader, fragmentShader: fragmentShader });
|
||||
//object.customDepthMaterial = new THREE.ShaderMaterial({ uniforms: uniforms, vertexShader: vertexShader, fragmentShader: fragmentShader });
|
||||
|
||||
// sphere
|
||||
|
||||
@@ -217,7 +218,7 @@
|
||||
//
|
||||
|
||||
stats = new Stats();
|
||||
container.appendChild(stats.domElement);
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
//
|
||||
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
var SCREEN_HEIGHT = window.innerHeight;
|
||||
var FLOOR = -250;
|
||||
|
||||
var container,stats;
|
||||
|
||||
var camera, scene;
|
||||
var renderer;
|
||||
|
||||
var mesh, helper;
|
||||
|
||||
var mixer;
|
||||
var container: HTMLElement;
|
||||
var stats: Stats;
|
||||
var camera: THREE.PerspectiveCamera;
|
||||
var scene: THREE.Scene;
|
||||
var renderer: THREE.WebGLRenderer;
|
||||
var mesh: THREE.Mesh;
|
||||
var helper: THREE.SkeletonHelper;
|
||||
var mixer: THREE.AnimationMixer;
|
||||
|
||||
var mouseX = 0, mouseY = 0;
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
// STATS
|
||||
|
||||
stats = new Stats();
|
||||
container.appendChild( stats.domElement );
|
||||
container.appendChild( stats.dom );
|
||||
|
||||
//
|
||||
|
||||
@@ -177,12 +177,12 @@
|
||||
mesh.receiveShadow = true;
|
||||
|
||||
helper = new THREE.SkeletonHelper( mesh );
|
||||
helper.material.linewidth = 3;
|
||||
//helper.material.linewidth = 3;
|
||||
helper.visible = false;
|
||||
scene.add( helper );
|
||||
|
||||
|
||||
var clipMorpher = THREE.AnimationClip.CreateFromMorphTargetSequence( 'facialExpressions', mesh.geometry.morphTargets, 3, true );
|
||||
var clipMorpher = THREE.AnimationClip.CreateFromMorphTargetSequence( 'facialExpressions', (mesh.geometry as THREE.Geometry).morphTargets, 3, true );
|
||||
var clipBones = geometry.animations[0];
|
||||
|
||||
mixer = new THREE.AnimationMixer( mesh );
|
||||
|
||||
@@ -10,11 +10,12 @@
|
||||
|
||||
if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
|
||||
|
||||
var container, stats;
|
||||
|
||||
var camera, scene, renderer;
|
||||
|
||||
var mesh;
|
||||
var container: HTMLElement;
|
||||
var stats: Stats;
|
||||
var camera: THREE.PerspectiveCamera;
|
||||
var scene: THREE.Scene;
|
||||
var renderer: THREE.WebGLRenderer;
|
||||
var mesh: THREE.Mesh;
|
||||
|
||||
init();
|
||||
animate();
|
||||
@@ -176,9 +177,9 @@
|
||||
//
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
container.appendChild( stats.domElement );
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
container.appendChild( stats.dom );
|
||||
|
||||
//
|
||||
|
||||
|
||||
@@ -7,8 +7,13 @@
|
||||
var SCREEN_WIDTH = window.innerWidth;
|
||||
var SCREEN_HEIGHT = window.innerHeight;
|
||||
|
||||
var container, stats;
|
||||
var camera, scene, renderer, mesh;
|
||||
var container: HTMLElement;
|
||||
var stats: Stats;
|
||||
var camera: THREE.PerspectiveCamera;
|
||||
var scene: THREE.Scene;
|
||||
var renderer: THREE.WebGLRenderer;
|
||||
var mesh: THREE.Mesh;
|
||||
|
||||
var cameraRig, activeCamera, activeHelper;
|
||||
var cameraPerspective, cameraOrtho;
|
||||
var cameraPerspectiveHelper, cameraOrthoHelper;
|
||||
@@ -112,7 +117,7 @@
|
||||
//
|
||||
|
||||
stats = new Stats();
|
||||
container.appendChild( stats.domElement );
|
||||
container.appendChild( stats.dom );
|
||||
|
||||
//
|
||||
|
||||
|
||||
@@ -68,9 +68,9 @@
|
||||
container.appendChild(renderer.domElement);
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
container.appendChild(stats.domElement);
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
//
|
||||
|
||||
@@ -104,16 +104,16 @@
|
||||
|
||||
uniforms.amplitude.value = 2.5 * Math.sin(sphere.rotation.y * 0.125);
|
||||
uniforms.color.value.offsetHSL(0.0005, 0, 0);
|
||||
|
||||
|
||||
for ( var i = 0; i < displacement.length; i ++ ) {
|
||||
|
||||
|
||||
displacement[ i ] = Math.sin( 0.1 * i + time );
|
||||
|
||||
|
||||
noise[ i ] += 0.5 * ( 0.5 - Math.random() );
|
||||
noise[ i ] = THREE.Math.clamp( noise[ i ], -5, 5 );
|
||||
|
||||
|
||||
displacement[ i ] += noise[ i ];
|
||||
|
||||
|
||||
}
|
||||
|
||||
sphere.geometry.attributes.displacement.needsUpdate = true;
|
||||
|
||||
@@ -116,9 +116,9 @@
|
||||
container.appendChild(renderer.domElement);
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
container.appendChild(stats.domElement);
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
//
|
||||
|
||||
|
||||
@@ -66,9 +66,9 @@
|
||||
container.appendChild(renderer.domElement);
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
container.appendChild(stats.domElement);
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
document.addEventListener('mousemove', onDocumentMouseMove, false);
|
||||
|
||||
@@ -147,4 +147,4 @@
|
||||
renderer.render(scene, camera);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -249,9 +249,9 @@
|
||||
//
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
container.appendChild(stats.domElement);
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
//
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
// stats
|
||||
|
||||
stats = new Stats();
|
||||
container.appendChild(stats.domElement);
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
// events
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
// STATS
|
||||
|
||||
stats = new Stats();
|
||||
container.appendChild( stats.domElement );
|
||||
container.appendChild( stats.dom );
|
||||
|
||||
//
|
||||
|
||||
|
||||
@@ -73,23 +73,20 @@
|
||||
|
||||
material = new THREE.LineBasicMaterial({ color: 0xffffff, opacity: 1, linewidth: 3, vertexColors: THREE.VertexColors });
|
||||
|
||||
var line, p, scale = 0.3, d = 225;
|
||||
var parameters = [
|
||||
var line, scale = 0.3, d = 225;
|
||||
var parameters : [THREE.LineBasicMaterial, number, [number, number, number], THREE.Geometry][] = [
|
||||
[material, scale * 1.5, [-d, 0, 0], geometry],
|
||||
[material, scale * 1.5, [0, 0, 0], geometry2],
|
||||
[material, scale * 1.5, [d, 0, 0], geometry3]
|
||||
];
|
||||
|
||||
for (i = 0; i < parameters.length; ++i) {
|
||||
|
||||
p = parameters[i];
|
||||
for (const p of parameters) {
|
||||
line = new THREE.Line(p[3], p[0]);
|
||||
line.scale.x = line.scale.y = line.scale.z = p[1];
|
||||
line.position.x = p[2][0];
|
||||
line.position.y = p[2][1];
|
||||
line.position.z = p[2][2];
|
||||
scene.add(line);
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -77,9 +77,9 @@
|
||||
container.appendChild(renderer.domElement);
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
container.appendChild(stats.domElement);
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
//
|
||||
|
||||
|
||||
@@ -146,10 +146,10 @@
|
||||
//
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
|
||||
container.appendChild(stats.domElement);
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
//
|
||||
|
||||
|
||||
@@ -58,9 +58,9 @@
|
||||
//
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
container.appendChild( stats.domElement );
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
container.appendChild( stats.dom );
|
||||
|
||||
//
|
||||
|
||||
|
||||
@@ -47,9 +47,9 @@
|
||||
container.appendChild(renderer.domElement);
|
||||
|
||||
stats = new Stats();
|
||||
stats.domElement.style.position = 'absolute';
|
||||
stats.domElement.style.top = '0px';
|
||||
container.appendChild(stats.domElement);
|
||||
stats.dom.style.position = 'absolute';
|
||||
stats.dom.style.top = '0px';
|
||||
container.appendChild(stats.dom);
|
||||
|
||||
onWindowResize();
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
/// <reference path="jscript-extensions.d.ts" />
|
||||
|
||||
var x: VarDate;
|
||||
var dte = new Date(x);
|
||||
x = dte.getVarDate();
|
||||
16
ts-activex/jscript-extensions.d.ts
vendored
16
ts-activex/jscript-extensions.d.ts
vendored
@@ -1,16 +0,0 @@
|
||||
// Type definitions for Microsoft JScript extensions
|
||||
// Project: https://msdn.microsoft.com/en-us/library/yek4tbz0(v=vs.84).aspx
|
||||
// Definitions by: Zev Spitz <https://github.com/zspitz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
//These will become unnecessary with the next version of Typescript
|
||||
|
||||
interface VarDate { }
|
||||
|
||||
interface DateConstructor {
|
||||
new (vd: VarDate): Date;
|
||||
}
|
||||
|
||||
interface Date {
|
||||
getVarDate: () => VarDate;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user