Merge branch 'master' of DefinitelyType
This commit is contained in:
Joe Tuttle
2017-03-07 18:46:07 -05:00
17 changed files with 175 additions and 37 deletions

View File

@@ -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',

62
auth0-js/index.d.ts vendored
View File

@@ -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 <https://github.com/adrianchia>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -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;
}

View File

@@ -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;

23
auth0-lock/index.d.ts vendored
View File

@@ -1,9 +1,9 @@
// Type definitions for auth0-lock 10.9
// Type definitions for auth0-lock 10.10
// Project: http://auth0.com
// Definitions by: Brian Caruso <https://github.com/carusology>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="auth0-js/v7" />
/// <reference types="auth0-js" />
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;
}

View File

@@ -1,5 +1,5 @@
/// <reference types="jasmine" />
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", () => {

View File

@@ -2,10 +2,14 @@
// Project: https://github.com/searls/jasmine-fixture
// Definitions by: Craig Brett <https://github.com/craigbrett17/>
// 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
*/
/// <reference types="jasmine" />
/**
* 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 {

View File

@@ -1,8 +1,6 @@
/// <reference types="jasmine" />
/// <reference types="jquery" />
/// <reference types="jasmine-jquery" />
describe("Jasmine fixture extension", () => {
describe("Affixes dom elements to body", () => {
it("Inserts a new element on affix", () => {

60
jointjs/index.d.ts vendored
View File

@@ -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 {
@@ -511,6 +520,7 @@ declare namespace joint {
polyline?: ShapeAttrs;
}
class Polyline extends Generic {
constructor(attributes?: GenericAttributes<PolylineAttrs>, options?: Object);
}
class Image extends Generic {
constructor(attributes?: GenericAttributes<dia.TextAttrs>, options?: Object);
@@ -539,28 +549,40 @@ declare namespace joint {
namespace chess {
class KingWhite extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class KingBlack extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class QueenWhite extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class QueenBlack extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class RookWhite extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class RookBlack extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class BishopWhite extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class BishopBlack extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class KnightWhite extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class KnightBlack extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class PawnWhite extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class PawnBlack extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
}
@@ -582,23 +604,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?: dia.LinkAttributes, options?: Object);
}
}
namespace erd {
class Entity extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.TextAttrs>, options?: Object);
constructor(attributes?: GenericAttributes<dia.TextAttrs>, options?: Object);
}
class WeakEntity extends Entity {
constructor(attributes?: GenericAttributes<dia.TextAttrs>, options?: Object);
}
class Relationship extends dia.Element {
constructor(attributes?: GenericAttributes<dia.TextAttrs>, options?: Object);
}
class IdentifyingRelationship extends Relationship {
constructor(attributes?: GenericAttributes<dia.TextAttrs>, options?: Object);
}
interface AttributeAttrs extends dia.TextAttrs {
ellipse?: ShapeAttrs;
@@ -607,12 +634,16 @@ declare namespace joint {
constructor(attributes?: GenericAttributes<AttributeAttrs>, options?: Object);
}
class Multivalued extends Attribute {
constructor(attributes?: GenericAttributes<AttributeAttrs>, options?: Object);
}
class Derived extends Attribute {
constructor(attributes?: GenericAttributes<AttributeAttrs>, options?: Object);
}
class Key extends Attribute {
constructor(attributes?: GenericAttributes<AttributeAttrs>, options?: Object);
}
class Normal extends Attribute {
constructor(attributes?: GenericAttributes<AttributeAttrs>, options?: Object);
}
interface ISAAttrs extends dia.Element {
polygon?: ShapeAttrs;
@@ -621,19 +652,23 @@ declare namespace joint {
constructor(attributes?: GenericAttributes<ISAAttrs>, options?: Object);
}
class Line extends dia.Link {
constructor(attributes?: dia.LinkAttributes, options?: Object);
cardinality(value: string | number): void;
}
}
namespace fsa {
class State extends basic.Circle {
constructor(attributes?: GenericAttributes<basic.CircleAttrs>, options?: Object);
}
class StartState extends dia.Element {
constructor(attributes?: GenericAttributes<basic.CircleAttrs>, options?: Object);
}
class EndState extends dia.Element {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class Arrow extends dia.Link {
constructor(attributes?: dia.LinkAttributes, options?: Object);
}
}
@@ -655,14 +690,19 @@ declare namespace joint {
constructor(attributes?: GenericAttributes<IOAttrs>, options?: Object);
}
class IO extends Gate {
constructor(attributes?: GenericAttributes<IOAttrs>, options?: Object);
}
class Input extends IO {
constructor(attributes?: GenericAttributes<IOAttrs>, options?: Object);
}
class Output extends IO {
constructor(attributes?: GenericAttributes<IOAttrs>, options?: Object);
}
class Gate11 extends Gate {
constructor(attributes?: GenericAttributes<IOAttrs>, options?: Object);
}
class Gate21 extends Gate {
constructor(attributes?: GenericAttributes<IOAttrs>, options?: Object);
}
interface Image {
'xlink:href'?: string;
@@ -720,11 +760,13 @@ declare namespace joint {
constructor(attributes?: GenericAttributes<MemberAttrs>, options?: Object);
}
class Arrow extends dia.Link {
constructor(attributes?: dia.LinkAttributes, options?: Object);
}
}
namespace pn {
class Place extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class PlaceView extends dia.ElementView {
renderTokens(): void;
@@ -733,6 +775,7 @@ declare namespace joint {
constructor(attributes?: GenericAttributes<basic.RectAttrs>, options?: Object);
}
class Link extends dia.Link {
constructor(attributes?: dia.LinkAttributes, options?: Object);
}
}
@@ -750,36 +793,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?: dia.LinkAttributes, options?: Object);
}
class Implementation extends dia.Link {
constructor(attributes?: dia.LinkAttributes, options?: Object);
}
class Aggregation extends dia.Link {
constructor(attributes?: dia.LinkAttributes, options?: Object);
}
class Composition extends dia.Link {
constructor(attributes?: dia.LinkAttributes, options?: Object);
}
class Association extends dia.Link {
constructor(attributes?: dia.LinkAttributes, options?: Object);
}
interface StateAttributes extends GenericAttributes<ShapeAttrs> {
events?: string[];
}
class State extends basic.Generic {
constructor(attributes?: GenericAttributes<basic.CircleAttrs>, options?: Object);
updateName(): void;
updateEvents(): void;
updatePath(): void;
}
class StartState extends basic.Circle {
constructor(attributes?: GenericAttributes<basic.CircleAttrs>, options?: Object);
}
class EndState extends basic.Generic {
constructor(attributes?: GenericAttributes<dia.SVGAttributes>, options?: Object);
}
class Transition extends dia.Link {
constructor(attributes?: dia.LinkAttributes, options?: Object);
}
}
}
@@ -833,7 +889,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;
}
}

View File

@@ -1,6 +1,21 @@
/// <reference types="jasmine" />
import Qty from "js-quantities";
declare function describe(desc: string, fn: () => void): void;
declare function it(desc: string, fn: () => void): void;
interface Expect<T> {
not: this;
toBe(y: T): void;
toEqual(y: T): void;
toBeTruthy(): void;
toBeNull(): void;
toBeCloseTo(this: Expect<number>, x: number, sigFigs: number): void;
toThrow(this: Expect<() => void>, msg?: string): void;
toContain<U>(this: Expect<U[]>, x: U): void;
};
declare function expect<T>(x: T): Expect<T>;
declare function beforeEach(f: () => void): void;
declare function afterEach(f: () => void): void;
// From project readme
let qty: Qty;

View File

@@ -1,7 +1,8 @@
/// <reference types="jasmine" />
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");

View File

@@ -2,6 +2,9 @@
// Project: https://github.com/helior/react-highlighter
// Definitions by: Pedro Pereira <https://github.com/oizie>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/// <reference types="react" />
declare var Highlight: any;
export = Highlight;

2
redux-ui/index.d.ts vendored
View File

@@ -2,7 +2,9 @@
// Project: https://github.com/tonyhb/redux-ui
// Definitions by: Andy Shu Xin <https://github.com/andyshuxin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/// <reference types="react" />
import * as Redux from 'redux';
export interface uiParams<UIStateShape> {

View File

@@ -1,5 +1,4 @@
import Reflux = require("reflux");
import React = require("react");
var syncActions = Reflux.createActions([
"statusUpdate",

View File

@@ -3183,7 +3183,7 @@ declare namespace sequelize {
/**
* A hash of attributes to describe your search. See above for examples.
*/
where?: WhereOptions | Array<col | and | or | string>;
where?: WhereOptions | fn | Array<col | and | or | string>;
/**
* A list of the attributes that you want to select. To rename an attribute, you can pass an array, with

View File

@@ -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 } } );
*/

View File

@@ -1,9 +1,9 @@
/// <reference types="jasmine" />
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:

View File

@@ -1,8 +1,7 @@
// ReSharper disable InconsistentNaming
// ReSharper disable WrongExpressionStatement
/// <reference types="node"/>
/// <reference types="jasmine" />
declare function describe(desc: string, f: () => void): void;
declare function it(desc: string, f: () => void): void;
// tests adapted from/for tcomb's test folder