mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Vendored
+2
-2
@@ -51,8 +51,8 @@ declare module 'angular' {
|
||||
cloakClassName(name: string): ITranslateProvider;
|
||||
fallbackLanguage(langKey?: string): string;
|
||||
fallbackLanguage(langKey?: string[]): string;
|
||||
instant(translationId: string, interpolateParams?: any, interpolationId?: string): string;
|
||||
instant(translationId: string[], interpolateParams?: any, interpolationId?: string): { [key: string]: string };
|
||||
instant(translationId: string, interpolateParams?: any, interpolationId?: string, forceLanguage?: string, sanitizeStrategy?: string): string;
|
||||
instant(translationId: string[], interpolateParams?: any, interpolationId?: string, forceLanguage?: string, sanitizeStrategy?: string): { [key: string]: string };
|
||||
isPostCompilingEnabled(): boolean;
|
||||
preferredLanguage(langKey?: string): string;
|
||||
proposedLanguage(): string;
|
||||
|
||||
Vendored
+1
@@ -735,6 +735,7 @@ declare namespace createjs {
|
||||
intersection(rect: Rectangle): Rectangle;
|
||||
intersects(rect: Rectangle): boolean;
|
||||
isEmpty(): boolean;
|
||||
pad(top: number, left: number, bottom: number, right: number): Rectangle;
|
||||
setValues(x?: number, y?: number, width?: number, height?: number): Rectangle;
|
||||
toString(): string;
|
||||
union(rect: Rectangle): Rectangle;
|
||||
|
||||
@@ -19,6 +19,22 @@ function test_getAuthInstance(){
|
||||
var auth = gapi.auth2.getAuthInstance();
|
||||
}
|
||||
|
||||
function test_signIn(){
|
||||
gapi.auth2.getAuthInstance().signIn({
|
||||
scope: 'email profile',
|
||||
prompt: 'content'
|
||||
});
|
||||
}
|
||||
|
||||
function test_signInOptionsBuild(){
|
||||
var options = new gapi.auth2.SigninOptionsBuilder();
|
||||
options.setAppPackageName('com.example.app');
|
||||
options.setFetchBasicProfile(true);
|
||||
options.setPrompt('select_account');
|
||||
options.setScope('profile').setScope('email');
|
||||
gapi.auth2.getAuthInstance().signIn(options);
|
||||
}
|
||||
|
||||
function test_getAuthResponse(){
|
||||
var user = gapi.auth2.getAuthInstance().currentUser.get();
|
||||
var authResponse = user.getAuthResponse();
|
||||
|
||||
Vendored
+32
-25
@@ -31,12 +31,7 @@ declare namespace gapi.auth2 {
|
||||
/**
|
||||
* Signs in the user using the specified options.
|
||||
*/
|
||||
signIn(options?: {
|
||||
app_package_name?: string;
|
||||
fetch_basic_profile?: boolean;
|
||||
prompt?: boolean;
|
||||
scope?: string;
|
||||
}, optionBuilder?: SigninOptionsBuilder): any;
|
||||
signIn(options?: SigninOptions | SigninOptionsBuilder): any;
|
||||
|
||||
/**
|
||||
* Signs out all accounts from the application.
|
||||
@@ -59,12 +54,8 @@ declare namespace gapi.auth2 {
|
||||
/**
|
||||
* Attaches the sign-in flow to the specified container's click handler.
|
||||
*/
|
||||
attachClickHandler(container: any, options: {
|
||||
app_package_name?: string;
|
||||
fetch_basic_profile?: boolean;
|
||||
prompt?: boolean;
|
||||
scope?: string;
|
||||
}, onsuccess: (googleUser: GoogleUser) => any, onfailure: (reason: string) => any): any;
|
||||
attachClickHandler(container: any, options: SigninOptions,
|
||||
onsuccess: (googleUser: GoogleUser) => any, onfailure: (reason: string) => any): any;
|
||||
}
|
||||
|
||||
export interface IsSignedIn{
|
||||
@@ -93,6 +84,32 @@ declare namespace gapi.auth2 {
|
||||
listen(listener: (user: GoogleUser) => any): void;
|
||||
}
|
||||
|
||||
export interface SigninOptions {
|
||||
/**
|
||||
* The package name of the Android app to install over the air.
|
||||
* See Android app installs from your web site:
|
||||
* https://developers.google.com/identity/sign-in/web/android-app-installs
|
||||
*/
|
||||
app_package_name?: string;
|
||||
/**
|
||||
* Fetch users' basic profile information when they sign in.
|
||||
* Adds 'profile', 'email' and 'openid' to the requested scopes.
|
||||
* True if unspecified.
|
||||
*/
|
||||
fetch_basic_profile?: boolean;
|
||||
/**
|
||||
* Specifies whether to prompt the user for re-authentication.
|
||||
* See OpenID Connect Request Parameters:
|
||||
* https://openid.net/specs/openid-connect-basic-1_0.html#RequestParameters
|
||||
*/
|
||||
prompt?: string;
|
||||
/**
|
||||
* The scopes to request, as a space-delimited string.
|
||||
* Optional if fetch_basic_profile is not set to false.
|
||||
*/
|
||||
scope?: string;
|
||||
}
|
||||
|
||||
export class SigninOptionsBuilder {
|
||||
setAppPackageName(name: string): any;
|
||||
setFetchBasicProfile(fetch: boolean): any;
|
||||
@@ -164,22 +181,12 @@ declare namespace gapi.auth2 {
|
||||
* When you use GoogleUser.signIn(), the sign-in flow skips the account chooser step.
|
||||
* See GoogleAuth.signIn().
|
||||
*/
|
||||
signIn(options?: {
|
||||
app_package_name?: string;
|
||||
fetch_basic_profile?: boolean;
|
||||
prompt?: boolean;
|
||||
scope?: string;
|
||||
}, optionBuilder?: SigninOptionsBuilder): any;
|
||||
signIn(options?: SigninOptions | SigninOptionsBuilder): any;
|
||||
|
||||
/**
|
||||
*
|
||||
* See GoogleUser.signIn()
|
||||
*/
|
||||
grant(options?: {
|
||||
app_package_name?: string;
|
||||
fetch_basic_profile?: boolean;
|
||||
prompt?: boolean;
|
||||
scope?: string;
|
||||
}, optionBuilder?: SigninOptionsBuilder): any;
|
||||
grant(options?: SigninOptions | SigninOptionsBuilder): any;
|
||||
|
||||
/**
|
||||
* Get permission from the user to access the specified scopes offline.
|
||||
|
||||
Vendored
+161
@@ -0,0 +1,161 @@
|
||||
// Type definitions for jQuery TOOLS 1.2
|
||||
// Project: https://github.com/jquerytools/jquerytools
|
||||
// Definitions by: Joe Skeen <https://github.com/joeskeen/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
/// <reference types="jquery"/>
|
||||
|
||||
declare interface JQuery {
|
||||
overlay(opts?: JQueryTools.overlay.OverlayOptions): JQuery;
|
||||
overlay<T extends JQueryTools.overlay.Overlay>(opts?: JQueryTools.overlay.OverlayOptions): T;
|
||||
data(key: 'overlay'): JQueryTools.overlay.Overlay;
|
||||
}
|
||||
|
||||
declare interface JQueryStatic {
|
||||
tools: JQueryTools.ToolsStatic;
|
||||
}
|
||||
|
||||
/** jQuery Tools (http://jquerytools.github.io/documentation/overlay/index.html) */
|
||||
declare namespace JQueryTools {
|
||||
interface ToolsStatic {
|
||||
overlay: overlay.OverlayStatic;
|
||||
}
|
||||
|
||||
namespace overlay {
|
||||
interface OverlayStatic {
|
||||
addEffect(effectName: string,
|
||||
effectFn: (this: Overlay, position: CssOptions, done: () => void) => void,
|
||||
closeFn: (this: Overlay, done: () => void) => void): void;
|
||||
}
|
||||
|
||||
interface CssOptions {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
interface OverlayOptions {
|
||||
/**
|
||||
* A jQuery selector for the closing elements inside the overlay. These
|
||||
* can be any elements such as links, buttons or images. If this is not
|
||||
* supplied, a close element is auto-generated. Read more about this in
|
||||
* defining close actions.
|
||||
*/
|
||||
close?: JQuery;
|
||||
/**
|
||||
* By default, overlays are closed when the mouse is clicked outside the
|
||||
* overlay area. Setting this property to false suppresses this behaviour
|
||||
* which is suitable for modal dialogs.
|
||||
* @default true
|
||||
*/
|
||||
closeOnClick?: boolean;
|
||||
/**
|
||||
* By default, overlays are closed when the ESC keyboard key is pressed.
|
||||
* Setting this property to false suppresses this behaviour.
|
||||
* @default true
|
||||
*/
|
||||
closeOnEsc?: boolean;
|
||||
/** The speed to close the overlay, in milliseconds */
|
||||
closeSpeed?: number;
|
||||
/**
|
||||
* The effect to be used when an overlay is opened and closed. This can
|
||||
* dramatically change the behaviour of the overlay. By default this tool
|
||||
* uses an effect called "default" which is a simple show/hide effect.
|
||||
* @default 'default'
|
||||
*/
|
||||
effect?: string;
|
||||
/**
|
||||
* since 1.2.0. whether overlay stays in the same position while the screen
|
||||
* is scrolled. This is the default behaviour for all browsers except IE6
|
||||
* and below. IE6 does not support fixed positioning. If this property is
|
||||
* set to false then the overlay is positioned in relationship to the document
|
||||
* so that when the screen is scrolled then the overlay moves along with the document.
|
||||
* @default true
|
||||
*/
|
||||
fixed?: boolean;
|
||||
/**
|
||||
* Previously known as expose. Overlay is very often used together with the
|
||||
* Mask Tool. Because of this, the support for this feature has been built
|
||||
* inside the tool. This option accepts the mask configuration. This is either
|
||||
* a simple string specifying the background color of the mask or a more complex
|
||||
* object literal specifying more configuration variables. See an example of an
|
||||
* overlay together with mask. By default masking is disabled.
|
||||
*/
|
||||
mask?: string | MaskOptions;
|
||||
/**
|
||||
* Specifies how far from the left-hand edge of the screen the overlay should be
|
||||
* placed. By default the overlay is horizontally centered with the value "center"
|
||||
* but you can also supply a numerical value specifying a distance in pixels.
|
||||
* @default 'center'
|
||||
*/
|
||||
left?: 'center' | number;
|
||||
/**
|
||||
* If enabled then the overlay loads immediately after it has been initialized.
|
||||
* @default false
|
||||
*/
|
||||
load?: boolean;
|
||||
/**
|
||||
* By default, there can be only one overlay on the page at once. Setting this
|
||||
* property to false allows you to have multiple overlay instances.
|
||||
* @default true
|
||||
*/
|
||||
oneInstance?: boolean;
|
||||
/**
|
||||
* The speed of the fade-in animation on the "default" effect. Valid values are
|
||||
* 'slow', 'normal' and 'fast', or you can supply a numerical value (in milliseconds).
|
||||
* By setting this property to 0, the overlay will appear immediately without any animation.
|
||||
* @default 'normal'
|
||||
*/
|
||||
speed?: 'slow' | 'normal' | 'fast' | number;
|
||||
/**
|
||||
* The element to be overlayed (if not specified in the rel attribute of the triggering element).
|
||||
*/
|
||||
target?: Element;
|
||||
/**
|
||||
* Specifies how far from the top edge of the screen the overlay should be placed.
|
||||
* Acceptable values are an integer number specifying a distance in pixels, a string
|
||||
* (such as '15%') specifying a percentage value or "center" in which case the overlay
|
||||
* is vertically centered. Percentage values work consistently at different screen resolutions.
|
||||
* @default '10%'
|
||||
*/
|
||||
top?: string | number;
|
||||
|
||||
/**
|
||||
* before the overlay is displayed. The overlay has already been positioned at the
|
||||
* location from where it will start animating.
|
||||
*/
|
||||
onBeforeLoad?: (this: Overlay, event: JQueryEventObject) => void;
|
||||
/** when the overlay has completely been displayed */
|
||||
onLoad?: (this: Overlay, event: JQueryEventObject) => void;
|
||||
/** before the overlay is closed */
|
||||
onBeforeClose?: (this: Overlay, event: JQueryEventObject) => void;
|
||||
/** when the overlay is closed */
|
||||
onClose?: (this: Overlay, event: JQueryEventObject) => void;
|
||||
}
|
||||
|
||||
interface MaskOptions {
|
||||
/** CSS color string (i.e. hex value) */
|
||||
color?: string;
|
||||
/** load speed in milliseconds */
|
||||
loadSpeed?: number;
|
||||
/** Opacity of mask. Between 0 and 1. */
|
||||
opacity?: number;
|
||||
}
|
||||
|
||||
interface Overlay {
|
||||
/** Closes the overlay. */
|
||||
close(): Overlay;
|
||||
/** Returns the closing element(s) as a jQuery object. */
|
||||
getClosers(): JQuery;
|
||||
/** Returns the configuration for the overlay. */
|
||||
getConf(): OverlayOptions;
|
||||
/** Returns the overlayed element as a jQuery object. */
|
||||
getOverlay(): JQuery;
|
||||
/** Returns the triggering element as a jQuery object. */
|
||||
getTrigger(): JQuery;
|
||||
/** Returns `true` if the overlay is opened. */
|
||||
isOpened(): boolean;
|
||||
/** Opens the overlay. */
|
||||
load(): Overlay;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
/// <reference path="index.d.ts" />
|
||||
|
||||
/* from documentation at http://jquerytools.github.io/documentation/overlay/index.html */
|
||||
|
||||
$("img[rel]").overlay();
|
||||
|
||||
var triggers = $(".modalInput").overlay({
|
||||
|
||||
// some mask tweaks suitable for modal dialogs
|
||||
mask: {
|
||||
color: '#ebecff',
|
||||
loadSpeed: 200,
|
||||
opacity: 0.9
|
||||
},
|
||||
|
||||
closeOnClick: false
|
||||
});
|
||||
|
||||
var buttons = $("#yesno button").click(function(this: JQuery, e: JQueryEventObject) {
|
||||
|
||||
// get user input
|
||||
var yes = buttons.index(this) === 0;
|
||||
|
||||
// do something with the answer
|
||||
triggers.eq(0).html("You clicked " + (yes ? "yes" : "no"));
|
||||
});
|
||||
|
||||
// select one or more elements to be overlay triggers
|
||||
$(".my_overlay_trigger").overlay({
|
||||
// one configuration property
|
||||
mask: {
|
||||
color: '#ccc'
|
||||
},
|
||||
// another property
|
||||
top: 50
|
||||
// ... the rest of the configuration properties
|
||||
});
|
||||
|
||||
$("#prompt form").submit(function(this: JQuery, e: JQueryEventObject) {
|
||||
|
||||
// close the overlay
|
||||
triggers.eq(1).overlay<JQueryTools.overlay.Overlay>().close();
|
||||
//or more straightforward:
|
||||
triggers.data('overlay').close();
|
||||
|
||||
// get user input
|
||||
var input = $("input", this).val();
|
||||
|
||||
// do something with the answer
|
||||
triggers.eq(1).html(input);
|
||||
|
||||
// do not submit the form
|
||||
return e.preventDefault();
|
||||
});
|
||||
|
||||
$.tools.overlay.addEffect('', function() {}, function() {});
|
||||
|
||||
/* custom effects */
|
||||
$.tools.overlay.addEffect("myEffect", function(position, done) {
|
||||
/*
|
||||
- 'this' variable is a reference to the overlay API
|
||||
- here we use jQuery's fadeIn() method to perform the effect
|
||||
*/
|
||||
this.getOverlay().css(position).fadeIn(this.getConf().speed, done);
|
||||
},
|
||||
|
||||
// close function
|
||||
function(done) {
|
||||
// fade out the overlay
|
||||
this.getOverlay().fadeOut(this.getConf().closeSpeed, done);
|
||||
}
|
||||
);
|
||||
|
||||
$("#apple img[rel]").overlay({effect: 'apple'});
|
||||
|
||||
// select the overlay element - and "make it an overlay"
|
||||
$("#facebox").overlay({
|
||||
// custom top position
|
||||
top: 260,
|
||||
// some mask tweaks suitable for facebox-looking dialogs
|
||||
mask: {
|
||||
// you might also consider a "transparent" color for the mask
|
||||
color: '#fff',
|
||||
// load mask a little faster
|
||||
loadSpeed: 200,
|
||||
// very transparent
|
||||
opacity: 0.5
|
||||
},
|
||||
// disable this for modal dialog-type of overlays
|
||||
closeOnClick: false,
|
||||
// load it immediately after the construction
|
||||
load: true
|
||||
});
|
||||
|
||||
$(function() {
|
||||
|
||||
// if the function argument is given to overlay,
|
||||
// it is assumed to be the onBeforeLoad event listener
|
||||
$("a[rel]").overlay({
|
||||
|
||||
mask: 'darkred',
|
||||
effect: 'apple',
|
||||
|
||||
onBeforeLoad: function() {
|
||||
|
||||
// grab wrapper element inside content
|
||||
var wrap = this.getOverlay().find(".contentWrap");
|
||||
|
||||
// load the page specified in the trigger
|
||||
wrap.load(this.getTrigger().attr("href"));
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
$(function() {
|
||||
// positions for each overlay
|
||||
var positions = [
|
||||
[0, 530],
|
||||
[400, 20],
|
||||
[400, 530],
|
||||
[0, 20]
|
||||
];
|
||||
|
||||
// setup triggers
|
||||
$("button[rel]").each(function(this: JQuery, i: number) {
|
||||
|
||||
$(this).overlay({
|
||||
|
||||
// common configuration for each overlay
|
||||
oneInstance: false,
|
||||
closeOnClick: false,
|
||||
|
||||
// setup custom finish position
|
||||
top: positions[i][0],
|
||||
left: positions[i][1],
|
||||
|
||||
// use apple effect
|
||||
effect: 'apple'
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// loading animation
|
||||
$.tools.overlay.addEffect("drop", function(css, done) {
|
||||
|
||||
// use Overlay API to gain access to crucial elements
|
||||
var conf = this.getConf(),
|
||||
overlay = this.getOverlay();
|
||||
|
||||
// determine initial position for the overlay
|
||||
if (conf.fixed) {
|
||||
css['position'] = 'fixed';
|
||||
} else {
|
||||
css['top'] += $(window).scrollTop();
|
||||
css['left'] += $(window).scrollLeft();
|
||||
css['position'] = 'absolute';
|
||||
}
|
||||
|
||||
// position the overlay and show it
|
||||
overlay.css(css).show();
|
||||
|
||||
// begin animating with our custom easing
|
||||
overlay.animate(
|
||||
{ top: '+=55', opacity: 1, width: '+=20'}, 400, 'drop', done
|
||||
);
|
||||
|
||||
/* closing animation */
|
||||
}, function(done) {
|
||||
this.getOverlay().animate(
|
||||
{top:'-=55', opacity:0, width:'-=20'}, 300, 'drop',
|
||||
function(this: JQuery) {
|
||||
$(this).hide();
|
||||
done.call(null);
|
||||
});
|
||||
});
|
||||
|
||||
$("img[rel]").overlay({
|
||||
effect: 'drop',
|
||||
mask: '#789'
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jquery.tools-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Vendored
+1
-1
@@ -142,7 +142,7 @@ declare namespace later {
|
||||
* For acces to custom time periods created as extension to the later static type
|
||||
* and modifiers created on the later modifier static type.
|
||||
*/
|
||||
[ timeperiodAndModifierName: string ]: number[];
|
||||
[ timeperiodAndModifierName: string ]: number[] | undefined;
|
||||
}
|
||||
|
||||
interface ParseStatic {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
|
||||
Vendored
+5
@@ -2163,6 +2163,11 @@ declare module "mongoose" {
|
||||
* @param fields the field(s) to unwind
|
||||
*/
|
||||
unwind(...fields: string[]): this;
|
||||
/**
|
||||
* Appends new custom $unwind operator(s) to this aggregate pipeline
|
||||
* new in mongodb 3.2
|
||||
*/
|
||||
unwind(...opts: { path: string, includeArrayIndex?: string, preserveNullAndEmptyArrays?: boolean }[]): this;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1016,7 +1016,41 @@ aggregate.sort('field -test');
|
||||
aggregate.then(cb).catch(cb);
|
||||
aggregate.unwind("tags").unwind('tags');
|
||||
aggregate.unwind("a", "b", "c").unwind('tag1', 'tag2');
|
||||
|
||||
aggregate.unwind(
|
||||
{
|
||||
path: "tags",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
})
|
||||
.unwind({
|
||||
path: "tags",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
});
|
||||
aggregate.unwind(
|
||||
{
|
||||
path: "a",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
}, {
|
||||
path: "b",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
}, {
|
||||
path: "c",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
})
|
||||
.unwind({
|
||||
path: "tag1",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
}, {
|
||||
path: "tag2",
|
||||
includeArrayIndex: "idx",
|
||||
preserveNullAndEmptyArrays: true
|
||||
});
|
||||
|
||||
/*
|
||||
* section schematype.js
|
||||
* http://mongoosejs.com/docs/api.html#schematype-js
|
||||
|
||||
Vendored
+71
@@ -0,0 +1,71 @@
|
||||
// Type definitions for node-xmpp-client 3.1
|
||||
// Project: https://github.com/node-xmpp/node-xmpp/tree/master/packages/node-xmpp-client/
|
||||
// Definitions by: PJakcson <https://github.com/PJakcson>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
export declare class Client {
|
||||
static Stanza: Stanza;
|
||||
|
||||
constructor(options: XmppOptions);
|
||||
|
||||
connect(): void;
|
||||
|
||||
disconnect(): void;
|
||||
|
||||
on(event: string, c: (e: any, d: any) => any): void;
|
||||
|
||||
send(stanza: any): void;
|
||||
}
|
||||
|
||||
interface Stanza extends Element {
|
||||
// This has to be used for the static class initializer new Client.Stanza(..). If there is a better way feel free to
|
||||
// contribute.
|
||||
// tslint:disable-next-line
|
||||
new(name: string, attr: any): Stanza;
|
||||
from: string;
|
||||
to: string;
|
||||
id: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
interface Element {
|
||||
is(name: string, xmlns: string): boolean;
|
||||
getName(): string;
|
||||
getNS(): string;
|
||||
findNS(prefix: string): string;
|
||||
getXmlns(): string;
|
||||
setAttrs(attrs: any): void;
|
||||
getAttrs(): any;
|
||||
|
||||
up(): Element;
|
||||
c(name: string, attrs?: any): Element;
|
||||
cnode(child: Element): Element;
|
||||
t(text: string): Element;
|
||||
remove(el: Element, xmnls: string): Element;
|
||||
attr(attr: any, val: any): any;
|
||||
|
||||
toString(): string;
|
||||
toJSON(): any;
|
||||
}
|
||||
|
||||
interface XmppOptions {
|
||||
jid: string;
|
||||
password: string;
|
||||
host?: string;
|
||||
port?: number;
|
||||
reconnect?: boolean;
|
||||
autostart?: boolean; // if we start connecting to a given port
|
||||
register?: boolean; // register account before authentication
|
||||
legacySSL?: boolean; // connect to the legacy SSL port, requires at least the host to be specified
|
||||
credentials?: any; // Dictionary (optional) - TLS or SSL key and certificate credentials
|
||||
actAs?: string; // if admin user act on behalf of another user (just user)
|
||||
disallowTLS?: boolean; // prevent upgrading the connection to a secure one via TLS
|
||||
preferred?: string; // Preferred SASL mechanism to use
|
||||
bosh?: Bosh;
|
||||
}
|
||||
|
||||
interface Bosh {
|
||||
url?: string;
|
||||
prebind?: (error: any, data: any) => void;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import {Client} from './index';
|
||||
|
||||
let client = new Client({
|
||||
jid: 'user@example.com',
|
||||
password: 'password'
|
||||
});
|
||||
|
||||
client.connect();
|
||||
|
||||
client.on('online', function () {
|
||||
});
|
||||
|
||||
client.on('stanza', function (stanza) {
|
||||
let _ = stanza;
|
||||
});
|
||||
|
||||
let stanza = new Client.Stanza('chat', {})
|
||||
.c('show').t('chat').up()
|
||||
.c('status').t('message');
|
||||
client.send(stanza);
|
||||
|
||||
client.disconnect();
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"node-xmpp-client-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "../tslint.json"
|
||||
}
|
||||
Vendored
+2
@@ -91,6 +91,8 @@ declare namespace request {
|
||||
qsStringifyOptions?: any;
|
||||
qsParseOptions?: any;
|
||||
json?: any;
|
||||
jsonReviver?: (key: string, value: any) => any;
|
||||
jsonReplacer?: (key: string, value: any) => any;
|
||||
multipart?: RequestPart[] | Multipart;
|
||||
agent?: http.Agent | https.Agent;
|
||||
agentOptions?: any;
|
||||
|
||||
@@ -91,6 +91,12 @@ var options: request.Options = {
|
||||
aws: aws,
|
||||
qs: obj,
|
||||
json: value,
|
||||
jsonReviver: (key: string, value: any) => {
|
||||
|
||||
},
|
||||
jsonReplacer: (key: string, value: any) => {
|
||||
|
||||
},
|
||||
multipart: value,
|
||||
agent: new http.Agent(),
|
||||
agentOptions: value,
|
||||
|
||||
Vendored
+5
-5
@@ -1,6 +1,6 @@
|
||||
// Type definitions for RSVP 3.0.9
|
||||
// Project: github.com/tildeio/rsvp.js 3.0.9
|
||||
// Definitions by: Taylor Brown <https://github.com/Taytay>
|
||||
// Type definitions for RSVP 3.3.3
|
||||
// Project: https://github.com/tildeio/rsvp.js
|
||||
// Definitions by: Taylor Brown <https://github.com/Taytay>, Mikael Kohlmyr <https://github.com/mkohlmyr>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// Some of this file was taken from the type definitions for es6-promise https://github.com/borisyankov/DefinitelyTyped/blob/master/es6-promise/es6-promise.d.ts
|
||||
@@ -220,8 +220,8 @@ declare module RSVP {
|
||||
* having to remember the initial order like you would with all().
|
||||
*
|
||||
*/
|
||||
export function hash<T>(promises: Thenable<T>[]): Promise<T[]>;
|
||||
export function hash<T>(promises: any[]): Promise<T[]>;
|
||||
export function hash<T>(promises: { [key: string]: Thenable<T> }): Promise<{ [key: string]: T }>;
|
||||
export function hash<T>(promises: { [key: string]: any }): Promise<{ [key: string]: T }>;
|
||||
|
||||
/**
|
||||
`RSVP.map` is similar to JavaScript's native `map` method, except that it
|
||||
|
||||
Vendored
+2
-2
@@ -1,4 +1,4 @@
|
||||
// Type definitions for ShellJS v0.6.0
|
||||
// Type definitions for ShellJS v0.7.6
|
||||
// Project: http://shelljs.org
|
||||
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -466,7 +466,7 @@ export interface ExecCallback {
|
||||
(code: number, stdout: string, stderr: string): any;
|
||||
}
|
||||
|
||||
export interface ExecOptions {
|
||||
export interface ExecOptions extends child.ExecOptions {
|
||||
silent?: boolean;
|
||||
async?: boolean;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ var pid = asyncVersion3.pid;
|
||||
shell.exec("node --version", { silent: true }, function (code, stdout, stderr) {
|
||||
var version = stdout;
|
||||
});
|
||||
shell.exec("node --version", { silent: true, async: true }, function (code, stdout, stderr) {
|
||||
shell.exec("node --version", { silent: true, async: true, cwd: '/usr/local/bin' }, function (code, stdout, stderr) {
|
||||
var version = stdout;
|
||||
});
|
||||
shell.exec("node --version", function (code, stdout, stderr) {
|
||||
|
||||
Vendored
+1
-1
@@ -180,7 +180,7 @@ declare namespace SocketIO {
|
||||
/**
|
||||
* Closes the server connection
|
||||
*/
|
||||
close():void;
|
||||
close( fn ?: () => void ):void;
|
||||
|
||||
/**
|
||||
* The event fired when we get a new connection
|
||||
|
||||
@@ -143,3 +143,14 @@ function testUsingItJustAsACrossBrowserWebSocket() {
|
||||
socket.on('disconnect', function () { });
|
||||
});
|
||||
}
|
||||
|
||||
function testClosingServerWithCallback() {
|
||||
var io = socketIO.listen(80);
|
||||
io.close(function() {
|
||||
});
|
||||
}
|
||||
|
||||
function testClosingServerWithoutCallback() {
|
||||
var io = socketIO.listen(80);
|
||||
io.close();
|
||||
}
|
||||
|
||||
Vendored
+9
-10
@@ -3,22 +3,21 @@
|
||||
// Definitions by: Paul Isache <https://github.com/Paul-Isache>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
declare namespace steed {
|
||||
interface Dictionary<T> { [key: string]: T; }
|
||||
interface ErrorCallback<T> { (err?: T): void; }
|
||||
type ErrorCallback<T> = (err?: T) => void;
|
||||
|
||||
interface SteedResultCallback<T, E> { (err: E, result: T): void; }
|
||||
interface SteedResultArrayCallback<T, E> { (err: E, results: T[]): void; }
|
||||
interface SteedResultObjectCallback<T, E> { (err: E, results: Dictionary<T>): void; }
|
||||
type SteedResultCallback<T, E> = (err: E, result: T) => void;
|
||||
type SteedResultArrayCallback<T, E> = (err: E, results: T[]) => void;
|
||||
type SteedResultObjectCallback<T, E> = (err: E, results: Dictionary<T>) => void;
|
||||
|
||||
interface SteedWorker<T, E> { (task: T, callback: ErrorCallback<E>): void; }
|
||||
interface SteedIterator<T, E> { (item: T, callback: ErrorCallback<E>): void; }
|
||||
interface SteedResultIterator<T, R, E> { (item: T, callback: SteedResultCallback<R, E>): void; }
|
||||
interface SteedFunction<T, E> { (callback: (err?: E, result?: T) => void): void; }
|
||||
type SteedWorker<T, E> = (task: T, callback: ErrorCallback<E>) => void;
|
||||
type SteedIterator<T, E> = (item: T, callback: ErrorCallback<E>) => void;
|
||||
type SteedResultIterator<T, R, E> = (item: T, callback: SteedResultCallback<R, E>) => void;
|
||||
type SteedFunction<T, E> = (callback: (err?: E, result?: T) => void) => void;
|
||||
|
||||
interface SteedQueue<T> {
|
||||
push<E>(task: T | T[], callback?: ErrorCallback<E> | SteedResultCallback<T, E>): void;
|
||||
push<E>(task: T | T[], callback?: SteedResultCallback<T, E>): void;
|
||||
unshift<E>(task: T | T[], callback?: ErrorCallback<E>): void;
|
||||
pause(): void;
|
||||
resume(): void;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "../tslint.json",
|
||||
"rules": {
|
||||
"forbidden-types": false
|
||||
}
|
||||
}
|
||||
Vendored
+1
-1
@@ -17,7 +17,7 @@ interface BluetoothRequestDeviceFilter {
|
||||
|
||||
interface RequestDeviceOptions {
|
||||
filters: BluetoothRequestDeviceFilter[];
|
||||
optionalServices?: number[];
|
||||
optionalServices?: BluetoothServiceUUID[];
|
||||
acceptAllDevices?: boolean;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+4
-1
@@ -759,7 +759,10 @@ declare namespace webpack {
|
||||
|
||||
namespace optimize {
|
||||
class AggressiveMergingPlugin extends Plugin {
|
||||
constructor(options: any);
|
||||
constructor(options?: {
|
||||
minSize?: number;
|
||||
maxSize?: number;
|
||||
});
|
||||
}
|
||||
|
||||
class CommonsChunkPlugin extends Plugin {
|
||||
|
||||
Reference in New Issue
Block a user