Merge branch 'master' into node_urlUrl

This commit is contained in:
Flarna
2017-02-14 21:45:39 +01:00
51 changed files with 708 additions and 561 deletions
+3 -1
View File
@@ -110,7 +110,9 @@ Your package should have this structure:
| tsconfig.json | This allows you to run `tsc` within the package. |
| tslint.json | Enables linting. |
Generate these by running `npm run new-package -- new-package-name`.
Generate these by running `npm run new-package -- --name my-package-name --template module`.
(Other templates are `module-class`, `module-function`, `module-plugin`, `global`, `global-plugin`, and `global-modifying-module`.
This just wraps [dts-gen](https://github.com/Microsoft/dts-gen), so it supports all options from that.)
You may edit the `tsconfig.json` to add new files, to add `"target": "es6"` (needed for async functions), to add to `"lib"`, or to add the `"jsx"` compiler option.
@@ -155,6 +155,7 @@ testApp.config((
placement: 'bottom',
animation: false,
popupDelay: 1000,
popupCloseDelay: 1000,
appendToBody: true,
trigger: 'mouseenter hover',
useContentExp: true,
+9 -2
View File
@@ -161,7 +161,7 @@ declare module 'angular' {
/**
* Defines the initial date, when no model value is specified.
*
*
* @default null
*/
initDate?: any;
@@ -834,12 +834,19 @@ declare module 'angular' {
animation?: boolean;
/**
* For how long should the user have to have the mouse over the element before the tooltip shows (in milliseconds)?
* Popup delay in milliseconds until it opens.
*
* @default 0
*/
popupDelay?: number;
/**
* For how long should the tooltip remain open after the close trigger event?
*
* @default 0
*/
popupCloseDelay?: number;
/**
* Should the tooltip be appended to `$body` instead of the parent element?
*
+1 -1
View File
@@ -1,4 +1,4 @@
/// <reference types="auth0-js" />
import 'auth0-js';
let webAuth = new auth0.WebAuth({
domain: 'mine.auth0.com',
+3 -3
View File
@@ -1,4 +1,4 @@
// Type definitions for Auth0.js v8.1.3
// Type definitions for Auth0.js 8.1
// Project: https://github.com/auth0/auth0.js
// Definitions by: Adrian Chia <https://github.com/adrianchia>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -409,7 +409,7 @@ declare namespace auth0 {
interface Auth0Error {
error: any;
errorDescription: string
errorDescription: string;
}
interface Auth0DecodedHash {
@@ -442,7 +442,7 @@ declare namespace auth0 {
connection: string;
send: string;
phoneNumber?: string;
email?: string,
email?: string;
authParams?: any;
}
+1 -1
View File
@@ -20,4 +20,4 @@
"index.d.ts",
"auth0-js-tests.ts"
]
}
}
+2 -1
View File
@@ -1,4 +1,5 @@
/// <reference types="auth0-js/v7" />
import 'auth0-js';
var auth0 = new Auth0({
domain: 'mine.auth0.com',
clientID: 'dsa7d77dsa7d7',
+7 -7
View File
@@ -1,4 +1,4 @@
// Type definitions for Auth0.js v7.x
// Type definitions for Auth0.js 7.0
// Project: https://github.com/auth0/auth0.js
// Definitions by: Robert McLaws <https://github.com/advancedrei>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -13,20 +13,20 @@ interface Window {
interface Auth0Static {
new(options: Auth0ClientOptions): Auth0Static;
changePassword(options: any, callback?: Function): void;
changePassword(options: any, callback?: (error?: Auth0Error, valid?: any) => void): void;
decodeJwt(jwt: string): any;
login(options: any, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void;
loginWithPopup(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void;
loginWithResourceOwner(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: any) => any): void;
loginWithUsernamePassword(options: Auth0LoginOptions, callback: (error?: Auth0Error, profile?: Auth0UserProfile, id_token?: string, access_token?: string, state?: string) => any): void;
logout(query: string): void;
getConnections(callback?: Function): void;
getConnections(callback?: (error?: Auth0Error, valid?: any) => void): void;
refreshToken(refreshToken: string, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void;
getDelegationToken(options: any, callback: (error?: Auth0Error, delegationResult?: Auth0DelegationToken) => any): void;
getProfile(id_token: string, callback?: Function): Auth0UserProfile;
getSSOData(withActiveDirectories: any, callback?: Function): void;
getProfile(id_token: string, callback?: (error?: Auth0Error, valid?: any) => void): Auth0UserProfile;
getSSOData(withActiveDirectories: any, callback?: (error?: Auth0Error, valid?: any) => void): void;
parseHash(hash: string): Auth0DecodedHash;
signup(options: Auth0SignupOptions, callback: Function): void;
signup(options: Auth0SignupOptions, callback: (error?: Auth0Error, valid?: any) => void): void;
validateUser(options: any, callback: (error?: Auth0Error, valid?: any) => any): void;
}
@@ -132,5 +132,5 @@ interface Auth0DelegationToken {
declare const Auth0: Auth0Static;
declare module "auth0-js" {
export = Auth0
export = Auth0;
}
+4 -5
View File
@@ -12,12 +12,11 @@
"typeRoots": [
"../../"
],
"paths": {
"auth0-js": [
"auth0-js/v7"
]
},
"types": [],
"paths": {
"auth0-js": ["auth0-js/v7"],
"auth0-js/*": ["auth0-js/v7/*"]
},
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
+2 -2
View File
@@ -1,5 +1,5 @@
/// <reference types="auth0-js/v7" />
/// <reference path="index.d.ts" />
import 'auth0-js/v7';
import Auth0Lock from 'auth0-lock';
const CLIENT_ID = "YOUR_AUTH0_APP_CLIENTID";
const DOMAIN = "YOUR_DOMAIN_AT.auth0.com";
+5
View File
@@ -0,0 +1,5 @@
{
"dependencies": {
"@types/auth0-js": "latest"
}
}
+1 -1
View File
@@ -20,4 +20,4 @@
"index.d.ts",
"auth0-lock-tests.ts"
]
}
}
+1 -2
View File
@@ -1,5 +1,4 @@
/// <reference types="auth0-js/v7" />
import 'auth0-js/v7';
var widget: Auth0WidgetStatic = new Auth0Widget({
domain: 'mine.auth0.com',
-1
View File
@@ -5,7 +5,6 @@
/// <reference types="auth0-js/v7" />
interface Auth0WidgetStatic {
new(params: Auth0Constructor): Auth0WidgetStatic;
+5
View File
@@ -0,0 +1,5 @@
{
"dependencies": {
"@types/auth0-js": "latest"
}
}
+1 -1
View File
@@ -19,4 +19,4 @@
"index.d.ts",
"auth0.widget-tests.ts"
]
}
}
+4 -2
View File
@@ -3,9 +3,11 @@
// Definitions by: Clément Bourgeois <https://github.com/moonpyk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as Express from 'express';
/// <reference types="node" />
declare function auth(req: Express.Request): auth.BasicAuthResult;
import * as http from 'http';
declare function auth(req: http.IncomingMessage): auth.BasicAuthResult;
declare namespace auth {
interface BasicAuthResult {
+2 -2
View File
@@ -10,7 +10,7 @@ function test() {
var utils = bezier.getUtils();
var line: BezierJs.Line = { p1: { x: 0, y: 0 }, p2: { x: 1, y: 1 } };
var abc: BezierJs.ABC = { A: null, B: null, C: null };
var arc: BezierJs.Arc = { e: 0, s: 0, x: 0, y: 0, r: 1 };
var arc: BezierJs.Arc = { e: 0, s: 0, x: 0, y: 0, r: 1, interval:{ start: 0, end: 1 } };
var bbox: BezierJs.BBox = bezier.bbox();
var closest: BezierJs.Closest = { mdist: 1, mpos: 0 };
var inflection: BezierJs.Inflection = { values: null, x: [0], y: [0], z: [0] };
@@ -95,4 +95,4 @@ function test() {
utils.round(.999, .001);
utils.shapeintersections(shape, bbox, shape, bbox);
}
}
+1
View File
@@ -51,6 +51,7 @@ declare namespace BezierJs {
e: number;
r: number;
s: number;
interval: { start: number; end: number; };
}
interface Shape {
startcap: BezierCap;
+8
View File
@@ -0,0 +1,8 @@
# Installation
> `npm install --save-dev @types/cordova_app_version_plugin`
# Summary
This package contains type definitions for cordova_app_version_plugin (https://www.npmjs.com/package/cordova_app_version_plugin)
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/cordova_app_version_plugin
@@ -0,0 +1,3 @@
/// <reference types="cordova" />
var appVersion = window.cordova.plugins.version.getAppVersion(); // e.g. "1.5.0"
+26
View File
@@ -0,0 +1,26 @@
// Type definitions for cordova_app_version_plugin v0.2.6
// Project: https://www.npmjs.com/package/cordova_app_version_plugin
// Definitions by: Larry Bahr <https://github.com/larrybahr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
//
// Licensed under the MIT license.
interface CordovaPlugins {
/**
* cordova_app_version_plugin interface
*/
version: CordovaAppVersionPlugin.CordovaAppVersionPlugin;
}
/**
* Keep the type global namespace clean by using a module
*/
declare module CordovaAppVersionPlugin {
interface CordovaAppVersionPlugin {
/**
* App version from config.xml's version (e.g. <widget id="my.app.id" version="1.5.0">)
* @example window.cordova.plugins.version.getAppVersion() // e.g: "1.5.0"
*/
getAppVersion(): string;
}
}
+23
View File
@@ -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",
"cordova_app_version_plugin-tests.ts"
]
}
+6
View File
@@ -9,6 +9,12 @@ function StepSample() {
var step = <cucumber.StepDefinitions>this;
var hook = <cucumber.Hooks>this;
hook.setWorldConstructor(function() {
this.visit = function(url: string, callback: Callback) {
callback(null, 'pending');
}
})
hook.Before(function(scenario: HookScenario, callback: Callback){
scenario.isFailed() && callback.pending();
});
+1
View File
@@ -69,6 +69,7 @@ declare namespace cucumber {
After(code: HookCode): void;
Around(code: AroundCode):void;
setDefaultTimeout(time:number): void;
setWorldConstructor(world: () => void): void;
registerHandler(handlerOption:string, code:(event:any, callback:CallbackStepDefinition) =>void): void;
registerListener(listener: EventListener): void;
}
+15
View File
@@ -39,3 +39,18 @@ class TestController implements Controller {
const server = new hapi.Server();
server.route(new TestController().routes());
@controller('/test')
class SimpleTestController implements Controller {
foo: string;
constructor(foo: string) {
this.foo = foo;
}
baseUrl: string;
routes: () => hapi.IRouteConfiguration[];
}
server.route(new SimpleTestController('bar').routes());
+1 -1
View File
@@ -5,7 +5,7 @@
import * as hapi from 'hapi';
interface ControllerStatic {
new (): Controller;
new (...args: any[]): Controller;
}
export interface Controller {
baseUrl: string;
+5
View File
@@ -0,0 +1,5 @@
{
"dependencies": {
"typescript": ">=2.1.4"
}
}
+1 -1
View File
@@ -89,7 +89,7 @@ export interface DocumentWithParentWindow extends Document {
* equivalent to what a browser will give if you open up an empty .html file.
* @param options see the explanation of the config object above.
*/
export declare function jsdom(markup: string, config?: Config): DocumentWithParentWindow;
export declare function jsdom(markup?: string, config?: Config): DocumentWithParentWindow;
/**
* Before creating any documents, you can modify the defaults for all future documents:
+32 -31
View File
@@ -1,22 +1,21 @@
// Type definitions for koa-favicon v2.x
// Type definitions for koa-hbs v1.x
// Project: https://github.com/gilt/koa-hbs
// Definitions by: Jacob Malone <https://github.com/jcbmln/>
// Definitions by: Jacob Malone <https://github.com/jcbmln/>, Mudkip <https://github.com/mudkipme>
// Definitions: https://github.com/jcbmln/DefinitelyTyped
/* =================== USAGE ===================
import * as Hbs from "koa-hbs";
import * as Koa from "koa";
....import hbs = require("koa-hbs");
var hbs = new Hbs();
var app = new Koa();
app.use(hbs.middleware({
viewPath: __dirname + '/views'
}));
app.use(function *() {
yield this.render('main', {
app.use(async (ctx, next) => {
await ctx.render('main', {
title: 'koa-hbs'
});
});
@@ -25,31 +24,33 @@
/// <reference types="koa" />
declare module "koa-hbs" {
import * as Koa from "koa";
import * as Koa from "koa";
namespace Hbs {
export interface Middleware {
viewPath: Array<string> | string,
handlebars?: Function,
templateOptions?: {},
extname?: string,
partialsPath?: Array<string> | string,
defaultLayout?: string,
layoutsPath?: string,
contentHelperName?: string,
blockHelperName?: string,
disableCache?: boolean
}
declare namespace Hbs {
export interface Middleware {
viewPath: Array<string> | string,
handlebars?: Function,
templateOptions?: {},
extname?: string,
partialsPath?: Array<string> | string,
defaultLayout?: string,
layoutsPath?: string,
contentHelperName?: string,
blockHelperName?: string,
disableCache?: boolean
}
class Hbs {
constructor();
middleware(opts: Hbs.Middleware): any;
}
namespace Hbs {}
export = Hbs;
}
declare class Hbs {
constructor();
middleware(opts: Hbs.Middleware): any;
}
declare const hbs: Hbs;
export = hbs;
declare module "koa" {
export interface Context extends Request, Response {
render(tpl: string, locals?: {[key: string]: any}): Promise<void>;
}
}
+3 -4
View File
@@ -1,16 +1,15 @@
import * as Hbs from 'koa-hbs';
import * as Koa from 'koa';
import hbs = require("koa-hbs");
import * as Path from 'path';
const app = new Koa();
const hbs = new Hbs();
app.use(hbs.middleware({
viewPath: Path.join(__dirname, './views')
}));
app.use(function *(next: any) {
yield this.render('index', {
app.use(async (ctx, next) => {
await ctx.render('index', {
title: 'Hello World!'
});
});
+1
View File
@@ -130,6 +130,7 @@ declare namespace __MaterialUI {
accent2Color?: string;
accent3Color?: string;
textColor?: string;
secondaryTextColor?: string;
alternateTextColor?: string;
canvasColor?: string;
borderColor?: string;
+177 -55
View File
@@ -1,6 +1,6 @@
// Type definitions for materialize-css v0.97.5
// Type definitions for materialize-css v0.98.0
// Project: http://materializecss.com/
// Definitions by: Erik Lieben <https://github.com/eriklieben>, Leon Yu <https://github.com/leonyu>
// Definitions by: Erik Lieben <https://github.com/eriklieben>, Leon Yu <https://github.com/leonyu>, Sukhdeep Singh <https://github.com/SinghSukhdeep>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="jquery" />
@@ -15,7 +15,7 @@ declare namespace Materialize {
/**
* A setting that changes the collapsible behavior to expandable instead of the default accordion style
*/
accordion: boolean;
accordion?: boolean;
/**
* Callback for Collapsible section close.
@@ -34,7 +34,23 @@ declare namespace Materialize {
/**
* The delay before the tooltip shows (in milliseconds)
*/
delay:number;
delay: number;
/**
* Tooltip text. Can use custom HTML if you set the html option
*/
tooltip?: string;
/**
* Set the direction of the tooltip. 'top', 'right', 'bottom', 'left'.
*
* (Default: 'bottom')
*/
position?: string;
/**
* Allow custom html inside the tooltip.
*
* (Default: false)
*/
html?: boolean;
}
/**
@@ -46,43 +62,49 @@ declare namespace Materialize {
* The duration of the transition enter in milliseconds.
* Default: 300
*/
inDuration?:number;
inDuration?: number;
/**
* The duration of the transition out in milliseconds.
* Default: 225
*/
outDuration?:number;
outDuration?: number;
// TODO: constrain_width
/**
* If true, constrainWidth to the size of the dropdown activator.
* Default: true
*/
constrain_width?:boolean;
constrainWidth?: boolean;
/**
* If true, the dropdown will open on hover.
* Default: false
*/
hover?:boolean;
hover?: boolean;
/**
* This defines the spacing from the aligned edge.
* Default: 0
*/
gutter?:number;
gutter?: number;
/**
* If true, the dropdown will show below the activator.
* Default: false
*/
belowOrigin?:boolean;
belowOrigin?: boolean;
/**
* Defines the edge the menu is aligned to.
* Default: 'left'
*/
alignment?:string;
alignment?: string;
/**
* If true, stops the event propagating from the dropdown origin click handler.
*
* Default: false
*/
stopPropagation?: boolean
}
/**
@@ -120,10 +142,10 @@ declare namespace Materialize {
*/
interface CarouselOptions {
/**
* Transition time.
* Transition duration in milliseconds
* Default: 200
*/
time_constant?: number;
duration?: number;
/**
* Perspective zoom. If 0, all items are the same size.
@@ -147,13 +169,25 @@ declare namespace Materialize {
* Set the width of the carousel.
* Default: false
*/
full_width?: boolean;
fullWidth?: boolean;
/**
* Set to true to show indicators.
*
* Default: false
*/
indicators?: boolean;
/**
* Don't wrap around and cycle through items.
*
* Default: false
*/
noWrap?: boolean;
}
/**
* The lean modal options
* The modal options
*/
interface LeanModalOptions {
interface ModalOptions {
/**
* Modal can be dismissed by clicking outside of the modal.
@@ -171,13 +205,23 @@ declare namespace Materialize {
* Transition in duration.
* Default: 300
*/
in_duration?: number;
inDuration?: number;
/**
* Transition out duration.
* Default: 200
*/
out_duration?: number;
outDuration?: number;
/**
* Starting top style attribute
* Default: `4%`
*/
startingTop?: string;
/**
* Ending top style attribute
* Default : `10%`
*/
endingTop?: string;
/**
* Callback for Modal open.
@@ -201,19 +245,19 @@ declare namespace Materialize {
* The distance in pixels from the top of the page where the element becomes fixed.
* Default: 0
*/
top?:number;
top?: number;
/**
* The distance in pixels from the top of the page where the elements stops being fixed.
* Default: Infinity
*/
bottom?:number;
bottom?: number;
/**
* The offset from the top the element will be fixed at.
* Default: 0
*/
offset?:number;
offset?: number;
}
/**
@@ -273,44 +317,97 @@ declare namespace Materialize {
* It will only be called once.
* Example: 'console.log("hello, world!")';
*/
callback?: string;
callback?: Function;
}
interface TabOptions {
/**
* Execute a callback function when the tab is changed.
*
* The callback provides a parameter which refers to the current tab being shown.
*/
onShow?: Function;
/**
* Set to true to enable swipeable tabs. This also uses the responsiveThreshold option.
*
* Default: false
*/
swipeable?: boolean;
/**
* The maximum width of the screen, in pixels, where the swipeable functionality initializes.
*
* Default: Infinity
*/
responsiveThreshold?: number;
}
interface ChipDataObject {
tag: string,
image?: string,
id?: number
}
interface ChipOptions {
/**
* Set the chip data
*/
data?: Materialize.ChipDataObject[];
/**
* Set first placeholder when there are no tags
*/
placeholder?: string;
/**
* Set second placeholder when adding additional tags.
*/
secondaryPlaceholder?: string;
/**
* Set autocomplete data.
*/
autocompleteData?: any;
/**
* Set autocomplete limit.
*/
autocompleteLimit?: number;
}
/**
* The Materialize object
*/
interface Materialize {
/**
* Displays a toast message on screen
*
* @name message The message to display on screen
* @name displayLength The duration in milliseconds to display the message on screen
* @name className The className to use to format the message to display
* @name completeCallback Callback function to call when the messages completes/hides.
*/
toast(message:string|JQuery, displayLength:number, className?:string, completeCallback?:Function): void;
* Displays a toast message on screen
*
* @name message The message to display on screen
* @name displayLength The duration in milliseconds to display the message on screen
* @name className The className to use to format the message to display
* @name completeCallback Callback function to call when the messages completes/hides.
*/
toast(message: string | JQuery, displayLength: number, className?: string, completeCallback?: Function): void;
/**
* Fires an event when the page is scrolled to a certain area
*
* @name options optional parameter with scroll fire options
*/
scrollFire(options?:ScrollFireOptions): void;
scrollFire(options?: ScrollFireOptions): void;
/**
* A staggered reveal effect for any UL Tag with list items
*
* @name selector the selector for the list to show in staggered fasion
*/
showStaggeredList(selector:string): void;
showStaggeredList(selector: string): void;
/**
* Fade in images. It also animates grayscale and brightness to give it a unique effect.
*
* @name selector the selector for the image to fade in
*/
fadeInImage(selector:string): void;
fadeInImage(selector: string): void;
/**
* Update all text field to reinitialize all the Materialize labels on the page if dynamically adding inputs
@@ -319,7 +416,7 @@ declare namespace Materialize {
}
}
declare var Materialize : Materialize.Materialize;
declare var Materialize: Materialize.Materialize;
interface JQuery {
@@ -365,7 +462,7 @@ interface JQuery {
*
* @name options the tooltip options or the string "remove" to remove the tooltip function
*/
tooltip(options?: Materialize.TooltipOptions|string): JQuery;
tooltip(options?: Materialize.TooltipOptions | string): JQuery;
/**
* Add a dropdown list to any button.
@@ -414,28 +511,32 @@ interface JQuery {
*
* @name method the methods to pause, start, move to next and move to previous slide.
*/
carousel(method: string, count: [number]): JQuery;
carousel(method: string, count?: number): JQuery;
/**
* Modal for dialog boxes, confirmation messages, or other content that can be called up.
* Modal for dialog boxes, confirmation messages, or other content that can be called up.
*
* For Initialization.
*/
modal(): JQuery;
/**
* Modal for dialog boxes, confirmation messages, or other content that can be called up.
*
* For opening and closing modals programatically.
*
* @name string action action to do (`open` or `close)
*/
modal(action: string): void;
/**
* Modal for dialog boxes, confirmation messages, or other content that can be called up.
*
* To customize the behaviour of a modal
*
* @name options the lean modal options
*/
leanModal(options?: Materialize.LeanModalOptions): JQuery;
/**
* Open a modal programatically
*
* @name options the lean modal options
*/
openModal(options?: Materialize.LeanModalOptions): void;
/**
* Close a modal programatically
*
* @name options the lean modal options
*/
closeModal(options?: Materialize.LeanModalOptions): void;
modal(options: Materialize.ModalOptions): void;
/**
* Parallax is an effect where the background content or image in this case, is moved at a different speed than the foreground content while scrolling.
@@ -461,12 +562,33 @@ interface JQuery {
*
* @params methodOrOptions the slide navigation options or a string with "show" to reveal or "hide" to hide the menu
*/
sideNav(methodOrOptions?: Materialize.SideNavOptions|string): void;
sideNav(methodOrOptions?: Materialize.SideNavOptions | string): void;
/**
* Programmatically trigger the tab change event
*
* @name method, the method to call (always "select_tab") and a param containing the id of the tab to open
*/
tabs(method?:string, tab?:string): JQuery;
tabs(method?: string, tab?: string): JQuery;
/**
* Tab Initialization with options
*
* @name TabOptions options jQuery plugin options
*/
tabs(options?: Materialize.TabOptions): JQuery;
/**
* Chip Initialization
*
* @name ChipOptions options Material chip options
*/
material_chip(options?: Materialize.ChipOptions): JQuery;
/**
* To access chip data
*
* @name string method name of the method to invoke
*/
material_chip(method: string): Materialize.ChipDataObject[] | Materialize.ChipDataObject;
}
+162 -127
View File
@@ -22,7 +22,7 @@ $('input#input_text, textarea#textarea1').characterCounter();
// Navbar
$(".dropdown-button").dropdown();
$(".dropdown-button").dropdown({hover: false});
$(".dropdown-button").dropdown({ hover: false });
$(".button-collapse").sideNav();
@@ -30,22 +30,22 @@ $(".button-collapse").sideNav();
// Collapsible
var collapseHtml = '<ul class="collapsible" data-collapsible="accordion">' +
'<li>' +
'<div class="collapsible-header"><i class="material-icons">filter_drama</i>First</div>' +
'<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>' +
'</li>' +
'<li>' +
'<div class="collapsible-header"><i class="material-icons">place</i>Second</div>' +
'<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>' +
'</li>' +
'<li>' +
'<div class="collapsible-header"><i class="material-icons">whatshot</i>Third</div>' +
'<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>' +
'</li>' +
'<li>' +
'<div class="collapsible-header"><i class="material-icons">filter_drama</i>First</div>' +
'<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>' +
'</li>' +
'<li>' +
'<div class="collapsible-header"><i class="material-icons">place</i>Second</div>' +
'<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>' +
'</li>' +
'<li>' +
'<div class="collapsible-header"><i class="material-icons">whatshot</i>Third</div>' +
'<div class="collapsible-body"><p>Lorem ipsum dolor sit amet.</p></div>' +
'</li>' +
'</ul>';
$(collapseHtml).collapsible({ accordion : false, onClose : function() { alert('Closed'); } });
$(collapseHtml).collapsible({ accordion : true, onOpen : function() { alert('Opened'); } });
$(collapseHtml).collapsible({ accordion: false, onClose: function () { alert('Closed'); } });
$(collapseHtml).collapsible({ accordion: true, onOpen: function () { alert('Opened'); } });
// Dialogs - Toasts
Materialize.toast('I am a toast!', 4000);
@@ -57,19 +57,21 @@ Materialize.toast($toastContent, 5000);
// Dialogs - Tooltip
var tooltipHtml = '<a class="btn tooltipped" data-position="bottom" data-delay="50" data-tooltip="I am tooltip">Hover me!</a>';
$(tooltipHtml).tooltip();
$(tooltipHtml).tooltip({delay: 100});
$(tooltipHtml).tooltip({ delay: 100 });
$(tooltipHtml).tooltip('remove');
// DropDown
var dropDownHtml = '<a class="dropdown-button btn" data-beloworigin="true" href="#" data-activates="dropdown1">Drop Me!</a>';
$(dropDownHtml).dropdown({
inDuration: 300,
outDuration: 225,
constrain_width: false,
hover: true,
gutter: 0,
belowOrigin: false,
alignment: 'left'
inDuration: 300,
outDuration: 225,
constrainWidth: false, // Does not change width of dropdown to that of the activator
hover: true, // Activate on hover
gutter: 0, // Spacing from edge
belowOrigin: false, // Displays dropdown below the button
alignment: 'left', // Displays dropdown with edge aligned to the left of button
stopPropagation: false // Stops event propagation
});
$(dropDownHtml).dropdown({});
@@ -79,136 +81,138 @@ $(materialboxHtml).materialbox();
// Media - slider
var sliderHtml = '<div class="slider">' +
'<ul class="slides">' +
'<li>' +
'<img src="http://lorempixel.com/580/250/nature/1"> <!-- random image -->' +
'<div class="caption center-align">' +
'<h3>This is our big Tagline!</h3>' +
'<h5 class="light grey-text text-lighten-3">Here\'s our small slogan.</h5>' +
'</div>' +
'</li>' +
'<li>' +
'<img src="http://lorempixel.com/580/250/nature/2"> <!-- random image -->' +
'<div class="caption left-align">' +
'<h3>Left Aligned Caption</h3>' +
'<h5 class="light grey-text text-lighten-3">Here\'s our small slogan.</h5>' +
'</div>' +
'</li>' +
'<li>' +
'<img src="http://lorempixel.com/580/250/nature/3"> <!-- random image -->' +
'<div class="caption right-align">' +
'<h3>Right Aligned Caption</h3>' +
'<h5 class="light grey-text text-lighten-3">Here\'s our small slogan.</h5>' +
'</div>' +
'</li>' +
'<li>' +
'<img src="http://lorempixel.com/580/250/nature/4"> <!-- random image -->' +
'<div class="caption center-align">' +
'<h3>This is our big Tagline!</h3>' +
'<h5 class="light grey-text text-lighten-3">Here\'s our small slogan.</h5>' +
'</div>' +
'</li>' +
'</ul>' +
'<ul class="slides">' +
'<li>' +
'<img src="http://lorempixel.com/580/250/nature/1"> <!-- random image -->' +
'<div class="caption center-align">' +
'<h3>This is our big Tagline!</h3>' +
'<h5 class="light grey-text text-lighten-3">Here\'s our small slogan.</h5>' +
'</div>' +
'</li>' +
'<li>' +
'<img src="http://lorempixel.com/580/250/nature/2"> <!-- random image -->' +
'<div class="caption left-align">' +
'<h3>Left Aligned Caption</h3>' +
'<h5 class="light grey-text text-lighten-3">Here\'s our small slogan.</h5>' +
'</div>' +
'</li>' +
'<li>' +
'<img src="http://lorempixel.com/580/250/nature/3"> <!-- random image -->' +
'<div class="caption right-align">' +
'<h3>Right Aligned Caption</h3>' +
'<h5 class="light grey-text text-lighten-3">Here\'s our small slogan.</h5>' +
'</div>' +
'</li>' +
'<li>' +
'<img src="http://lorempixel.com/580/250/nature/4"> <!-- random image -->' +
'<div class="caption center-align">' +
'<h3>This is our big Tagline!</h3>' +
'<h5 class="light grey-text text-lighten-3">Here\'s our small slogan.</h5>' +
'</div>' +
'</li>' +
'</ul>' +
'</div>';
$(sliderHtml).slider();
$(sliderHtml).slider({});
$(sliderHtml).slider({ indicators: true });
$(sliderHtml).slider({ indicators: true, height: 5 });
$(sliderHtml).slider({ indicators: true, height: 5, transition: 4 });
$(sliderHtml).slider({ indicators: true, height: 5, transition: 4, interval: 5 });
$(sliderHtml).slider();
$(sliderHtml).slider({});
$(sliderHtml).slider({ indicators: true });
$(sliderHtml).slider({ indicators: true, height: 5 });
$(sliderHtml).slider({ indicators: true, height: 5, transition: 4 });
$(sliderHtml).slider({ indicators: true, height: 5, transition: 4, interval: 5 });
// Carousel
$('.carousel').carousel();
$('.carousel').carousel({});
$('.carousel').carousel({ time_constant: 200, dist: -100, shift: 500, padding: 6000, full_width: true });
$('.carousel').carousel({ duration: 200, dist: -100, shift: 500, padding: 6000, fullWidth: true, indicators: false, noWrap: false });
// Next slide
$('.carousel').carousel('next');
$('.carousel').carousel('next', [3]); // Move next n times.
$('.carousel').carousel('next', 3); // Move next n times.
// Previous slide
$('.carousel').carousel('prev');
$('.carousel').carousel('prev', [4]); // Move prev n times.
$('.carousel').carousel('prev', 4); // Move prev n times.
// Modals
var modalhtml = '<div id="modal1" class="modal bottom-sheet">' +
'<div class="modal-content">' +
'<h4>Modal Header</h4>' +
'<p>A bunch of text</p>' +
'</div>' +
'<div class="modal-footer">' +
'<a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Agree</a>' +
'</div>' +
'<div class="modal-content">' +
'<h4>Modal Header</h4>' +
'<p>A bunch of text</p>' +
'</div>' +
'<div class="modal-footer">' +
'<a href="#!" class=" modal-action modal-close waves-effect waves-green btn-flat">Agree</a>' +
'</div>' +
'</div>';
$(modalhtml).openModal();
$(modalhtml).closeModal();
$(modalhtml).modal('open');
$(modalhtml).modal('close');
var modalTriggerHtml = '<button data-target="modal1" class="btn modal-trigger">Modal</button>';
$(modalTriggerHtml).leanModal();
$(modalTriggerHtml).leanModal({});
$(modalTriggerHtml).leanModal({ dismissible: true });
$(modalTriggerHtml).leanModal({ dismissible: true, opacity: 1 });
$(modalTriggerHtml).leanModal({ dismissible: true, opacity: 1, in_duration: 100 });
$(modalTriggerHtml).leanModal({ dismissible: true, opacity: 1, in_duration: 100, out_duration: 100 });
$(modalTriggerHtml).leanModal({ dismissible: true, opacity: 1, in_duration: 100, out_duration: 100, ready: () => console.log('ready') });
$(modalTriggerHtml).leanModal({ dismissible: true, opacity: 1, in_duration: 100, out_duration: 100, ready: () => console.log('ready'), complete: () => console.log('complete')});
$(modalTriggerHtml).modal();
$(modalTriggerHtml).modal({});
$(modalTriggerHtml).modal({ dismissible: true });
$(modalTriggerHtml).modal({ dismissible: true, opacity: 1 });
$(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100 });
$(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100 });
$(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100, startingTop: "4%" });
$(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100, startingTop: "4%", endingTop: "10%" });
$(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100, startingTop: "4%", endingTop: "10%", ready: () => console.log('ready') });
$(modalTriggerHtml).modal({ dismissible: true, opacity: 1, inDuration: 100, outDuration: 100, startingTop: "4%", endingTop: "10%", ready: () => console.log('ready'), complete: () => console.log('complete') });
// Parallax
var parallaxHtml = '<div class="parallax-container">' +
'<div class="parallax"><img src="images/parallax1.jpg"></div>' +
'</div>';
$(parallaxHtml).parallax();
'<div class="parallax"><img src="images/parallax1.jpg"></div>' +
'</div>';
$(parallaxHtml).parallax();
// PushPin
$('<div />').pushpin();
$('<div />').pushpin({ top: 1 });
$('<div />').pushpin({ top: 1, bottom: 1 });
$('<div />').pushpin({ top: 1, bottom: 1, offset: 2 });
// PushPin
$('<div />').pushpin();
$('<div />').pushpin({ top: 1 });
$('<div />').pushpin({ top: 1, bottom: 1 });
$('<div />').pushpin({ top: 1, bottom: 1, offset: 2 });
// ScrollFire
var options = [
{selector: '.class', offset: 200, callback: 'console.log(".class")' },
{selector: '.other-class', offset: 200, callback: 'console.log(".other-class")' },
{ selector: '.class', offset: 200, callback: 'console.log(".class")' },
{ selector: '.other-class', offset: 200, callback: 'console.log(".other-class")' },
];
Materialize.scrollFire(options);
// ScrollSpy
var scrollSpyHtml = '<div class="row">' +
'<div class="col s12 m9 l10">' +
'<div id="introduction" class="section scrollspy">' +
'<p>Content </p>' +
'</div>' +
'<div id="structure" class="section scrollspy">' +
'<p>Content </p>' +
'</div>' +
'<div id="initialization" class="section scrollspy">' +
'<p>Content </p>' +
'</div>' +
'</div>' +
'<div class="col hide-on-small-only m3 l2">' +
'<ul class="section table-of-contents">' +
'<li><a href="#introduction">Introduction</a></li>' +
'<li><a href="#structure">Structure</a></li>' +
'<li><a href="#initialization">Intialization</a></li>' +
'</ul>' +
'</div>' +
'<div class="col s12 m9 l10">' +
'<div id="introduction" class="section scrollspy">' +
'<p>Content </p>' +
'</div>' +
'<div id="structure" class="section scrollspy">' +
'<p>Content </p>' +
'</div>' +
'<div id="initialization" class="section scrollspy">' +
'<p>Content </p>' +
'</div>' +
'</div>' +
'<div class="col hide-on-small-only m3 l2">' +
'<ul class="section table-of-contents">' +
'<li><a href="#introduction">Introduction</a></li>' +
'<li><a href="#structure">Structure</a></li>' +
'<li><a href="#initialization">Intialization</a></li>' +
'</ul>' +
'</div>' +
'</div>';
$(scrollSpyHtml, ".scrollspy").scrollSpy();
// Side-Nav
var sideNavHtml = '<nav>' +
'<ul class="right hide-on-med-and-down">' +
'<li><a href="#!">First Sidebar Link</a></li>' +
'<li><a href="#!">Second Sidebar Link</a></li>' +
'<li><a href="#!">First Sidebar Link</a></li>' +
'<li><a href="#!">Second Sidebar Link</a></li>' +
'</ul>' +
'<ul id="slide-out" class="side-nav">' +
'<li><a href="#!">First Sidebar Link</a></li>' +
'<li><a href="#!">Second Sidebar Link</a></li>' +
'<li><a href="#!">First Sidebar Link</a></li>' +
'<li><a href="#!">Second Sidebar Link</a></li>' +
'</ul>' +
'<a href="#" data-activates="slide-out" class="button-collapse"><i class="mdi-navigation-menu"></i></a>' +
'</nav>';
'</nav>';
$(sideNavHtml).sideNav();
$(sideNavHtml).sideNav({});
$(sideNavHtml).sideNav({ menuWidth: 100 });
@@ -220,24 +224,55 @@ $(sideNavHtml).sideNav("hide");
// Tabs
var tabsHtml = '<div class="row">' +
'<div class="col s12">' +
'<ul class="tabs">' +
'<li class="tab col s3"><a href="#test1">Test 1</a></li>' +
'<li class="tab col s3"><a class="active" href="#test2">Test 2</a></li>' +
'<li class="tab col s3 disabled"><a href="#test3">Disabled Tab</a></li>' +
'<li class="tab col s3"><a href="#test4">Test 4</a></li>' +
'</ul>' +
'</div>' +
'<div id="test1" class="col s12">Test 1</div>' +
'<div id="test2" class="col s12">Test 2</div>' +
'<div id="test3" class="col s12">Test 3</div>' +
'<div id="test4" class="col s12">Test 4</div>' +
'<div class="col s12">' +
'<ul class="tabs">' +
'<li class="tab col s3"><a href="#test1">Test 1</a></li>' +
'<li class="tab col s3"><a class="active" href="#test2">Test 2</a></li>' +
'<li class="tab col s3 disabled"><a href="#test3">Disabled Tab</a></li>' +
'<li class="tab col s3"><a href="#test4">Test 4</a></li>' +
'</ul>' +
'</div>' +
'<div id="test1" class="col s12">Test 1</div>' +
'<div id="test2" class="col s12">Test 2</div>' +
'<div id="test3" class="col s12">Test 3</div>' +
'<div id="test4" class="col s12">Test 4</div>' +
'</div>';
$(tabsHtml).tabs();
$(tabsHtml).tabs('select_tab', 'test1');
$(tabsHtml).tabs();
$(tabsHtml).tabs('select_tab', 'test1');
$(tabsHtml).tabs({ onShow: (currentTab: any) => { console.log(currentTab) }, swipeable: false, responsiveThreshold: 5000 });
// Transitions
Materialize.showStaggeredList('#staggered-test');
Materialize.updateTextFields();
Materialize.updateTextFields();
let chipsHTML = '<div class="chips"></div>' +
'<div class="chips chips-initial"></div>' +
'<div class="chips chips-placeholder"></div>' +
'<div class="chips chips-autocomplete"></div>';
$(chipsHTML).material_chip();
$(chipsHTML).material_chip({
data: [{
tag: 'Apple',
}, {
tag: 'Microsoft',
}, {
tag: 'Google',
}],
});
$('.chips-placeholder').material_chip({
placeholder: 'Enter a tag',
secondaryPlaceholder: '+Tag',
});
$('.chips-autocomplete').material_chip({
autocompleteData: {
'Apple': null,
'Microsoft': null,
'Google': null
}
});
let chipData: Materialize.ChipDataObject | Materialize.ChipDataObject[] = $('.chips-initial').material_chip('data');
+3 -1
View File
@@ -34,7 +34,8 @@ declare namespace nock {
type HttpHeaders = { [key: string]: string | { (req: any, res: any, body: string): any; }; };
type InterceptFunction = (
uri: string | RegExp | { (uri: string): boolean; },
requestBody?: string | RegExp | { (body: any): boolean; } | any
requestBody?: string | RegExp | { (body: any): boolean; } | any,
interceptorOptions?: Options
) => Interceptor;
export type ReplyCallback = (err: any, result: ReplyCallbackResult) => void;
type ReplyCallbackResult = string | [number, string | any] | [number, string | any, HttpHeaders] | any;
@@ -48,6 +49,7 @@ declare namespace nock {
patch: InterceptFunction;
merge: InterceptFunction;
delete: InterceptFunction;
options: InterceptFunction;
intercept: (
uri: string | RegExp | { (uri: string): boolean; },
+10
View File
@@ -21,29 +21,39 @@ inst = scope.head(str);
inst = scope.get(str);
inst = scope.get(str, data);
inst = scope.get(str, data, options);
inst = scope.options(str);
inst = scope.options(str, data);
inst = scope.options(str, data, options);
inst = scope.patch(str);
inst = scope.patch(str, str);
inst = scope.patch(str, obj);
inst = scope.patch(str, obj, options);
inst = scope.patch(str, regex);
inst = scope.post(str);
inst = scope.post(str, data);
inst = scope.post(str, data, options);
inst = scope.post(str, obj);
inst = scope.post(str, regex);
inst = scope.put(str);
inst = scope.put(str, data);
inst = scope.put(str, data, options);
inst = scope.put(str, obj);
inst = scope.put(str, regex);
inst = scope.delete(str);
inst = scope.delete(str, data);
inst = scope.delete(str, data, options);
inst = scope.delete(str, obj);
inst = scope.delete(str, regex);
inst = scope.merge(str);
inst = scope.merge(str, data);
inst = scope.merge(str, data, options);
inst = scope.merge(str, obj);
inst = scope.merge(str, regex);
+3 -2
View File
@@ -16,12 +16,13 @@
},
"scripts": {
"compile-scripts": "tsc -p scripts",
"new-package": "node scripts/new-package.js",
"new-package": "dts-gen --dt",
"not-needed": "node scripts/not-needed.js",
"lint": "node scripts/lint.js",
"test": "node node_modules/types-publisher/bin/tester/test.js --run-from-definitely-typed --nProcesses 1"
},
"devDependencies": {
"types-publisher": "Microsoft/types-publisher#production"
"types-publisher": "Microsoft/types-publisher#production",
"dts-gen": "latest"
}
}
+44 -21
View File
@@ -1,61 +1,84 @@
// Type definitions for pako 0.2.8
// Type definitions for pako 1.0.4
// Project: https://github.com/nodeca/pako
// Definitions by: Denis Cappellin <http://github.com/cappellin>
// Definitions by: Denis Cappellin <https://github.com/cappellin>, Caleb Eggensperger <https://github.com/calebegg>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = Pako;
export as namespace pako;
declare namespace Pako {
export interface DeflateOptions {
level?: number;
windowBits?: number;
memLevel?: number;
strategy?: number;
dictionary?: any;
raw?: boolean;
to?: 'string';
}
export interface InflateOptions {
windowBits?: number;
raw?: boolean;
to?: 'string';
}
export type Data = Uint8Array | Array<number> | string;
/**
* Compress data with deflate algorithm and options.
*/
export function deflate( data: Uint8Array | Array<number> | string, options?: any ): string;
export function deflate( data: Data, options: DeflateOptions & {to: 'string'} ): string;
export function deflate( data: Data, options?: DeflateOptions ): Uint8Array;
/**
* The same as deflate, but creates raw data, without wrapper (header and adler32 crc).
*/
export function deflateRaw( data: Uint8Array | Array<number> | string, options?: any ): string;
export function deflateRaw( data: Data, options: DeflateOptions & {to: 'string'} ): string;
export function deflateRaw( data: Data, options?: DeflateOptions ): Uint8Array;
/**
* The same as deflate, but create gzip wrapper instead of deflate one.
*/
export function gzip( data: Uint8Array | Array<number> | string, options?: any ): string;
export function gzip( data: Data, options: DeflateOptions & {to: 'string'} ): string;
export function gzip( data: Data, options?: DeflateOptions ): Uint8Array;
/**
* Decompress data with inflate/ungzip and options. Autodetect format via wrapper header
* by default. That's why we don't provide separate ungzip method.
*/
export function inflate( data: Uint8Array | Array<number> | string, options?: any ): Uint8Array;
export function inflate( data: Uint8Array | Array<number> | string, options?: any ): Array<number>;
export function inflate( data: Uint8Array | Array<number> | string, options?: any ): String;
export function inflate( data: Data, options: InflateOptions & {to: 'string'} ): string;
export function inflate( data: Data, options?: InflateOptions ): Uint8Array;
/**
* The same as inflate, but creates raw data, without wrapper (header and adler32 crc).
*/
export function inflateRaw( data: Uint8Array | Array<number> | string, options?: any ): Uint8Array;
export function inflateRaw( data: Uint8Array | Array<number> | string, options?: any ): Array<number>;
export function inflateRaw( data: Uint8Array | Array<number> | string, options?: any ): string;
export function inflateRaw( data: Data, options: InflateOptions & {to: 'string'} ): string;
export function inflateRaw( data: Data, options?: InflateOptions ): Uint8Array;
/**
* Just shortcut to inflate, because it autodetects format by header.content. Done for convenience.
*/
export function ungzip( data: Uint8Array | Array<number> | string, options?: any ): Uint8Array;
export function ungzip( data: Uint8Array | Array<number> | string, options?: any ): Array<number>;
export function ungzip( data: Uint8Array | Array<number> | string, options?: any ): string;
export function ungzip( data: Data, options: InflateOptions & {to: 'string'} ): string;
export function ungzip( data: Data, options?: InflateOptions ): Uint8Array;
export class Deflate {
constructor( options?: any );
constructor( options?: DeflateOptions );
err: number;
msg: string;
result: Uint8Array | Array<number>;
onData( chunk: Uint8Array | Array<number> | string ): void;
onData( chunk: Data ): void;
onEnd( status: number ): void;
push( data: Uint8Array | Array<number> | ArrayBuffer | string, mode?: number | boolean ): boolean;
push( data: Data | ArrayBuffer, mode?: number | boolean ): boolean;
}
export class Inflate {
constructor( options?: any );
constructor( options?: InflateOptions );
err: number;
msg: string;
result: Uint8Array | Array<number> | string;
onData( chunk: Uint8Array | Array<number> | string ): void;
result: Data;
onData( chunk: Data ): void;
onEnd( status: number ): void;
push( data: Uint8Array | Array<number> | ArrayBuffer | string, mode?: number | boolean ): boolean;
push( data: Data | ArrayBuffer, mode?: number | boolean ): boolean;
}
}
+11 -4
View File
@@ -5,13 +5,20 @@ import pako = require("pako");
var chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])
var chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);
var deflate = new pako.Deflate({ level: 3});
var deflate = new pako.Deflate({ level: 3 });
deflate.push(chunk1, false);
deflate.push(chunk2, true); // true -> last chunk
if (deflate.err) {
throw new Error( deflate.err.toString() );
if (deflate.err) {
throw new Error( deflate.err.toString() );
}
console.log(deflate.result);
console.log(deflate.result);
let str: string = pako.deflate('1234', {to: 'string'});
let arr: Uint8Array = pako.deflate('1234');
let str2: string = pako.inflate('1234', {to: 'string'});
let arr2: Uint8Array = pako.inflate('1234');
+1
View File
@@ -31,6 +31,7 @@ interface IStrategyOption {
scopeSeparator?: string;
enableProof?: boolean;
profileFields?: string[];
passReqToCallback?: boolean;
}
declare class Strategy implements passport.Strategy {
+58
View File
@@ -0,0 +1,58 @@
// Type definitions for react-css-transition-replace 2.0.1
// Project: https://github.com/malte-wessel/react-custom-scrollbars
// Definitions by: David-LeBlanc-git <https://github.com/David-LeBlanc-git>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
import * as React from "react";
declare module "react-custom-scrollbars" {
export interface positionValues {
top: number;
left: number;
clientWidth: number;
clientHeight: number;
scrollWidth: number;
scrollHeight: number;
scrollLeft: number;
scrollTop: number;
}
export interface ScrollbarProps extends React.HTMLProps<Scrollbars> {
onScroll?: React.UIEventHandler<any>;
onScrollFrame?: (values: positionValues) => void;
onScrollStart?: () => void;
onScrollStop?: () => void;
onUpdate?: (values: positionValues) => void;
renderView?: React.StatelessComponent<any>;
renderTrackHorizontal?: React.StatelessComponent<any>;
renderTrackVertical?: React.StatelessComponent<any>;
renderThumbHorizontal?: React.StatelessComponent<any>;
renderThumbVertical?: React.StatelessComponent<any>;
autoHide?: boolean;
autoHideTimeout?: number;
autoHideDuration?: number;
thumbSize?: number;
thumbMinSize?: number;
universal?: boolean;
}
export default class Scrollbars extends React.Component<ScrollbarProps, {}> {
scrollTop(top: number): void;
scrollLeft(left: number): void;
scrollToTop(): void;
scrollToBottom(): void;
scrollToLeft(): void;
scrollToRight(): void;
getScrollLeft(): number;
getScrollTop(): number;
getScrollWidth(): number;
getScrollHeight(): number;
getWidth(): number;
getHeight(): number;
getValues(): positionValues;
}
}
@@ -0,0 +1,10 @@
import * as React from "react"
import { render } from 'react-dom';
import Scrollbars from "react-custom-scrollbars"
render(
<Scrollbars>
<div>Test</div>
</Scrollbars>,
document.getElementById("main")
)
+24
View File
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react"
},
"files": [
"index.d.ts",
"react-custom-scrollbars-tests.tsx"
]
}
+2 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for React Notification System v0.2.10
// Type definitions for React Notification System v0.2.11
// Project: https://www.npmjs.com/package/react-notification-system
// Definitions by: Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>, Deividas Bakanas <https://github.com/DeividasBakanas>, Karol Janyst <https://github.com/LKay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -12,6 +12,7 @@ declare namespace NotificationSystem {
addNotification(notification: Notification): Notification;
removeNotification(notification: Notification): void;
removeNotification(uid: number | string): void;
clearNotifications(): void;
}
export type CallBackFunction = (notification: Notification) => void;
+8 -8
View File
@@ -11,14 +11,14 @@ declare module "react-sticky" {
export var StickyContainer: React.ComponentClass<React.HTMLAttributes<HTMLDivElement>>;
export interface StickyProps {
isActive: boolean;
className: string;
style: any;
stickyClassName: string;
stickyStyle: any;
topOffset: number;
bottomOffset: number;
onStickyStateChange: (isSticky: boolean) => void;
isActive?: boolean;
className?: string;
style?: any;
stickyClassName?: string;
stickyStyle?: any;
topOffset?: number;
bottomOffset?: number;
onStickyStateChange?: (isSticky: boolean) => void;
}
export var Sticky: React.ComponentClass<StickyProps>;
+8 -1
View File
@@ -1,9 +1,16 @@
import {Sticky, StickyContainer} from "react-sticky";
import * as React from "react";
const StickyComponent: JSX.Element =
const StickyAllOptions: JSX.Element =
<StickyContainer className="sticky-container">
<Sticky isActive={true} className="sticky" style={{}} stickyClassName="sticky" stickyStyle={{}} topOffset={0} bottomOffset={0} onStickyStateChange={(isSticky: boolean): void => undefined}>
<div/>
</Sticky>
</StickyContainer>;
const StickyNoOptions: JSX.Element =
<StickyContainer>
<Sticky>
<div/>
</Sticky>
</StickyContainer>;
-121
View File
@@ -1,121 +0,0 @@
/// <reference types="node" />
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
const http_1 = require("http");
const fs_1 = require("fs");
const path = require("path");
const newPackageName = process.argv[2];
if (!newPackageName) {
throw new Error("Usage: node scripts/new-package.js new-package-name");
}
run().catch(e => {
console.error(e);
process.exit(1);
});
function run() {
return __awaiter(this, void 0, void 0, function* () {
const files = [
["index.d.ts", yield getIndex()],
[`${newPackageName}-tests.ts`, ""],
["tsconfig.json", `${JSON.stringify(getTSConfig(), undefined, 4)}\n`],
["tslint.json", '{ "extends": "../tslint.json" }\n'],
];
try {
yield pify1(fs_1.mkdir, newPackageName);
yield Promise.all(files.map(([name, text]) => write(name, text)));
}
catch (e) {
if (e.code === "EEXIST") {
console.warn(`Module “${newPackageName}” already exists!`);
}
else {
console.error(`Error creating module files: ${e}\nCleaning Up.`);
yield Promise.all(files.map(([name]) => rm(name)));
yield pify1(fs_1.rmdir, newPackageName);
}
process.exit(1);
}
});
}
function getIndex() {
return __awaiter(this, void 0, void 0, function* () {
let version = "x.x";
let project = "https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.)";
try {
const reg = JSON.parse(yield loadString(`http://registry.npmjs.org/${newPackageName}`));
const { latest } = reg["dist-tags"];
const { homepage } = reg.versions[latest];
version = latest.split(".").slice(0, 2).join(".");
if (homepage !== undefined)
project = homepage;
}
catch (e) {
console.warn(`Warning: could not retrieve version/homepage information: ${e.message}`);
}
return `// Type definitions for ${newPackageName} ${version}
// Project: ${project}
// Definitions by: My Self <https://github.com/me>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
Fill the header in!
`;
});
}
function getTSConfig() {
return {
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
`${newPackageName}-tests.ts`
]
};
}
function write(name, content) {
return new Promise((resolve, reject) => {
fs_1.writeFile(path.join(newPackageName, name), content, err => err ? reject(err) : resolve());
});
}
function rm(name) {
return pify1(fs_1.unlink, path.join(newPackageName, name)).catch((e) => {
if (e.code === "ENOENT")
return;
throw e;
});
}
function pify1(fn, arg) {
return new Promise((resolve, reject) => {
fn(arg, err => err ? reject(err) : resolve());
});
}
function loadString(url) {
return new Promise((resolve, reject) => {
http_1.get(url, (res) => {
if (res.statusCode !== 200) {
return reject(new Error(`HTTP Error ${res.statusCode}: ${http_1.STATUS_CODES[res.statusCode || 500]} for ${url}`));
}
let rawData = "";
res.on("data", chunk => rawData += chunk);
res.on("end", () => resolve(rawData));
}).on("error", e => reject(e));
});
}
-131
View File
@@ -1,131 +0,0 @@
/// <reference types="node" />
import { get, STATUS_CODES } from "http"
import { mkdir, writeFile, unlink, rmdir } from "fs"
import * as path from "path"
interface Package {
name: string
description: string
version: string
homepage?: string
}
interface Registry {
name: string
description: string
"dist-tags": { latest: string }
versions: { [version: string]: Package }
}
const newPackageName = process.argv[2]
if (!newPackageName) {
throw new Error("Usage: node scripts/new-package.js new-package-name")
}
run().catch(e => {
console.error(e)
process.exit(1)
})
async function run() {
const files: [string, string][] = [
["index.d.ts", await getIndex()],
[`${newPackageName}-tests.ts`, ""],
["tsconfig.json", `${JSON.stringify(getTSConfig(), undefined, 4)}\n`],
["tslint.json", '{ "extends": "../tslint.json" }\n'],
]
try {
await pify1(mkdir, newPackageName)
await Promise.all(files.map(([name, text]) => write(name, text)))
} catch (e) {
if (e.code === "EEXIST") {
console.warn(`Module “${newPackageName}” already exists!`)
} else {
console.error(`Error creating module files: ${e}\nCleaning Up.`)
await Promise.all(files.map(([name]) => rm(name)))
await pify1(rmdir, newPackageName)
}
process.exit(1)
}
}
async function getIndex() {
let version = "x.x"
let project = "https://github.com/baz/foo (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.)"
try {
const reg: Registry = JSON.parse(await loadString(`http://registry.npmjs.org/${newPackageName}`))
const { latest } = reg["dist-tags"]
const { homepage } = reg.versions[latest]
version = latest.split(".").slice(0, 2).join(".")
if (homepage !== undefined) project = homepage
} catch (e) {
console.warn(`Warning: could not retrieve version/homepage information: ${e.message}`)
}
return `// Type definitions for ${newPackageName} ${version}
// Project: ${project}
// Definitions by: My Self <https://github.com/me>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
Fill the header in!
`
}
function getTSConfig() {
return {
"compilerOptions": {
"module": "commonjs",
"lib": ["es6"],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
`${newPackageName}-tests.ts`
]
}
}
function write(name: string, content: string) {
return new Promise((resolve, reject) => {
writeFile(path.join(newPackageName, name), content, err => err ? reject(err): resolve())
})
}
function rm(name: string) {
return pify1(unlink, path.join(newPackageName, name)).catch((e: NodeJS.ErrnoException) => {
if (e.code === "ENOENT") return
throw e
})
}
function pify1<F extends (a: A, cb: (err?: Error) => void) => void, A>(fn: F, arg: A) {
return new Promise((resolve, reject) => {
fn(arg, err => err ? reject(err): resolve())
})
}
function loadString(url: string): Promise<string> {
return new Promise((resolve, reject) => {
get(url, (res) => {
if (res.statusCode !== 200) {
return reject(new Error(`HTTP Error ${res.statusCode}: ${STATUS_CODES[res.statusCode || 500]} for ${url}`))
}
let rawData = ""
res.on("data", chunk => rawData += chunk)
res.on("end", () => resolve(rawData))
}).on("error", e => reject(e))
})
}
+5 -18
View File
@@ -3319,38 +3319,25 @@ declare namespace sequelize {
/**
* Options for Model.findOrInitialize method
*/
interface FindOrInitializeOptions<TAttributes> extends LoggingOptions {
/**
* A hash of search attributes.
*/
where: string | WhereOptions;
interface FindOrInitializeOptions<TAttributes> extends FindOptions {
/**
* Default values to use if building a new instance
*/
defaults?: TAttributes;
/**
* Transaction to run query under
*/
transaction?: Transaction;
}
/**
* Options for Model.findOrInitialize method
* Options for Model.findOrInitialize method
*/
interface FindCreateFindOptions<TAttributes> {
interface FindCreateFindOptions<TAttributes> extends FindOptions {
/**
* A hash of search attributes.
*/
where: string | WhereOptions;
/**
* Default values to use if building a new instance
* Default values to use if building a new instance
*/
defaults?: TAttributes;
}
/**
+1 -1
View File
@@ -977,6 +977,7 @@ let findOrRetVal: Promise<[AnyInstance, boolean]>;
findOrRetVal = User.findOrInitialize( { where : { username : 'foo' } } );
findOrRetVal = User.findOrInitialize( { where : { username : 'foo' }, transaction : t } );
findOrRetVal = User.findOrInitialize( { where : { username : 'foo' }, defaults : { foo : 'asd' }, transaction : t } );
findOrRetVal = User.findOrInitialize( { where : { username : 'foo' }, defaults : { foo : 'asd' }, paranoid : false } );
findOrRetVal = User.findOrCreate( { where : { a : 'b' }, defaults : { json : { a : { b : 'c' }, d : [1, 2, 3] } } } );
findOrRetVal = User.findOrCreate( { where : { a : 'b' }, defaults : { json : 'a', data : 'b' } } );
@@ -989,7 +990,6 @@ findOrRetVal = User.findOrCreate( { where : { objectId : 'asdasdasd' }, defaults
findOrRetVal = User.findOrCreate( { where : { id : undefined }, defaults : { name : Math.random().toString() } } );
findOrRetVal = User.findOrCreate( { where : { email : 'unique.email.@d.com', companyId : Math.floor( Math.random() * 5 ) } } );
findOrRetVal = User.findOrCreate( { where : { objectId : 1 }, defaults : { bool : false } } );
findOrRetVal = User.findOrCreate( { where : 'c', defaults : {} } );
User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) } );
+3 -1
View File
@@ -269,6 +269,8 @@ export class Vector {
export class Matrix {
T: Matrix;
shape: number[];
/**
* @method constructor
@@ -586,4 +588,4 @@ export class Matrix {
public toArray (): number[][];
}
export class BLAS {}
export class BLAS {}