mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -330,6 +330,7 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [Pickadate.js](https://github.com/amsul/pickadate.js) (by [Adi Dahiya](https://github.com/adidahiya))
|
||||
* [PixiJS](https://github.com/GoodBoyDigital/pixi.js) (by [Pedro Casaubon](https://github.com/xperiments))
|
||||
* [Platform](https://github.com/bestiejs/platform.js) (by [Jake Hickman](https://github.com/JakeH))
|
||||
* [podcast](http://github.com/maxnowack/node-podcast) (by [Niklas Mollenhauer](https://github.com/nikeee))
|
||||
* [PouchDB](http://pouchdb.com) (by [Bill Sears](https://github.com/MrBigDog2U/))
|
||||
* [PreloadJS](http://www.createjs.com/#!/PreloadJS) (by [Pedro Ferreira](https://bitbucket.org/drk4))
|
||||
* [ProgressJs](http://usablica.github.io/progress.js/) (by [Shunsuke Ohtani](https://github.com/zaneli))
|
||||
@@ -382,6 +383,7 @@ All definitions files include a header with the author and editors, so at some p
|
||||
* [Store.js](https://github.com/marcuswestin/store.js/) (by [Vincent Bortone](https://github.com/vbortone))
|
||||
* [stylus](https://github.com/LearnBoost/stylus) (by [Maxime LUCE](https://github.com/SomaticIT))
|
||||
* [Sugar](http://sugarjs.com/) (by [Josh Baldwin](https://github.com/jbaldwin/))
|
||||
* [svg-pan-zoom] (https://github.com/ariutta/svg-pan-zoom) (by [Chintan Shah] (https://github.com/Promact))
|
||||
* [swfobject](https://code.google.com/p/swfobject/) (by [rou](https://github.com/rou))
|
||||
* [Swiper](http://www.idangero.us/sliders/swiper) (by [Sebastián Galiano](https://github.com/sgaliano))
|
||||
* [SwipeView](http://cubiq.org/swipeview) (by [Boris Yankov](https://github.com/borisyankov))
|
||||
|
||||
@@ -22,12 +22,6 @@ var constructResult1 = new Promise<string>((resolve: (promise: Thenable<string>)
|
||||
});
|
||||
promiseString = constructResult1;
|
||||
|
||||
//cast test
|
||||
var castResult = Promise.cast('a string');
|
||||
promiseString = castResult;
|
||||
var castResult1 = Promise.cast(Promise.resolve('a string'));
|
||||
promiseString = castResult1;
|
||||
|
||||
//resolve test
|
||||
var resolveResult = Promise.resolve('a string');
|
||||
promiseString = resolveResult;
|
||||
|
||||
@@ -20,12 +20,6 @@ var constructResult1 = new Promise<string>((resolve:(promise: Thenable<string>)
|
||||
});
|
||||
promiseString = constructResult1;
|
||||
|
||||
//cast test
|
||||
var castResult = Promise.cast('a string');
|
||||
promiseString = castResult;
|
||||
var castResult1 = Promise.cast(Promise.resolve('a string'));
|
||||
promiseString = castResult1;
|
||||
|
||||
//resolve test
|
||||
var resolveResult = Promise.resolve('a string');
|
||||
promiseString = resolveResult;
|
||||
|
||||
Vendored
+1
-11
@@ -118,23 +118,13 @@ declare class Promise<R> implements Thenable<R> {
|
||||
}
|
||||
|
||||
declare module Promise {
|
||||
/**
|
||||
* Returns promise (only if promise.constructor == Promise)
|
||||
*/
|
||||
function cast<R>(promise: Promise<R>): Promise<R>;
|
||||
/**
|
||||
* Make a promise that fulfills to obj.
|
||||
*/
|
||||
function cast<R>(object: R): Promise<R>;
|
||||
|
||||
/**
|
||||
* Make a new promise from the thenable.
|
||||
* A thenable is promise-like in as far as it has a "then" method.
|
||||
* This also creates a new promise if you pass it a genuine JavaScript promise, making it less efficient for casting than Promise.cast.
|
||||
*/
|
||||
function resolve<R>(thenable?: Thenable<R>): Promise<R>;
|
||||
/**
|
||||
* Make a promise that fulfills to obj. Same as Promise.cast(obj) in this situation.
|
||||
* Make a promise that fulfills to obj.
|
||||
*/
|
||||
function resolve<R>(object?: R): Promise<R>;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ var empty = {},
|
||||
observable = ko.observable(123),
|
||||
computed = ko.computed(function () { return observable() + 1; }),
|
||||
model = { prop: 100 },
|
||||
notifiedValues = [];
|
||||
notifiedValues: any[] = [];
|
||||
|
||||
|
||||
// Basic properties
|
||||
|
||||
Vendored
+1
-1
@@ -19,7 +19,7 @@ interface KnockoutDefinePropertyOptions {
|
||||
}
|
||||
|
||||
interface Array<T> {
|
||||
remove(item): T[];
|
||||
remove(item: T): T[];
|
||||
removeAll(items: T[]): T[];
|
||||
removeAll(): T[];
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
///<reference path="podcast.d.ts" />
|
||||
|
||||
import Podcast = require('podcast');
|
||||
|
||||
/* lets create an rss feed */
|
||||
var feed = new Podcast({
|
||||
title: 'title',
|
||||
description: 'description',
|
||||
feed_url: 'http://example.com/rss.xml',
|
||||
site_url: 'http://example.com',
|
||||
image_url: 'http://example.com/icon.png',
|
||||
docs: 'http://example.com/rss/docs.html',
|
||||
author: 'Dylan Greene',
|
||||
managingEditor: 'Dylan Greene',
|
||||
webMaster: 'Dylan Greene',
|
||||
copyright: '2013 Dylan Greene',
|
||||
language: 'en',
|
||||
categories: ['Category 1','Category 2','Category 3'],
|
||||
pubDate: new Date('May 20, 2012 04:00:00 GMT'),
|
||||
ttl: 60,
|
||||
itunesAuthor: 'Max Nowack',
|
||||
itunesSubtitle: 'I am a sub title',
|
||||
itunesSummary: 'I am a summary',
|
||||
itunesOwner: { name: 'Max Nowack', email:'max@unsou.de' },
|
||||
itunesExplicit: false,
|
||||
itunesCategory: {
|
||||
"name": "Entertainment",
|
||||
"subcats": null
|
||||
},
|
||||
itunesImage: 'http://link.to/image.png'
|
||||
});
|
||||
|
||||
/* loop over data and add to feed */
|
||||
feed.item({
|
||||
title: 'item title',
|
||||
description: 'use this for the content. It can include html.',
|
||||
url: 'http://example.com/article4?this&that', // link to the item
|
||||
guid: '1123', // optional - defaults to url
|
||||
categories: ['Category 1','Category 2','Category 3','Category 4'], // optional - array of item categories
|
||||
author: 'Guest Author', // optional - defaults to feed author property
|
||||
date: new Date('May 27, 2012'),
|
||||
lat: 33.417974, //optional latitude field for GeoRSS
|
||||
long: -111.933231, //optional longitude field for GeoRSS
|
||||
enclosure : {url:'...', file:'path-to-file'}, // optional enclosure
|
||||
itunesAuthor: 'Max Nowack',
|
||||
itunesExplicit: false,
|
||||
itunesSubtitle: 'I am a sub title',
|
||||
itunesSummary: 'I am a summary',
|
||||
itunesDuration: 12345,
|
||||
itunesKeywords: ['javascript','podcast']
|
||||
});
|
||||
|
||||
// cache the xml to send to clients
|
||||
var xml = feed.xml();
|
||||
|
||||
console.log(xml);
|
||||
Vendored
+80
@@ -0,0 +1,80 @@
|
||||
// Type definitions for podcast v0.1.0
|
||||
// Project: http://github.com/maxnowack/node-podcast
|
||||
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface PodcastStatic
|
||||
{
|
||||
new(options: IFeedOptions): PodcastStatic;
|
||||
|
||||
item(options: IItemOptions): void;
|
||||
xml(indent?: string): string;
|
||||
}
|
||||
|
||||
interface IFeedOptions
|
||||
{
|
||||
title: string;
|
||||
description?: string;
|
||||
generator?: string;
|
||||
feed_url: string;
|
||||
site_url: string;
|
||||
image_url?: string;
|
||||
docs?: string;
|
||||
author: string;
|
||||
managingEditor?: string;
|
||||
webMaster?: string;
|
||||
copyright?: string;
|
||||
language?: string;
|
||||
categories?: string[];
|
||||
pubDate?: Date;
|
||||
ttl?: number;
|
||||
itunesAuthor?: string;
|
||||
itunesSubtitle?: string;
|
||||
itunesSummary?: string;
|
||||
itunesOwner?: IItunesOwner;
|
||||
itunesExplicit?: boolean;
|
||||
itunesCategory?: IItunesCategory;
|
||||
itunesImage?: string;
|
||||
}
|
||||
|
||||
interface IItunesOwner
|
||||
{
|
||||
name: string;
|
||||
email: string;
|
||||
}
|
||||
interface IItunesCategory
|
||||
{
|
||||
name: string;
|
||||
subcats: IItunesSubCategory[]
|
||||
}
|
||||
interface IItunesSubCategory
|
||||
{
|
||||
name: string;
|
||||
subcat: string[] /* ? */
|
||||
}
|
||||
|
||||
interface IItemOptions
|
||||
{
|
||||
title: string;
|
||||
description: string;
|
||||
url: string;
|
||||
guid: string;
|
||||
categories?: string[];
|
||||
author?: string;
|
||||
date: Date;
|
||||
lat?: number;
|
||||
long?: number;
|
||||
itunesAuthor?: string;
|
||||
itunesExplicit?: boolean;
|
||||
itunesSubtitle?: string;
|
||||
itunesSummary?: string;
|
||||
itunesDuration?: number;
|
||||
itunesKeywords?: string[];
|
||||
}
|
||||
|
||||
declare var Podcast: PodcastStatic;
|
||||
|
||||
declare module "podcast"
|
||||
{
|
||||
export = Podcast;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/// <reference path="svg-pan-zoom.d.ts" />
|
||||
|
||||
var svgPanZoomOptions : SvgPanZoom.OptionConfig = {
|
||||
panEnabled: true // enable or disable panning (default enabled)
|
||||
, controlIconsEnabled: false // insert icons to give user an option in addition to mouse events to control pan/zoom (default disabled)
|
||||
, zoomEnabled: true // enable or disable zooming (default enabled)
|
||||
, dblClickZoomEnabled: true // enable or disable zooming by double clicking (default enabled)
|
||||
, zoomScaleSensitivity: 0.2 // Zoom sensitivity
|
||||
, minZoom: 0.5 // Minimum Zoom level
|
||||
, maxZoom: 10 // Maximum Zoom level
|
||||
, fit: true // enable or disable viewport fit in SVG (default true)
|
||||
, center: true // enable or disable viewport centering in SVG (default true)
|
||||
, beforeZoom: null
|
||||
, onZoom: function(){}
|
||||
, beforePan: null
|
||||
, onPan: function(){}
|
||||
, refreshRate: 60 // in hz
|
||||
};
|
||||
|
||||
var panZoomTiger: SvgPanZoom.ISvgPanZoom = svgPanZoom('#demo-tiger');
|
||||
|
||||
var svgElement = document.querySelector('#demo-tiger');
|
||||
panZoomTiger = svgPanZoom(svgElement);
|
||||
|
||||
panZoomTiger = svgPanZoom('#demo-tiger', {
|
||||
panEnabled: true
|
||||
, controlIconsEnabled: false
|
||||
, zoomEnabled: true
|
||||
, dblClickZoomEnabled: true
|
||||
, zoomScaleSensitivity: 0.2
|
||||
, minZoom: 0.5
|
||||
, maxZoom: 10
|
||||
, fit: true
|
||||
, center: true
|
||||
, refreshRate: 'auto'
|
||||
, beforeZoom: function(){}
|
||||
, onZoom: function(){}
|
||||
, beforePan: function(){}
|
||||
, onPan: function(){}
|
||||
});
|
||||
|
||||
// Pan to rendered point x = 50, y = 50
|
||||
panZoomTiger.pan({x: 50, y: 50});
|
||||
|
||||
// Pan by x = 50, y = 50 of rendered pixels
|
||||
panZoomTiger.panBy({x: 50, y: 50});
|
||||
|
||||
// Set zoom level to 2
|
||||
panZoomTiger.zoom(2);
|
||||
|
||||
// Zoom by 130%
|
||||
panZoomTiger.zoomBy(1.3);
|
||||
|
||||
// Set zoom level to 2 at point
|
||||
panZoomTiger.zoomAtPoint(2, {x: 50, y: 50});
|
||||
|
||||
// Zoom by 130% at point
|
||||
panZoomTiger.zoomAtPointBy(1.3, {x: 50, y: 50});
|
||||
|
||||
panZoomTiger.zoomIn();
|
||||
panZoomTiger.zoomOut();
|
||||
panZoomTiger.resetZoom();
|
||||
|
||||
panZoomTiger.enablePan();
|
||||
panZoomTiger.disablePan();
|
||||
|
||||
panZoomTiger.enableZoom();
|
||||
panZoomTiger.disableZoom();
|
||||
|
||||
panZoomTiger.fit();
|
||||
panZoomTiger.center();
|
||||
|
||||
panZoomTiger.resize(); // update SVG cached size and controls positions
|
||||
panZoomTiger.fit(true); // dropCache and fit
|
||||
panZoomTiger.center(true); // dropCache and center
|
||||
|
||||
delete panZoomTiger;
|
||||
Vendored
+151
@@ -0,0 +1,151 @@
|
||||
// Type definitions for svg-pan-zoom v2.3.9
|
||||
// Project: https://github.com/ariutta/svg-pan-zoom
|
||||
// Definitions by: Chintan Shah <https://github.com/Promact>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module SvgPanZoom {
|
||||
|
||||
interface OptionConfig {
|
||||
panEnabled?: boolean; // enable or disable panning (default enabled)
|
||||
controlIconsEnabled?: boolean; // insert icons to give user an option in addition to mouse events to control pan/zoom (default disabled)
|
||||
zoomEnabled?: boolean; // enable or disable zooming (default enabled)
|
||||
dblClickZoomEnabled?: boolean; // enable or disable zooming by double clicking (default enabled)
|
||||
zoomScaleSensitivity?: number; // Zoom sensitivity
|
||||
minZoom?: number; // Minimum Zoom level
|
||||
maxZoom?: number; // Maximum Zoom level
|
||||
fit?: boolean; // enable or disable viewport fit in SVG (default true)
|
||||
center?: boolean; // enable or disable viewport centering in SVG (default true)
|
||||
beforeZoom?: (scale:number) => void;
|
||||
onZoom?: (scale:number) => void;
|
||||
beforePan?: (point:IPoint) => void;
|
||||
onPan?: (point:IPoint) => void;
|
||||
refreshRate?: any; // in hz
|
||||
}
|
||||
|
||||
interface IPoint {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
interface ISvgPanZoom {
|
||||
/**
|
||||
* Creates a new SvgPanZoom instance with given element selector.
|
||||
*
|
||||
* @param svg selector of the tag on which it is to be applied.
|
||||
* @param options provides customization options at the initialization of the object.
|
||||
*/
|
||||
(svg:any, options?:OptionConfig): ISvgPanZoom;
|
||||
|
||||
/**
|
||||
* Enables Panning on svg element
|
||||
*/
|
||||
enablePan(): void;
|
||||
|
||||
/**
|
||||
* Disables panning on svg element
|
||||
*/
|
||||
disablePan(): void;
|
||||
|
||||
/**
|
||||
* Checks if Panning is enabled or not
|
||||
* @return true or false based on panning settings
|
||||
*/
|
||||
isPanEnabled(): boolean;
|
||||
|
||||
|
||||
setBeforePan(fn: (point:IPoint)=> void): void;
|
||||
|
||||
setOnPan(fn: (point:IPoint)=> void): void;
|
||||
|
||||
enableZoom(): void;
|
||||
|
||||
disableZoom(): void;
|
||||
|
||||
isZoomEnabled(): boolean;
|
||||
|
||||
enableControlIcons(): void;
|
||||
|
||||
disableControlIcons(): void;
|
||||
|
||||
isControlIconsEnabled(): boolean;
|
||||
|
||||
enableDblClickZoom(): void;
|
||||
|
||||
disableDblClickZoom(): void;
|
||||
|
||||
setZoomScaleSensitivity(scale: number): void;
|
||||
|
||||
setMinZoom(zoom: number): void;
|
||||
|
||||
setMaxZoom(zoom: number): void;
|
||||
|
||||
setBeforeZoom(fn: (scale: number) => void): void;
|
||||
|
||||
setOnZoom(fn: (scale: number) => void): void;
|
||||
|
||||
zoom(scale: number):void;
|
||||
|
||||
zoomIn(): void;
|
||||
|
||||
zoomOut(): void;
|
||||
|
||||
zoomBy(scale: number): void;
|
||||
|
||||
resetZoom(): void;
|
||||
|
||||
/**
|
||||
* Get zoom scale/level
|
||||
*
|
||||
* @return {float} zoom scale
|
||||
*/
|
||||
getZoom(): number;
|
||||
|
||||
/**
|
||||
* Adjust viewport size (only) so it will fit in SVG
|
||||
* Does not center image
|
||||
*
|
||||
* @param {bool} dropCache drop viewBox cache and recalculate SVG's viewport sizes. Default false
|
||||
*/
|
||||
fit(dropCache?: boolean): void;
|
||||
|
||||
/**
|
||||
* Adjust viewport pan (only) so it will be centered in SVG
|
||||
* Does not zoom/fit image
|
||||
*
|
||||
* @param {bool} dropCache drop viewBox cache and recalculate SVG's viewport sizes. Default false
|
||||
*/
|
||||
center(dropCache?: boolean): void;
|
||||
|
||||
/**
|
||||
* Recalculates cached svg dimensions and controls position
|
||||
*/
|
||||
resize(): void;
|
||||
|
||||
/**
|
||||
* Pan to a rendered position
|
||||
*
|
||||
* @param {object} point {x: 0, y: 0}
|
||||
*/
|
||||
pan(point: IPoint): void;
|
||||
|
||||
/**
|
||||
* Relatively pan the graph by a specified rendered position vector
|
||||
*
|
||||
* @param {object} point {x: 0, y: 0}
|
||||
*/
|
||||
panBy(point: IPoint): void;
|
||||
|
||||
/**
|
||||
* Get pan vector
|
||||
*
|
||||
* @return {object} {x: 0, y: 0}
|
||||
*/
|
||||
getPan(): IPoint;
|
||||
|
||||
zoomAtPoint(scale:number, point:IPoint): boolean;
|
||||
|
||||
zoomAtPointBy(scale:number, point:IPoint): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare var svgPanZoom:SvgPanZoom.ISvgPanZoom;
|
||||
Reference in New Issue
Block a user