mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-13 05:20:25 +00:00
Merge remote-tracking branch 'upstream/master' into update-java-to-072
This commit is contained in:
Vendored
+19
-1
@@ -164,7 +164,7 @@ declare module "aws-sdk" {
|
||||
/**
|
||||
* Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) that you can use to access AWS resources that you might not normally have access to.
|
||||
*/
|
||||
assumeRole(params: sts.AssumeRoleParams, callback: (err: any, data: any) => void): void;
|
||||
assumeRole(params: sts.AssumeRoleParams, callback: (err: any, data: sts.AssumeRoleCallbackData) => void): void;
|
||||
|
||||
/**
|
||||
* Returns a set of temporary security credentials for users who have been authenticated via a SAML authentication response.
|
||||
@@ -1408,6 +1408,24 @@ declare module "aws-sdk" {
|
||||
TokenCode?: string;
|
||||
}
|
||||
|
||||
export interface AssumeRoleCallbackData{
|
||||
Credentials: TemporaryCredentials;
|
||||
AssumedRoleUser: AssumedRoleUser;
|
||||
PackedPolicySize: number;
|
||||
}
|
||||
|
||||
export interface TemporaryCredentials{
|
||||
AccessKeyId: string;
|
||||
SecretAccessKey: string;
|
||||
SessionToken: string;
|
||||
Expiration: Date;
|
||||
}
|
||||
|
||||
export interface AssumedRoleUser{
|
||||
AssumedRoleId: string;
|
||||
Arn: string;
|
||||
}
|
||||
|
||||
export interface AssumeRoleWithSAMLParams {
|
||||
PrincipalArn: string;
|
||||
RoleArn: string;
|
||||
|
||||
Vendored
+6
-1
@@ -1078,11 +1078,16 @@ declare namespace d3 {
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
export function extent<T>(array: T[], accessor: (datum: T, index: number) => string): [string, string];
|
||||
|
||||
/**
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
export function extent<T>(array: T[], accessor: (datum: T, index: number) => Date): [Date, Date];
|
||||
|
||||
/**
|
||||
* Return the min and max simultaneously.
|
||||
*/
|
||||
export function extent<T, U extends Numeric>(array: U[], accessor: (datum: T, index: number) => U): [U | Primitive, U | Primitive];
|
||||
export function extent<T, U extends Numeric>(array: T[], accessor: (datum: T, index: number) => U): [U | Primitive, U | Primitive];
|
||||
|
||||
/**
|
||||
* Compute the sum of an array of numbers.
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
# DevExpress ASP.NET/MVC TypeScript definitions #
|
||||
DevExpress ASP.NET/MVC TypeScript definitions
|
||||
=============================================
|
||||
|
||||
You can use these TypeScript definitions for your web projects, which contain DevExpress ASP.NET or MVC controls. For this, simply add <reference path="TypeScript/devexpress-web.d.ts" /> at the top of your code.
|
||||
|
||||
The API enclosed into the DevExpress ASP.NET/MVC TypeScript definition file fully corresponds to the API described in the DevExpress ASP.NET/MVC Documentation: [Reference](https://documentation.devexpress.com/#AspNet/DevExpressWebScripts).
|
||||
|
||||
If you have any issues while using the DevExpress ASP.NET/MVC TypeScript definitions, please refer to our [Support Center](https://www.devexpress.com/Support/Center/Question/List/1).
|
||||
You can use these TypeScript definitions for your web projects, which contain
|
||||
DevExpress ASP.NET or MVC controls. For this, simply add at the top of your
|
||||
code `<reference path="TypeScript/devexpress-web.d.ts" />`.
|
||||
|
||||
The API enclosed into the DevExpress ASP.NET/MVC TypeScript definition file
|
||||
fully corresponds to the API described in the DevExpress ASP.NET/MVC
|
||||
Documentation:
|
||||
[Reference](https://documentation.devexpress.com/#AspNet/DevExpressWebScripts).
|
||||
|
||||
If you have any issues while using the DevExpress ASP.NET/MVC TypeScript
|
||||
definitions, please refer to our [Support
|
||||
Center](https://www.devexpress.com/Support/Center/Question/List/1).
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/// <reference path="../gregorian-calendar/gregorian-calendar.d.ts" />
|
||||
|
||||
import GregorianCalendar = require('gregorian-calendar');
|
||||
import GregorianCalendarFormat = require('gregorian-calendar-format');
|
||||
|
||||
|
||||
let cal = new GregorianCalendar();
|
||||
cal.set(2016, 7, 27, 0, 0, 0, 0);
|
||||
|
||||
let fmt = new GregorianCalendarFormat('yyyy-MM');
|
||||
|
||||
let calAsStr = fmt.format(cal);
|
||||
console.log(calAsStr);
|
||||
|
||||
+274
@@ -0,0 +1,274 @@
|
||||
// Type definitions for gregorian-calendar v4.1.4
|
||||
// Project: https://github.com/yiminghe/gregorian-calendar
|
||||
// Definitions by: Charlie Arnold <https://github.com/cwalv>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
|
||||
declare module 'gregorian-calendar' {
|
||||
|
||||
class GregorianCalendar {
|
||||
|
||||
constructor(locale?: Object);
|
||||
|
||||
/**
|
||||
* same as call setYear, setMonth, setDayOfMonth ....
|
||||
*/
|
||||
set(year: Number, month: Number, dayOfMonth: Number,
|
||||
hourOfDay: Number, minutes: Number, seconds: Number,
|
||||
milliseconds: Number): void;
|
||||
|
||||
/**
|
||||
* set absolute time for current instance
|
||||
*/
|
||||
setTime(time: Number): void;
|
||||
|
||||
/**
|
||||
* get absolute time for current instance
|
||||
*/
|
||||
getTime(): Number;
|
||||
|
||||
/**
|
||||
* set current date instance's timezone offset (in minutes)
|
||||
*/
|
||||
setTimezoneOffset(timezoneOffset: Number): void
|
||||
|
||||
/**
|
||||
* current date instance's timezone offset (in minutes)
|
||||
*/
|
||||
getTimezoneOffset(): Number;
|
||||
|
||||
/**
|
||||
* set the year of the given calendar field.
|
||||
*/
|
||||
setYear(year: Number): void;
|
||||
|
||||
/**
|
||||
* Returns the year of the given calendar field.
|
||||
*/
|
||||
getYear(): Number;
|
||||
|
||||
/**
|
||||
* set the month of the given calendar field. January is 0, you can use enum
|
||||
*/
|
||||
setMonth(month: Number): void;
|
||||
|
||||
/**
|
||||
* set the month of the given calendar field without influence month.
|
||||
* 2015-09-29 -> setMonth(2) -> 2015-03-01
|
||||
* 2015-09-29 -> rollSetMonth(2) -> 2015-02-28
|
||||
*/
|
||||
rollSetMonth(month: Number): void;
|
||||
|
||||
/**
|
||||
* Returns the month of the given calendar field.
|
||||
*/
|
||||
getMonth(): Number;
|
||||
|
||||
/**
|
||||
* set the day of month of the given calendar field.
|
||||
*/
|
||||
setDayOfMonth(day: Number): void;
|
||||
|
||||
/**
|
||||
* Returns the day of month of the given calendar field.
|
||||
*/
|
||||
getDayOfMonth(): Number;
|
||||
|
||||
|
||||
/**
|
||||
* set the hour of day for the given calendar field.
|
||||
*/
|
||||
setHourOfDay(hour: Number): void;
|
||||
|
||||
/**
|
||||
* Returns the hour of day for the given calendar field.
|
||||
*/
|
||||
getHourOfDay(): Number
|
||||
|
||||
/**
|
||||
* set the minute of the given calendar field.
|
||||
*/
|
||||
setMinutes(minute: Number): void;
|
||||
|
||||
/**
|
||||
* Returns the minute of the given calendar field.
|
||||
*/
|
||||
getMinutes(): Number;
|
||||
|
||||
/**
|
||||
* set the second of the given calendar field.
|
||||
*/
|
||||
setSeconds(second: Number): void;
|
||||
|
||||
/**
|
||||
* Returns the second of the given calendar field.
|
||||
*/
|
||||
getSeconds(): Number;
|
||||
|
||||
/**
|
||||
* set the millisecond of the given calendar field.
|
||||
*/
|
||||
setMilliSeconds(second: Number): void;
|
||||
|
||||
/**
|
||||
* Returns the millisecond of the given calendar field.
|
||||
*/
|
||||
getMilliSeconds(): Number;
|
||||
|
||||
/**
|
||||
* Returns the week of year of the given calendar field.
|
||||
*/
|
||||
getWeekOfYear(): Number;
|
||||
|
||||
/**
|
||||
* Returns the week of month of the given calendar field.
|
||||
*/
|
||||
getWeekOfMonth(): Number;
|
||||
|
||||
/**
|
||||
* Returns the day of year of the given calendar field.
|
||||
*/
|
||||
getDayOfYear(): Number;
|
||||
|
||||
/**
|
||||
* Returns the day of week of the given calendar field. sunday is 0, monday is 1
|
||||
*/
|
||||
getDayOfWeek(): Number;
|
||||
|
||||
/**
|
||||
* Returns the day of week in month of the given calendar field.
|
||||
*/
|
||||
getDayOfWeekInMonth(): Number;
|
||||
|
||||
/**
|
||||
* add the year of the given calendar field.
|
||||
*/
|
||||
addYear(amount: Number): void;
|
||||
|
||||
/**
|
||||
* add the month of the given calendar field.
|
||||
*/
|
||||
addMonth(amount: Number): void;
|
||||
|
||||
/**
|
||||
* add the day of month of the given calendar field.
|
||||
*/
|
||||
addDayOfMonth(amount: Number): void;
|
||||
|
||||
/**
|
||||
* add the hour of day of the given calendar field.
|
||||
*/
|
||||
addHourOfDay(amount: Number): void;
|
||||
|
||||
/**
|
||||
* add the minute of the given calendar field.
|
||||
*/
|
||||
addMinute(amount: Number): void;
|
||||
|
||||
/**
|
||||
* add the second of the given calendar field.
|
||||
*/
|
||||
addSecond(amount: Number): void;
|
||||
|
||||
/**
|
||||
* add the millisecond of the given calendar field.
|
||||
*/
|
||||
addMilliSecond(amount: Number): void;
|
||||
|
||||
/**
|
||||
* Returns the week number of year represented by this GregorianCalendar.
|
||||
*/
|
||||
getWeekYear(): Number;
|
||||
|
||||
/**
|
||||
* Sets this GregorianCalendar to the date given by the date specifiers - weekYear, weekOfYear, and dayOfWeek.
|
||||
* weekOfYear follows the WEEK_OF_YEAR numbering.
|
||||
* The dayOfWeek value must be one of the DAY_OF_WEEK values: SUNDAY to SATURDAY.
|
||||
* weekYear: the week year
|
||||
* weekOfYear: the week number based on weekYear
|
||||
* dayOfWeek: the day of week value
|
||||
*/
|
||||
setWeekDate(weekYear: Number, weekOfYear: Number, dayOfWeek: Number): void;
|
||||
|
||||
/**
|
||||
* Returns the number of weeks in the week year
|
||||
*/
|
||||
getWeeksInWeekYear(): Number;
|
||||
|
||||
/**
|
||||
* Returns a clone of current instance
|
||||
*/
|
||||
clone(): GregorianCalendar;
|
||||
|
||||
equals(other: GregorianCalendar): boolean;
|
||||
|
||||
/**
|
||||
* compare this object and other by day. return -1 0 or 1
|
||||
*/
|
||||
compareToDay(other: GregorianCalendar): Number;
|
||||
|
||||
/**
|
||||
* clear all field of current instance
|
||||
*/
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
export = GregorianCalendar;
|
||||
}
|
||||
|
||||
declare module 'gregorian-calendar-format' {
|
||||
|
||||
import GregorianCalendar = require('gregorian-calendar');
|
||||
|
||||
enum DateTimeStyle {
|
||||
/**
|
||||
* full style
|
||||
*/
|
||||
FULL = 0,
|
||||
/**
|
||||
* long style
|
||||
*/
|
||||
LONG,
|
||||
/**
|
||||
* medium style
|
||||
*/
|
||||
MEDIUM,
|
||||
/**
|
||||
* short style
|
||||
*/
|
||||
SHORT,
|
||||
}
|
||||
|
||||
class DateTimeFormat {
|
||||
|
||||
public Style: DateTimeStyle;
|
||||
|
||||
/**
|
||||
* @param pattern The format pattern string
|
||||
* @param locale The local of to output (defaults to require('gregorian-calendar/lib/locale/en_US'),
|
||||
* may also be one of:
|
||||
* require('gregorian-calendar/lib/locale/zh_CN')
|
||||
* require('gregorian-calendar/lib/locale/ru_RU')
|
||||
*/
|
||||
constructor(pattern: string, locale?: Object);
|
||||
|
||||
/**
|
||||
* format an instance of GregorianCalendar according to pattern
|
||||
*/
|
||||
format(calendar: GregorianCalendar): String;
|
||||
|
||||
/**
|
||||
* parse a dateString to an instance of GregorianCalendar according to pattern, it's better to specify calendarLocale, such as
|
||||
* `df.parse('2013-11-12', {locale: require('gregorian-calendar/lib/locale/zh_CN'}));`
|
||||
*/
|
||||
parse(dateString: String, {locale: Object}): GregorianCalendar;
|
||||
|
||||
/**
|
||||
* get a predefine GregorianCalendarFormat instance
|
||||
*/
|
||||
getDateTimeInstance(dateStyle: DateTimeStyle, timeStyle: DateTimeStyle, locale?: Object): DateTimeFormat;
|
||||
}
|
||||
|
||||
export = DateTimeFormat;
|
||||
}
|
||||
|
||||
+16
-5
@@ -41,7 +41,7 @@ function test_addClass() {
|
||||
|
||||
function test_after() {
|
||||
$('.inner').after('<p>Test</p>');
|
||||
$('<div/>').after('<p></p>');
|
||||
$('<div/>').after('<p></p>').after(document.createDocumentFragment());
|
||||
$('<div/>').after('<p></p>').addClass('foo')
|
||||
.filter('p').attr('id', 'bar').html('hello')
|
||||
.end()
|
||||
@@ -88,7 +88,7 @@ function test_ajax() {
|
||||
alert('Load was performed.');
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Load failed. responseJSON=' + jqXHR.responseJSON);
|
||||
alert('Load failed. responseJSON=' + jqXHR.responseJSON);
|
||||
}
|
||||
});
|
||||
var _super = jQuery.ajaxSettings.xhr;
|
||||
@@ -509,7 +509,7 @@ function test_toggle() {
|
||||
|
||||
function test_append() {
|
||||
$('.inner').append('<p>Test</p>');
|
||||
$('.container').append($('h2'));
|
||||
$('.container').append($('h2')).append(document.createDocumentFragment());
|
||||
|
||||
var $newdiv1 = $('<div id="object1"/>'),
|
||||
newdiv2 = document.createElement('div'),
|
||||
@@ -559,7 +559,7 @@ function test_attributeSelectors() {
|
||||
|
||||
function test_before() {
|
||||
$('.inner').before('<p>Test</p>');
|
||||
$('.container').before($('h2'));
|
||||
$('.container').before($('h2')).before(document.createDocumentFragment());
|
||||
$("<div/>").before("<p></p>");
|
||||
var $newdiv1 = $('<div id="object1"/>'),
|
||||
newdiv2 = document.createElement('div'),
|
||||
@@ -946,6 +946,17 @@ function test_clone() {
|
||||
.clone());
|
||||
}
|
||||
|
||||
function test_prepend() {
|
||||
$('.inner').prepend('<p>Test</p>');
|
||||
$('.container').prepend($('h2')).prepend(document.createDocumentFragment());
|
||||
|
||||
var $newdiv1 = $('<div id="object1"/>'),
|
||||
newdiv2 = document.createElement('div'),
|
||||
existingdiv1 = document.getElementById('foo');
|
||||
|
||||
$('body').prepend($newdiv1, [newdiv2, existingdiv1]);
|
||||
}
|
||||
|
||||
function test_prependTo() {
|
||||
$("<p>Test</p>").prependTo(".inner");
|
||||
$("h2").prependTo($(".container"));
|
||||
@@ -3249,7 +3260,7 @@ function test_not() {
|
||||
$("p").not("#selected");
|
||||
|
||||
$("p").not($("div p.selected"));
|
||||
|
||||
|
||||
var el1 = $("<div/>")[0];
|
||||
var el2 = $("<div/>")[0];
|
||||
$("p").not([el1, el2]);
|
||||
|
||||
Vendored
+8
-8
@@ -2632,10 +2632,10 @@ interface JQuery {
|
||||
/**
|
||||
* Insert content, specified by the parameter, after each element in the set of matched elements.
|
||||
*
|
||||
* param content1 HTML string, DOM element, array of elements, or jQuery object to insert after each element in the set of matched elements.
|
||||
* param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert after each element in the set of matched elements.
|
||||
* param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert after each element in the set of matched elements.
|
||||
*/
|
||||
after(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
|
||||
after(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery;
|
||||
/**
|
||||
* Insert content, specified by the parameter, after each element in the set of matched elements.
|
||||
*
|
||||
@@ -2646,10 +2646,10 @@ interface JQuery {
|
||||
/**
|
||||
* Insert content, specified by the parameter, to the end of each element in the set of matched elements.
|
||||
*
|
||||
* param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
|
||||
* param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the end of each element in the set of matched elements.
|
||||
* param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the end of each element in the set of matched elements.
|
||||
*/
|
||||
append(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
|
||||
append(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery;
|
||||
/**
|
||||
* Insert content, specified by the parameter, to the end of each element in the set of matched elements.
|
||||
*
|
||||
@@ -2667,10 +2667,10 @@ interface JQuery {
|
||||
/**
|
||||
* Insert content, specified by the parameter, before each element in the set of matched elements.
|
||||
*
|
||||
* param content1 HTML string, DOM element, array of elements, or jQuery object to insert before each element in the set of matched elements.
|
||||
* param content1 HTML string, DOM element, DocumentFragment, array of elements, or jQuery object to insert before each element in the set of matched elements.
|
||||
* param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert before each element in the set of matched elements.
|
||||
*/
|
||||
before(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
|
||||
before(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery;
|
||||
/**
|
||||
* Insert content, specified by the parameter, before each element in the set of matched elements.
|
||||
*
|
||||
@@ -2715,10 +2715,10 @@ interface JQuery {
|
||||
/**
|
||||
* Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
|
||||
*
|
||||
* param content1 DOM element, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
|
||||
* param content1 DOM element, DocumentFragment, array of elements, HTML string, or jQuery object to insert at the beginning of each element in the set of matched elements.
|
||||
* param content2 One or more additional DOM elements, arrays of elements, HTML strings, or jQuery objects to insert at the beginning of each element in the set of matched elements.
|
||||
*/
|
||||
prepend(content1: JQuery|any[]|Element|Text|string, ...content2: any[]): JQuery;
|
||||
prepend(content1: JQuery|any[]|Element|DocumentFragment|Text|string, ...content2: any[]): JQuery;
|
||||
/**
|
||||
* Insert content, specified by the parameter, to the beginning of each element in the set of matched elements.
|
||||
*
|
||||
|
||||
Vendored
+14
-1
@@ -164,17 +164,30 @@ declare module "knex" {
|
||||
|
||||
interface Join {
|
||||
(raw: Raw): QueryBuilder;
|
||||
(tableName: string, callback: Function): QueryBuilder;
|
||||
(tableName: string, callback: (joinClause: JoinClause) => any): QueryBuilder;
|
||||
(tableName: string, columns: {[key: string]: string|Raw}): QueryBuilder;
|
||||
(tableName: string, raw: Raw): QueryBuilder;
|
||||
(tableName: string, column1: string, column2: string): QueryBuilder;
|
||||
(tableName: string, column1: string, raw: Raw): QueryBuilder;
|
||||
(tableName: string, column1: string, operator: string, column2: string): QueryBuilder;
|
||||
}
|
||||
|
||||
interface JoinClause {
|
||||
on(raw: Raw): JoinClause;
|
||||
on(callback: Function): JoinClause;
|
||||
on(columns: {[key: string]: string|Raw}): JoinClause;
|
||||
on(column1: string, column2: string): JoinClause;
|
||||
on(column1: string, raw: Raw): JoinClause;
|
||||
on(column1: string, operator: string, column2: string): JoinClause;
|
||||
}
|
||||
|
||||
interface JoinRaw {
|
||||
(tableName: string, binding?: Value): QueryBuilder;
|
||||
}
|
||||
|
||||
interface Where extends WhereRaw, WhereWrapped, WhereNull {
|
||||
(raw: Raw): QueryBuilder;
|
||||
(callback: (queryBuilder: QueryBuilder) => any): QueryBuilder;
|
||||
(object: Object): QueryBuilder;
|
||||
(columnName: string, value: Value): QueryBuilder;
|
||||
(columnName: string, operator: string, value: Value): QueryBuilder;
|
||||
|
||||
@@ -238,3 +238,5 @@ var tabsHtml = '<div class="row">' +
|
||||
|
||||
// Transitions
|
||||
Materialize.showStaggeredList('#staggered-test');
|
||||
|
||||
Materialize.updateTextFields();
|
||||
Vendored
+5
@@ -319,6 +319,11 @@ declare namespace Materialize {
|
||||
* @name selector the selector for the image to fade in
|
||||
*/
|
||||
fadeInImage(selector:string): void;
|
||||
|
||||
/**
|
||||
* Update all text field to reinitialize all the Materialize labels on the page if dynamically adding inputs
|
||||
*/
|
||||
updateTextFields(): void;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ schema.path('name');
|
||||
schema.path('name', Number);
|
||||
schema.pathType('name');
|
||||
schema.plugin(function() {});
|
||||
schema.post('save', function(next: () => void, doc: IActor) {});
|
||||
schema.post('save', function(doc: IActor) {});
|
||||
schema.pre('save', function(next: () => void) {});
|
||||
schema.requiredPaths();
|
||||
schema.static('findByName', function(name: string, callback: () => void) {});
|
||||
|
||||
Vendored
+1
-2
@@ -276,8 +276,7 @@ declare module "mongoose" {
|
||||
|
||||
pre(method: string, fn: HookSyncCallback, errorCb?: HookErrorCallback): Schema;
|
||||
pre(method: string, isAsync: boolean, fn: HookAsyncCallback, errorCb?: HookErrorCallback): Schema;
|
||||
post(method: string, fn: HookSyncCallback, errorCb?: HookErrorCallback): Schema;
|
||||
post(method: string, isAsync: boolean, fn: HookAsyncCallback, errorCb?: HookErrorCallback): Schema;
|
||||
post(method: string, fn: (doc: Document, next?: HookNextFunction) => any ): Schema;
|
||||
|
||||
requiredPaths(): string[];
|
||||
set(key: string, value: any): void;
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/// <reference path="pdfobject.d.ts" />
|
||||
|
||||
import * as PDFObject from "pdfobject";
|
||||
|
||||
function test_embedding_with_url_only() {
|
||||
var el:HTMLElement = PDFObject.embed("url");
|
||||
}
|
||||
|
||||
function test_embedding_with_url_and_target() {
|
||||
var el:HTMLElement = PDFObject.embed("url", ".css-selector");
|
||||
}
|
||||
|
||||
function test_embedding_with_all_parameters() {
|
||||
var el:HTMLElement = PDFObject.embed("url", ".css-selector", {
|
||||
"height": "200px"
|
||||
});
|
||||
}
|
||||
|
||||
function test_pdf_object_version() {
|
||||
var version:string = PDFObject.pdfobjectversion;
|
||||
}
|
||||
|
||||
function test_supports_pdfs() {
|
||||
var supportsPDFs:boolean = PDFObject.supportsPDFs;
|
||||
}
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
// Type definitions for PDFObject v2.0.201604172
|
||||
// Project: https://github.com/pipwerks/PDFObject
|
||||
// Definitions by: Niels Boogaard <http://github.com/nielsboogaard>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "pdfobject" {
|
||||
interface PDFObject {
|
||||
embed(url:string, target?:any, options?:any): HTMLElement;
|
||||
pdfobjectversion: string;
|
||||
supportsPDFs: boolean;
|
||||
}
|
||||
|
||||
var pdfObject: PDFObject;
|
||||
export = pdfObject;
|
||||
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
|
||||
import { Option, MenuRendererProps } from "react-select-props";
|
||||
import { Option, ReactSelectProps, ReactAsyncSelectProps, MenuRendererProps } from "react-select-props";
|
||||
import Select = require("react-select");
|
||||
|
||||
const CustomOption = React.createClass({
|
||||
@@ -78,42 +78,43 @@ class SelectTest extends React.Component<React.Props<{}>, {}> {
|
||||
const onClose = () => { return; };
|
||||
const optionRenderer = (option: Option) => <span>{option.label}</span>
|
||||
|
||||
const selectProps: ReactSelectProps = {
|
||||
name: "test-select",
|
||||
className: "test-select",
|
||||
key: "1",
|
||||
options: options,
|
||||
optionRenderer: optionRenderer,
|
||||
allowCreate: true,
|
||||
autofocus: true,
|
||||
autosize: true,
|
||||
clearable: true,
|
||||
escapeClearsValue: true,
|
||||
ignoreAccents: true,
|
||||
joinValues: false,
|
||||
matchPos: "any",
|
||||
matchProp: "any",
|
||||
menuContainerStyle: {},
|
||||
menuRenderer: renderMenu,
|
||||
menuStyle: {},
|
||||
multi: true,
|
||||
onMenuScrollToBottom: () => {},
|
||||
onValueClick: onChange,
|
||||
onOpen: onOpen,
|
||||
onClose: onClose,
|
||||
openAfterFocus: false,
|
||||
optionComponent: CustomOption,
|
||||
required: false,
|
||||
resetValue: "resetValue",
|
||||
scrollMenuIntoView: false,
|
||||
valueKey: "github",
|
||||
labelKey: "name",
|
||||
onChange: onChange,
|
||||
value: options,
|
||||
valueComponent: CustomValue,
|
||||
};
|
||||
|
||||
return <div>
|
||||
<Select
|
||||
name="test-select"
|
||||
className="test-select"
|
||||
key="1"
|
||||
options={options}
|
||||
optionRenderer={optionRenderer}
|
||||
allowCreate={true}
|
||||
autofocus={true}
|
||||
autosize={true}
|
||||
clearable={true}
|
||||
escapeClearsValue={true}
|
||||
ignoreAccents={true}
|
||||
joinValues={false}
|
||||
matchPos={"any"}
|
||||
matchProp={"any"}
|
||||
menuContainerStyle={{}}
|
||||
menuRenderer={renderMenu}
|
||||
menuStyle={{}}
|
||||
multi={true}
|
||||
onMenuScrollToBottom={() => {}}
|
||||
onValueClick={onChange}
|
||||
onOpen={onOpen}
|
||||
onClose={onClose}
|
||||
openAfterFocus={false}
|
||||
optionComponent={CustomOption}
|
||||
required={false}
|
||||
resetValue={"resetValue"}
|
||||
scrollMenuIntoView={false}
|
||||
valueKey="github"
|
||||
labelKey="name"
|
||||
onChange={onChange}
|
||||
simpleValue
|
||||
value={options}
|
||||
valueComponent={CustomValue}
|
||||
/>
|
||||
<Select {...selectProps} />
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
@@ -128,29 +129,32 @@ class SelectAsyncTest extends React.Component<React.Props<{}>, {}> {
|
||||
};
|
||||
const options: Option[] = [{ label: "Foo", value: "bar" }];
|
||||
const onChange = (value: any) => console.log(value);
|
||||
|
||||
const asyncSelectProps: ReactAsyncSelectProps = {
|
||||
name: "test-select",
|
||||
className: "test-select",
|
||||
key: "1",
|
||||
matchPos: "any",
|
||||
matchProp: "any",
|
||||
multi: true,
|
||||
onValueClick: onChange,
|
||||
valueKey: "github",
|
||||
labelKey: "name",
|
||||
onChange: onChange,
|
||||
simpleValue: undefined,
|
||||
value: options,
|
||||
loadOptions: getOptions,
|
||||
cache: {},
|
||||
ignoreAccents: false,
|
||||
ignoreCase: true,
|
||||
isLoading: false,
|
||||
minimumInput: 5,
|
||||
searchPromptText: "search...",
|
||||
searchingText: "searching...",
|
||||
};
|
||||
|
||||
return <div>
|
||||
<Select.Async
|
||||
name="test-select"
|
||||
className="test-select"
|
||||
key="1"
|
||||
matchPos={"any"}
|
||||
matchProp={"any"}
|
||||
multi={true}
|
||||
onValueClick={onChange}
|
||||
valueKey="github"
|
||||
labelKey="name"
|
||||
onChange={onChange}
|
||||
simpleValue
|
||||
value={options}
|
||||
loadOptions={getOptions}
|
||||
cache={{}}
|
||||
ignoreAccents={false}
|
||||
ignoreCase={{}}
|
||||
isLoading={false}
|
||||
minimumInput={5}
|
||||
searchPromptText={"search..."}
|
||||
searchingText={"searching..."}
|
||||
/>
|
||||
<Select.Async {...asyncSelectProps} />
|
||||
</div>;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+10
-12
@@ -62,7 +62,7 @@ declare namespace ReactSelect {
|
||||
valueArray: Option[];
|
||||
}
|
||||
|
||||
interface ReactSelectProps extends __React.Props<ReactSelect> {
|
||||
interface ReactSelectProps extends __React.Props<ReactSelectClass> {
|
||||
/**
|
||||
* text to display when `allowCreate` is true.
|
||||
* @default 'Add "{label}"?'
|
||||
@@ -401,26 +401,24 @@ declare namespace ReactSelect {
|
||||
searchingText?: string;
|
||||
}
|
||||
|
||||
interface ReactSelect extends __React.ReactElement<ReactSelectProps> { }
|
||||
interface ReactSelectAsyncClass extends __React.ComponentClass<ReactAsyncSelectProps> {
|
||||
class ReactSelectAsyncClass extends __React.Component<ReactAsyncSelectProps, {}> {
|
||||
}
|
||||
const Async: ReactSelectAsyncClass;
|
||||
interface ReactSelectClass extends __React.ComponentClass<ReactSelectProps> {
|
||||
Async: ReactSelectAsyncClass;
|
||||
class ReactSelectClass extends __React.Component<ReactSelectProps, {}> {
|
||||
static Async: ReactSelectAsyncClass;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
declare module "react-select" {
|
||||
const RS: ReactSelect.ReactSelectClass;
|
||||
export = RS;
|
||||
export = ReactSelect.ReactSelectClass;
|
||||
}
|
||||
|
||||
declare module "react-select-props" {
|
||||
|
||||
interface Option extends ReactSelect.Option {}
|
||||
interface MenuRendererProps extends ReactSelect.MenuRendererProps {}
|
||||
import Option = ReactSelect.Option;
|
||||
import MenuRendererProps = ReactSelect.MenuRendererProps;
|
||||
import ReactSelectProps = ReactSelect.ReactSelectProps;
|
||||
import ReactAsyncSelectProps = ReactSelect.ReactAsyncSelectProps;
|
||||
|
||||
export { MenuRendererProps, Option };
|
||||
export { MenuRendererProps, ReactSelectProps, ReactAsyncSelectProps, Option };
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/// <reference path="request-promise.d.ts" />
|
||||
|
||||
import rp = require('request-promise');
|
||||
import nodeRequest = require('request');
|
||||
import errors = require('request-promise/errors');
|
||||
|
||||
rp('http://www.google.com')
|
||||
.then(console.dir)
|
||||
.catch(console.error);
|
||||
|
||||
var options: nodeRequest.Options = {
|
||||
var options: rp.Options = {
|
||||
uri : 'http://posttestserver.com/post.php',
|
||||
method : 'POST',
|
||||
json: true,
|
||||
@@ -18,7 +18,39 @@ rp(options)
|
||||
.then(console.dir)
|
||||
.catch(console.error);
|
||||
|
||||
// --> Displays length of response from server after post
|
||||
rp('http://google.com').finally(() => {});
|
||||
|
||||
// This works:
|
||||
rp('http://google.com').then(console.dir);
|
||||
rp('http://google.com').catch(console.error);
|
||||
rp('http://google.com').then(console.dir, console.error);
|
||||
|
||||
// This works as well since additional methods are only used AFTER the FIRST call in the chain:
|
||||
rp('http://google.com').then(console.dir).spread(console.dir);
|
||||
rp('http://google.com').catch(console.error).error(console.error);
|
||||
|
||||
// Use .promise() in these cases:
|
||||
rp('http://google.com').promise().bind(this).then(console.dir);
|
||||
|
||||
rp({ uri: 'http://google.com', resolveWithFullResponse: true }).then((response) => {});
|
||||
rp({ uri: 'http://google.com', simple: false }).catch((reason) => {});
|
||||
|
||||
rp({
|
||||
uri: 'http://google.com',
|
||||
transform: (body: any, response: http.IncomingMessage, resolveWithFullResponse: boolean): any => {
|
||||
throw new Error('Transform failed!');
|
||||
}
|
||||
}).catch(errors.StatusCodeError, (reason: errors.StatusCodeError) => {
|
||||
// The server responded with a status codes other than 2xx.
|
||||
// Check reason.statusCode
|
||||
}).catch(errors.RequestError, (reason: errors.RequestError) => {
|
||||
// The request failed due to technical reasons.
|
||||
// reason.cause is the Error object Request would pass into a callback.
|
||||
}).catch(errors.TransformError, (reason: errors.TransformError) => {
|
||||
console.log(reason.cause.message); // => Transform failed!
|
||||
// reason.response is the original response for which the transform operation failed
|
||||
});
|
||||
|
||||
|
||||
//Defaults tests
|
||||
(() => {
|
||||
@@ -46,7 +78,7 @@ rp(options)
|
||||
console.log("DELETE succeeded with status %d", response.statusCode);
|
||||
})
|
||||
.catch(console.error);
|
||||
|
||||
|
||||
//The following examples from https://github.com/request/request
|
||||
import fs = require('fs');
|
||||
import http = require('http');
|
||||
@@ -71,14 +103,14 @@ request
|
||||
console.log(response.headers['content-type']); // 'image/png'
|
||||
})
|
||||
.pipe(request.put('http://mysite.com/img.png'));
|
||||
|
||||
|
||||
request
|
||||
.get('http://mysite.com/doodle.png')
|
||||
.on('error', function(err: any) {
|
||||
console.log(err);
|
||||
})
|
||||
.pipe(fs.createWriteStream('doodle.png'));
|
||||
|
||||
|
||||
http.createServer(function (req, resp) {
|
||||
if (req.url === '/doodle.png') {
|
||||
if (req.method === 'PUT') {
|
||||
@@ -98,7 +130,7 @@ http.createServer(function (req, resp) {
|
||||
});
|
||||
|
||||
var resp: http.ServerResponse;
|
||||
var req: nodeRequest.Request;
|
||||
var req: rp.RequestPromise;
|
||||
req.pipe(request('http://mysite.com/doodle.png')).pipe(resp);
|
||||
|
||||
var r = request;
|
||||
@@ -192,7 +224,7 @@ request({
|
||||
}
|
||||
console.log('Upload successful! Server responded with:', body);
|
||||
});
|
||||
|
||||
|
||||
request.get('http://some.server.com/').auth('username', 'password', false);
|
||||
// or
|
||||
request.get('http://some.server.com/', {
|
||||
@@ -282,8 +314,8 @@ request.post({url:url, oauth:oauth}, function (e, r, body) {
|
||||
, token_secret: perm_data.oauth_token_secret
|
||||
};
|
||||
var url = 'https://api.twitter.com/1.1/users/show.json';
|
||||
var query = {
|
||||
screen_name: perm_data.screen_name,
|
||||
var query = {
|
||||
screen_name: perm_data.screen_name,
|
||||
user_id: perm_data.user_id
|
||||
};
|
||||
request.get({url:url, oauth:oauth, qs:query, json:true}, function (e, r, user) {
|
||||
@@ -370,7 +402,7 @@ request({
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//requests using baseRequest() will set the 'x-token' header
|
||||
var baseRequest = request.defaults({
|
||||
headers: {'x-token': 'my-token'}
|
||||
@@ -420,7 +452,7 @@ var rand = Math.floor(Math.random()*100000000).toString();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
request(
|
||||
{ method: 'GET'
|
||||
, uri: 'http://www.google.com'
|
||||
@@ -442,7 +474,7 @@ request(
|
||||
console.log('received ' + data.length + ' bytes of compressed data')
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
var requestWithJar = request.defaults({jar: true})
|
||||
requestWithJar('http://www.google.com', function () {
|
||||
requestWithJar('http://images.google.com');
|
||||
|
||||
Vendored
+73
-22
@@ -1,33 +1,84 @@
|
||||
// Type definitions for request-promise v0.4.2
|
||||
// Project: https://www.npmjs.com/package/request-promise
|
||||
// Definitions by: Christopher Glantschnig <https://github.com/cglantschnig/>, Joe Skeen <http://github.com/joeskeen>
|
||||
// Type definitions for request-promise v3.0.0
|
||||
// Project: https://github.com/request/request-promise
|
||||
// Definitions by: Christopher Glantschnig <https://github.com/cglantschnig/>, Joe Skeen <http://github.com/joeskeen>, Aya Morisawa <https://github.com/AyaMorisawa>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// Change [0]: 2015/08/20 - Aya Morisawa <https://github.com/AyaMorisawa>
|
||||
|
||||
/// <reference path="../request/request.d.ts" />
|
||||
/// <reference path="../bluebird/bluebird.d.ts" />
|
||||
|
||||
declare module 'request-promise' {
|
||||
import request = require('request');
|
||||
import http = require('http');
|
||||
|
||||
interface RequestPromise extends request.Request {
|
||||
then<TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult>;
|
||||
then<TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): Promise<TResult>;
|
||||
catch(onrejected?: (reason: any) => any | PromiseLike<any>): Promise<any>;
|
||||
catch(onrejected?: (reason: any) => void): Promise<any>;
|
||||
finally<TResult>(handler: () => PromiseLike<TResult>): Promise<any>;
|
||||
finally<TResult>(handler: () => TResult): Promise<any>;
|
||||
promise(): Promise<any>;
|
||||
import errors = require('request-promise/errors');
|
||||
|
||||
namespace requestPromise {
|
||||
interface RequestPromise extends request.Request {
|
||||
then<TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult>;
|
||||
then<TResult>(onfulfilled?: (value: any) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): Promise<TResult>;
|
||||
catch(onrejected?: (reason: any) => any | PromiseLike<any>): Promise<any>;
|
||||
catch(onrejected?: (reason: any) => void): Promise<any>;
|
||||
catch(type: errors.RequestErrorConstructor, onrejected?: (reason: errors.RequestError) => void): Promise<any>;
|
||||
catch(type: errors.StatusCodeErrorConstructor, onrejected?: (reason: errors.StatusCodeError) => void): Promise<any>;
|
||||
catch(type: errors.TransformErrorConstructor, onrejected?: (reason: errors.TransformError) => void): Promise<any>;
|
||||
finally<TResult>(handler: () => PromiseLike<TResult>): Promise<any>;
|
||||
finally<TResult>(handler: () => TResult): Promise<any>;
|
||||
promise(): Promise<any>;
|
||||
}
|
||||
|
||||
interface RequestPromiseOptions extends request.CoreOptions {
|
||||
simple?: boolean;
|
||||
transform?: (body: any, response: http.IncomingMessage, resolveWithFullResponse?: boolean) => any;
|
||||
resolveWithFullResponse?: boolean;
|
||||
}
|
||||
|
||||
export type OptionsWithUri = request.UriOptions & RequestPromiseOptions;
|
||||
export type OptionsWithUrl = request.UrlOptions & RequestPromiseOptions;
|
||||
export type Options = OptionsWithUri | OptionsWithUrl;
|
||||
}
|
||||
|
||||
interface RequestPromiseOptions extends request.CoreOptions {
|
||||
simple?: boolean;
|
||||
transform?: (body: any, response: http.IncomingMessage) => any;
|
||||
resolveWithFullResponse?: boolean;
|
||||
}
|
||||
|
||||
var requestPromise: request.RequestAPI<RequestPromise, RequestPromiseOptions, request.RequiredUriUrl>;
|
||||
|
||||
var requestPromise: request.RequestAPI<requestPromise.RequestPromise, requestPromise.RequestPromiseOptions, request.RequiredUriUrl>;
|
||||
export = requestPromise;
|
||||
}
|
||||
declare module 'request-promise/errors' {
|
||||
import rp = require('request-promise');
|
||||
import http = require('http');
|
||||
|
||||
export interface RequestError extends Error {
|
||||
cause: any;
|
||||
error: any;
|
||||
options: rp.Options;
|
||||
response: http.IncomingMessage;
|
||||
}
|
||||
export interface RequestErrorConstructor {
|
||||
new (cause: any, options: rp.Options, response: http.IncomingMessage): RequestError;
|
||||
(cause: any, options: rp.Options, response: http.IncomingMessage): RequestError;
|
||||
prototype: RequestError;
|
||||
}
|
||||
export const RequestError: RequestErrorConstructor;
|
||||
|
||||
export interface StatusCodeError extends Error {
|
||||
statusCode: number;
|
||||
error: any;
|
||||
options: rp.Options;
|
||||
response: http.IncomingMessage;
|
||||
}
|
||||
export interface StatusCodeErrorConstructor extends Error {
|
||||
new (statusCode: number, body: any, options: rp.Options, response: http.IncomingMessage): StatusCodeError;
|
||||
(statusCode: number, body: any, options: rp.Options, response: http.IncomingMessage): StatusCodeError;
|
||||
prototype: StatusCodeError;
|
||||
}
|
||||
export const StatusCodeError: StatusCodeErrorConstructor;
|
||||
|
||||
export interface TransformError extends Error {
|
||||
cause: any;
|
||||
error: any;
|
||||
options: rp.Options;
|
||||
response: http.IncomingMessage;
|
||||
}
|
||||
export interface TransformErrorConstructor extends Error {
|
||||
new (cause: any, options: rp.Options, response: http.IncomingMessage): TransformError;
|
||||
(cause: any, options: rp.Options, response: http.IncomingMessage): TransformError;
|
||||
prototype: TransformError;
|
||||
}
|
||||
export const TransformError: TransformErrorConstructor;
|
||||
}
|
||||
|
||||
@@ -9,5 +9,38 @@ function test_scan() {
|
||||
const source2: Rx.Observable<string> = Rx.Observable.range(1, 3)
|
||||
.scan((acc, x, i, source) => acc + x, '...');
|
||||
|
||||
|
||||
/* concatAll Example */
|
||||
var source = Rx.Observable.range(0, 3)
|
||||
.map(function (x) { return Rx.Observable.range(x, 3); })
|
||||
.concatAll();
|
||||
|
||||
var subscription = source.subscribe(
|
||||
function (x) {
|
||||
console.log('Next: %s', x);
|
||||
},
|
||||
function (err) {
|
||||
console.log('Error: %s', err);
|
||||
},
|
||||
function () {
|
||||
console.log('Completed');
|
||||
});
|
||||
|
||||
/* mergeAll example */
|
||||
var source = Rx.Observable.range(0, 3)
|
||||
.map(function (x) { return Rx.Observable.range(x, 3); })
|
||||
.mergeAll();
|
||||
|
||||
var subscription = source.subscribe(
|
||||
function (x) {
|
||||
console.log('Next: %s', x);
|
||||
},
|
||||
function (err) {
|
||||
console.log('Error: %s', err);
|
||||
},
|
||||
function () {
|
||||
console.log('Completed');
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
Vendored
+6
-6
@@ -245,8 +245,8 @@ declare namespace Rx {
|
||||
withLatestFrom<TOther, TResult>(souces: (Observable<TOther>|IPromise<TOther>)[], resultSelector: (firstValue: T, ...otherValues: TOther[]) => TResult): Observable<TResult>;
|
||||
concat(...sources: (Observable<T>|IPromise<T>)[]): Observable<T>;
|
||||
concat(sources: (Observable<T>|IPromise<T>)[]): Observable<T>;
|
||||
concatAll(): T;
|
||||
concatObservable(): T; // alias for concatAll
|
||||
concatAll(): Observable<T>;
|
||||
concatObservable(): Observable<T>; // alias for concatAll
|
||||
concatMap<T2, R>(selector: (value: T, index: number) => Observable<T2>, resultSelector: (value1: T, value2: T2, index: number) => R): Observable<R>; // alias for selectConcat
|
||||
concatMap<T2, R>(selector: (value: T, index: number) => IPromise<T2>, resultSelector: (value1: T, value2: T2, index: number) => R): Observable<R>; // alias for selectConcat
|
||||
concatMap<R>(selector: (value: T, index: number) => Observable<R>): Observable<R>; // alias for selectConcat
|
||||
@@ -257,12 +257,12 @@ declare namespace Rx {
|
||||
merge(maxConcurrent: number): T;
|
||||
merge(other: Observable<T>): Observable<T>;
|
||||
merge(other: IPromise<T>): Observable<T>;
|
||||
mergeAll(): T;
|
||||
mergeObservable(): T; // alias for mergeAll
|
||||
mergeAll(): Observable<T>;
|
||||
mergeObservable(): Observable<T>; // alias for mergeAll
|
||||
skipUntil<T2>(other: Observable<T2>): Observable<T>;
|
||||
skipUntil<T2>(other: IPromise<T2>): Observable<T>;
|
||||
switch(): T;
|
||||
switchLatest(): T; // alias for switch
|
||||
switch(): Observable<T>;
|
||||
switchLatest(): Observable<T>; // alias for switch
|
||||
takeUntil<T2>(other: Observable<T2>): Observable<T>;
|
||||
takeUntil<T2>(other: IPromise<T2>): Observable<T>;
|
||||
zip<T2>(second: Observable<T2>|IPromise<T2>): Observable<[T, T2]>;
|
||||
|
||||
Vendored
+2
-2
@@ -5725,8 +5725,8 @@ declare namespace THREE {
|
||||
|
||||
export namespace ShapeUtils {
|
||||
export function area(contour: number[]): number;
|
||||
export function triangulate(contour: number[], indices: boolean): number[];
|
||||
export function triangulateShape(contour: number[], holes: any[]): number[];
|
||||
export function triangulate(contour: Vector2[], indices: boolean): Vector2[][] | number[][];
|
||||
export function triangulateShape(contour: Vector2[], holes: Vector2[][]): Vector2[][];
|
||||
export function isClockWise(pts: number[]): boolean;
|
||||
export function b2(t: number, p0: number, p1: number, p2: number): number;
|
||||
export function b3(t: number, p0: number, p1: number, p2: number, p3: number): number;
|
||||
|
||||
@@ -45,4 +45,85 @@ myApp.config(($stateProvider: angular.ui.IStateProvider, $stickyStateProvider: a
|
||||
|
||||
$stickyStateProvider.enableDebug(true);
|
||||
$stateProvider.state(state);
|
||||
|
||||
$stateProvider.state({
|
||||
name: 'test',
|
||||
sticky: true,
|
||||
dsr: {
|
||||
default: 'substate',
|
||||
params: ['param1', 'param2'],
|
||||
fn: function ($dsr$) {
|
||||
|
||||
return $dsr$.to;
|
||||
}
|
||||
},
|
||||
onInactivate: function ($state: angular.ui.IState) {
|
||||
var iAmInjectedByInjector = $state;
|
||||
},
|
||||
onReactivate: function ($state: angular.ui.IState) {
|
||||
var iAmInjectedByInjector = $state;
|
||||
},
|
||||
controller: ($previousState: angular.ui.IPreviousStateService, $deepstateRedirect: angular.ui.IDeepStateRedirectService) => {
|
||||
$previousState.memo('test-memo1');
|
||||
$previousState.memo('test-memo2', 'test-state-name2');
|
||||
$previousState.memo('test-memo3', 'test-state-name3', {});
|
||||
$previousState.forget('test-memo3');
|
||||
$previousState.go('test-memo2', {
|
||||
location: true,
|
||||
notify: true
|
||||
});
|
||||
$previousState.get();
|
||||
$previousState.get('test-memo1');
|
||||
|
||||
$deepstateRedirect.reset('statename1', {
|
||||
'stateParam1': ['value1', 'value2'],
|
||||
'stateParam2': 'value'
|
||||
});
|
||||
},
|
||||
views: {
|
||||
//named views are mandatory
|
||||
'name1': {}
|
||||
}
|
||||
});
|
||||
|
||||
$stateProvider.state('name1', {
|
||||
name: 'test',
|
||||
sticky: true,
|
||||
dsr: {
|
||||
default: 'substate',
|
||||
params: ['param1', 'param2'],
|
||||
fn: function ($dsr$) {
|
||||
|
||||
return $dsr$.to;
|
||||
}
|
||||
},
|
||||
onInactivate: function ($state: angular.ui.IState) {
|
||||
var iAmInjectedByInjector = $state;
|
||||
},
|
||||
onReactivate: function ($state: angular.ui.IState) {
|
||||
var iAmInjectedByInjector = $state;
|
||||
},
|
||||
controller: ($previousState: angular.ui.IPreviousStateService, $deepstateRedirect: angular.ui.IDeepStateRedirectService) => {
|
||||
$previousState.memo('test-memo1');
|
||||
$previousState.memo('test-memo2', 'test-state-name2');
|
||||
$previousState.memo('test-memo3', 'test-state-name3', {});
|
||||
$previousState.forget('test-memo3');
|
||||
$previousState.go('test-memo2', {
|
||||
location: true,
|
||||
notify: true
|
||||
});
|
||||
$previousState.get();
|
||||
$previousState.get('test-memo1');
|
||||
|
||||
$deepstateRedirect.reset('statename1', {
|
||||
'stateParam1': ['value1', 'value2'],
|
||||
'stateParam2': 'value'
|
||||
});
|
||||
},
|
||||
views: {
|
||||
//named views are mandatory
|
||||
'name1': {}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
+4
@@ -148,4 +148,8 @@ declare namespace angular.ui {
|
||||
registerStickyState(state: IStickyState): void;
|
||||
}
|
||||
|
||||
interface IStateProvider extends angular.IServiceProvider {
|
||||
state(config: IStickyState): IStateProvider;
|
||||
state(name: string, config: IStickyState): IStateProvider;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user