From 9608cfb4eff05e0542e5671cc053563f9fe17ca7 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Thu, 23 Feb 2017 08:41:38 -0800 Subject: [PATCH 1/8] Fix packages that used 'jasmine' for tests. Jasmine requires TypeScript 2.1, but since these packages only use it for tests, they should stop depending on it and stay TS2.0 compatible. Similar for 'react'. --- google.analytics/google.analytics-tests.ts | 4 ++-- jasmine-fixture/index.d.ts | 10 +++++++--- jasmine-fixture/jasmine-fixture-tests.ts | 2 -- js-quantities/js-quantities-tests.ts | 17 ++++++++++++++++- react-ga/react-ga-tests.tsx | 5 +++-- react-highlighter/index.d.ts | 3 +++ redux-ui/index.d.ts | 2 ++ reflux/reflux-tests.ts | 1 - .../supertest-as-promised-tests.ts | 6 +++--- tcomb/tcomb-tests.ts | 7 +++---- 10 files changed, 39 insertions(+), 18 deletions(-) diff --git a/google.analytics/google.analytics-tests.ts b/google.analytics/google.analytics-tests.ts index 6b7962899b..32df930cc9 100644 --- a/google.analytics/google.analytics-tests.ts +++ b/google.analytics/google.analytics-tests.ts @@ -1,5 +1,5 @@ - -/// +declare function describe(desc: string, fn: () => void): void; +declare function it(desc: string, fn: () => void): void; describe("tester Google Analytics Tracker _gat object", () => { it("can set ga script element", () => { diff --git a/jasmine-fixture/index.d.ts b/jasmine-fixture/index.d.ts index 8ea5956f1e..9a8c7b98b2 100644 --- a/jasmine-fixture/index.d.ts +++ b/jasmine-fixture/index.d.ts @@ -2,10 +2,14 @@ // Project: https://github.com/searls/jasmine-fixture // Definitions by: Craig Brett // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 -/** Affixes the given jquery selectors into the body and will be removed after each spec -* @param {string} selector The JQuery selector to be added to the dom -*/ +/// + +/** + * Affixes the given jquery selectors into the body and will be removed after each spec + * @param {string} selector The JQuery selector to be added to the dom + */ declare function affix(selector: string): JQuery; interface JQuery { diff --git a/jasmine-fixture/jasmine-fixture-tests.ts b/jasmine-fixture/jasmine-fixture-tests.ts index b0ec42d512..74eb750590 100644 --- a/jasmine-fixture/jasmine-fixture-tests.ts +++ b/jasmine-fixture/jasmine-fixture-tests.ts @@ -1,8 +1,6 @@ -/// /// /// - describe("Jasmine fixture extension", () => { describe("Affixes dom elements to body", () => { it("Inserts a new element on affix", () => { diff --git a/js-quantities/js-quantities-tests.ts b/js-quantities/js-quantities-tests.ts index 95819381b5..ed69816dc3 100644 --- a/js-quantities/js-quantities-tests.ts +++ b/js-quantities/js-quantities-tests.ts @@ -1,6 +1,21 @@ -/// import Qty from "js-quantities"; +declare function describe(desc: string, fn: () => void): void; +declare function it(desc: string, fn: () => void): void; +interface Expect { + not: this; + toBe(y: T): void; + toEqual(y: T): void; + toBeTruthy(): void; + toBeNull(): void; + toBeCloseTo(this: Expect, x: number, sigFigs: number): void; + toThrow(this: Expect<() => void>, msg?: string): void; + toContain(this: Expect, x: U): void; +}; +declare function expect(x: T): Expect; +declare function beforeEach(f: () => void): void; +declare function afterEach(f: () => void): void; + // From project readme let qty: Qty; diff --git a/react-ga/react-ga-tests.tsx b/react-ga/react-ga-tests.tsx index 10770f04f5..0db1be21c2 100644 --- a/react-ga/react-ga-tests.tsx +++ b/react-ga/react-ga-tests.tsx @@ -1,7 +1,8 @@ -/// - import * as ga from "react-ga"; +declare function describe(desc: string, f: () => void): void; +declare function it(desc: string, f: () => void): void; + describe("Testing react-ga initialize object", () => { it("Able to initialize react-ga object", () => { ga.initialize("UA-65432-1"); diff --git a/react-highlighter/index.d.ts b/react-highlighter/index.d.ts index 74468c9b7c..6e34a4dbe3 100644 --- a/react-highlighter/index.d.ts +++ b/react-highlighter/index.d.ts @@ -2,6 +2,9 @@ // Project: https://github.com/helior/react-highlighter // Definitions by: Pedro Pereira // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 + +/// declare var Highlight: any; export = Highlight; diff --git a/redux-ui/index.d.ts b/redux-ui/index.d.ts index 3b1f8f4a58..1c3468233d 100644 --- a/redux-ui/index.d.ts +++ b/redux-ui/index.d.ts @@ -2,7 +2,9 @@ // Project: https://github.com/tonyhb/redux-ui // Definitions by: Andy Shu Xin // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 +/// import * as Redux from 'redux'; export interface uiParams { diff --git a/reflux/reflux-tests.ts b/reflux/reflux-tests.ts index 7a392282fa..150e40db03 100644 --- a/reflux/reflux-tests.ts +++ b/reflux/reflux-tests.ts @@ -1,5 +1,4 @@ import Reflux = require("reflux"); -import React = require("react"); var syncActions = Reflux.createActions([ "statusUpdate", diff --git a/supertest-as-promised/supertest-as-promised-tests.ts b/supertest-as-promised/supertest-as-promised-tests.ts index c20f9a92b6..35cbc68388 100644 --- a/supertest-as-promised/supertest-as-promised-tests.ts +++ b/supertest-as-promised/supertest-as-promised-tests.ts @@ -1,9 +1,9 @@ - -/// - import * as request from 'supertest-as-promised'; import * as express from 'express'; +declare function describe(desc: string, f: () => void): void; +declare function it(desc: string, f: () => void): void; + var app = express(); // chain your requests like you were promised: diff --git a/tcomb/tcomb-tests.ts b/tcomb/tcomb-tests.ts index 02982faae7..7aa7d9a786 100644 --- a/tcomb/tcomb-tests.ts +++ b/tcomb/tcomb-tests.ts @@ -1,8 +1,7 @@ -// ReSharper disable InconsistentNaming -// ReSharper disable WrongExpressionStatement - /// -/// + +declare function describe(desc: string, f: () => void): void; +declare function it(desc: string, f: () => void): void; // tests adapted from/for tcomb's test folder From a37824dc8fd17a7da8a828f57426f3d8329ca3f9 Mon Sep 17 00:00:00 2001 From: Raphael Thiebault Date: Wed, 1 Mar 2017 17:23:12 +0000 Subject: [PATCH 2/8] Sequelize : Fix missing type fn on FindOptions --- sequelize/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequelize/index.d.ts b/sequelize/index.d.ts index 85283ff468..1852332f0f 100644 --- a/sequelize/index.d.ts +++ b/sequelize/index.d.ts @@ -3183,7 +3183,7 @@ declare namespace sequelize { /** * A hash of attributes to describe your search. See above for examples. */ - where?: WhereOptions | Array; + where?: WhereOptions | fn | Array; /** * A list of the attributes that you want to select. To rename an attribute, you can pass an array, with From 411026b03bdab780eeb883f512f93ea1e1f14b35 Mon Sep 17 00:00:00 2001 From: Raphael Thiebault Date: Tue, 7 Mar 2017 11:39:03 +0000 Subject: [PATCH 3/8] Sequelize : Fix missing test for s.fn() on FindOptions --- sequelize/sequelize-tests.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sequelize/sequelize-tests.ts b/sequelize/sequelize-tests.ts index 9a54ea6d64..b482b1f08b 100644 --- a/sequelize/sequelize-tests.ts +++ b/sequelize/sequelize-tests.ts @@ -905,6 +905,7 @@ User.findAll( { attributes: [[s.fn('count', Sequelize.col('*')), 'count']] }); User.findAll( { attributes: [[s.fn('count', Sequelize.col('*')), 'count']], group: ['sex'] }); User.findAll( { attributes: [s.cast(s.fn('count', Sequelize.col('*')), 'INTEGER')] }); User.findAll( { attributes: [[s.cast(s.fn('count', Sequelize.col('*')), 'INTEGER'), 'count']] }); +User.findAll( { where : s.fn('count', [0, 10]) } ); User.findById( 'a string' ); @@ -925,6 +926,7 @@ User.findOne( { where : { name : 'worker' }, include : [User] } ); User.findOne( { where : { name : 'Boris' }, include : [User, { model : User, as : 'Photos' }] } ); User.findOne( { where : { username : 'someone' }, include : [User] } ); User.findOne( { where : { username : 'barfooz' }, raw : true } ); +User.findOne( { where : s.fn('count', []) } ); /* NOTE https://github.com/DefinitelyTyped/DefinitelyTyped/pull/5590 User.findOne( { updatedAt : { ne : null } } ); */ From bd50abd4f87ae51d56e751c7dc7e95bbfc3ab088 Mon Sep 17 00:00:00 2001 From: Chris Moran Date: Tue, 7 Mar 2017 11:09:16 -0500 Subject: [PATCH 4/8] Add constructors to types I added previously. This removes a warning when trying to use these classes while compiling typescript --- jointjs/index.d.ts | 51 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/jointjs/index.d.ts b/jointjs/index.d.ts index c8ef9ae302..8ecb05f3ba 100644 --- a/jointjs/index.d.ts +++ b/jointjs/index.d.ts @@ -511,6 +511,7 @@ declare namespace joint { polyline?: ShapeAttrs; } class Polyline extends Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class Image extends Generic { constructor(attributes?: GenericAttributes, options?: Object); @@ -539,28 +540,40 @@ declare namespace joint { namespace chess { class KingWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class KingBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class QueenWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class QueenBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class RookWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class RookBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class BishopWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class BishopBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class KnightWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class KnightBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class PawnWhite extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class PawnBlack extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } } @@ -582,23 +595,28 @@ declare namespace joint { removeInPort(port: string, opt?: any): this; } class Coupled extends Model { + constructor(attributes?: ModelAttributes, options?: Object); } class Atomic extends Model { + constructor(attributes?: ModelAttributes, options?: Object); } class Link extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } } namespace erd { class Entity extends basic.Generic { - constructor(attributes?: GenericAttributes, options?: Object); + constructor(attributes?: GenericAttributes, options?: Object); } class WeakEntity extends Entity { + constructor(attributes?: GenericAttributes, options?: Object); } class Relationship extends dia.Element { constructor(attributes?: GenericAttributes, options?: Object); } class IdentifyingRelationship extends Relationship { + constructor(attributes?: GenericAttributes, options?: Object); } interface AttributeAttrs extends dia.TextAttrs { ellipse?: ShapeAttrs; @@ -607,12 +625,16 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Multivalued extends Attribute { + constructor(attributes?: GenericAttributes, options?: Object); } class Derived extends Attribute { + constructor(attributes?: GenericAttributes, options?: Object); } class Key extends Attribute { + constructor(attributes?: GenericAttributes, options?: Object); } class Normal extends Attribute { + constructor(attributes?: GenericAttributes, options?: Object); } interface ISAAttrs extends dia.Element { polygon?: ShapeAttrs; @@ -621,19 +643,23 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Line extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); cardinality(value: string | number): void; } } namespace fsa { class State extends basic.Circle { + constructor(attributes?: GenericAttributes, options?: Object); } class StartState extends dia.Element { constructor(attributes?: GenericAttributes, options?: Object); } class EndState extends dia.Element { + constructor(attributes?: GenericAttributes, options?: Object); } class Arrow extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } } @@ -655,14 +681,19 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class IO extends Gate { + constructor(attributes?: GenericAttributes, options?: Object); } class Input extends IO { + constructor(attributes?: GenericAttributes, options?: Object); } class Output extends IO { + constructor(attributes?: GenericAttributes, options?: Object); } class Gate11 extends Gate { + constructor(attributes?: GenericAttributes, options?: Object); } class Gate21 extends Gate { + constructor(attributes?: GenericAttributes, options?: Object); } interface Image { 'xlink:href'?: string; @@ -720,11 +751,13 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Arrow extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } } namespace pn { class Place extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class PlaceView extends dia.ElementView { renderTokens(): void; @@ -733,6 +766,7 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Link extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } } @@ -750,36 +784,49 @@ declare namespace joint { class ClassView extends dia.ElementView { } class Abstract extends Class { + constructor(attributes?: ClassAttributes, options?: Object); } class AbstractView extends ClassView { + constructor(attributes?: ClassAttributes, options?: Object); } class Interface extends Class { + constructor(attributes?: ClassAttributes, options?: Object); } class InterfaceView extends ClassView { + constructor(attributes?: ClassAttributes, options?: Object); } class Generalization extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } class Implementation extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } class Aggregation extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } class Composition extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } class Association extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } interface StateAttributes extends GenericAttributes { events?: string[]; } class State extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); updateName(): void; updateEvents(): void; updatePath(): void; } class StartState extends basic.Circle { + constructor(attributes?: GenericAttributes, options?: Object); } class EndState extends basic.Generic { + constructor(attributes?: GenericAttributes, options?: Object); } class Transition extends dia.Link { + constructor(attributes?: LinkAttributes, options?: Object); } } } @@ -833,7 +880,7 @@ declare namespace joint { setLinkVertices?: (link: dia.Link, vertices: Position[]) => void; } - class DirectedGraph { + export class DirectedGraph { static layout(graph: dia.Graph | dia.Cell[], options?: LayoutOptions): dia.BBox; } } From 93cdf199a536ef8032eaee9d6161c4ff653576ac Mon Sep 17 00:00:00 2001 From: Chris Moran Date: Tue, 7 Mar 2017 11:15:52 -0500 Subject: [PATCH 5/8] Add namespace prefix to LinkAttributes --- jointjs/index.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/jointjs/index.d.ts b/jointjs/index.d.ts index 8ecb05f3ba..e8c9e8b53e 100644 --- a/jointjs/index.d.ts +++ b/jointjs/index.d.ts @@ -601,7 +601,7 @@ declare namespace joint { constructor(attributes?: ModelAttributes, options?: Object); } class Link extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } } @@ -643,7 +643,7 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Line extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); cardinality(value: string | number): void; } } @@ -659,7 +659,7 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Arrow extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } } @@ -751,7 +751,7 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Arrow extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } } @@ -766,7 +766,7 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Link extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } } @@ -796,19 +796,19 @@ declare namespace joint { constructor(attributes?: ClassAttributes, options?: Object); } class Generalization extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } class Implementation extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } class Aggregation extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } class Composition extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } class Association extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } interface StateAttributes extends GenericAttributes { events?: string[]; @@ -826,7 +826,7 @@ declare namespace joint { constructor(attributes?: GenericAttributes, options?: Object); } class Transition extends dia.Link { - constructor(attributes?: LinkAttributes, options?: Object); + constructor(attributes?: dia.LinkAttributes, options?: Object); } } } From edf261726e3e17cbd7983632b5cf53e16284624b Mon Sep 17 00:00:00 2001 From: Adrian Chia Date: Tue, 7 Mar 2017 14:30:46 -0600 Subject: [PATCH 6/8] Update auth0-js to 8.2.0, update auth0-lock to use auth0 v8 --- auth0-js/auth0-js-tests.ts | 2 +- auth0-js/index.d.ts | 60 ++++++++++++++++++++++++++++++++-- auth0-lock/auth0-lock-tests.ts | 4 +-- auth0-lock/index.d.ts | 21 +++++++----- 4 files changed, 73 insertions(+), 14 deletions(-) diff --git a/auth0-js/auth0-js-tests.ts b/auth0-js/auth0-js-tests.ts index 4d3b08bed4..cbd791030b 100644 --- a/auth0-js/auth0-js-tests.ts +++ b/auth0-js/auth0-js-tests.ts @@ -64,7 +64,7 @@ webAuth.signupAndAuthorize({ webAuth.client.login({ - ealm: 'Username-Password-Authentication', //connection name or HRD domain + realm: 'Username-Password-Authentication', //connection name or HRD domain username: 'info@auth0.com', password: 'areallystrongpassword', audience: 'https://mystore.com/api/v2', diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index cc408023bc..56e3db81e7 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -323,6 +323,13 @@ export class Redirect { export class Popup { constructor(client: any, options: any); + /** + * Returns a new instance of the popup handler + * + * @method buildPopupHandler + */ + buildPopupHandler(): any; + /** * Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser. * @@ -396,6 +403,7 @@ interface AuthOptions { scope?: string; audience?: string; leeway?: number; + plugins?: any[]; _disableDeprecationWarnings?: boolean; _sendTelemetry?: boolean; _telemetryInfo?: any; @@ -409,8 +417,15 @@ interface PasswordlessAuthOptions { } interface Auth0Error { - error: any; - errorDescription: string; + error?: any; + errorDescription?: string; + code?: string; + description?: string; + name?: string; + policy?: string; + original?: any; + statusCode?: number; + statusText?: string; } interface Auth0DecodedHash { @@ -453,3 +468,44 @@ interface PasswordlessVerifyOptions { phoneNumber?: string; email?: string; } + +interface Auth0UserProfile { + name: string; + nickname: string; + picture: string; + user_id: string; + username?: string; + given_name?: string; + family_name?: string; + email?: string; + email_verified?: string; + clientID: string; + gender?: string; + locale?: string; + identities: Auth0Identity[]; + created_at: string; + updated_at: string; + sub: string; + user_metadata?: any; + app_metadata?: any; +} + +interface MicrosoftUserProfile extends Auth0UserProfile { + emails?: string[]; //optional depending on whether email addresses permission is granted +} + +interface Office365UserProfile extends Auth0UserProfile { + tenantid: string; + upn: string; +} + +interface AdfsUserProfile extends Auth0UserProfile { + issuer?: string; +} + +interface Auth0Identity { + connection: string; + isSocial: boolean; + provider: string; + user_id: string; +} diff --git a/auth0-lock/auth0-lock-tests.ts b/auth0-lock/auth0-lock-tests.ts index 8045386586..a241eb6d0c 100644 --- a/auth0-lock/auth0-lock-tests.ts +++ b/auth0-lock/auth0-lock-tests.ts @@ -1,4 +1,4 @@ -import 'auth0-js/v7'; +import * as auth0 from 'auth0-js'; import Auth0Lock from 'auth0-lock'; const CLIENT_ID = "YOUR_AUTH0_APP_CLIENTID"; @@ -38,7 +38,7 @@ lock.show(showOptions); // "on" event-driven example lock.on("authenticated", function(authResult : any) { - lock.getProfile(authResult.idToken, function(error, profile) { + lock.getProfile(authResult.idToken, function(error: auth0.Auth0Error, profile: auth0.Auth0UserProfile) { if (error) { // Handle error return; diff --git a/auth0-lock/index.d.ts b/auth0-lock/index.d.ts index 09c3f4fedd..27b534fb1e 100644 --- a/auth0-lock/index.d.ts +++ b/auth0-lock/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Brian Caruso // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// interface Auth0LockAdditionalSignUpFieldOption { value: string; @@ -11,13 +11,13 @@ interface Auth0LockAdditionalSignUpFieldOption { } type Auth0LockAdditionalSignUpFieldOptionsCallback = - (error: Auth0Error, options: Auth0LockAdditionalSignUpFieldOption[]) => void; + (error: auth0.Auth0Error, options: Auth0LockAdditionalSignUpFieldOption[]) => void; type Auth0LockAdditionalSignUpFieldOptionsFunction = (callback: Auth0LockAdditionalSignUpFieldOptionsCallback) => void; type Auth0LockAdditionalSignUpFieldPrefillCallback = - (error: Auth0Error, prefill: string) => void; + (error: auth0.Auth0Error, prefill: string) => void; type Auth0LockAdditionalSignUpFieldPrefillFunction = (callback: Auth0LockAdditionalSignUpFieldPrefillCallback) => void; @@ -32,8 +32,8 @@ interface Auth0LockAdditionalSignUpField { validator?: (input: string) => { valid: boolean; hint?: string }; } -type Auth0LockAvatarUrlCallback = (error: Auth0Error, url: string) => void; -type Auth0LockAvatarDisplayNameCallback = (error: Auth0Error, displayName: string) => void; +type Auth0LockAvatarUrlCallback = (error: auth0.Auth0Error, url: string) => void; +type Auth0LockAvatarDisplayNameCallback = (error: auth0.Auth0Error, displayName: string) => void; interface Auth0LockAvatarOptions { url: (email: string, callback: Auth0LockAvatarUrlCallback) => void; @@ -63,6 +63,7 @@ interface Auth0LockAuthOptions { redirectUrl?: string; responseType?: string; sso?: boolean; + audience?: string; } interface Auth0LockPopupOptions { @@ -101,6 +102,7 @@ interface Auth0LockConstructorOptions { socialButtonStyle?: "big" | "small"; theme?: Auth0LockThemeOptions; usernameStyle?: string; + oidcConformant?: boolean; } interface Auth0LockFlashMessageOptions { @@ -123,15 +125,16 @@ interface Auth0LockStatic { new (clientId: string, domain: string, options?: Auth0LockConstructorOptions): Auth0LockStatic; // deprecated - getProfile(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void): void; - getUserInfo(token: string, callback: (error: Auth0Error, profile: Auth0UserProfile) => void): void; - + getProfile(token: string, callback: (error: auth0.Auth0Error, profile: auth0.Auth0UserProfile) => void): void; + getUserInfo(token: string, callback: (error: auth0.Auth0Error, profile: auth0.Auth0UserProfile) => void): void; + // https://github.com/auth0/lock#resumeauthhash-callback + resumeAuth( hash: string, callback: (error: auth0.Auth0Error, authResult: any) => void): void; show(options?: Auth0LockShowOptions): void; hide(): void; logout(query: any): void; on(event: "show" | "hide", callback: () => void): void; - on(event: "unrecoverable_error" | "authorization_error", callback: (error: Auth0Error) => void): void; + on(event: "unrecoverable_error" | "authorization_error", callback: (error: auth0.Auth0Error) => void): void; on(event: "authenticated", callback: (authResult: any) => void): void; on(event: string, callback: (...args: any[]) => void): void; } From 8bc911a5c1b25220e6fd35367b58a32241515132 Mon Sep 17 00:00:00 2001 From: Adrian Chia Date: Tue, 7 Mar 2017 14:42:20 -0600 Subject: [PATCH 7/8] increase auth0-js, auth0-lock version number in header --- auth0-js/index.d.ts | 2 +- auth0-lock/index.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/auth0-js/index.d.ts b/auth0-js/index.d.ts index 56e3db81e7..f51e3979d3 100644 --- a/auth0-js/index.d.ts +++ b/auth0-js/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Auth0.js 8.1 +// Type definitions for Auth0.js 8.2 // Project: https://github.com/auth0/auth0.js // Definitions by: Adrian Chia // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped diff --git a/auth0-lock/index.d.ts b/auth0-lock/index.d.ts index 27b534fb1e..285ad25288 100644 --- a/auth0-lock/index.d.ts +++ b/auth0-lock/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for auth0-lock 10.9 +// Type definitions for auth0-lock 10.10 // Project: http://auth0.com // Definitions by: Brian Caruso // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped From b77325fd0c234f1a571e95c2dd6cc3cfb4942a3a Mon Sep 17 00:00:00 2001 From: Chris Moran Date: Tue, 7 Mar 2017 16:57:46 -0500 Subject: [PATCH 8/8] Add some missing methods to Element class --- jointjs/index.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jointjs/index.d.ts b/jointjs/index.d.ts index e8c9e8b53e..95e2b2b7e3 100644 --- a/jointjs/index.d.ts +++ b/jointjs/index.d.ts @@ -156,6 +156,15 @@ declare namespace joint { findView(paper: Paper): ElementView; isElement(): boolean; scale(scaleX: number, scaleY: number, origin?: Point, options?: any): this; + addPort(port: any, opt?: any): this; + addPorts(ports: any[], opt?: any): this; + removePort(port: any, opt?: any): this; + hasPorts(): boolean; + hasPort(id: string): boolean; + getPorts(): any[]; + getPort(id: string): any; + getPortIndex(port: any): number; + portProp(portId: string, path: any, value?: any, opt?: any): joint.dia.Element; } interface CSSSelector {