diff --git a/cradle/cradle-tests.ts b/cradle/cradle-tests.ts
new file mode 100644
index 000000000..655e92a87
--- /dev/null
+++ b/cradle/cradle-tests.ts
@@ -0,0 +1,185 @@
+///
+
+import cradle = require("cradle");
+
+cradle.setup({
+ host: 'living-room.couch',
+ cache: true,
+ raw: false,
+ forceSave: true
+});
+
+const connection = new cradle.Connection();
+const connection2 = new(cradle.Connection);
+const connection3 = new(cradle.Connection)('173.45.66.92');
+
+connection.databases(function(error, response) {});
+connection.config(function(error, response) {});
+connection.databases(function(error, response) {});
+connection.info(function(error, response) {});
+connection.stats(function(error, response) {});
+connection.activeTasks(function(error, response) {});
+connection.uuids(function(error, response) {});
+connection.uuids(10, function(error, response) {});
+connection.replicate({
+ source: "database",
+ target: "targetDatabase"
+}, function(error, response) {});
+
+const db = connection.database('starwars');
+
+db.exists(function (error, exists) {
+ if (error) {
+ console.log('error', error);
+ } else if (exists) {
+ console.log('the force is with you.');
+ } else {
+ console.log('database does not exists.');
+ db.create(function(error){
+ /* do something if there's an erroror */
+ /* populate design documents */
+ });
+ }
+});
+
+db.get<{
+ name: string;
+}>('vader', function (error, doc) {
+ doc.name; // 'Darth Vader'
+});
+
+db.get('luke', function (error, doc) {
+ doc.prop;
+});
+
+ db.get(['luke', 'vader'], function (error, doc) {
+ //
+ });
+
+db.save('skywalker', {
+ force: 'light',
+ name: 'Luke Skywalker'
+}, function (error, res) {
+ if (error) {
+ // Handle erroror
+ } else {
+ // Handle success
+ }
+});
+
+db.save({
+ force: 'dark', name: 'Darth'
+ }, function (err, res) {
+ // Handle response
+ });
+
+db.save('luke', '1-94B6F82', {
+ force: 'dark', name: 'Luke'
+}, function (err, res) {
+ // Handle response
+});
+
+db.save([
+ { name: 'Yoda' },
+ { name: 'Han Solo' },
+ { name: 'Leia' }
+], function (err, res) {
+ // Handle response
+});
+
+db.merge('luke', {jedi: true}, function (err, res) {
+ // Luke is now a jedi,
+ // but remains on the dark side of the force.
+});
+
+db.view('characters/all', function (err, res) {
+ res.forEach(function (row: any) {
+ console.log("%s is on the %s side of the force.", row.name, row.force);
+ });
+});
+
+db.view('characters/all', {group: true, reduce: true} , function (err, res) {
+ res.forEach(function (row: any) {
+ console.log("%s is on the %s side of the force.", row.name, row.force);
+ });
+ });
+
+ db.temporaryView({
+ map: function (doc: any) {
+ //
+ }
+ }, function (err, res) {
+ if (err) console.log(err);
+ console.log(res);
+ });
+
+db.remove('luke', '1-94B6F82', function (err, res) {
+ // Handle response
+});
+
+db.update('my_designdoc/update_handler_name', 'luke', undefined, { my_param: false }, function (err, res) {
+ // Handle the response, specified by the update handler
+});
+
+db.changes(function (err, list) {
+ list.forEach(function (change) { console.log(change) });
+});
+
+db.changes({ since: 42 }, function (err, list) {
+ //
+});
+
+const feed = db.changes({ since: 42 });
+
+feed.on('change', function (change: any) {
+ console.log(change);
+});
+
+const idAndRevData = {
+ id: 'luke',
+ rev: 'my-rev'
+};
+
+const attachmentData = {
+ name: 'fooAttachment.txt',
+ 'Content-Type': 'text/plain',
+ body: 'Foo document text'
+};
+
+db.saveAttachment(idAndRevData, attachmentData, function (err, reply) {
+ if (err) {
+ console.dir(err)
+ return
+ }
+ console.dir(reply)
+});
+
+
+db.getAttachment('luke', 'foo.txt', function (err, reply) {
+ if (err) {
+ console.dir(err);
+ return;
+ }
+ console.dir(reply);
+});
+
+db.removeAttachment('luke', 'foo.txt', function (err, reply) {
+ if (err) {
+ console.dir(err);
+ return;
+ }
+ console.dir(reply);
+});
+
+db.info(function(error, response) {});
+db.all(function(error, response) {});
+db.all({
+ body: {
+ keys: ['key1', 'key2']
+ }
+}, function(error, response) {});
+db.compact(function(error, response) {});
+db.compact('design', function(error, response) {});
+db.viewCleanup(function(error, response) {});
+db.replicate('database', function(error, response) {});
+db.replicate('database', {}, function(error, response) {});
diff --git a/cradle/cradle.d.ts b/cradle/cradle.d.ts
new file mode 100644
index 000000000..6434af26c
--- /dev/null
+++ b/cradle/cradle.d.ts
@@ -0,0 +1,122 @@
+// Type definitions for cradle
+// Project: https://github.com/flatiron/cradle
+// Definitions by: Panu Horsmalahti
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+declare module "cradle" {
+ interface Options {
+ host?: string;
+ hostname?: string;
+ cache?: boolean;
+ raw?: boolean;
+ forceSave?: boolean;
+ auth?: string | {
+ username: string;
+ password: string;
+ }
+ ca?: string;
+ secure?: boolean;
+ retries?: number;
+ retryTimeout?: number;
+ maxSockets?: number;
+ }
+
+ interface Callback {
+ (error: any, response: any): void;
+ }
+
+ interface ErrorCallback {
+ (error: any): void;
+ }
+
+ export class Connection {
+ constructor(uri?: string, port?: number, options?: Options);
+ database(name: string): Database;
+ databases(Callback: Callback): void;
+ config(callback: Callback): void;
+ info(callback: Callback): void;
+ stats(callback: Callback): void;
+ activeTasks(callback: Callback): void;
+ uuids(callback: Callback): void;
+ uuids(count: number, callback: Callback): void;
+ replicate(options: {
+ source: string | {
+ url: string;
+ };
+ target: string | {
+ url: string;
+ };
+ cancel?: boolean;
+ continuous?: boolean;
+ create_target?: boolean;
+ doc_ids?: string[];
+ filter?: string;
+ proxy?: string;
+ query_params?: any;
+ }, callback: Callback): void;
+ }
+
+ export interface ChangesOptions {
+ since: number;
+ }
+
+ export class Database {
+ name: string;
+ get(id: string, callback: (error: any, document: any) => void): void;
+ get(id: string, callback: (error: any, document: T) => void): void;
+ get(id: string, rev: string, callback: (error: any, document: any) => void): void;
+ get(id: string, rev: string, callback: (error: any, document: T) => void): void;
+ get(ids: string[], callback: Callback): void;
+ save(document: any, callback: Callback): void;
+ save(id: string, document: any, callback: Callback): void;
+ save(id: string, revision: string, document: any,
+ callback: Callback): void;
+ save(document: T, callback: Callback): void;
+ save(id: string, document: T, callback: Callback): void;
+ save(id: string, revision: string, document: T,
+ callback: Callback): void;
+ save(documents: any[], callback: Callback): void;
+ merge(id: string, document: any, callback: Callback): void;
+ merge(id: string, document: T, callback: Callback): void;
+ remove(id: string, revision: string, callback: Callback): void;
+ update(name: string, id: string, queryObject: any, documentBody: any,
+ callback: Callback): void;
+ view(name: string, callback: Callback): void;
+ view(name: string, options: {
+ group?: boolean;
+ reduce?: boolean;
+ key?: string;
+ startkey?: any;
+ endkey?: any;
+ include_docs?: boolean;
+ limit?: number;
+ descending?: boolean;
+ }, callback: Callback): void;
+ temporaryView(view: any, callback: Callback): void;
+ create(callback: ErrorCallback): void;
+ exists(callback: (error: any, exists: boolean) => void): void;
+ destroy(callback: ErrorCallback): void;
+ changes(options: ChangesOptions): any;
+ changes(callback: (error: any, list: any[]) => void): void;
+ changes(options: ChangesOptions, callback: (error: any,
+ list: any[]) => void): void;
+ saveAttachment(idAndRevData: {
+ id: string;
+ rev: string;
+ }, attachmentData: any, callback: Callback): void;
+ getAttachment(id: string, attachmentName: string,
+ callback: Callback): void;
+ removeAttachment(id: string, attachmentName: string,
+ callback: Callback): void;
+ info(callback: Callback): void;
+ all(callback: Callback): void;
+ all(options: any, callback: Callback): void;
+ compact(callback: Callback): void;
+ compact(design: string, callback: Callback): void;
+ viewCleanup(callback: Callback): void;
+ replicate(target: string, callback: Callback): void;
+ replicate(target: string, options: any, callback: Callback): void;
+ }
+
+ export function setup(options: Options): void;
+}
diff --git a/cucumber/cucumber-tests.ts b/cucumber/cucumber-tests.ts
new file mode 100644
index 000000000..f8b560607
--- /dev/null
+++ b/cucumber/cucumber-tests.ts
@@ -0,0 +1,40 @@
+///
+
+function StepSample() {
+ type Callback = cucumber.CallbackStepDefinition;
+ var step = this;
+ var hook = this;
+
+ hook.Before(function(scenario, callback){
+ scenario.isFailed() && callback.pending();
+ })
+
+ hook.Around(function(scenario, runScenario) {
+ scenario.isFailed() && runScenario(null, function(){
+ console.log('finish tasks');
+ });
+ });
+
+ hook.registerHandler('AfterFeatures', function (event, callback) {
+ callback();
+ });
+
+ step.Given(/^I am on the Cucumber.js GitHub repository$/, function(callback:Callback) {
+ this.visit('https://github.com/cucumber/cucumber-js', callback);
+ });
+
+ step.When(/^I go to the README file$/, function(title:string, callback:Callback) {
+ callback.pending();
+ });
+
+ step.Then(/^I should see "(.*)" as the page title$/, { timeout:60*1000}, function(title:string, callback:Callback) {
+ var pageTitle = this.browser.text('title');
+
+ if (title === pageTitle) {
+ callback();
+ } else {
+ callback(new Error("Expected to be on page with title " + title));
+ }
+ });
+}
+
diff --git a/cucumber/cucumber.d.ts b/cucumber/cucumber.d.ts
new file mode 100644
index 000000000..75faeff7a
--- /dev/null
+++ b/cucumber/cucumber.d.ts
@@ -0,0 +1,57 @@
+// Type definitions for cucumber-js
+// Project: https://github.com/cucumber/cucumber-js
+// Definitions by: Abraão Alves
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+///
+
+declare module cucumber {
+
+ export interface CallbackStepDefinition{
+ pending : () => Thenable;
+ (errror?:any):void;
+ }
+
+ interface StepDefinitionCode {
+ (...stepArgs: Array): Thenable | any | void;
+ }
+
+ interface StepDefinitionOptions{
+ timeout?: number;
+ }
+
+ export interface StepDefinitions {
+ Given(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void;
+ Given(pattern: RegExp | string, code: StepDefinitionCode): void;
+ When(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void;
+ When(pattern: RegExp | string, code: StepDefinitionCode): void;
+ Then(pattern: RegExp | string, options: StepDefinitionOptions, code: StepDefinitionCode): void;
+ Then(pattern: RegExp | string, code: StepDefinitionCode): void;
+ setDefaultTimeout(time:number): void;
+ }
+
+ interface HookScenario{
+ attach(text: string, mimeType?: string, callback?: (err?:any) => void): void;
+ isFailed() : boolean;
+ }
+
+ interface HookCode {
+ (scenario: HookScenario, callback?: CallbackStepDefinition): void;
+ }
+
+ interface AroundCode{
+ (scenario: HookScenario, runScenario?: (error:string, callback?:Function)=>void): void;
+ }
+
+ export interface Hooks {
+ Before(code: HookCode): void;
+ After(code: HookCode): void;
+ Around(code: AroundCode):void;
+ setDefaultTimeout(time:number): void;
+ registerHandler(handlerOption:string, code:(event:any, callback:CallbackStepDefinition) =>void): void;
+ }
+}
+
+declare module 'cucumber'{
+ export = cucumber;
+}
\ No newline at end of file
diff --git a/fullCalendar/fullCalendar.d.ts b/fullCalendar/fullCalendar.d.ts
index 6400dba7e..7415bdd73 100644
--- a/fullCalendar/fullCalendar.d.ts
+++ b/fullCalendar/fullCalendar.d.ts
@@ -247,6 +247,7 @@ declare module FullCalendar {
backgroundColor?: string;
borderColor?: string;
textColor?: string;
+ rendering?: string;
}
export interface ViewObject extends Timespan {
diff --git a/github-electron/github-electron.d.ts b/github-electron/github-electron.d.ts
index 7c5fa8b4d..48f893d06 100644
--- a/github-electron/github-electron.d.ts
+++ b/github-electron/github-electron.d.ts
@@ -1700,7 +1700,7 @@ declare module GitHubElectron {
interface Electron {
clipboard: GitHubElectron.Clipboard;
crashReporter: GitHubElectron.CrashReporter;
- nativeImage: GitHubElectron.NativeImage;
+ nativeImage: typeof GitHubElectron.NativeImage;
screen: GitHubElectron.Screen;
shell: GitHubElectron.Shell;
remote: GitHubElectron.Remote;
diff --git a/jssha/jssha-tests.ts b/jssha/jssha-tests.ts
index f6e0f96b4..e5a83b14a 100644
--- a/jssha/jssha-tests.ts
+++ b/jssha/jssha-tests.ts
@@ -46,4 +46,11 @@ let hmac5:string = shaObj1.getHMAC("HEX", { outputUpper: true, b64Pad: '=' });
shaObj.setHMACKey("abc", "TEXT");
shaObj.update("This is a test");
let hmac = shaObj.getHMAC("HEX");
+}
+
+// Browser global test
+{
+ var shaObj = new jsSHA("SHA-512", "TEXT");
+ shaObj.update("This is a test");
+ var hash = shaObj.getHash("HEX");
}
\ No newline at end of file
diff --git a/jssha/jssha.d.ts b/jssha/jssha.d.ts
index 6dc4f65d3..f695a6670 100644
--- a/jssha/jssha.d.ts
+++ b/jssha/jssha.d.ts
@@ -79,7 +79,7 @@ declare module jsSHA {
}
}
+declare var jsSHA: jsSHA.jsSHA;
declare module 'jssha' {
- var jsSHA: jsSHA.jsSHA;
export = jsSHA;
-}
\ No newline at end of file
+}
diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts
index 2d244b16e..9cf772cab 100644
--- a/lodash/lodash-tests.ts
+++ b/lodash/lodash-tests.ts
@@ -5532,17 +5532,34 @@ result = _([]).isFinite();
result = _({}).isFinite();
// _.isFunction
-result = _.isFunction(any);
-result = _(1).isFunction();
-result = _([]).isFunction();
-result = _({}).isFunction();
-{
- let value: Function|string = "foo";
- if (_.isFunction(value)) {
- value();
- } else {
- let result: string = value;
- }
+module TestIsFunction {
+ {
+ let value: number|Function;
+
+ if (_.isFunction(value)) {
+ let result: Function = value;
+ }
+ else {
+ let result: number = value;
+ }
+ }
+
+ {
+ let result: boolean;
+
+ result = _.isFunction(any);
+ result = _(1).isFunction();
+ result = _([]).isFunction();
+ result = _({}).isFunction();
+ }
+
+ {
+ let result: _.LoDashExplicitWrapper;
+
+ result = _(1).chain().isFunction();
+ result = _([]).chain().isFunction();
+ result = _({}).chain().isFunction();
+ }
}
// _.isMatch
diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts
index 8425f1d82..81d78b1bc 100644
--- a/lodash/lodash.d.ts
+++ b/lodash/lodash.d.ts
@@ -9434,9 +9434,10 @@ declare module _ {
interface LoDashStatic {
/**
* Checks if value is classified as a Function object.
+ *
* @param value The value to check.
* @return Returns true if value is correctly classified, else false.
- **/
+ */
isFunction(value?: any): value is Function;
}
@@ -9447,6 +9448,13 @@ declare module _ {
isFunction(): boolean;
}
+ interface LoDashExplicitWrapperBase {
+ /**
+ * @see _.isFunction
+ */
+ isFunction(): LoDashExplicitWrapper;
+ }
+
//_.isMatch
interface isMatchCustomizer {
(value: any, other: any, indexOrKey?: number|string): boolean;
diff --git a/maker.js/makerjs-tests.ts b/maker.js/makerjs-tests.ts
index 59a50e4fc..ae17a8fe9 100644
--- a/maker.js/makerjs-tests.ts
+++ b/maker.js/makerjs-tests.ts
@@ -40,6 +40,8 @@ function test() {
function testExporter() {
new makerjs.exporter.Exporter({});
makerjs.exporter.toDXF(model);
+ makerjs.exporter.toOpenJsCad(model);
+ makerjs.exporter.toSTL(model);
makerjs.exporter.toSVG(model);
makerjs.exporter.tryGetModelUnits(model);
}
@@ -66,12 +68,17 @@ function test() {
function testModel(){
makerjs.model.combine(model, model, true, false, true, false);
makerjs.model.convertUnits(model, makerjs.unitType.Centimeter);
+ makerjs.model.countChildModels(model);
+ makerjs.model.detachLoop(model);
+ makerjs.model.findLoops(model);
makerjs.model.getSimilarPathId(model, 'foo');
+ makerjs.model.isPathInsideModel(paths.line, model);
makerjs.model.mirror(model, false, true);
makerjs.model.move(makerjs.model.originate(model, [9,9]), [0,0]);
makerjs.model.moveRelative(model, [1,1]);
makerjs.model.originate(model);
makerjs.model.rotate(makerjs.model.scale(model, 6), 45, [0,0]);
+ makerjs.model.scale(model, 7);
makerjs.model.walkPaths(model, (modelContext: MakerJs.IModel, pathId: string, pathContext: MakerJs.IPath) => {});
}
@@ -80,6 +87,7 @@ function test() {
new makerjs.models.BoltCircle(7, 7, 7, 7),
new makerjs.models.BoltRectangle(2, 2, 2),
new makerjs.models.ConnectTheDots(true, [ [0,0], [1,1] ]),
+ new makerjs.models.Dome(5, 7),
new makerjs.models.Oval(7, 7),
new makerjs.models.OvalArc(6, 4, 2, 12),
new makerjs.models.Polygon(7, 5),
@@ -141,7 +149,9 @@ function test() {
makerjs.point.middle(paths.line);
makerjs.point.mirror(p1, true, false);
makerjs.point.rotate(p1, 5, p2);
+ makerjs.point.rounded(p1);
makerjs.point.scale(p2, 8);
+ makerjs.point.serialize(p1);
makerjs.point.subtract(p2, p1);
makerjs.point.zero();
}
diff --git a/maker.js/makerjs.d.ts b/maker.js/makerjs.d.ts
index 69cd3dbb7..779af0534 100644
--- a/maker.js/makerjs.d.ts
+++ b/maker.js/makerjs.d.ts
@@ -247,6 +247,37 @@ declare module MakerJs {
*/
path2Angles?: number[];
}
+ /**
+ * Options when matching points
+ */
+ interface IPointMatchOptions {
+ /**
+ * Optional exemplar of number of decimal places.
+ */
+ accuracy?: number;
+ }
+ /**
+ * Options to pass to model.findLoops.
+ */
+ interface IFindLoopsOptions extends IPointMatchOptions {
+ /**
+ * Flag to remove looped paths from the original model.
+ */
+ removeFromOriginal?: boolean;
+ }
+ /**
+ * A path that may be indicated to "flow" in either direction between its endpoints.
+ */
+ interface IPathDirectional extends IPath {
+ /**
+ * The endpoints of the path.
+ */
+ endPoints: IPoint[];
+ /**
+ * Path flows forwards or reverse.
+ */
+ reversed?: boolean;
+ }
/**
* Path objects by id.
*/
@@ -302,6 +333,12 @@ declare module MakerJs {
*/
layer?: string;
}
+ /**
+ * Callback signature for model.walkPaths().
+ */
+ interface IModelPathCallback {
+ (modelContext: IModel, pathId: string, pathContext: IPath): void;
+ }
/**
* Test to see if an object implements the required properties of a model.
*/
@@ -408,6 +445,7 @@ declare module MakerJs.point {
*
* @param a First point.
* @param b Second point.
+ * @param accuracy Optional exemplar of number of decimal places.
* @returns true if points are the same, false if they are not
*/
function areEqualRounded(a: IPoint, b: IPoint, accuracy?: number): boolean;
@@ -456,7 +494,7 @@ declare module MakerJs.point {
*/
function fromPathEnds(pathContext: IPath): IPoint[];
/**
- * Get the middle point of a path. Currently only supports Arc and Line paths.
+ * Get the middle point of a path.
*
* @param pathContext The path object.
* @param ratio Optional ratio (between 0 and 1) of point along the path. Default is .5 for middle.
@@ -472,6 +510,14 @@ declare module MakerJs.point {
* @returns Mirrored point.
*/
function mirror(pointToMirror: IPoint, mirrorX: boolean, mirrorY: boolean): IPoint;
+ /**
+ * Round the values of a point.
+ *
+ * @param pointContext The point to serialize.
+ * @param accuracy Optional exemplar number of decimal places.
+ * @returns A new point with the values rounded.
+ */
+ function rounded(pointContext: IPoint, accuracy?: number): IPoint;
/**
* Rotate a point.
*
@@ -489,6 +535,14 @@ declare module MakerJs.point {
* @returns A new point.
*/
function scale(pointToScale: IPoint, scaleValue: number): IPoint;
+ /**
+ * Get a string representation of a point.
+ *
+ * @param pointContext The point to serialize.
+ * @param accuracy Optional exemplar of number of decimal places.
+ * @returns String representing the point.
+ */
+ function serialize(pointContext: IPoint, accuracy?: number): string;
/**
* Subtract a point from another point, and return the result as a new point. Shortcut to Add(a, b, subtract = true).
*
@@ -637,6 +691,13 @@ declare module MakerJs.paths {
}
}
declare module MakerJs.model {
+ /**
+ * Count the number of child models within a given model.
+ *
+ * @param modelContext The model containing other models.
+ * @returns Number of child models.
+ */
+ function countChildModels(modelContext: IModel): number;
/**
* Get an unused id in the paths map with the same prefix.
*
@@ -702,12 +763,6 @@ declare module MakerJs.model {
* @returns The scaled model (for chaining).
*/
function convertUnits(modeltoConvert: IModel, destUnitType: string): IModel;
- /**
- * Callback signature for walkPaths.
- */
- interface IModelPathCallback {
- (modelContext: IModel, pathId: string, pathContext: IPath): void;
- }
/**
* Recursively walk through all paths for a given model.
*
@@ -717,6 +772,15 @@ declare module MakerJs.model {
function walkPaths(modelContext: IModel, callback: IModelPathCallback): void;
}
declare module MakerJs.model {
+ /**
+ * Check to see if a path is inside of a model.
+ *
+ * @param pathContext The path to check.
+ * @param modelContext The model to check against.
+ * @param farPoint Optional point of reference which is outside the bounds of the modelContext.
+ * @returns Boolean true if the path is inside of the modelContext.
+ */
+ function isPathInsideModel(pathContext: IPath, modelContext: IModel, farPoint?: IPoint): boolean;
/**
* Combine 2 models. The models should be originated.
*
@@ -726,9 +790,10 @@ declare module MakerJs.model {
* @param includeAOutsideB Flag to include paths from modelA which are outside of modelB.
* @param includeBInsideA Flag to include paths from modelB which are inside of modelA.
* @param includeBOutsideA Flag to include paths from modelB which are outside of modelA.
+ * @param keepDuplicates Flag to include paths which are duplicate in both models.
* @param farPoint Optional point of reference which is outside the bounds of both models.
*/
- function combine(modelA: IModel, modelB: IModel, includeAInsideB: boolean, includeAOutsideB: boolean, includeBInsideA: boolean, includeBOutsideA: boolean, farPoint?: IPoint): void;
+ function combine(modelA: IModel, modelB: IModel, includeAInsideB?: boolean, includeAOutsideB?: boolean, includeBInsideA?: boolean, includeBOutsideA?: boolean, keepDuplicates?: boolean, farPoint?: IPoint): void;
}
declare module MakerJs.units {
/**
@@ -927,7 +992,7 @@ declare module MakerJs.path {
* @param line2 Second line to fillet, which will be modified to fit the fillet.
* @returns Arc path object of the new fillet.
*/
- function dogbone(line1: IPathLine, line2: IPathLine, filletRadius: number): IPathArc;
+ function dogbone(line1: IPathLine, line2: IPathLine, filletRadius: number, options?: IPointMatchOptions): IPathArc;
/**
* Adds a round corner to the inside angle between 2 paths. The paths must meet at one point.
*
@@ -935,7 +1000,7 @@ declare module MakerJs.path {
* @param path2 Second path to fillet, which will be modified to fit the fillet.
* @returns Arc path object of the new fillet.
*/
- function fillet(path1: IPath, path2: IPath, filletRadius: number): IPathArc;
+ function fillet(path1: IPath, path2: IPath, filletRadius: number, options?: IPointMatchOptions): IPathArc;
}
declare module MakerJs.kit {
/**
@@ -998,6 +1063,22 @@ declare module MakerJs.kit {
*/
function getParameterValues(ctor: IKit): any[];
}
+declare module MakerJs.model {
+ /**
+ * Find paths that have common endpoints and form loops.
+ *
+ * @param modelContext The model to search for loops.
+ * @param options Optional options object.
+ * @returns A new model with child models ranked according to their containment within other found loops. The paths of models will be IPathDirectionalWithPrimeContext.
+ */
+ function findLoops(modelContext: IModel, options?: IFindLoopsOptions): IModel;
+ /**
+ * Remove all paths in a loop model from the model(s) which contained them.
+ *
+ * @param loopToDetach The model to search for loops.
+ */
+ function detachLoop(loopToDetach: IModel): void;
+}
declare module MakerJs.exporter {
/**
* Attributes for an XML tag.
@@ -1052,6 +1133,34 @@ declare module MakerJs.exporter {
toString(): string;
}
}
+declare module MakerJs.exporter {
+ function toOpenJsCad(modelToExport: IModel, options?: IOpenJsCadOptions): string;
+ function toOpenJsCad(pathsToExport: IPath[], options?: IOpenJsCadOptions): string;
+ function toOpenJsCad(pathToExport: IPath, options?: IOpenJsCadOptions): string;
+ /**
+ * Executes a JavaScript string with the OpenJsCad engine - converts 2D to 3D.
+ *
+ * @param modelToExport Model object to export.
+ * @param options Export options object.
+ * @param options.extrusion Height of 3D extrusion.
+ * @param options.resolution Size of facets.
+ * @returns String of STL format of 3D object.
+ */
+ function toSTL(modelToExport: IModel, options?: IOpenJsCadOptions): string;
+ /**
+ * OpenJsCad export options.
+ */
+ interface IOpenJsCadOptions extends IFindLoopsOptions {
+ /**
+ * Optional depth of 3D extrusion.
+ */
+ extrusion?: number;
+ /**
+ * Optional size of curve facets.
+ */
+ facetSize?: number;
+ }
+}
declare module MakerJs.exporter {
function toSVG(modelToExport: IModel, options?: ISVGRenderOptions): string;
function toSVG(pathsToExport: IPath[], options?: ISVGRenderOptions): string;
@@ -1118,6 +1227,12 @@ declare module MakerJs.models {
constructor(width: number, height: number, holeRadius: number);
}
}
+declare module MakerJs.models {
+ class Dome implements IModel {
+ paths: IPathMap;
+ constructor(width: number, height: number, radius?: number);
+ }
+}
declare module MakerJs.models {
class RoundRectangle implements IModel {
paths: IPathMap;
diff --git a/mithril/mithril.d.ts b/mithril/mithril.d.ts
index 3cd0e21e4..c2304e7ec 100644
--- a/mithril/mithril.d.ts
+++ b/mithril/mithril.d.ts
@@ -5,90 +5,174 @@
//Mithril type definitions for Typescript
-interface MithrilStatic {
- (selector: string, attributes: Object, children?: any): MithrilVirtualElement;
- (selector: string, children?: any): MithrilVirtualElement;
- prop(value?: T): (value?: T) => T;
- prop(promise: MithrilPromise): MithrilPromiseProperty;
- withAttr(property: string, callback: (value: any) => void): (e: Event) => any;
- module(rootElement: Node, module: MithrilModule): void;
- trust(html: string): String;
- render(rootElement: Element, children?: any): void;
- render(rootElement: HTMLDocument, children?: any): void;
- redraw: MithrilRedraw;
- route: MithrilRoute;
- request(options: MithrilXHROptions): MithrilPromise;
- deferred(): MithrilDeferred;
- sync(promises: MithrilPromise[]): MithrilPromise;
- startComputation(): void;
- endComputation(): void;
+declare module _mithril {
+ interface MithrilStatic {
+
+ (selector: string, attributes: MithrilAttributes, ...children: Array>): MithrilVirtualElement;
+ (selector: string, ...children: Array>): MithrilVirtualElement;
+
+ prop(promise: MithrilPromise) : MithrilPromiseProperty;
+ prop(value: T): MithrilProperty;
+ prop(): MithrilProperty