mirror of
https://github.com/fergalmoran/icebreaker-mobile.git
synced 2025-12-22 09:39:31 +00:00
First draft
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -5,3 +5,5 @@ www/build/
|
|||||||
platforms/
|
platforms/
|
||||||
plugins/
|
plugins/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
certs/
|
||||||
|
|||||||
39
app/app.ts
39
app/app.ts
@@ -1,10 +1,12 @@
|
|||||||
//import 'es6-shim';
|
//import 'es6-shim';
|
||||||
import {Component} from '@angular/core';
|
import {Component, ViewChild} from '@angular/core';
|
||||||
import {ionicBootstrap, Platform} from 'ionic-angular';
|
import {Nav, ionicBootstrap, Platform} from 'ionic-angular';
|
||||||
import {StatusBar} from 'ionic-native';
|
import {StatusBar} from 'ionic-native';
|
||||||
import {HomePage} from './pages/home/home';
|
import {NearbyPage} from './pages/nearby/nearby';
|
||||||
import {TabsPage} from './pages/tabs/tabs';
|
import {TabsPage} from './pages/tabs/tabs';
|
||||||
|
import {OnInit} from '@angular/core';
|
||||||
|
import {AuthProvider} from './providers/auth/auth'
|
||||||
|
import {LoginPage} from './pages/login/login'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
FIREBASE_PROVIDERS, defaultFirebase,
|
FIREBASE_PROVIDERS, defaultFirebase,
|
||||||
@@ -15,6 +17,7 @@ import {
|
|||||||
@Component({
|
@Component({
|
||||||
template: '<ion-nav [root]="rootPage"></ion-nav>',
|
template: '<ion-nav [root]="rootPage"></ion-nav>',
|
||||||
providers: [
|
providers: [
|
||||||
|
AuthProvider,
|
||||||
FIREBASE_PROVIDERS,
|
FIREBASE_PROVIDERS,
|
||||||
// Initialize Firebase app
|
// Initialize Firebase app
|
||||||
defaultFirebase({
|
defaultFirebase({
|
||||||
@@ -31,15 +34,31 @@ import {
|
|||||||
})
|
})
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class MyApp {
|
export class MyApp implements OnInit {
|
||||||
|
@ViewChild(Nav) nav: Nav;
|
||||||
private rootPage: any;
|
private rootPage: any;
|
||||||
|
isAppInitialized: boolean;
|
||||||
|
|
||||||
constructor(platform: Platform) {
|
constructor(private platform: Platform, protected auth: AuthProvider) {
|
||||||
this.rootPage = TabsPage;
|
this.isAppInitialized = false;
|
||||||
platform.ready().then(() => {
|
}
|
||||||
// Okay, so the platform is ready and our plugins are available.
|
|
||||||
// Here you can do any higher level native things you might need.
|
ngOnInit() {
|
||||||
|
this.initializeApp();
|
||||||
|
}
|
||||||
|
|
||||||
|
initializeApp() {
|
||||||
|
this.platform.ready().then(() => {
|
||||||
StatusBar.styleDefault();
|
StatusBar.styleDefault();
|
||||||
|
|
||||||
|
this.auth.getUserData().subscribe(data => {
|
||||||
|
if (!this.isAppInitialized) {
|
||||||
|
this.nav.setRoot(TabsPage);
|
||||||
|
this.isAppInitialized = true;
|
||||||
|
}
|
||||||
|
}, err => {
|
||||||
|
this.nav.setRoot(LoginPage);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
<ion-header>
|
|
||||||
<ion-navbar>
|
|
||||||
<ion-title>
|
|
||||||
Ice Breaker
|
|
||||||
</ion-title>
|
|
||||||
<ion-buttons end>
|
|
||||||
<button (click)="logoutClicked()">
|
|
||||||
<ion-icon name="contact"></ion-icon>
|
|
||||||
{{buttonTitle}}
|
|
||||||
</button>
|
|
||||||
</ion-buttons>
|
|
||||||
</ion-navbar>
|
|
||||||
</ion-header>
|
|
||||||
<ion-content padding class="home">
|
|
||||||
<ion-list>
|
|
||||||
<ion-list-header>Nearby people</ion-list-header>
|
|
||||||
<ion-item *ngFor="let neighbour of neighbours | async">
|
|
||||||
<ion-avatar item-left>
|
|
||||||
<img [src]="neighbour.avatarImage" style="width:32px;height=32px;" alt="">
|
|
||||||
</ion-avatar>
|
|
||||||
<h2>{{neighbour.displayName}}</h2>
|
|
||||||
<p>{{neighbour.tagLine}}</p>
|
|
||||||
</ion-item>
|
|
||||||
</ion-list>
|
|
||||||
</ion-content>
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
.home {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
import {Modal, NavController, Page} from 'ionic-angular';
|
|
||||||
import {Component, OnInit, Inject} from '@angular/core';
|
|
||||||
import {MomentDate} from '../../lib/MomentDate'
|
|
||||||
import {Observable} from 'rxjs/Observable';
|
|
||||||
import { AngularFire } from 'angularfire2';
|
|
||||||
|
|
||||||
import {LoginPage} from '../login/login'
|
|
||||||
import {NeighboursService} from '../../services/neighbours.service';
|
|
||||||
|
|
||||||
|
|
||||||
@Page({
|
|
||||||
templateUrl: 'build/pages/home/home.html',
|
|
||||||
providers: [NeighboursService]
|
|
||||||
})
|
|
||||||
export class HomePage implements OnInit {
|
|
||||||
|
|
||||||
neighbours: Observable<any[]>;
|
|
||||||
buttonTitle = "Login";
|
|
||||||
_authInfo: any;
|
|
||||||
displayName: any;
|
|
||||||
|
|
||||||
constructor(public navCtrl: NavController, private _af: AngularFire,
|
|
||||||
private _neighboursService: NeighboursService) {
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
this._af.auth.subscribe((data) => {
|
|
||||||
if (data) {
|
|
||||||
this.buttonTitle = "Logout";
|
|
||||||
this._af.auth.unsubscribe();
|
|
||||||
if (data.auth.providerData[0].providerId === "twitter.com") {
|
|
||||||
this._authInfo = data.auth.providerData[0]
|
|
||||||
this.displayName = data.auth.providerData[0].displayName
|
|
||||||
} else if (data.github) {
|
|
||||||
this._authInfo = data.github
|
|
||||||
} else {
|
|
||||||
this._authInfo = data.auth || {}
|
|
||||||
this.displayName = data.auth.providerData[0].email
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this._displayLoginModal();
|
|
||||||
}
|
|
||||||
this.neighbours = this._neighboursService.getNeighbours();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
logoutClicked() {
|
|
||||||
if (this._authInfo && (this._authInfo.email || this._authInfo.providerId)) {
|
|
||||||
this._af.auth.logout();
|
|
||||||
this._authInfo = null
|
|
||||||
this._displayLoginModal()
|
|
||||||
} else {
|
|
||||||
this._displayLoginModal()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
registerMe() {
|
|
||||||
this._neighboursService.registerMe();
|
|
||||||
}
|
|
||||||
|
|
||||||
_displayLoginModal() {
|
|
||||||
let loginPage = Modal.create(LoginPage);
|
|
||||||
this.navCtrl.present(loginPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -19,8 +19,10 @@
|
|||||||
<button block (click)="registerUser(loginCreds.value, $event)">Create Account</button>
|
<button block (click)="registerUser(loginCreds.value, $event)">Create Account</button>
|
||||||
</div>
|
</div>
|
||||||
<div padding>
|
<div padding>
|
||||||
<button block (click)="registerUserWithFacebook(loginCreds.value, $event)">Facebook</button>
|
<button block class="google-btn" (click)="registerUserWithGoogleUsingPopupFirebase()">
|
||||||
<button block (click)="registerUserWithTwitter(loginCreds.value, $event)">Twitter</button>
|
<ion-icon name="logo-google" ></ion-icon>
|
||||||
|
Log In with Google
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div padding>
|
<div padding>
|
||||||
<p *ngIf="error" class="error">Error: {{ error.code }}</p>
|
<p *ngIf="error" class="error">Error: {{ error.code }}</p>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import {Modal, NavController, Page, ViewController} from 'ionic-angular';
|
import {Modal, NavController, Page, ViewController} from 'ionic-angular';
|
||||||
import {Component, OnInit, Inject} from '@angular/core';
|
import {Component, OnInit, Inject} from '@angular/core';
|
||||||
import {AngularFire, AuthProviders, AuthMethods } from 'angularfire2';
|
import {AngularFire, AuthProviders, AuthMethods } from 'angularfire2';
|
||||||
|
import {AuthProvider} from "../../providers/auth/auth";
|
||||||
|
import {TabsPage} from "../tabs/tabs"
|
||||||
|
|
||||||
@Page({
|
@Page({
|
||||||
templateUrl: 'build/pages/login/login.html'
|
templateUrl: 'build/pages/login/login.html'
|
||||||
@@ -9,27 +11,20 @@ export class LoginPage {
|
|||||||
|
|
||||||
error: any
|
error: any
|
||||||
|
|
||||||
constructor(public af: AngularFire,
|
constructor(
|
||||||
public viewCtrl: ViewController) { }
|
private navCtrl: NavController,
|
||||||
/**
|
public af: AngularFire,
|
||||||
* this will dismiss the modal page
|
public viewCtrl: ViewController,
|
||||||
*/
|
private auth: AuthProvider) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
dismiss() {
|
dismiss() {
|
||||||
this.viewCtrl.dismiss();
|
this.viewCtrl.dismiss();
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* this create in the user using the form credentials.
|
|
||||||
*
|
|
||||||
* we are preventing the default behavor of submitting
|
|
||||||
* the form
|
|
||||||
*
|
|
||||||
* @param _credentials {Object} the email and password from the form
|
|
||||||
* @param _event {Object} the event information from the form submit
|
|
||||||
*/
|
|
||||||
registerUser(_credentials, _event) {
|
registerUser(_credentials, _event) {
|
||||||
_event.preventDefault();
|
_event.preventDefault();
|
||||||
|
|
||||||
|
|
||||||
this.af.auth.createUser(_credentials)
|
this.af.auth.createUser(_credentials)
|
||||||
.then((user) => {
|
.then((user) => {
|
||||||
console.log(`Create User Success:`, user);
|
console.log(`Create User Success:`, user);
|
||||||
@@ -40,59 +35,6 @@ export class LoginPage {
|
|||||||
.catch(e => console.error(`Create User Failure:`, e));
|
.catch(e => console.error(`Create User Failure:`, e));
|
||||||
}
|
}
|
||||||
|
|
||||||
registerUserWithFacebook(_credentials, _event) {
|
|
||||||
_event.preventDefault();
|
|
||||||
|
|
||||||
this.af.auth.login({
|
|
||||||
provider: AuthProviders.Facebook,
|
|
||||||
method: AuthMethods.Popup
|
|
||||||
}).then((value) => {
|
|
||||||
this.dismiss()
|
|
||||||
}).catch((error) => {
|
|
||||||
this.error = error
|
|
||||||
console.log(error)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
registerUserWithTwitter(_credentials, _event) {
|
|
||||||
_event.preventDefault();
|
|
||||||
|
|
||||||
this.af.auth.login({
|
|
||||||
provider: AuthProviders.Twitter,
|
|
||||||
method: AuthMethods.Redirect
|
|
||||||
}).then((authData) => {
|
|
||||||
console.log(authData)
|
|
||||||
|
|
||||||
// already has user... need better info??
|
|
||||||
if (!authData) {
|
|
||||||
this.dismiss()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const itemObservable = this.af.database.object('/users/' + authData.uid);
|
|
||||||
itemObservable.set({
|
|
||||||
"provider": authData.auth.providerData[0].providerId,
|
|
||||||
"avatar": authData.auth.photoURL || "MISSING",
|
|
||||||
"displayName": authData.auth.providerData[0].displayName || authData.auth.email,
|
|
||||||
})
|
|
||||||
|
|
||||||
}).then((value) => {
|
|
||||||
this.dismiss()
|
|
||||||
}).catch((error) => {
|
|
||||||
this.error = error
|
|
||||||
console.log(error)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* this logs in the user using the form credentials.
|
|
||||||
*
|
|
||||||
* if the user is a new user, then we need to create the user AFTER
|
|
||||||
* we have successfully logged in
|
|
||||||
*
|
|
||||||
* @param _credentials {Object} the email and password from the form
|
|
||||||
* @param _event {Object} the event information from the form submit
|
|
||||||
*/
|
|
||||||
login(credentials, _event) {
|
login(credentials, _event) {
|
||||||
_event.preventDefault();
|
_event.preventDefault();
|
||||||
|
|
||||||
@@ -125,4 +67,12 @@ export class LoginPage {
|
|||||||
console.log(error)
|
console.log(error)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
registerUserWithGoogleUsingPopupFirebase() {
|
||||||
|
this.auth.loginWithGoogleUsingPopupFirebase().subscribe(data => {
|
||||||
|
this.navCtrl.setRoot(TabsPage);
|
||||||
|
}, err => {
|
||||||
|
this.error = err;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -63,18 +63,18 @@
|
|||||||
</ion-list-header>
|
</ion-list-header>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-icon name='flash' item-left></ion-icon>
|
<ion-icon name='flash' item-left></ion-icon>
|
||||||
Harry
|
Maurice
|
||||||
<ion-note item-right>The boy who lived</ion-note>
|
<ion-note item-right>I like spuds</ion-note>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-icon name='book' item-left></ion-icon>
|
<ion-icon name='book' item-left></ion-icon>
|
||||||
Hermoine
|
Donagh
|
||||||
<ion-note item-right>Muggle-born</ion-note>
|
<ion-note item-right>Wanna see my robots?</ion-note>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-icon name='beer' item-left></ion-icon>
|
<ion-icon name='beer' item-left></ion-icon>
|
||||||
Ron
|
Fergal
|
||||||
<ion-note item-right>Brilliant!</ion-note>
|
<ion-note item-right>!!!!</ion-note>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<ion-tabs>
|
<ion-tabs>
|
||||||
<ion-tab tabIcon="contact" [root]="tabHome"></ion-tab>
|
<ion-tab tabIcon="compass" [root]="tabPlaces"></ion-tab>
|
||||||
<ion-tab tabIcon="compass" [root]="tabAbout"></ion-tab>
|
<ion-tab tabIcon="beer" [root]="tabNearby"></ion-tab>
|
||||||
<ion-tab tabIcon="analytics" [root]="tabContact"></ion-tab>
|
<ion-tab tabIcon="contact" [root]="tabContact"></ion-tab>
|
||||||
<ion-tab tabIcon="settings" [root]="tabSettings"></ion-tab>
|
<ion-tab tabIcon="settings" [root]="tabSettings"></ion-tab>
|
||||||
</ion-tabs>
|
</ion-tabs>
|
||||||
@@ -1,25 +1,39 @@
|
|||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {HomePage} from '../home/home';
|
import {NavController} from 'ionic-angular';
|
||||||
|
import {NearbyPage} from '../nearby/nearby';
|
||||||
|
import {Modal} from 'ionic-angular';
|
||||||
|
import {PlacesPage} from '../places/places';
|
||||||
import {AboutPage} from '../about/about';
|
import {AboutPage} from '../about/about';
|
||||||
import {ContactPage} from '../contact/contact';
|
import {ContactPage} from '../contact/contact';
|
||||||
import {SettingsPage} from '../settings/settings';
|
import {SettingsPage} from '../settings/settings';
|
||||||
|
import {AngularFire} from 'angularfire2';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: 'build/pages/tabs/tabs.html'
|
templateUrl: 'build/pages/tabs/tabs.html'
|
||||||
})
|
})
|
||||||
export class TabsPage {
|
export class TabsPage {
|
||||||
|
|
||||||
private tabHome: any;
|
private tabNearby: any;
|
||||||
private tabAbout: any;
|
private tabPlaces: any;
|
||||||
private tabContact: any;
|
private tabContact: any;
|
||||||
private tabSettings: any;
|
private tabSettings: any;
|
||||||
|
|
||||||
constructor() {
|
|
||||||
|
buttonTitle = "Login";
|
||||||
|
_authInfo: any;
|
||||||
|
displayName: any;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(public navCtrl: NavController, private _aasdf: AngularFire) {
|
||||||
// this tells the tabs component which Pages
|
// this tells the tabs component which Pages
|
||||||
// should be each tab's root Page
|
// should be each tab's root Page
|
||||||
this.tabHome = HomePage;
|
this.tabNearby = NearbyPage;
|
||||||
this.tabAbout = AboutPage;
|
this.tabPlaces = PlacesPage;
|
||||||
this.tabContact = ContactPage;
|
this.tabContact = ContactPage;
|
||||||
this.tabSettings = SettingsPage;
|
this.tabSettings = SettingsPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,6 @@
|
|||||||
// http://ionicframework.com/docs/v2/theming/
|
// http://ionicframework.com/docs/v2/theming/
|
||||||
|
|
||||||
|
|
||||||
// App Shared Imports
|
// App Shared Imports
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
// These are the imports which make up the design of this app.
|
// These are the imports which make up the design of this app.
|
||||||
// By default each design mode includes these shared imports.
|
// By default each design mode includes these shared imports.
|
||||||
// App Shared Sass variables belong in app.variables.scss.
|
// App Shared Sass variables belong in app.variables.scss.
|
||||||
|
|
||||||
@import '../pages/home/home';
|
|
||||||
|
|||||||
16
config.xml
16
config.xml
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<widget id="com.ionicframework.fbtest484605" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
<widget id="com.podnoms.icebreaker" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
|
||||||
<name>fbtest</name>
|
<name>IceBreaker</name>
|
||||||
<description>An Ionic Framework and Cordova project.</description>
|
<description>How much does a polar bear weigh?</description>
|
||||||
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
|
<author email="Ferg@lMoran.me" href="http://podnoms.com/">Pod::Noms</author>
|
||||||
<content src="index.html"/>
|
<content src="index.html"/>
|
||||||
<access origin="*"/>
|
<access origin="*"/>
|
||||||
<allow-intent href="http://*/*"/>
|
<allow-intent href="http://*/*"/>
|
||||||
@@ -32,4 +32,12 @@
|
|||||||
<plugin name="cordova-plugin-splashscreen" spec="~3.2.1"/>
|
<plugin name="cordova-plugin-splashscreen" spec="~3.2.1"/>
|
||||||
<plugin name="cordova-plugin-statusbar" spec="~2.1.2"/>
|
<plugin name="cordova-plugin-statusbar" spec="~2.1.2"/>
|
||||||
<plugin name="ionic-plugin-keyboard" spec="~2.0.1"/>
|
<plugin name="ionic-plugin-keyboard" spec="~2.0.1"/>
|
||||||
|
<plugin name="cordova-plugin-facebook4" spec="~1.7.1">
|
||||||
|
<variable name="APP_ID" value="1768059153478688" />
|
||||||
|
<variable name="APP_NAME" value="Ice Breaker" />
|
||||||
|
</plugin>
|
||||||
|
<plugin name="cordova-plugin-googleplus" spec="~4.0.8">
|
||||||
|
<variable name="REVERSED_CLIENT_ID" value="com.googleusercontent.apps._google_client_app_id_" />
|
||||||
|
</plugin>
|
||||||
|
<plugin name="cordova-plugin-inappbrowser" spec="~1.4.0" />
|
||||||
</widget>
|
</widget>
|
||||||
@@ -2,19 +2,25 @@
|
|||||||
{
|
{
|
||||||
"userName": "fergal.moran@gmail.com",
|
"userName": "fergal.moran@gmail.com",
|
||||||
"displayName": "Fergal Moran",
|
"displayName": "Fergal Moran",
|
||||||
"avatarImage": "https://api.adorable.io/avatars/64/fergalm",
|
"avatarImage": "https://podnomscdn.blob.core.windows.net/icebreaker/fergal.jpg",
|
||||||
"tagLine": "Scientist, pragmatist, generous lover, all round nice guy"
|
"tagLine": "Scientist, pragmatist, generous lover, all round nice guy",
|
||||||
|
"averageRating": "4.5",
|
||||||
|
"followerCount": "253"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"userName": "mar.spud@gmail.com",
|
"userName": "mar.spud@gmail.com",
|
||||||
"displayName": "Maurice Murphy",
|
"displayName": "Maurice Murphy",
|
||||||
"avatarImage": "https://api.adorable.io/avatars/64/marspud",
|
"avatarImage": "https://podnomscdn.blob.core.windows.net/icebreaker/maurice.jpg",
|
||||||
"tagLine": "I like spuds"
|
"tagLine": "I like spuds",
|
||||||
|
"averageRating": "4.5",
|
||||||
|
"followerCount": "182"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"userName": "donagh.murphy@gmail.com",
|
"userName": "donagh.murphy@gmail.com",
|
||||||
"displayName": "Donagh Murphy",
|
"displayName": "Donagh Murphy",
|
||||||
"avatarImage": "https://api.adorable.io/avatars/64/donaghmurphy",
|
"avatarImage": "https://podnomscdn.blob.core.windows.net/icebreaker/donagh.jpg",
|
||||||
"tagLine": "Wanna see my robots?"
|
"tagLine": "Wanna see my robots?",
|
||||||
|
"averageRating": "4.5",
|
||||||
|
"followerCount": "193"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
54
package.json
54
package.json
@@ -1,36 +1,39 @@
|
|||||||
{
|
{
|
||||||
|
"name": "icebreaker",
|
||||||
|
"description": "icebreaker: How much does a polar bear weigh?",
|
||||||
|
"version": "0.0.2",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@angular/common": "2.0.0-rc.3",
|
"@angular/common": "2.0.0-rc.4",
|
||||||
"@angular/compiler": "2.0.0-rc.3",
|
"@angular/compiler": "2.0.0-rc.4",
|
||||||
"@angular/core": "2.0.0-rc.3",
|
"@angular/core": "2.0.0-rc.4",
|
||||||
"@angular/platform-browser": "2.0.0-rc.3",
|
"@angular/forms": "0.2.0",
|
||||||
"@angular/platform-browser-dynamic": "2.0.0-rc.3",
|
"@angular/http": "2.0.0-rc.4",
|
||||||
"@angular/http": "2.0.0-rc.3",
|
"@angular/platform-browser": "2.0.0-rc.4",
|
||||||
"es6-shim": "^0.35.0",
|
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
|
||||||
"ionic-angular": "2.0.0-beta.10",
|
"@angular/router": "2.0.0-rc.2",
|
||||||
"ionic-native": "1.3.2",
|
"es6-shim": "0.35.0",
|
||||||
|
"ionic-angular": "2.0.0-beta.11",
|
||||||
|
"ionic-native": "^1.3.10",
|
||||||
"ionicons": "3.0.0",
|
"ionicons": "3.0.0",
|
||||||
"reflect-metadata": "^0.1.3",
|
"reflect-metadata": "0.1.3",
|
||||||
"rxjs": "5.0.0-beta.6",
|
"rxjs": "5.0.0-beta.6",
|
||||||
"zone.js": "^0.6.12",
|
"zone.js": "0.6.12",
|
||||||
"angularfire2": "2.0.0-beta.2",
|
"angularfire2": "2.0.0-beta.2",
|
||||||
"firebase": "3.2.1",
|
"firebase": "3.3.0",
|
||||||
"moment": "2.14.1"
|
"moment": "2.13.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"del": "2.2.0",
|
"del": "2.2.0",
|
||||||
"gulp": "3.9.1",
|
"gulp": "3.9.1",
|
||||||
"gulp-tslint": "^5.0.0",
|
|
||||||
"gulp-watch": "4.3.5",
|
"gulp-watch": "4.3.5",
|
||||||
"ionic-gulp-browserify-typescript": "^1.1.0",
|
"ionic-gulp-browserify-typescript": "2.0.0",
|
||||||
"ionic-gulp-fonts-copy": "^1.0.0",
|
"ionic-gulp-fonts-copy": "^1.0.0",
|
||||||
"ionic-gulp-html-copy": "^1.0.0",
|
"ionic-gulp-html-copy": "^1.0.0",
|
||||||
"ionic-gulp-sass-build": "^1.0.0",
|
"ionic-gulp-sass-build": "^1.0.0",
|
||||||
"ionic-gulp-scripts-copy": "^2.0.0",
|
"ionic-gulp-scripts-copy": "^2.0.0",
|
||||||
"ionic-gulp-tslint": "^1.0.0",
|
"ionic-gulp-tslint": "^1.0.0",
|
||||||
"run-sequence": "1.1.5",
|
"tslint-ionic-rules": "0.0.4",
|
||||||
"tslint": "^3.10.1",
|
"run-sequence": "1.1.5"
|
||||||
"tslint-ionic-rules": "^0.0.3"
|
|
||||||
},
|
},
|
||||||
"cordovaPlugins": [
|
"cordovaPlugins": [
|
||||||
"cordova-plugin-device",
|
"cordova-plugin-device",
|
||||||
@@ -39,15 +42,20 @@
|
|||||||
"cordova-plugin-splashscreen",
|
"cordova-plugin-splashscreen",
|
||||||
"cordova-plugin-statusbar",
|
"cordova-plugin-statusbar",
|
||||||
"ionic-plugin-keyboard",
|
"ionic-plugin-keyboard",
|
||||||
"cordova-plugin-inappbrowser"
|
"cordova-plugin-inappbrowser",
|
||||||
|
"cordova-plugin-geolocation",
|
||||||
|
"cordova-plugin-console@~1.0.2",
|
||||||
|
"cordova-plugin-device@~1.1.1",
|
||||||
|
"cordova-plugin-statusbar@~2.1.2",
|
||||||
|
"cordova-plugin-splashscreen@~3.2.1",
|
||||||
|
"ionic-plugin-keyboard@~2.0.1"
|
||||||
],
|
],
|
||||||
"cordovaPlatforms": [
|
"cordovaPlatforms": [
|
||||||
"ios", {
|
"ios",
|
||||||
|
{
|
||||||
"platform": "ios",
|
"platform": "ios",
|
||||||
"version": "",
|
"version": "",
|
||||||
"locator": "ios"
|
"locator": "ios"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"name": "fbtest",
|
|
||||||
"description": "fbtest: An Ionic project"
|
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {},
|
||||||
"moment": "registry:npm/moment#2.10.5+20160211003958"
|
|
||||||
},
|
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"ambientDependencies": {
|
"ambientDependencies": {
|
||||||
},
|
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
|
||||||
"globalDependencies": {
|
"firebase": "registry:dt/firebase#2.4.1+20160412125105"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
2
typings/browser.d.ts
vendored
2
typings/browser.d.ts
vendored
@@ -1,2 +0,0 @@
|
|||||||
/// <reference path="browser/ambient/es6-shim/index.d.ts" />
|
|
||||||
/// <reference path="browser/definitions/moment/index.d.ts" />
|
|
||||||
670
typings/browser/ambient/es6-shim/es6-shim.d.ts
vendored
670
typings/browser/ambient/es6-shim/es6-shim.d.ts
vendored
@@ -1,670 +0,0 @@
|
|||||||
// Compiled using typings@0.6.8
|
|
||||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/4de74cb527395c13ba20b438c3a7a419ad931f1c/es6-shim/es6-shim.d.ts
|
|
||||||
// Type definitions for es6-shim v0.31.2
|
|
||||||
// Project: https://github.com/paulmillr/es6-shim
|
|
||||||
// Definitions by: Ron Buckton <http://github.com/rbuckton>
|
|
||||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
||||||
|
|
||||||
declare type PropertyKey = string | number | symbol;
|
|
||||||
|
|
||||||
interface IteratorResult<T> {
|
|
||||||
done: boolean;
|
|
||||||
value?: T;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IterableShim<T> {
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): Iterator<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Iterator<T> {
|
|
||||||
next(value?: any): IteratorResult<T>;
|
|
||||||
return?(value?: any): IteratorResult<T>;
|
|
||||||
throw?(e?: any): IteratorResult<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IterableIteratorShim<T> extends IterableShim<T>, Iterator<T> {
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable iterator. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): IterableIteratorShim<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface StringConstructor {
|
|
||||||
/**
|
|
||||||
* Return the String value whose elements are, in order, the elements in the List elements.
|
|
||||||
* If length is 0, the empty string is returned.
|
|
||||||
*/
|
|
||||||
fromCodePoint(...codePoints: number[]): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* String.raw is intended for use as a tag function of a Tagged Template String. When called
|
|
||||||
* as such the first argument will be a well formed template call site object and the rest
|
|
||||||
* parameter will contain the substitution values.
|
|
||||||
* @param template A well-formed template string call site representation.
|
|
||||||
* @param substitutions A set of substitution values.
|
|
||||||
*/
|
|
||||||
raw(template: TemplateStringsArray, ...substitutions: any[]): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface String {
|
|
||||||
/**
|
|
||||||
* Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
|
|
||||||
* value of the UTF-16 encoded code point starting at the string element at position pos in
|
|
||||||
* the String resulting from converting this object to a String.
|
|
||||||
* If there is no element at that position, the result is undefined.
|
|
||||||
* If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
|
|
||||||
*/
|
|
||||||
codePointAt(pos: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if searchString appears as a substring of the result of converting this
|
|
||||||
* object to a String, at one or more positions that are
|
|
||||||
* greater than or equal to position; otherwise, returns false.
|
|
||||||
* @param searchString search string
|
|
||||||
* @param position If position is undefined, 0 is assumed, so as to search all of the String.
|
|
||||||
*/
|
|
||||||
includes(searchString: string, position?: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the sequence of elements of searchString converted to a String is the
|
|
||||||
* same as the corresponding elements of this object (converted to a String) starting at
|
|
||||||
* endPosition – length(this). Otherwise returns false.
|
|
||||||
*/
|
|
||||||
endsWith(searchString: string, endPosition?: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a String value that is made from count copies appended together. If count is 0,
|
|
||||||
* T is the empty String is returned.
|
|
||||||
* @param count number of copies to append
|
|
||||||
*/
|
|
||||||
repeat(count: number): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the sequence of elements of searchString converted to a String is the
|
|
||||||
* same as the corresponding elements of this object (converted to a String) starting at
|
|
||||||
* position. Otherwise returns false.
|
|
||||||
*/
|
|
||||||
startsWith(searchString: string, position?: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an <a> HTML anchor element and sets the name attribute to the text value
|
|
||||||
* @param name
|
|
||||||
*/
|
|
||||||
anchor(name: string): string;
|
|
||||||
|
|
||||||
/** Returns a <big> HTML element */
|
|
||||||
big(): string;
|
|
||||||
|
|
||||||
/** Returns a <blink> HTML element */
|
|
||||||
blink(): string;
|
|
||||||
|
|
||||||
/** Returns a <b> HTML element */
|
|
||||||
bold(): string;
|
|
||||||
|
|
||||||
/** Returns a <tt> HTML element */
|
|
||||||
fixed(): string
|
|
||||||
|
|
||||||
/** Returns a <font> HTML element and sets the color attribute value */
|
|
||||||
fontcolor(color: string): string
|
|
||||||
|
|
||||||
/** Returns a <font> HTML element and sets the size attribute value */
|
|
||||||
fontsize(size: number): string;
|
|
||||||
|
|
||||||
/** Returns a <font> HTML element and sets the size attribute value */
|
|
||||||
fontsize(size: string): string;
|
|
||||||
|
|
||||||
/** Returns an <i> HTML element */
|
|
||||||
italics(): string;
|
|
||||||
|
|
||||||
/** Returns an <a> HTML element and sets the href attribute value */
|
|
||||||
link(url: string): string;
|
|
||||||
|
|
||||||
/** Returns a <small> HTML element */
|
|
||||||
small(): string;
|
|
||||||
|
|
||||||
/** Returns a <strike> HTML element */
|
|
||||||
strike(): string;
|
|
||||||
|
|
||||||
/** Returns a <sub> HTML element */
|
|
||||||
sub(): string;
|
|
||||||
|
|
||||||
/** Returns a <sup> HTML element */
|
|
||||||
sup(): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): IterableIteratorShim<string>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ArrayConstructor {
|
|
||||||
/**
|
|
||||||
* Creates an array from an array-like object.
|
|
||||||
* @param arrayLike An array-like object to convert to an array.
|
|
||||||
* @param mapfn A mapping function to call on every element of the array.
|
|
||||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
|
||||||
*/
|
|
||||||
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array from an iterable object.
|
|
||||||
* @param iterable An iterable object to convert to an array.
|
|
||||||
* @param mapfn A mapping function to call on every element of the array.
|
|
||||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
|
||||||
*/
|
|
||||||
from<T, U>(iterable: IterableShim<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array from an array-like object.
|
|
||||||
* @param arrayLike An array-like object to convert to an array.
|
|
||||||
*/
|
|
||||||
from<T>(arrayLike: ArrayLike<T>): Array<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array from an iterable object.
|
|
||||||
* @param iterable An iterable object to convert to an array.
|
|
||||||
*/
|
|
||||||
from<T>(iterable: IterableShim<T>): Array<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a new array from a set of elements.
|
|
||||||
* @param items A set of elements to include in the new array object.
|
|
||||||
*/
|
|
||||||
of<T>(...items: T[]): Array<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Array<T> {
|
|
||||||
/**
|
|
||||||
* Returns the value of the first element in the array where predicate is true, and undefined
|
|
||||||
* otherwise.
|
|
||||||
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
||||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
||||||
* immediately returns that element value. Otherwise, find returns undefined.
|
|
||||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
||||||
* predicate. If it is not provided, undefined is used instead.
|
|
||||||
*/
|
|
||||||
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the index of the first element in the array where predicate is true, and undefined
|
|
||||||
* otherwise.
|
|
||||||
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
||||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
||||||
* immediately returns that element value. Otherwise, find returns undefined.
|
|
||||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
||||||
* predicate. If it is not provided, undefined is used instead.
|
|
||||||
*/
|
|
||||||
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the this object after filling the section identified by start and end with value
|
|
||||||
* @param value value to fill array section with
|
|
||||||
* @param start index to start filling the array at. If start is negative, it is treated as
|
|
||||||
* length+start where length is the length of the array.
|
|
||||||
* @param end index to stop filling the array at. If end is negative, it is treated as
|
|
||||||
* length+end.
|
|
||||||
*/
|
|
||||||
fill(value: T, start?: number, end?: number): T[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the this object after copying a section of the array identified by start and end
|
|
||||||
* to the same array starting at position target
|
|
||||||
* @param target If target is negative, it is treated as length+target where length is the
|
|
||||||
* length of the array.
|
|
||||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
||||||
* is treated as length+end.
|
|
||||||
* @param end If not specified, length of the this object is used as its default value.
|
|
||||||
*/
|
|
||||||
copyWithin(target: number, start: number, end?: number): T[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an array of key, value pairs for every entry in the array
|
|
||||||
*/
|
|
||||||
entries(): IterableIteratorShim<[number, T]>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an list of keys in the array
|
|
||||||
*/
|
|
||||||
keys(): IterableIteratorShim<number>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an list of values in the array
|
|
||||||
*/
|
|
||||||
values(): IterableIteratorShim<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): IterableIteratorShim<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface NumberConstructor {
|
|
||||||
/**
|
|
||||||
* The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1
|
|
||||||
* that is representable as a Number value, which is approximately:
|
|
||||||
* 2.2204460492503130808472633361816 x 10−16.
|
|
||||||
*/
|
|
||||||
EPSILON: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if passed value is finite.
|
|
||||||
* Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
|
|
||||||
* number. Only finite values of the type number, result in true.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isFinite(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the value passed is an integer, false otherwise.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isInteger(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
|
|
||||||
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
|
|
||||||
* to a number. Only values of the type number, that are also NaN, result in true.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isNaN(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the value passed is a safe integer.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isSafeInteger(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value of the largest integer n such that n and n + 1 are both exactly representable as
|
|
||||||
* a Number value.
|
|
||||||
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1.
|
|
||||||
*/
|
|
||||||
MAX_SAFE_INTEGER: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value of the smallest integer n such that n and n − 1 are both exactly representable as
|
|
||||||
* a Number value.
|
|
||||||
* The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
|
|
||||||
*/
|
|
||||||
MIN_SAFE_INTEGER: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts a string to a floating-point number.
|
|
||||||
* @param string A string that contains a floating-point number.
|
|
||||||
*/
|
|
||||||
parseFloat(string: string): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts A string to an integer.
|
|
||||||
* @param s A string to convert into a number.
|
|
||||||
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
|
|
||||||
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
|
|
||||||
* All other strings are considered decimal.
|
|
||||||
*/
|
|
||||||
parseInt(string: string, radix?: number): number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ObjectConstructor {
|
|
||||||
/**
|
|
||||||
* Copy the values of all of the enumerable own properties from one or more source objects to a
|
|
||||||
* target object. Returns the target object.
|
|
||||||
* @param target The target object to copy to.
|
|
||||||
* @param sources One or more source objects to copy properties from.
|
|
||||||
*/
|
|
||||||
assign(target: any, ...sources: any[]): any;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the values are the same value, false otherwise.
|
|
||||||
* @param value1 The first value.
|
|
||||||
* @param value2 The second value.
|
|
||||||
*/
|
|
||||||
is(value1: any, value2: any): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the prototype of a specified object o to object proto or null. Returns the object o.
|
|
||||||
* @param o The object to change its prototype.
|
|
||||||
* @param proto The value of the new prototype or null.
|
|
||||||
* @remarks Requires `__proto__` support.
|
|
||||||
*/
|
|
||||||
setPrototypeOf(o: any, proto: any): any;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface RegExp {
|
|
||||||
/**
|
|
||||||
* Returns a string indicating the flags of the regular expression in question. This field is read-only.
|
|
||||||
* The characters in this string are sequenced and concatenated in the following order:
|
|
||||||
*
|
|
||||||
* - "g" for global
|
|
||||||
* - "i" for ignoreCase
|
|
||||||
* - "m" for multiline
|
|
||||||
* - "u" for unicode
|
|
||||||
* - "y" for sticky
|
|
||||||
*
|
|
||||||
* If no flags are set, the value is the empty string.
|
|
||||||
*/
|
|
||||||
flags: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Math {
|
|
||||||
/**
|
|
||||||
* Returns the number of leading zero bits in the 32-bit binary representation of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
clz32(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the result of 32-bit multiplication of two numbers.
|
|
||||||
* @param x First number
|
|
||||||
* @param y Second number
|
|
||||||
*/
|
|
||||||
imul(x: number, y: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the sign of the x, indicating whether x is positive, negative or zero.
|
|
||||||
* @param x The numeric expression to test
|
|
||||||
*/
|
|
||||||
sign(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the base 10 logarithm of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
log10(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the base 2 logarithm of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
log2(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the natural logarithm of 1 + x.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
log1p(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of
|
|
||||||
* the natural logarithms).
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
expm1(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hyperbolic cosine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
cosh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hyperbolic sine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
sinh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hyperbolic tangent of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
tanh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the inverse hyperbolic cosine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
acosh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the inverse hyperbolic sine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
asinh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the inverse hyperbolic tangent of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
atanh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the square root of the sum of squares of its arguments.
|
|
||||||
* @param values Values to compute the square root for.
|
|
||||||
* If no arguments are passed, the result is +0.
|
|
||||||
* If there is only one argument, the result is the absolute value.
|
|
||||||
* If any argument is +Infinity or -Infinity, the result is +Infinity.
|
|
||||||
* If any argument is NaN, the result is NaN.
|
|
||||||
* If all arguments are either +0 or −0, the result is +0.
|
|
||||||
*/
|
|
||||||
hypot(...values: number[]): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the integral part of the a numeric expression, x, removing any fractional digits.
|
|
||||||
* If x is already an integer, the result is x.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
trunc(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the nearest single precision float representation of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
fround(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an implementation-dependent approximation to the cube root of number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
cbrt(x: number): number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PromiseLike<T> {
|
|
||||||
/**
|
|
||||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
||||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
|
||||||
* @param onrejected The callback to execute when the Promise is rejected.
|
|
||||||
* @returns A Promise for the completion of which ever callback is executed.
|
|
||||||
*/
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>;
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the completion of an asynchronous operation
|
|
||||||
*/
|
|
||||||
interface Promise<T> {
|
|
||||||
/**
|
|
||||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
||||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
|
||||||
* @param onrejected The callback to execute when the Promise is rejected.
|
|
||||||
* @returns A Promise for the completion of which ever callback is executed.
|
|
||||||
*/
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult>;
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): Promise<TResult>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Attaches a callback for only the rejection of the Promise.
|
|
||||||
* @param onrejected The callback to execute when the Promise is rejected.
|
|
||||||
* @returns A Promise for the completion of the callback.
|
|
||||||
*/
|
|
||||||
catch(onrejected?: (reason: any) => T | PromiseLike<T>): Promise<T>;
|
|
||||||
catch(onrejected?: (reason: any) => void): Promise<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PromiseConstructor {
|
|
||||||
/**
|
|
||||||
* A reference to the prototype.
|
|
||||||
*/
|
|
||||||
prototype: Promise<any>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new Promise.
|
|
||||||
* @param executor A callback used to initialize the promise. This callback is passed two arguments:
|
|
||||||
* a resolve callback used resolve the promise with a value or the result of another promise,
|
|
||||||
* and a reject callback used to reject the promise with a provided reason or error.
|
|
||||||
*/
|
|
||||||
new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a Promise that is resolved with an array of results when all of the provided Promises
|
|
||||||
* resolve, or rejected when any Promise is rejected.
|
|
||||||
* @param values An array of Promises.
|
|
||||||
* @returns A new Promise.
|
|
||||||
*/
|
|
||||||
all<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T[]>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
|
|
||||||
* or rejected.
|
|
||||||
* @param values An array of Promises.
|
|
||||||
* @returns A new Promise.
|
|
||||||
*/
|
|
||||||
race<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new rejected promise for the provided reason.
|
|
||||||
* @param reason The reason the promise was rejected.
|
|
||||||
* @returns A new rejected Promise.
|
|
||||||
*/
|
|
||||||
reject(reason: any): Promise<void>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new rejected promise for the provided reason.
|
|
||||||
* @param reason The reason the promise was rejected.
|
|
||||||
* @returns A new rejected Promise.
|
|
||||||
*/
|
|
||||||
reject<T>(reason: any): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new resolved promise for the provided value.
|
|
||||||
* @param value A promise.
|
|
||||||
* @returns A promise whose internal state matches the provided promise.
|
|
||||||
*/
|
|
||||||
resolve<T>(value: T | PromiseLike<T>): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new resolved promise .
|
|
||||||
* @returns A resolved promise.
|
|
||||||
*/
|
|
||||||
resolve(): Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var Promise: PromiseConstructor;
|
|
||||||
|
|
||||||
interface Map<K, V> {
|
|
||||||
clear(): void;
|
|
||||||
delete(key: K): boolean;
|
|
||||||
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
|
|
||||||
get(key: K): V;
|
|
||||||
has(key: K): boolean;
|
|
||||||
set(key: K, value?: V): Map<K, V>;
|
|
||||||
size: number;
|
|
||||||
entries(): IterableIteratorShim<[K, V]>;
|
|
||||||
keys(): IterableIteratorShim<K>;
|
|
||||||
values(): IterableIteratorShim<V>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MapConstructor {
|
|
||||||
new <K, V>(): Map<K, V>;
|
|
||||||
new <K, V>(iterable: IterableShim<[K, V]>): Map<K, V>;
|
|
||||||
prototype: Map<any, any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var Map: MapConstructor;
|
|
||||||
|
|
||||||
interface Set<T> {
|
|
||||||
add(value: T): Set<T>;
|
|
||||||
clear(): void;
|
|
||||||
delete(value: T): boolean;
|
|
||||||
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
|
|
||||||
has(value: T): boolean;
|
|
||||||
size: number;
|
|
||||||
entries(): IterableIteratorShim<[T, T]>;
|
|
||||||
keys(): IterableIteratorShim<T>;
|
|
||||||
values(): IterableIteratorShim<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SetConstructor {
|
|
||||||
new <T>(): Set<T>;
|
|
||||||
new <T>(iterable: IterableShim<T>): Set<T>;
|
|
||||||
prototype: Set<any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var Set: SetConstructor;
|
|
||||||
|
|
||||||
interface WeakMap<K, V> {
|
|
||||||
delete(key: K): boolean;
|
|
||||||
get(key: K): V;
|
|
||||||
has(key: K): boolean;
|
|
||||||
set(key: K, value?: V): WeakMap<K, V>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface WeakMapConstructor {
|
|
||||||
new <K, V>(): WeakMap<K, V>;
|
|
||||||
new <K, V>(iterable: IterableShim<[K, V]>): WeakMap<K, V>;
|
|
||||||
prototype: WeakMap<any, any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var WeakMap: WeakMapConstructor;
|
|
||||||
|
|
||||||
interface WeakSet<T> {
|
|
||||||
add(value: T): WeakSet<T>;
|
|
||||||
delete(value: T): boolean;
|
|
||||||
has(value: T): boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface WeakSetConstructor {
|
|
||||||
new <T>(): WeakSet<T>;
|
|
||||||
new <T>(iterable: IterableShim<T>): WeakSet<T>;
|
|
||||||
prototype: WeakSet<any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var WeakSet: WeakSetConstructor;
|
|
||||||
|
|
||||||
declare module Reflect {
|
|
||||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
|
||||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
|
||||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
|
||||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function enumerate(target: any): IterableIteratorShim<any>;
|
|
||||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
|
||||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
|
||||||
function getPrototypeOf(target: any): any;
|
|
||||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function isExtensible(target: any): boolean;
|
|
||||||
function ownKeys(target: any): Array<PropertyKey>;
|
|
||||||
function preventExtensions(target: any): boolean;
|
|
||||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
|
||||||
function setPrototypeOf(target: any, proto: any): boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module "es6-shim" {
|
|
||||||
var String: StringConstructor;
|
|
||||||
var Array: ArrayConstructor;
|
|
||||||
var Number: NumberConstructor;
|
|
||||||
var Math: Math;
|
|
||||||
var Object: ObjectConstructor;
|
|
||||||
var Map: MapConstructor;
|
|
||||||
var Set: SetConstructor;
|
|
||||||
var WeakMap: WeakMapConstructor;
|
|
||||||
var WeakSet: WeakSetConstructor;
|
|
||||||
var Promise: PromiseConstructor;
|
|
||||||
module Reflect {
|
|
||||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
|
||||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
|
||||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
|
||||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function enumerate(target: any): Iterator<any>;
|
|
||||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
|
||||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
|
||||||
function getPrototypeOf(target: any): any;
|
|
||||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function isExtensible(target: any): boolean;
|
|
||||||
function ownKeys(target: any): Array<PropertyKey>;
|
|
||||||
function preventExtensions(target: any): boolean;
|
|
||||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
|
||||||
function setPrototypeOf(target: any, proto: any): boolean;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
670
typings/browser/ambient/es6-shim/index.d.ts
vendored
670
typings/browser/ambient/es6-shim/index.d.ts
vendored
@@ -1,670 +0,0 @@
|
|||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/4de74cb527395c13ba20b438c3a7a419ad931f1c/es6-shim/es6-shim.d.ts
|
|
||||||
// Type definitions for es6-shim v0.31.2
|
|
||||||
// Project: https://github.com/paulmillr/es6-shim
|
|
||||||
// Definitions by: Ron Buckton <http://github.com/rbuckton>
|
|
||||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
||||||
|
|
||||||
declare type PropertyKey = string | number | symbol;
|
|
||||||
|
|
||||||
interface IteratorResult<T> {
|
|
||||||
done: boolean;
|
|
||||||
value?: T;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IterableShim<T> {
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): Iterator<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Iterator<T> {
|
|
||||||
next(value?: any): IteratorResult<T>;
|
|
||||||
return?(value?: any): IteratorResult<T>;
|
|
||||||
throw?(e?: any): IteratorResult<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IterableIteratorShim<T> extends IterableShim<T>, Iterator<T> {
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable iterator. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): IterableIteratorShim<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface StringConstructor {
|
|
||||||
/**
|
|
||||||
* Return the String value whose elements are, in order, the elements in the List elements.
|
|
||||||
* If length is 0, the empty string is returned.
|
|
||||||
*/
|
|
||||||
fromCodePoint(...codePoints: number[]): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* String.raw is intended for use as a tag function of a Tagged Template String. When called
|
|
||||||
* as such the first argument will be a well formed template call site object and the rest
|
|
||||||
* parameter will contain the substitution values.
|
|
||||||
* @param template A well-formed template string call site representation.
|
|
||||||
* @param substitutions A set of substitution values.
|
|
||||||
*/
|
|
||||||
raw(template: TemplateStringsArray, ...substitutions: any[]): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface String {
|
|
||||||
/**
|
|
||||||
* Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
|
|
||||||
* value of the UTF-16 encoded code point starting at the string element at position pos in
|
|
||||||
* the String resulting from converting this object to a String.
|
|
||||||
* If there is no element at that position, the result is undefined.
|
|
||||||
* If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
|
|
||||||
*/
|
|
||||||
codePointAt(pos: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if searchString appears as a substring of the result of converting this
|
|
||||||
* object to a String, at one or more positions that are
|
|
||||||
* greater than or equal to position; otherwise, returns false.
|
|
||||||
* @param searchString search string
|
|
||||||
* @param position If position is undefined, 0 is assumed, so as to search all of the String.
|
|
||||||
*/
|
|
||||||
includes(searchString: string, position?: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the sequence of elements of searchString converted to a String is the
|
|
||||||
* same as the corresponding elements of this object (converted to a String) starting at
|
|
||||||
* endPosition – length(this). Otherwise returns false.
|
|
||||||
*/
|
|
||||||
endsWith(searchString: string, endPosition?: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a String value that is made from count copies appended together. If count is 0,
|
|
||||||
* T is the empty String is returned.
|
|
||||||
* @param count number of copies to append
|
|
||||||
*/
|
|
||||||
repeat(count: number): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the sequence of elements of searchString converted to a String is the
|
|
||||||
* same as the corresponding elements of this object (converted to a String) starting at
|
|
||||||
* position. Otherwise returns false.
|
|
||||||
*/
|
|
||||||
startsWith(searchString: string, position?: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an <a> HTML anchor element and sets the name attribute to the text value
|
|
||||||
* @param name
|
|
||||||
*/
|
|
||||||
anchor(name: string): string;
|
|
||||||
|
|
||||||
/** Returns a <big> HTML element */
|
|
||||||
big(): string;
|
|
||||||
|
|
||||||
/** Returns a <blink> HTML element */
|
|
||||||
blink(): string;
|
|
||||||
|
|
||||||
/** Returns a <b> HTML element */
|
|
||||||
bold(): string;
|
|
||||||
|
|
||||||
/** Returns a <tt> HTML element */
|
|
||||||
fixed(): string
|
|
||||||
|
|
||||||
/** Returns a <font> HTML element and sets the color attribute value */
|
|
||||||
fontcolor(color: string): string
|
|
||||||
|
|
||||||
/** Returns a <font> HTML element and sets the size attribute value */
|
|
||||||
fontsize(size: number): string;
|
|
||||||
|
|
||||||
/** Returns a <font> HTML element and sets the size attribute value */
|
|
||||||
fontsize(size: string): string;
|
|
||||||
|
|
||||||
/** Returns an <i> HTML element */
|
|
||||||
italics(): string;
|
|
||||||
|
|
||||||
/** Returns an <a> HTML element and sets the href attribute value */
|
|
||||||
link(url: string): string;
|
|
||||||
|
|
||||||
/** Returns a <small> HTML element */
|
|
||||||
small(): string;
|
|
||||||
|
|
||||||
/** Returns a <strike> HTML element */
|
|
||||||
strike(): string;
|
|
||||||
|
|
||||||
/** Returns a <sub> HTML element */
|
|
||||||
sub(): string;
|
|
||||||
|
|
||||||
/** Returns a <sup> HTML element */
|
|
||||||
sup(): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): IterableIteratorShim<string>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ArrayConstructor {
|
|
||||||
/**
|
|
||||||
* Creates an array from an array-like object.
|
|
||||||
* @param arrayLike An array-like object to convert to an array.
|
|
||||||
* @param mapfn A mapping function to call on every element of the array.
|
|
||||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
|
||||||
*/
|
|
||||||
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array from an iterable object.
|
|
||||||
* @param iterable An iterable object to convert to an array.
|
|
||||||
* @param mapfn A mapping function to call on every element of the array.
|
|
||||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
|
||||||
*/
|
|
||||||
from<T, U>(iterable: IterableShim<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array from an array-like object.
|
|
||||||
* @param arrayLike An array-like object to convert to an array.
|
|
||||||
*/
|
|
||||||
from<T>(arrayLike: ArrayLike<T>): Array<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array from an iterable object.
|
|
||||||
* @param iterable An iterable object to convert to an array.
|
|
||||||
*/
|
|
||||||
from<T>(iterable: IterableShim<T>): Array<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a new array from a set of elements.
|
|
||||||
* @param items A set of elements to include in the new array object.
|
|
||||||
*/
|
|
||||||
of<T>(...items: T[]): Array<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Array<T> {
|
|
||||||
/**
|
|
||||||
* Returns the value of the first element in the array where predicate is true, and undefined
|
|
||||||
* otherwise.
|
|
||||||
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
||||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
||||||
* immediately returns that element value. Otherwise, find returns undefined.
|
|
||||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
||||||
* predicate. If it is not provided, undefined is used instead.
|
|
||||||
*/
|
|
||||||
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the index of the first element in the array where predicate is true, and undefined
|
|
||||||
* otherwise.
|
|
||||||
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
||||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
||||||
* immediately returns that element value. Otherwise, find returns undefined.
|
|
||||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
||||||
* predicate. If it is not provided, undefined is used instead.
|
|
||||||
*/
|
|
||||||
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the this object after filling the section identified by start and end with value
|
|
||||||
* @param value value to fill array section with
|
|
||||||
* @param start index to start filling the array at. If start is negative, it is treated as
|
|
||||||
* length+start where length is the length of the array.
|
|
||||||
* @param end index to stop filling the array at. If end is negative, it is treated as
|
|
||||||
* length+end.
|
|
||||||
*/
|
|
||||||
fill(value: T, start?: number, end?: number): T[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the this object after copying a section of the array identified by start and end
|
|
||||||
* to the same array starting at position target
|
|
||||||
* @param target If target is negative, it is treated as length+target where length is the
|
|
||||||
* length of the array.
|
|
||||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
||||||
* is treated as length+end.
|
|
||||||
* @param end If not specified, length of the this object is used as its default value.
|
|
||||||
*/
|
|
||||||
copyWithin(target: number, start: number, end?: number): T[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an array of key, value pairs for every entry in the array
|
|
||||||
*/
|
|
||||||
entries(): IterableIteratorShim<[number, T]>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an list of keys in the array
|
|
||||||
*/
|
|
||||||
keys(): IterableIteratorShim<number>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an list of values in the array
|
|
||||||
*/
|
|
||||||
values(): IterableIteratorShim<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): IterableIteratorShim<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface NumberConstructor {
|
|
||||||
/**
|
|
||||||
* The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1
|
|
||||||
* that is representable as a Number value, which is approximately:
|
|
||||||
* 2.2204460492503130808472633361816 x 10−16.
|
|
||||||
*/
|
|
||||||
EPSILON: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if passed value is finite.
|
|
||||||
* Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
|
|
||||||
* number. Only finite values of the type number, result in true.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isFinite(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the value passed is an integer, false otherwise.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isInteger(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
|
|
||||||
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
|
|
||||||
* to a number. Only values of the type number, that are also NaN, result in true.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isNaN(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the value passed is a safe integer.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isSafeInteger(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value of the largest integer n such that n and n + 1 are both exactly representable as
|
|
||||||
* a Number value.
|
|
||||||
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1.
|
|
||||||
*/
|
|
||||||
MAX_SAFE_INTEGER: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value of the smallest integer n such that n and n − 1 are both exactly representable as
|
|
||||||
* a Number value.
|
|
||||||
* The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
|
|
||||||
*/
|
|
||||||
MIN_SAFE_INTEGER: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts a string to a floating-point number.
|
|
||||||
* @param string A string that contains a floating-point number.
|
|
||||||
*/
|
|
||||||
parseFloat(string: string): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts A string to an integer.
|
|
||||||
* @param s A string to convert into a number.
|
|
||||||
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
|
|
||||||
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
|
|
||||||
* All other strings are considered decimal.
|
|
||||||
*/
|
|
||||||
parseInt(string: string, radix?: number): number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ObjectConstructor {
|
|
||||||
/**
|
|
||||||
* Copy the values of all of the enumerable own properties from one or more source objects to a
|
|
||||||
* target object. Returns the target object.
|
|
||||||
* @param target The target object to copy to.
|
|
||||||
* @param sources One or more source objects to copy properties from.
|
|
||||||
*/
|
|
||||||
assign(target: any, ...sources: any[]): any;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the values are the same value, false otherwise.
|
|
||||||
* @param value1 The first value.
|
|
||||||
* @param value2 The second value.
|
|
||||||
*/
|
|
||||||
is(value1: any, value2: any): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the prototype of a specified object o to object proto or null. Returns the object o.
|
|
||||||
* @param o The object to change its prototype.
|
|
||||||
* @param proto The value of the new prototype or null.
|
|
||||||
* @remarks Requires `__proto__` support.
|
|
||||||
*/
|
|
||||||
setPrototypeOf(o: any, proto: any): any;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface RegExp {
|
|
||||||
/**
|
|
||||||
* Returns a string indicating the flags of the regular expression in question. This field is read-only.
|
|
||||||
* The characters in this string are sequenced and concatenated in the following order:
|
|
||||||
*
|
|
||||||
* - "g" for global
|
|
||||||
* - "i" for ignoreCase
|
|
||||||
* - "m" for multiline
|
|
||||||
* - "u" for unicode
|
|
||||||
* - "y" for sticky
|
|
||||||
*
|
|
||||||
* If no flags are set, the value is the empty string.
|
|
||||||
*/
|
|
||||||
flags: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Math {
|
|
||||||
/**
|
|
||||||
* Returns the number of leading zero bits in the 32-bit binary representation of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
clz32(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the result of 32-bit multiplication of two numbers.
|
|
||||||
* @param x First number
|
|
||||||
* @param y Second number
|
|
||||||
*/
|
|
||||||
imul(x: number, y: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the sign of the x, indicating whether x is positive, negative or zero.
|
|
||||||
* @param x The numeric expression to test
|
|
||||||
*/
|
|
||||||
sign(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the base 10 logarithm of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
log10(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the base 2 logarithm of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
log2(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the natural logarithm of 1 + x.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
log1p(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of
|
|
||||||
* the natural logarithms).
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
expm1(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hyperbolic cosine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
cosh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hyperbolic sine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
sinh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hyperbolic tangent of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
tanh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the inverse hyperbolic cosine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
acosh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the inverse hyperbolic sine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
asinh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the inverse hyperbolic tangent of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
atanh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the square root of the sum of squares of its arguments.
|
|
||||||
* @param values Values to compute the square root for.
|
|
||||||
* If no arguments are passed, the result is +0.
|
|
||||||
* If there is only one argument, the result is the absolute value.
|
|
||||||
* If any argument is +Infinity or -Infinity, the result is +Infinity.
|
|
||||||
* If any argument is NaN, the result is NaN.
|
|
||||||
* If all arguments are either +0 or −0, the result is +0.
|
|
||||||
*/
|
|
||||||
hypot(...values: number[]): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the integral part of the a numeric expression, x, removing any fractional digits.
|
|
||||||
* If x is already an integer, the result is x.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
trunc(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the nearest single precision float representation of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
fround(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an implementation-dependent approximation to the cube root of number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
cbrt(x: number): number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PromiseLike<T> {
|
|
||||||
/**
|
|
||||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
||||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
|
||||||
* @param onrejected The callback to execute when the Promise is rejected.
|
|
||||||
* @returns A Promise for the completion of which ever callback is executed.
|
|
||||||
*/
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>;
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the completion of an asynchronous operation
|
|
||||||
*/
|
|
||||||
interface Promise<T> {
|
|
||||||
/**
|
|
||||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
||||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
|
||||||
* @param onrejected The callback to execute when the Promise is rejected.
|
|
||||||
* @returns A Promise for the completion of which ever callback is executed.
|
|
||||||
*/
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult>;
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): Promise<TResult>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Attaches a callback for only the rejection of the Promise.
|
|
||||||
* @param onrejected The callback to execute when the Promise is rejected.
|
|
||||||
* @returns A Promise for the completion of the callback.
|
|
||||||
*/
|
|
||||||
catch(onrejected?: (reason: any) => T | PromiseLike<T>): Promise<T>;
|
|
||||||
catch(onrejected?: (reason: any) => void): Promise<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PromiseConstructor {
|
|
||||||
/**
|
|
||||||
* A reference to the prototype.
|
|
||||||
*/
|
|
||||||
prototype: Promise<any>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new Promise.
|
|
||||||
* @param executor A callback used to initialize the promise. This callback is passed two arguments:
|
|
||||||
* a resolve callback used resolve the promise with a value or the result of another promise,
|
|
||||||
* and a reject callback used to reject the promise with a provided reason or error.
|
|
||||||
*/
|
|
||||||
new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a Promise that is resolved with an array of results when all of the provided Promises
|
|
||||||
* resolve, or rejected when any Promise is rejected.
|
|
||||||
* @param values An array of Promises.
|
|
||||||
* @returns A new Promise.
|
|
||||||
*/
|
|
||||||
all<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T[]>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
|
|
||||||
* or rejected.
|
|
||||||
* @param values An array of Promises.
|
|
||||||
* @returns A new Promise.
|
|
||||||
*/
|
|
||||||
race<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new rejected promise for the provided reason.
|
|
||||||
* @param reason The reason the promise was rejected.
|
|
||||||
* @returns A new rejected Promise.
|
|
||||||
*/
|
|
||||||
reject(reason: any): Promise<void>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new rejected promise for the provided reason.
|
|
||||||
* @param reason The reason the promise was rejected.
|
|
||||||
* @returns A new rejected Promise.
|
|
||||||
*/
|
|
||||||
reject<T>(reason: any): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new resolved promise for the provided value.
|
|
||||||
* @param value A promise.
|
|
||||||
* @returns A promise whose internal state matches the provided promise.
|
|
||||||
*/
|
|
||||||
resolve<T>(value: T | PromiseLike<T>): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new resolved promise .
|
|
||||||
* @returns A resolved promise.
|
|
||||||
*/
|
|
||||||
resolve(): Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var Promise: PromiseConstructor;
|
|
||||||
|
|
||||||
interface Map<K, V> {
|
|
||||||
clear(): void;
|
|
||||||
delete(key: K): boolean;
|
|
||||||
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
|
|
||||||
get(key: K): V;
|
|
||||||
has(key: K): boolean;
|
|
||||||
set(key: K, value?: V): Map<K, V>;
|
|
||||||
size: number;
|
|
||||||
entries(): IterableIteratorShim<[K, V]>;
|
|
||||||
keys(): IterableIteratorShim<K>;
|
|
||||||
values(): IterableIteratorShim<V>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MapConstructor {
|
|
||||||
new <K, V>(): Map<K, V>;
|
|
||||||
new <K, V>(iterable: IterableShim<[K, V]>): Map<K, V>;
|
|
||||||
prototype: Map<any, any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var Map: MapConstructor;
|
|
||||||
|
|
||||||
interface Set<T> {
|
|
||||||
add(value: T): Set<T>;
|
|
||||||
clear(): void;
|
|
||||||
delete(value: T): boolean;
|
|
||||||
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
|
|
||||||
has(value: T): boolean;
|
|
||||||
size: number;
|
|
||||||
entries(): IterableIteratorShim<[T, T]>;
|
|
||||||
keys(): IterableIteratorShim<T>;
|
|
||||||
values(): IterableIteratorShim<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SetConstructor {
|
|
||||||
new <T>(): Set<T>;
|
|
||||||
new <T>(iterable: IterableShim<T>): Set<T>;
|
|
||||||
prototype: Set<any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var Set: SetConstructor;
|
|
||||||
|
|
||||||
interface WeakMap<K, V> {
|
|
||||||
delete(key: K): boolean;
|
|
||||||
get(key: K): V;
|
|
||||||
has(key: K): boolean;
|
|
||||||
set(key: K, value?: V): WeakMap<K, V>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface WeakMapConstructor {
|
|
||||||
new <K, V>(): WeakMap<K, V>;
|
|
||||||
new <K, V>(iterable: IterableShim<[K, V]>): WeakMap<K, V>;
|
|
||||||
prototype: WeakMap<any, any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var WeakMap: WeakMapConstructor;
|
|
||||||
|
|
||||||
interface WeakSet<T> {
|
|
||||||
add(value: T): WeakSet<T>;
|
|
||||||
delete(value: T): boolean;
|
|
||||||
has(value: T): boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface WeakSetConstructor {
|
|
||||||
new <T>(): WeakSet<T>;
|
|
||||||
new <T>(iterable: IterableShim<T>): WeakSet<T>;
|
|
||||||
prototype: WeakSet<any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var WeakSet: WeakSetConstructor;
|
|
||||||
|
|
||||||
declare module Reflect {
|
|
||||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
|
||||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
|
||||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
|
||||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function enumerate(target: any): IterableIteratorShim<any>;
|
|
||||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
|
||||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
|
||||||
function getPrototypeOf(target: any): any;
|
|
||||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function isExtensible(target: any): boolean;
|
|
||||||
function ownKeys(target: any): Array<PropertyKey>;
|
|
||||||
function preventExtensions(target: any): boolean;
|
|
||||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
|
||||||
function setPrototypeOf(target: any, proto: any): boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module "es6-shim" {
|
|
||||||
var String: StringConstructor;
|
|
||||||
var Array: ArrayConstructor;
|
|
||||||
var Number: NumberConstructor;
|
|
||||||
var Math: Math;
|
|
||||||
var Object: ObjectConstructor;
|
|
||||||
var Map: MapConstructor;
|
|
||||||
var Set: SetConstructor;
|
|
||||||
var WeakMap: WeakMapConstructor;
|
|
||||||
var WeakSet: WeakSetConstructor;
|
|
||||||
var Promise: PromiseConstructor;
|
|
||||||
module Reflect {
|
|
||||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
|
||||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
|
||||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
|
||||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function enumerate(target: any): Iterator<any>;
|
|
||||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
|
||||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
|
||||||
function getPrototypeOf(target: any): any;
|
|
||||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function isExtensible(target: any): boolean;
|
|
||||||
function ownKeys(target: any): Array<PropertyKey>;
|
|
||||||
function preventExtensions(target: any): boolean;
|
|
||||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
|
||||||
function setPrototypeOf(target: any, proto: any): boolean;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
497
typings/browser/definitions/moment/index.d.ts
vendored
497
typings/browser/definitions/moment/index.d.ts
vendored
@@ -1,497 +0,0 @@
|
|||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/typed-typings/npm-moment/a4075cd50e63efbedd850f654594f293ab81a385/moment.d.ts
|
|
||||||
declare module '~moment/moment' {
|
|
||||||
// Type definitions for Moment.js 2.10.5
|
|
||||||
|
|
||||||
function moment(): moment.Moment;
|
|
||||||
function moment(date: number): moment.Moment;
|
|
||||||
function moment(date: number[]): moment.Moment;
|
|
||||||
function moment(date: string, format?: string, strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, format?: string, language?: string, strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, formats: string[], strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, formats: string[], language?: string, strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, specialFormat: () => void, strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, specialFormat: () => void, language?: string, strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, formatsIncludingSpecial: any[], strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, formatsIncludingSpecial: any[], language?: string, strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: Date): moment.Moment;
|
|
||||||
function moment(date: moment.Moment): moment.Moment;
|
|
||||||
function moment(date: Object): moment.Moment;
|
|
||||||
|
|
||||||
namespace moment {
|
|
||||||
type formatFunction = () => string;
|
|
||||||
|
|
||||||
interface MomentDateObject {
|
|
||||||
years?: number;
|
|
||||||
/* One digit */
|
|
||||||
months?: number;
|
|
||||||
/* Day of the month */
|
|
||||||
date?: number;
|
|
||||||
hours?: number;
|
|
||||||
minutes?: number;
|
|
||||||
seconds?: number;
|
|
||||||
milliseconds?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MomentLanguageData extends BaseMomentLanguage {
|
|
||||||
/**
|
|
||||||
* @param formatType should be L, LL, LLL, LLLL.
|
|
||||||
*/
|
|
||||||
longDateFormat(formatType: string): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Duration {
|
|
||||||
humanize(withSuffix?: boolean): string;
|
|
||||||
|
|
||||||
as(units: string): number;
|
|
||||||
|
|
||||||
milliseconds(): number;
|
|
||||||
asMilliseconds(): number;
|
|
||||||
|
|
||||||
seconds(): number;
|
|
||||||
asSeconds(): number;
|
|
||||||
|
|
||||||
minutes(): number;
|
|
||||||
asMinutes(): number;
|
|
||||||
|
|
||||||
hours(): number;
|
|
||||||
asHours(): number;
|
|
||||||
|
|
||||||
days(): number;
|
|
||||||
asDays(): number;
|
|
||||||
|
|
||||||
months(): number;
|
|
||||||
asMonths(): number;
|
|
||||||
|
|
||||||
years(): number;
|
|
||||||
asYears(): number;
|
|
||||||
|
|
||||||
add(n: number, p: string): Duration;
|
|
||||||
add(n: number): Duration;
|
|
||||||
add(d: Duration): Duration;
|
|
||||||
|
|
||||||
subtract(n: number, p: string): Duration;
|
|
||||||
subtract(n: number): Duration;
|
|
||||||
subtract(d: Duration): Duration;
|
|
||||||
|
|
||||||
toISOString(): string;
|
|
||||||
toJSON(): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MomentInput {
|
|
||||||
/** Year */
|
|
||||||
years?: number;
|
|
||||||
/** Year */
|
|
||||||
year?: number;
|
|
||||||
/** Year */
|
|
||||||
y?: number;
|
|
||||||
|
|
||||||
/** Month */
|
|
||||||
months?: number;
|
|
||||||
/** Month */
|
|
||||||
month?: number;
|
|
||||||
/** Month */
|
|
||||||
M?: number;
|
|
||||||
|
|
||||||
/** Week */
|
|
||||||
weeks?: number;
|
|
||||||
/** Week */
|
|
||||||
week?: number;
|
|
||||||
/** Week */
|
|
||||||
w?: number;
|
|
||||||
|
|
||||||
/** Day/Date */
|
|
||||||
days?: number;
|
|
||||||
/** Day/Date */
|
|
||||||
day?: number;
|
|
||||||
/** Day/Date */
|
|
||||||
date?: number;
|
|
||||||
/** Day/Date */
|
|
||||||
d?: number;
|
|
||||||
|
|
||||||
/** Hour */
|
|
||||||
hours?: number;
|
|
||||||
/** Hour */
|
|
||||||
hour?: number;
|
|
||||||
/** Hour */
|
|
||||||
h?: number;
|
|
||||||
|
|
||||||
/** Minute */
|
|
||||||
minutes?: number;
|
|
||||||
/** Minute */
|
|
||||||
minute?: number;
|
|
||||||
/** Minute */
|
|
||||||
m?: number;
|
|
||||||
|
|
||||||
/** Second */
|
|
||||||
seconds?: number;
|
|
||||||
/** Second */
|
|
||||||
second?: number;
|
|
||||||
/** Second */
|
|
||||||
s?: number;
|
|
||||||
|
|
||||||
/** Millisecond */
|
|
||||||
milliseconds?: number;
|
|
||||||
/** Millisecond */
|
|
||||||
millisecond?: number;
|
|
||||||
/** Millisecond */
|
|
||||||
ms?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MomentCalendar {
|
|
||||||
lastDay?: string | formatFunction;
|
|
||||||
sameDay?: string | formatFunction;
|
|
||||||
nextDay?: string | formatFunction;
|
|
||||||
lastWeek?: string | formatFunction;
|
|
||||||
nextWeek?: string | formatFunction;
|
|
||||||
sameElse?: string | formatFunction;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MomentRelativeTime {
|
|
||||||
future: any;
|
|
||||||
past: any;
|
|
||||||
s: any;
|
|
||||||
m: any;
|
|
||||||
mm: any;
|
|
||||||
h: any;
|
|
||||||
hh: any;
|
|
||||||
d: any;
|
|
||||||
dd: any;
|
|
||||||
M: any;
|
|
||||||
MM: any;
|
|
||||||
y: any;
|
|
||||||
yy: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MomentLongDateFormat {
|
|
||||||
L: string;
|
|
||||||
LL: string;
|
|
||||||
LLL: string;
|
|
||||||
LLLL: string;
|
|
||||||
LT: string;
|
|
||||||
LTS: string;
|
|
||||||
l?: string;
|
|
||||||
ll?: string;
|
|
||||||
lll?: string;
|
|
||||||
llll?: string;
|
|
||||||
lt?: string;
|
|
||||||
lts?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface BaseMomentLanguage {
|
|
||||||
months?: any;
|
|
||||||
monthsShort?: any;
|
|
||||||
weekdays?: any;
|
|
||||||
weekdaysShort?: any;
|
|
||||||
weekdaysMin?: any;
|
|
||||||
relativeTime?: MomentRelativeTime;
|
|
||||||
meridiem?: (hour: number, minute: number, isLowercase: boolean) => string;
|
|
||||||
calendar?: MomentCalendar;
|
|
||||||
ordinal?: (num: number) => string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MomentLanguage extends BaseMomentLanguage {
|
|
||||||
longDateFormat?: MomentLongDateFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Moment {
|
|
||||||
format(format: string): string;
|
|
||||||
format(): string;
|
|
||||||
|
|
||||||
fromNow(withoutSuffix?: boolean): string;
|
|
||||||
|
|
||||||
startOf(unitOfTime: string): Moment;
|
|
||||||
endOf(unitOfTime: string): Moment;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by adding time. (deprecated in 2.8.0)
|
|
||||||
*
|
|
||||||
* @param unitOfTime the unit of time you want to add (eg "years" / "hours" etc)
|
|
||||||
* @param amount the amount you want to add
|
|
||||||
*/
|
|
||||||
add(unitOfTime: string, amount: number): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by adding time.
|
|
||||||
*
|
|
||||||
* @param amount the amount you want to add
|
|
||||||
* @param unitOfTime the unit of time you want to add (eg "years" / "hours" etc)
|
|
||||||
*/
|
|
||||||
add(amount: number, unitOfTime: string): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by adding time. Note that the order of arguments can be flipped.
|
|
||||||
*
|
|
||||||
* @param amount the amount you want to add
|
|
||||||
* @param unitOfTime the unit of time you want to add (eg "years" / "hours" etc)
|
|
||||||
*/
|
|
||||||
add(amount: string, unitOfTime: string): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by adding time.
|
|
||||||
*
|
|
||||||
* @param objectLiteral an object literal that describes multiple time units {days:7,months:1}
|
|
||||||
*/
|
|
||||||
add(objectLiteral: MomentInput): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by adding time.
|
|
||||||
*
|
|
||||||
* @param duration a length of time
|
|
||||||
*/
|
|
||||||
add(duration: Duration): Moment;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by subtracting time. (deprecated in 2.8.0)
|
|
||||||
*
|
|
||||||
* @param unitOfTime the unit of time you want to subtract (eg "years" / "hours" etc)
|
|
||||||
* @param amount the amount you want to subtract
|
|
||||||
*/
|
|
||||||
subtract(unitOfTime: string, amount: number): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by subtracting time.
|
|
||||||
*
|
|
||||||
* @param unitOfTime the unit of time you want to subtract (eg "years" / "hours" etc)
|
|
||||||
* @param amount the amount you want to subtract
|
|
||||||
*/
|
|
||||||
subtract(amount: number, unitOfTime: string): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by subtracting time. Note that the order of arguments can be flipped.
|
|
||||||
*
|
|
||||||
* @param amount the amount you want to add
|
|
||||||
* @param unitOfTime the unit of time you want to subtract (eg "years" / "hours" etc)
|
|
||||||
*/
|
|
||||||
subtract(amount: string, unitOfTime: string): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by subtracting time.
|
|
||||||
*
|
|
||||||
* @param objectLiteral an object literal that describes multiple time units {days:7,months:1}
|
|
||||||
*/
|
|
||||||
subtract(objectLiteral: MomentInput): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by subtracting time.
|
|
||||||
*
|
|
||||||
* @param duration a length of time
|
|
||||||
*/
|
|
||||||
subtract(duration: Duration): Moment;
|
|
||||||
|
|
||||||
calendar(): string;
|
|
||||||
calendar(start: Moment): string;
|
|
||||||
calendar(start: Moment, formats: MomentCalendar): string;
|
|
||||||
|
|
||||||
clone(): Moment;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Unix timestamp, or milliseconds since the epoch.
|
|
||||||
*/
|
|
||||||
valueOf(): number;
|
|
||||||
|
|
||||||
local(): Moment; // current date/time in local mode
|
|
||||||
|
|
||||||
utc(): Moment; // current date/time in UTC mode
|
|
||||||
|
|
||||||
isValid(): boolean;
|
|
||||||
invalidAt(): number;
|
|
||||||
|
|
||||||
year(y: number): Moment;
|
|
||||||
year(): number;
|
|
||||||
quarter(): number;
|
|
||||||
quarter(q: number): Moment;
|
|
||||||
month(M: number): Moment;
|
|
||||||
month(M: string): Moment;
|
|
||||||
month(): number;
|
|
||||||
day(d: number): Moment;
|
|
||||||
day(d: string): Moment;
|
|
||||||
day(): number;
|
|
||||||
date(d: number): Moment;
|
|
||||||
date(): number;
|
|
||||||
hour(h: number): Moment;
|
|
||||||
hour(): number;
|
|
||||||
hours(h: number): Moment;
|
|
||||||
hours(): number;
|
|
||||||
minute(m: number): Moment;
|
|
||||||
minute(): number;
|
|
||||||
minutes(m: number): Moment;
|
|
||||||
minutes(): number;
|
|
||||||
second(s: number): Moment;
|
|
||||||
second(): number;
|
|
||||||
seconds(s: number): Moment;
|
|
||||||
seconds(): number;
|
|
||||||
millisecond(ms: number): Moment;
|
|
||||||
millisecond(): number;
|
|
||||||
milliseconds(ms: number): Moment;
|
|
||||||
milliseconds(): number;
|
|
||||||
weekday(): number;
|
|
||||||
weekday(d: number): Moment;
|
|
||||||
isoWeekday(): number;
|
|
||||||
isoWeekday(d: number): Moment;
|
|
||||||
weekYear(): number;
|
|
||||||
weekYear(d: number): Moment;
|
|
||||||
isoWeekYear(): number;
|
|
||||||
isoWeekYear(d: number): Moment;
|
|
||||||
week(): number;
|
|
||||||
week(d: number): Moment;
|
|
||||||
weeks(): number;
|
|
||||||
weeks(d: number): Moment;
|
|
||||||
isoWeek(): number;
|
|
||||||
isoWeek(d: number): Moment;
|
|
||||||
isoWeeks(): number;
|
|
||||||
isoWeeks(d: number): Moment;
|
|
||||||
weeksInYear(): number;
|
|
||||||
isoWeeksInYear(): number;
|
|
||||||
dayOfYear(): number;
|
|
||||||
dayOfYear(d: number): Moment;
|
|
||||||
|
|
||||||
from(f: Moment | string | number | Date | number[], suffix?: boolean): string;
|
|
||||||
to(f: Moment | string | number | Date | number[], suffix?: boolean): string;
|
|
||||||
toNow(withoutPrefix?: boolean): string;
|
|
||||||
|
|
||||||
diff(b: Moment): number;
|
|
||||||
diff(b: Moment, unitOfTime: string): number;
|
|
||||||
diff(b: Moment, unitOfTime: string, round: boolean): number;
|
|
||||||
|
|
||||||
toArray(): number[];
|
|
||||||
toDate(): Date;
|
|
||||||
toISOString(): string;
|
|
||||||
toJSON(): string;
|
|
||||||
unix(): number;
|
|
||||||
|
|
||||||
isLeapYear(): boolean;
|
|
||||||
zone(): number;
|
|
||||||
zone(b: number): Moment;
|
|
||||||
zone(b: string): Moment;
|
|
||||||
utcOffset(): number;
|
|
||||||
utcOffset(b: number): Moment;
|
|
||||||
utcOffset(b: string): Moment;
|
|
||||||
daysInMonth(): number;
|
|
||||||
isDST(): boolean;
|
|
||||||
|
|
||||||
isBefore(): boolean;
|
|
||||||
isBefore(b: Moment | string | number | Date | number[], granularity?: string): boolean;
|
|
||||||
|
|
||||||
isAfter(): boolean;
|
|
||||||
isAfter(b: Moment | string | number | Date | number[], granularity?: string): boolean;
|
|
||||||
|
|
||||||
isSame(b: Moment | string | number | Date | number[], granularity?: string): boolean;
|
|
||||||
isBetween(a: Moment | string | number | Date | number[], b: Moment | string | number | Date | number[], granularity?: string): boolean;
|
|
||||||
|
|
||||||
// Deprecated as of 2.8.0.
|
|
||||||
lang(language: string): Moment;
|
|
||||||
lang(reset: boolean): Moment;
|
|
||||||
lang(): MomentLanguage;
|
|
||||||
|
|
||||||
locale(language: string): Moment;
|
|
||||||
locale(reset: boolean): Moment;
|
|
||||||
locale(): string;
|
|
||||||
|
|
||||||
localeData(language: string): Moment;
|
|
||||||
localeData(reset: boolean): Moment;
|
|
||||||
localeData(): MomentLanguage;
|
|
||||||
|
|
||||||
// Deprecated as of 2.7.0.
|
|
||||||
max(date: Moment | string | number | Date | any[]): Moment;
|
|
||||||
max(date: string, format: string): Moment;
|
|
||||||
|
|
||||||
// Deprecated as of 2.7.0.
|
|
||||||
min(date: Moment | string | number | Date | any[]): Moment;
|
|
||||||
min(date: string, format: string): Moment;
|
|
||||||
|
|
||||||
get(unit: string): number;
|
|
||||||
set(unit: string, value: number): Moment;
|
|
||||||
set(objectLiteral: MomentInput): Moment;
|
|
||||||
|
|
||||||
/*This returns an object containing year, month, day-of-month, hour, minute, seconds, milliseconds.*/
|
|
||||||
//Works with version 2.10.5+
|
|
||||||
toObject(): MomentDateObject;
|
|
||||||
}
|
|
||||||
|
|
||||||
export var version: string;
|
|
||||||
export var fn: Moment;
|
|
||||||
|
|
||||||
export function utc(): Moment;
|
|
||||||
export function utc(date: number): Moment;
|
|
||||||
export function utc(date: number[]): Moment;
|
|
||||||
export function utc(date: string, format?: string, strict?: boolean): Moment;
|
|
||||||
export function utc(date: string, format?: string, language?: string, strict?: boolean): Moment;
|
|
||||||
export function utc(date: string, formats: string[], strict?: boolean): Moment;
|
|
||||||
export function utc(date: string, formats: string[], language?: string, strict?: boolean): Moment;
|
|
||||||
export function utc(date: Date): Moment;
|
|
||||||
export function utc(date: Moment): Moment;
|
|
||||||
export function utc(date: Object): Moment;
|
|
||||||
|
|
||||||
export function unix(timestamp: number): Moment;
|
|
||||||
|
|
||||||
export function invalid(parsingFlags?: Object): Moment;
|
|
||||||
export function isMoment(): boolean;
|
|
||||||
export function isMoment(m: any): boolean;
|
|
||||||
export function isDate(m: any): boolean;
|
|
||||||
export function isDuration(): boolean;
|
|
||||||
export function isDuration(d: any): boolean;
|
|
||||||
|
|
||||||
// Deprecated in 2.8.0.
|
|
||||||
export function lang(language?: string): string;
|
|
||||||
export function lang(language?: string, definition?: MomentLanguage): string;
|
|
||||||
|
|
||||||
export function locale(language?: string): string;
|
|
||||||
export function locale(language?: string[]): string;
|
|
||||||
export function locale(language?: string, definition?: MomentLanguage): string;
|
|
||||||
|
|
||||||
export function localeData(language?: string): MomentLanguageData;
|
|
||||||
|
|
||||||
export var longDateFormat: any;
|
|
||||||
export var relativeTime: any;
|
|
||||||
export var meridiem: (hour: number, minute: number, isLowercase: boolean) => string;
|
|
||||||
export var calendar: any;
|
|
||||||
export var ordinal: (num: number) => string;
|
|
||||||
|
|
||||||
export function duration(milliseconds: Number): Duration;
|
|
||||||
export function duration(num: Number, unitOfTime: string): Duration;
|
|
||||||
export function duration(input: MomentInput): Duration;
|
|
||||||
export function duration(object: any): Duration;
|
|
||||||
export function duration(): Duration;
|
|
||||||
|
|
||||||
export function parseZone(date: string): Moment;
|
|
||||||
|
|
||||||
export function months(): string[];
|
|
||||||
export function months(index: number): string;
|
|
||||||
export function months(format: string): string[];
|
|
||||||
export function months(format: string, index: number): string;
|
|
||||||
export function monthsShort(): string[];
|
|
||||||
export function monthsShort(index: number): string;
|
|
||||||
export function monthsShort(format: string): string[];
|
|
||||||
export function monthsShort(format: string, index: number): string;
|
|
||||||
|
|
||||||
export function weekdays(): string[];
|
|
||||||
export function weekdays(index: number): string;
|
|
||||||
export function weekdays(format: string): string[];
|
|
||||||
export function weekdays(format: string, index: number): string;
|
|
||||||
export function weekdaysShort(): string[];
|
|
||||||
export function weekdaysShort(index: number): string;
|
|
||||||
export function weekdaysShort(format: string): string[];
|
|
||||||
export function weekdaysShort(format: string, index: number): string;
|
|
||||||
export function weekdaysMin(): string[];
|
|
||||||
export function weekdaysMin(index: number): string;
|
|
||||||
export function weekdaysMin(format: string): string[];
|
|
||||||
export function weekdaysMin(format: string, index: number): string;
|
|
||||||
|
|
||||||
export function min(...moments: Moment[]): Moment;
|
|
||||||
export function max(...moments: Moment[]): Moment;
|
|
||||||
|
|
||||||
export function normalizeUnits(unit: string): string;
|
|
||||||
export function relativeTimeThreshold(threshold: string): number | boolean;
|
|
||||||
export function relativeTimeThreshold(threshold: string, limit: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constant used to enable explicit ISO_8601 format parsing.
|
|
||||||
*/
|
|
||||||
export function ISO_8601(): void;
|
|
||||||
|
|
||||||
export var defaultFormat: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export = moment;
|
|
||||||
}
|
|
||||||
declare module 'moment/moment' {
|
|
||||||
import main = require('~moment/moment');
|
|
||||||
export = main;
|
|
||||||
}
|
|
||||||
declare module 'moment' {
|
|
||||||
import main = require('~moment/moment');
|
|
||||||
export = main;
|
|
||||||
}
|
|
||||||
3
typings/main.d.ts
vendored
3
typings/main.d.ts
vendored
@@ -1,3 +0,0 @@
|
|||||||
/// <reference path="main/ambient/es6-shim/index.d.ts" />
|
|
||||||
/// <reference path="../node_modules/angularfire2/firebase3.d.ts" />
|
|
||||||
/// <reference path="main/definitions/moment/index.d.ts" />
|
|
||||||
670
typings/main/ambient/es6-shim/es6-shim.d.ts
vendored
670
typings/main/ambient/es6-shim/es6-shim.d.ts
vendored
@@ -1,670 +0,0 @@
|
|||||||
// Compiled using typings@0.6.8
|
|
||||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/4de74cb527395c13ba20b438c3a7a419ad931f1c/es6-shim/es6-shim.d.ts
|
|
||||||
// Type definitions for es6-shim v0.31.2
|
|
||||||
// Project: https://github.com/paulmillr/es6-shim
|
|
||||||
// Definitions by: Ron Buckton <http://github.com/rbuckton>
|
|
||||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
||||||
|
|
||||||
declare type PropertyKey = string | number | symbol;
|
|
||||||
|
|
||||||
interface IteratorResult<T> {
|
|
||||||
done: boolean;
|
|
||||||
value?: T;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IterableShim<T> {
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): Iterator<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Iterator<T> {
|
|
||||||
next(value?: any): IteratorResult<T>;
|
|
||||||
return?(value?: any): IteratorResult<T>;
|
|
||||||
throw?(e?: any): IteratorResult<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IterableIteratorShim<T> extends IterableShim<T>, Iterator<T> {
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable iterator. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): IterableIteratorShim<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface StringConstructor {
|
|
||||||
/**
|
|
||||||
* Return the String value whose elements are, in order, the elements in the List elements.
|
|
||||||
* If length is 0, the empty string is returned.
|
|
||||||
*/
|
|
||||||
fromCodePoint(...codePoints: number[]): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* String.raw is intended for use as a tag function of a Tagged Template String. When called
|
|
||||||
* as such the first argument will be a well formed template call site object and the rest
|
|
||||||
* parameter will contain the substitution values.
|
|
||||||
* @param template A well-formed template string call site representation.
|
|
||||||
* @param substitutions A set of substitution values.
|
|
||||||
*/
|
|
||||||
raw(template: TemplateStringsArray, ...substitutions: any[]): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface String {
|
|
||||||
/**
|
|
||||||
* Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
|
|
||||||
* value of the UTF-16 encoded code point starting at the string element at position pos in
|
|
||||||
* the String resulting from converting this object to a String.
|
|
||||||
* If there is no element at that position, the result is undefined.
|
|
||||||
* If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
|
|
||||||
*/
|
|
||||||
codePointAt(pos: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if searchString appears as a substring of the result of converting this
|
|
||||||
* object to a String, at one or more positions that are
|
|
||||||
* greater than or equal to position; otherwise, returns false.
|
|
||||||
* @param searchString search string
|
|
||||||
* @param position If position is undefined, 0 is assumed, so as to search all of the String.
|
|
||||||
*/
|
|
||||||
includes(searchString: string, position?: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the sequence of elements of searchString converted to a String is the
|
|
||||||
* same as the corresponding elements of this object (converted to a String) starting at
|
|
||||||
* endPosition – length(this). Otherwise returns false.
|
|
||||||
*/
|
|
||||||
endsWith(searchString: string, endPosition?: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a String value that is made from count copies appended together. If count is 0,
|
|
||||||
* T is the empty String is returned.
|
|
||||||
* @param count number of copies to append
|
|
||||||
*/
|
|
||||||
repeat(count: number): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the sequence of elements of searchString converted to a String is the
|
|
||||||
* same as the corresponding elements of this object (converted to a String) starting at
|
|
||||||
* position. Otherwise returns false.
|
|
||||||
*/
|
|
||||||
startsWith(searchString: string, position?: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an <a> HTML anchor element and sets the name attribute to the text value
|
|
||||||
* @param name
|
|
||||||
*/
|
|
||||||
anchor(name: string): string;
|
|
||||||
|
|
||||||
/** Returns a <big> HTML element */
|
|
||||||
big(): string;
|
|
||||||
|
|
||||||
/** Returns a <blink> HTML element */
|
|
||||||
blink(): string;
|
|
||||||
|
|
||||||
/** Returns a <b> HTML element */
|
|
||||||
bold(): string;
|
|
||||||
|
|
||||||
/** Returns a <tt> HTML element */
|
|
||||||
fixed(): string
|
|
||||||
|
|
||||||
/** Returns a <font> HTML element and sets the color attribute value */
|
|
||||||
fontcolor(color: string): string
|
|
||||||
|
|
||||||
/** Returns a <font> HTML element and sets the size attribute value */
|
|
||||||
fontsize(size: number): string;
|
|
||||||
|
|
||||||
/** Returns a <font> HTML element and sets the size attribute value */
|
|
||||||
fontsize(size: string): string;
|
|
||||||
|
|
||||||
/** Returns an <i> HTML element */
|
|
||||||
italics(): string;
|
|
||||||
|
|
||||||
/** Returns an <a> HTML element and sets the href attribute value */
|
|
||||||
link(url: string): string;
|
|
||||||
|
|
||||||
/** Returns a <small> HTML element */
|
|
||||||
small(): string;
|
|
||||||
|
|
||||||
/** Returns a <strike> HTML element */
|
|
||||||
strike(): string;
|
|
||||||
|
|
||||||
/** Returns a <sub> HTML element */
|
|
||||||
sub(): string;
|
|
||||||
|
|
||||||
/** Returns a <sup> HTML element */
|
|
||||||
sup(): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): IterableIteratorShim<string>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ArrayConstructor {
|
|
||||||
/**
|
|
||||||
* Creates an array from an array-like object.
|
|
||||||
* @param arrayLike An array-like object to convert to an array.
|
|
||||||
* @param mapfn A mapping function to call on every element of the array.
|
|
||||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
|
||||||
*/
|
|
||||||
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array from an iterable object.
|
|
||||||
* @param iterable An iterable object to convert to an array.
|
|
||||||
* @param mapfn A mapping function to call on every element of the array.
|
|
||||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
|
||||||
*/
|
|
||||||
from<T, U>(iterable: IterableShim<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array from an array-like object.
|
|
||||||
* @param arrayLike An array-like object to convert to an array.
|
|
||||||
*/
|
|
||||||
from<T>(arrayLike: ArrayLike<T>): Array<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array from an iterable object.
|
|
||||||
* @param iterable An iterable object to convert to an array.
|
|
||||||
*/
|
|
||||||
from<T>(iterable: IterableShim<T>): Array<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a new array from a set of elements.
|
|
||||||
* @param items A set of elements to include in the new array object.
|
|
||||||
*/
|
|
||||||
of<T>(...items: T[]): Array<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Array<T> {
|
|
||||||
/**
|
|
||||||
* Returns the value of the first element in the array where predicate is true, and undefined
|
|
||||||
* otherwise.
|
|
||||||
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
||||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
||||||
* immediately returns that element value. Otherwise, find returns undefined.
|
|
||||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
||||||
* predicate. If it is not provided, undefined is used instead.
|
|
||||||
*/
|
|
||||||
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the index of the first element in the array where predicate is true, and undefined
|
|
||||||
* otherwise.
|
|
||||||
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
||||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
||||||
* immediately returns that element value. Otherwise, find returns undefined.
|
|
||||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
||||||
* predicate. If it is not provided, undefined is used instead.
|
|
||||||
*/
|
|
||||||
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the this object after filling the section identified by start and end with value
|
|
||||||
* @param value value to fill array section with
|
|
||||||
* @param start index to start filling the array at. If start is negative, it is treated as
|
|
||||||
* length+start where length is the length of the array.
|
|
||||||
* @param end index to stop filling the array at. If end is negative, it is treated as
|
|
||||||
* length+end.
|
|
||||||
*/
|
|
||||||
fill(value: T, start?: number, end?: number): T[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the this object after copying a section of the array identified by start and end
|
|
||||||
* to the same array starting at position target
|
|
||||||
* @param target If target is negative, it is treated as length+target where length is the
|
|
||||||
* length of the array.
|
|
||||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
||||||
* is treated as length+end.
|
|
||||||
* @param end If not specified, length of the this object is used as its default value.
|
|
||||||
*/
|
|
||||||
copyWithin(target: number, start: number, end?: number): T[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an array of key, value pairs for every entry in the array
|
|
||||||
*/
|
|
||||||
entries(): IterableIteratorShim<[number, T]>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an list of keys in the array
|
|
||||||
*/
|
|
||||||
keys(): IterableIteratorShim<number>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an list of values in the array
|
|
||||||
*/
|
|
||||||
values(): IterableIteratorShim<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): IterableIteratorShim<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface NumberConstructor {
|
|
||||||
/**
|
|
||||||
* The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1
|
|
||||||
* that is representable as a Number value, which is approximately:
|
|
||||||
* 2.2204460492503130808472633361816 x 10−16.
|
|
||||||
*/
|
|
||||||
EPSILON: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if passed value is finite.
|
|
||||||
* Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
|
|
||||||
* number. Only finite values of the type number, result in true.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isFinite(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the value passed is an integer, false otherwise.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isInteger(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
|
|
||||||
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
|
|
||||||
* to a number. Only values of the type number, that are also NaN, result in true.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isNaN(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the value passed is a safe integer.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isSafeInteger(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value of the largest integer n such that n and n + 1 are both exactly representable as
|
|
||||||
* a Number value.
|
|
||||||
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1.
|
|
||||||
*/
|
|
||||||
MAX_SAFE_INTEGER: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value of the smallest integer n such that n and n − 1 are both exactly representable as
|
|
||||||
* a Number value.
|
|
||||||
* The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
|
|
||||||
*/
|
|
||||||
MIN_SAFE_INTEGER: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts a string to a floating-point number.
|
|
||||||
* @param string A string that contains a floating-point number.
|
|
||||||
*/
|
|
||||||
parseFloat(string: string): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts A string to an integer.
|
|
||||||
* @param s A string to convert into a number.
|
|
||||||
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
|
|
||||||
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
|
|
||||||
* All other strings are considered decimal.
|
|
||||||
*/
|
|
||||||
parseInt(string: string, radix?: number): number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ObjectConstructor {
|
|
||||||
/**
|
|
||||||
* Copy the values of all of the enumerable own properties from one or more source objects to a
|
|
||||||
* target object. Returns the target object.
|
|
||||||
* @param target The target object to copy to.
|
|
||||||
* @param sources One or more source objects to copy properties from.
|
|
||||||
*/
|
|
||||||
assign(target: any, ...sources: any[]): any;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the values are the same value, false otherwise.
|
|
||||||
* @param value1 The first value.
|
|
||||||
* @param value2 The second value.
|
|
||||||
*/
|
|
||||||
is(value1: any, value2: any): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the prototype of a specified object o to object proto or null. Returns the object o.
|
|
||||||
* @param o The object to change its prototype.
|
|
||||||
* @param proto The value of the new prototype or null.
|
|
||||||
* @remarks Requires `__proto__` support.
|
|
||||||
*/
|
|
||||||
setPrototypeOf(o: any, proto: any): any;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface RegExp {
|
|
||||||
/**
|
|
||||||
* Returns a string indicating the flags of the regular expression in question. This field is read-only.
|
|
||||||
* The characters in this string are sequenced and concatenated in the following order:
|
|
||||||
*
|
|
||||||
* - "g" for global
|
|
||||||
* - "i" for ignoreCase
|
|
||||||
* - "m" for multiline
|
|
||||||
* - "u" for unicode
|
|
||||||
* - "y" for sticky
|
|
||||||
*
|
|
||||||
* If no flags are set, the value is the empty string.
|
|
||||||
*/
|
|
||||||
flags: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Math {
|
|
||||||
/**
|
|
||||||
* Returns the number of leading zero bits in the 32-bit binary representation of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
clz32(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the result of 32-bit multiplication of two numbers.
|
|
||||||
* @param x First number
|
|
||||||
* @param y Second number
|
|
||||||
*/
|
|
||||||
imul(x: number, y: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the sign of the x, indicating whether x is positive, negative or zero.
|
|
||||||
* @param x The numeric expression to test
|
|
||||||
*/
|
|
||||||
sign(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the base 10 logarithm of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
log10(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the base 2 logarithm of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
log2(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the natural logarithm of 1 + x.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
log1p(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of
|
|
||||||
* the natural logarithms).
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
expm1(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hyperbolic cosine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
cosh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hyperbolic sine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
sinh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hyperbolic tangent of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
tanh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the inverse hyperbolic cosine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
acosh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the inverse hyperbolic sine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
asinh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the inverse hyperbolic tangent of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
atanh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the square root of the sum of squares of its arguments.
|
|
||||||
* @param values Values to compute the square root for.
|
|
||||||
* If no arguments are passed, the result is +0.
|
|
||||||
* If there is only one argument, the result is the absolute value.
|
|
||||||
* If any argument is +Infinity or -Infinity, the result is +Infinity.
|
|
||||||
* If any argument is NaN, the result is NaN.
|
|
||||||
* If all arguments are either +0 or −0, the result is +0.
|
|
||||||
*/
|
|
||||||
hypot(...values: number[]): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the integral part of the a numeric expression, x, removing any fractional digits.
|
|
||||||
* If x is already an integer, the result is x.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
trunc(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the nearest single precision float representation of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
fround(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an implementation-dependent approximation to the cube root of number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
cbrt(x: number): number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PromiseLike<T> {
|
|
||||||
/**
|
|
||||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
||||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
|
||||||
* @param onrejected The callback to execute when the Promise is rejected.
|
|
||||||
* @returns A Promise for the completion of which ever callback is executed.
|
|
||||||
*/
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>;
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the completion of an asynchronous operation
|
|
||||||
*/
|
|
||||||
interface Promise<T> {
|
|
||||||
/**
|
|
||||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
||||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
|
||||||
* @param onrejected The callback to execute when the Promise is rejected.
|
|
||||||
* @returns A Promise for the completion of which ever callback is executed.
|
|
||||||
*/
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult>;
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): Promise<TResult>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Attaches a callback for only the rejection of the Promise.
|
|
||||||
* @param onrejected The callback to execute when the Promise is rejected.
|
|
||||||
* @returns A Promise for the completion of the callback.
|
|
||||||
*/
|
|
||||||
catch(onrejected?: (reason: any) => T | PromiseLike<T>): Promise<T>;
|
|
||||||
catch(onrejected?: (reason: any) => void): Promise<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PromiseConstructor {
|
|
||||||
/**
|
|
||||||
* A reference to the prototype.
|
|
||||||
*/
|
|
||||||
prototype: Promise<any>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new Promise.
|
|
||||||
* @param executor A callback used to initialize the promise. This callback is passed two arguments:
|
|
||||||
* a resolve callback used resolve the promise with a value or the result of another promise,
|
|
||||||
* and a reject callback used to reject the promise with a provided reason or error.
|
|
||||||
*/
|
|
||||||
new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a Promise that is resolved with an array of results when all of the provided Promises
|
|
||||||
* resolve, or rejected when any Promise is rejected.
|
|
||||||
* @param values An array of Promises.
|
|
||||||
* @returns A new Promise.
|
|
||||||
*/
|
|
||||||
all<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T[]>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
|
|
||||||
* or rejected.
|
|
||||||
* @param values An array of Promises.
|
|
||||||
* @returns A new Promise.
|
|
||||||
*/
|
|
||||||
race<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new rejected promise for the provided reason.
|
|
||||||
* @param reason The reason the promise was rejected.
|
|
||||||
* @returns A new rejected Promise.
|
|
||||||
*/
|
|
||||||
reject(reason: any): Promise<void>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new rejected promise for the provided reason.
|
|
||||||
* @param reason The reason the promise was rejected.
|
|
||||||
* @returns A new rejected Promise.
|
|
||||||
*/
|
|
||||||
reject<T>(reason: any): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new resolved promise for the provided value.
|
|
||||||
* @param value A promise.
|
|
||||||
* @returns A promise whose internal state matches the provided promise.
|
|
||||||
*/
|
|
||||||
resolve<T>(value: T | PromiseLike<T>): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new resolved promise .
|
|
||||||
* @returns A resolved promise.
|
|
||||||
*/
|
|
||||||
resolve(): Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var Promise: PromiseConstructor;
|
|
||||||
|
|
||||||
interface Map<K, V> {
|
|
||||||
clear(): void;
|
|
||||||
delete(key: K): boolean;
|
|
||||||
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
|
|
||||||
get(key: K): V;
|
|
||||||
has(key: K): boolean;
|
|
||||||
set(key: K, value?: V): Map<K, V>;
|
|
||||||
size: number;
|
|
||||||
entries(): IterableIteratorShim<[K, V]>;
|
|
||||||
keys(): IterableIteratorShim<K>;
|
|
||||||
values(): IterableIteratorShim<V>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MapConstructor {
|
|
||||||
new <K, V>(): Map<K, V>;
|
|
||||||
new <K, V>(iterable: IterableShim<[K, V]>): Map<K, V>;
|
|
||||||
prototype: Map<any, any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var Map: MapConstructor;
|
|
||||||
|
|
||||||
interface Set<T> {
|
|
||||||
add(value: T): Set<T>;
|
|
||||||
clear(): void;
|
|
||||||
delete(value: T): boolean;
|
|
||||||
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
|
|
||||||
has(value: T): boolean;
|
|
||||||
size: number;
|
|
||||||
entries(): IterableIteratorShim<[T, T]>;
|
|
||||||
keys(): IterableIteratorShim<T>;
|
|
||||||
values(): IterableIteratorShim<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SetConstructor {
|
|
||||||
new <T>(): Set<T>;
|
|
||||||
new <T>(iterable: IterableShim<T>): Set<T>;
|
|
||||||
prototype: Set<any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var Set: SetConstructor;
|
|
||||||
|
|
||||||
interface WeakMap<K, V> {
|
|
||||||
delete(key: K): boolean;
|
|
||||||
get(key: K): V;
|
|
||||||
has(key: K): boolean;
|
|
||||||
set(key: K, value?: V): WeakMap<K, V>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface WeakMapConstructor {
|
|
||||||
new <K, V>(): WeakMap<K, V>;
|
|
||||||
new <K, V>(iterable: IterableShim<[K, V]>): WeakMap<K, V>;
|
|
||||||
prototype: WeakMap<any, any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var WeakMap: WeakMapConstructor;
|
|
||||||
|
|
||||||
interface WeakSet<T> {
|
|
||||||
add(value: T): WeakSet<T>;
|
|
||||||
delete(value: T): boolean;
|
|
||||||
has(value: T): boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface WeakSetConstructor {
|
|
||||||
new <T>(): WeakSet<T>;
|
|
||||||
new <T>(iterable: IterableShim<T>): WeakSet<T>;
|
|
||||||
prototype: WeakSet<any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var WeakSet: WeakSetConstructor;
|
|
||||||
|
|
||||||
declare module Reflect {
|
|
||||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
|
||||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
|
||||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
|
||||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function enumerate(target: any): IterableIteratorShim<any>;
|
|
||||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
|
||||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
|
||||||
function getPrototypeOf(target: any): any;
|
|
||||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function isExtensible(target: any): boolean;
|
|
||||||
function ownKeys(target: any): Array<PropertyKey>;
|
|
||||||
function preventExtensions(target: any): boolean;
|
|
||||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
|
||||||
function setPrototypeOf(target: any, proto: any): boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module "es6-shim" {
|
|
||||||
var String: StringConstructor;
|
|
||||||
var Array: ArrayConstructor;
|
|
||||||
var Number: NumberConstructor;
|
|
||||||
var Math: Math;
|
|
||||||
var Object: ObjectConstructor;
|
|
||||||
var Map: MapConstructor;
|
|
||||||
var Set: SetConstructor;
|
|
||||||
var WeakMap: WeakMapConstructor;
|
|
||||||
var WeakSet: WeakSetConstructor;
|
|
||||||
var Promise: PromiseConstructor;
|
|
||||||
module Reflect {
|
|
||||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
|
||||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
|
||||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
|
||||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function enumerate(target: any): Iterator<any>;
|
|
||||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
|
||||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
|
||||||
function getPrototypeOf(target: any): any;
|
|
||||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function isExtensible(target: any): boolean;
|
|
||||||
function ownKeys(target: any): Array<PropertyKey>;
|
|
||||||
function preventExtensions(target: any): boolean;
|
|
||||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
|
||||||
function setPrototypeOf(target: any, proto: any): boolean;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
670
typings/main/ambient/es6-shim/index.d.ts
vendored
670
typings/main/ambient/es6-shim/index.d.ts
vendored
@@ -1,670 +0,0 @@
|
|||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/4de74cb527395c13ba20b438c3a7a419ad931f1c/es6-shim/es6-shim.d.ts
|
|
||||||
// Type definitions for es6-shim v0.31.2
|
|
||||||
// Project: https://github.com/paulmillr/es6-shim
|
|
||||||
// Definitions by: Ron Buckton <http://github.com/rbuckton>
|
|
||||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
||||||
|
|
||||||
declare type PropertyKey = string | number | symbol;
|
|
||||||
|
|
||||||
interface IteratorResult<T> {
|
|
||||||
done: boolean;
|
|
||||||
value?: T;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IterableShim<T> {
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): Iterator<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Iterator<T> {
|
|
||||||
next(value?: any): IteratorResult<T>;
|
|
||||||
return?(value?: any): IteratorResult<T>;
|
|
||||||
throw?(e?: any): IteratorResult<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IterableIteratorShim<T> extends IterableShim<T>, Iterator<T> {
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable iterator. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): IterableIteratorShim<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface StringConstructor {
|
|
||||||
/**
|
|
||||||
* Return the String value whose elements are, in order, the elements in the List elements.
|
|
||||||
* If length is 0, the empty string is returned.
|
|
||||||
*/
|
|
||||||
fromCodePoint(...codePoints: number[]): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* String.raw is intended for use as a tag function of a Tagged Template String. When called
|
|
||||||
* as such the first argument will be a well formed template call site object and the rest
|
|
||||||
* parameter will contain the substitution values.
|
|
||||||
* @param template A well-formed template string call site representation.
|
|
||||||
* @param substitutions A set of substitution values.
|
|
||||||
*/
|
|
||||||
raw(template: TemplateStringsArray, ...substitutions: any[]): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface String {
|
|
||||||
/**
|
|
||||||
* Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point
|
|
||||||
* value of the UTF-16 encoded code point starting at the string element at position pos in
|
|
||||||
* the String resulting from converting this object to a String.
|
|
||||||
* If there is no element at that position, the result is undefined.
|
|
||||||
* If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.
|
|
||||||
*/
|
|
||||||
codePointAt(pos: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if searchString appears as a substring of the result of converting this
|
|
||||||
* object to a String, at one or more positions that are
|
|
||||||
* greater than or equal to position; otherwise, returns false.
|
|
||||||
* @param searchString search string
|
|
||||||
* @param position If position is undefined, 0 is assumed, so as to search all of the String.
|
|
||||||
*/
|
|
||||||
includes(searchString: string, position?: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the sequence of elements of searchString converted to a String is the
|
|
||||||
* same as the corresponding elements of this object (converted to a String) starting at
|
|
||||||
* endPosition – length(this). Otherwise returns false.
|
|
||||||
*/
|
|
||||||
endsWith(searchString: string, endPosition?: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a String value that is made from count copies appended together. If count is 0,
|
|
||||||
* T is the empty String is returned.
|
|
||||||
* @param count number of copies to append
|
|
||||||
*/
|
|
||||||
repeat(count: number): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the sequence of elements of searchString converted to a String is the
|
|
||||||
* same as the corresponding elements of this object (converted to a String) starting at
|
|
||||||
* position. Otherwise returns false.
|
|
||||||
*/
|
|
||||||
startsWith(searchString: string, position?: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an <a> HTML anchor element and sets the name attribute to the text value
|
|
||||||
* @param name
|
|
||||||
*/
|
|
||||||
anchor(name: string): string;
|
|
||||||
|
|
||||||
/** Returns a <big> HTML element */
|
|
||||||
big(): string;
|
|
||||||
|
|
||||||
/** Returns a <blink> HTML element */
|
|
||||||
blink(): string;
|
|
||||||
|
|
||||||
/** Returns a <b> HTML element */
|
|
||||||
bold(): string;
|
|
||||||
|
|
||||||
/** Returns a <tt> HTML element */
|
|
||||||
fixed(): string
|
|
||||||
|
|
||||||
/** Returns a <font> HTML element and sets the color attribute value */
|
|
||||||
fontcolor(color: string): string
|
|
||||||
|
|
||||||
/** Returns a <font> HTML element and sets the size attribute value */
|
|
||||||
fontsize(size: number): string;
|
|
||||||
|
|
||||||
/** Returns a <font> HTML element and sets the size attribute value */
|
|
||||||
fontsize(size: string): string;
|
|
||||||
|
|
||||||
/** Returns an <i> HTML element */
|
|
||||||
italics(): string;
|
|
||||||
|
|
||||||
/** Returns an <a> HTML element and sets the href attribute value */
|
|
||||||
link(url: string): string;
|
|
||||||
|
|
||||||
/** Returns a <small> HTML element */
|
|
||||||
small(): string;
|
|
||||||
|
|
||||||
/** Returns a <strike> HTML element */
|
|
||||||
strike(): string;
|
|
||||||
|
|
||||||
/** Returns a <sub> HTML element */
|
|
||||||
sub(): string;
|
|
||||||
|
|
||||||
/** Returns a <sup> HTML element */
|
|
||||||
sup(): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): IterableIteratorShim<string>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ArrayConstructor {
|
|
||||||
/**
|
|
||||||
* Creates an array from an array-like object.
|
|
||||||
* @param arrayLike An array-like object to convert to an array.
|
|
||||||
* @param mapfn A mapping function to call on every element of the array.
|
|
||||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
|
||||||
*/
|
|
||||||
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array from an iterable object.
|
|
||||||
* @param iterable An iterable object to convert to an array.
|
|
||||||
* @param mapfn A mapping function to call on every element of the array.
|
|
||||||
* @param thisArg Value of 'this' used to invoke the mapfn.
|
|
||||||
*/
|
|
||||||
from<T, U>(iterable: IterableShim<T>, mapfn: (v: T, k: number) => U, thisArg?: any): Array<U>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array from an array-like object.
|
|
||||||
* @param arrayLike An array-like object to convert to an array.
|
|
||||||
*/
|
|
||||||
from<T>(arrayLike: ArrayLike<T>): Array<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an array from an iterable object.
|
|
||||||
* @param iterable An iterable object to convert to an array.
|
|
||||||
*/
|
|
||||||
from<T>(iterable: IterableShim<T>): Array<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a new array from a set of elements.
|
|
||||||
* @param items A set of elements to include in the new array object.
|
|
||||||
*/
|
|
||||||
of<T>(...items: T[]): Array<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Array<T> {
|
|
||||||
/**
|
|
||||||
* Returns the value of the first element in the array where predicate is true, and undefined
|
|
||||||
* otherwise.
|
|
||||||
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
||||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
||||||
* immediately returns that element value. Otherwise, find returns undefined.
|
|
||||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
||||||
* predicate. If it is not provided, undefined is used instead.
|
|
||||||
*/
|
|
||||||
find(predicate: (value: T, index: number, obj: Array<T>) => boolean, thisArg?: any): T;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the index of the first element in the array where predicate is true, and undefined
|
|
||||||
* otherwise.
|
|
||||||
* @param predicate find calls predicate once for each element of the array, in ascending
|
|
||||||
* order, until it finds one where predicate returns true. If such an element is found, find
|
|
||||||
* immediately returns that element value. Otherwise, find returns undefined.
|
|
||||||
* @param thisArg If provided, it will be used as the this value for each invocation of
|
|
||||||
* predicate. If it is not provided, undefined is used instead.
|
|
||||||
*/
|
|
||||||
findIndex(predicate: (value: T) => boolean, thisArg?: any): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the this object after filling the section identified by start and end with value
|
|
||||||
* @param value value to fill array section with
|
|
||||||
* @param start index to start filling the array at. If start is negative, it is treated as
|
|
||||||
* length+start where length is the length of the array.
|
|
||||||
* @param end index to stop filling the array at. If end is negative, it is treated as
|
|
||||||
* length+end.
|
|
||||||
*/
|
|
||||||
fill(value: T, start?: number, end?: number): T[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the this object after copying a section of the array identified by start and end
|
|
||||||
* to the same array starting at position target
|
|
||||||
* @param target If target is negative, it is treated as length+target where length is the
|
|
||||||
* length of the array.
|
|
||||||
* @param start If start is negative, it is treated as length+start. If end is negative, it
|
|
||||||
* is treated as length+end.
|
|
||||||
* @param end If not specified, length of the this object is used as its default value.
|
|
||||||
*/
|
|
||||||
copyWithin(target: number, start: number, end?: number): T[];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an array of key, value pairs for every entry in the array
|
|
||||||
*/
|
|
||||||
entries(): IterableIteratorShim<[number, T]>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an list of keys in the array
|
|
||||||
*/
|
|
||||||
keys(): IterableIteratorShim<number>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an list of values in the array
|
|
||||||
*/
|
|
||||||
values(): IterableIteratorShim<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Shim for an ES6 iterable. Not intended for direct use by user code.
|
|
||||||
*/
|
|
||||||
"_es6-shim iterator_"(): IterableIteratorShim<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface NumberConstructor {
|
|
||||||
/**
|
|
||||||
* The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1
|
|
||||||
* that is representable as a Number value, which is approximately:
|
|
||||||
* 2.2204460492503130808472633361816 x 10−16.
|
|
||||||
*/
|
|
||||||
EPSILON: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if passed value is finite.
|
|
||||||
* Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a
|
|
||||||
* number. Only finite values of the type number, result in true.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isFinite(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the value passed is an integer, false otherwise.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isInteger(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
|
|
||||||
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
|
|
||||||
* to a number. Only values of the type number, that are also NaN, result in true.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isNaN(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the value passed is a safe integer.
|
|
||||||
* @param number A numeric value.
|
|
||||||
*/
|
|
||||||
isSafeInteger(number: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value of the largest integer n such that n and n + 1 are both exactly representable as
|
|
||||||
* a Number value.
|
|
||||||
* The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1.
|
|
||||||
*/
|
|
||||||
MAX_SAFE_INTEGER: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The value of the smallest integer n such that n and n − 1 are both exactly representable as
|
|
||||||
* a Number value.
|
|
||||||
* The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).
|
|
||||||
*/
|
|
||||||
MIN_SAFE_INTEGER: number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts a string to a floating-point number.
|
|
||||||
* @param string A string that contains a floating-point number.
|
|
||||||
*/
|
|
||||||
parseFloat(string: string): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Converts A string to an integer.
|
|
||||||
* @param s A string to convert into a number.
|
|
||||||
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
|
|
||||||
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
|
|
||||||
* All other strings are considered decimal.
|
|
||||||
*/
|
|
||||||
parseInt(string: string, radix?: number): number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface ObjectConstructor {
|
|
||||||
/**
|
|
||||||
* Copy the values of all of the enumerable own properties from one or more source objects to a
|
|
||||||
* target object. Returns the target object.
|
|
||||||
* @param target The target object to copy to.
|
|
||||||
* @param sources One or more source objects to copy properties from.
|
|
||||||
*/
|
|
||||||
assign(target: any, ...sources: any[]): any;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the values are the same value, false otherwise.
|
|
||||||
* @param value1 The first value.
|
|
||||||
* @param value2 The second value.
|
|
||||||
*/
|
|
||||||
is(value1: any, value2: any): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the prototype of a specified object o to object proto or null. Returns the object o.
|
|
||||||
* @param o The object to change its prototype.
|
|
||||||
* @param proto The value of the new prototype or null.
|
|
||||||
* @remarks Requires `__proto__` support.
|
|
||||||
*/
|
|
||||||
setPrototypeOf(o: any, proto: any): any;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface RegExp {
|
|
||||||
/**
|
|
||||||
* Returns a string indicating the flags of the regular expression in question. This field is read-only.
|
|
||||||
* The characters in this string are sequenced and concatenated in the following order:
|
|
||||||
*
|
|
||||||
* - "g" for global
|
|
||||||
* - "i" for ignoreCase
|
|
||||||
* - "m" for multiline
|
|
||||||
* - "u" for unicode
|
|
||||||
* - "y" for sticky
|
|
||||||
*
|
|
||||||
* If no flags are set, the value is the empty string.
|
|
||||||
*/
|
|
||||||
flags: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Math {
|
|
||||||
/**
|
|
||||||
* Returns the number of leading zero bits in the 32-bit binary representation of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
clz32(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the result of 32-bit multiplication of two numbers.
|
|
||||||
* @param x First number
|
|
||||||
* @param y Second number
|
|
||||||
*/
|
|
||||||
imul(x: number, y: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the sign of the x, indicating whether x is positive, negative or zero.
|
|
||||||
* @param x The numeric expression to test
|
|
||||||
*/
|
|
||||||
sign(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the base 10 logarithm of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
log10(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the base 2 logarithm of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
log2(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the natural logarithm of 1 + x.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
log1p(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of
|
|
||||||
* the natural logarithms).
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
expm1(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hyperbolic cosine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
cosh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hyperbolic sine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
sinh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the hyperbolic tangent of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
tanh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the inverse hyperbolic cosine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
acosh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the inverse hyperbolic sine of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
asinh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the inverse hyperbolic tangent of a number.
|
|
||||||
* @param x A numeric expression that contains an angle measured in radians.
|
|
||||||
*/
|
|
||||||
atanh(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the square root of the sum of squares of its arguments.
|
|
||||||
* @param values Values to compute the square root for.
|
|
||||||
* If no arguments are passed, the result is +0.
|
|
||||||
* If there is only one argument, the result is the absolute value.
|
|
||||||
* If any argument is +Infinity or -Infinity, the result is +Infinity.
|
|
||||||
* If any argument is NaN, the result is NaN.
|
|
||||||
* If all arguments are either +0 or −0, the result is +0.
|
|
||||||
*/
|
|
||||||
hypot(...values: number[]): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the integral part of the a numeric expression, x, removing any fractional digits.
|
|
||||||
* If x is already an integer, the result is x.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
trunc(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the nearest single precision float representation of a number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
fround(x: number): number;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns an implementation-dependent approximation to the cube root of number.
|
|
||||||
* @param x A numeric expression.
|
|
||||||
*/
|
|
||||||
cbrt(x: number): number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PromiseLike<T> {
|
|
||||||
/**
|
|
||||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
||||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
|
||||||
* @param onrejected The callback to execute when the Promise is rejected.
|
|
||||||
* @returns A Promise for the completion of which ever callback is executed.
|
|
||||||
*/
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): PromiseLike<TResult>;
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): PromiseLike<TResult>;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents the completion of an asynchronous operation
|
|
||||||
*/
|
|
||||||
interface Promise<T> {
|
|
||||||
/**
|
|
||||||
* Attaches callbacks for the resolution and/or rejection of the Promise.
|
|
||||||
* @param onfulfilled The callback to execute when the Promise is resolved.
|
|
||||||
* @param onrejected The callback to execute when the Promise is rejected.
|
|
||||||
* @returns A Promise for the completion of which ever callback is executed.
|
|
||||||
*/
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => TResult | PromiseLike<TResult>): Promise<TResult>;
|
|
||||||
then<TResult>(onfulfilled?: (value: T) => TResult | PromiseLike<TResult>, onrejected?: (reason: any) => void): Promise<TResult>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Attaches a callback for only the rejection of the Promise.
|
|
||||||
* @param onrejected The callback to execute when the Promise is rejected.
|
|
||||||
* @returns A Promise for the completion of the callback.
|
|
||||||
*/
|
|
||||||
catch(onrejected?: (reason: any) => T | PromiseLike<T>): Promise<T>;
|
|
||||||
catch(onrejected?: (reason: any) => void): Promise<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface PromiseConstructor {
|
|
||||||
/**
|
|
||||||
* A reference to the prototype.
|
|
||||||
*/
|
|
||||||
prototype: Promise<any>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new Promise.
|
|
||||||
* @param executor A callback used to initialize the promise. This callback is passed two arguments:
|
|
||||||
* a resolve callback used resolve the promise with a value or the result of another promise,
|
|
||||||
* and a reject callback used to reject the promise with a provided reason or error.
|
|
||||||
*/
|
|
||||||
new <T>(executor: (resolve: (value?: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a Promise that is resolved with an array of results when all of the provided Promises
|
|
||||||
* resolve, or rejected when any Promise is rejected.
|
|
||||||
* @param values An array of Promises.
|
|
||||||
* @returns A new Promise.
|
|
||||||
*/
|
|
||||||
all<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T[]>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
|
|
||||||
* or rejected.
|
|
||||||
* @param values An array of Promises.
|
|
||||||
* @returns A new Promise.
|
|
||||||
*/
|
|
||||||
race<T>(values: IterableShim<T | PromiseLike<T>>): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new rejected promise for the provided reason.
|
|
||||||
* @param reason The reason the promise was rejected.
|
|
||||||
* @returns A new rejected Promise.
|
|
||||||
*/
|
|
||||||
reject(reason: any): Promise<void>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new rejected promise for the provided reason.
|
|
||||||
* @param reason The reason the promise was rejected.
|
|
||||||
* @returns A new rejected Promise.
|
|
||||||
*/
|
|
||||||
reject<T>(reason: any): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new resolved promise for the provided value.
|
|
||||||
* @param value A promise.
|
|
||||||
* @returns A promise whose internal state matches the provided promise.
|
|
||||||
*/
|
|
||||||
resolve<T>(value: T | PromiseLike<T>): Promise<T>;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates a new resolved promise .
|
|
||||||
* @returns A resolved promise.
|
|
||||||
*/
|
|
||||||
resolve(): Promise<void>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var Promise: PromiseConstructor;
|
|
||||||
|
|
||||||
interface Map<K, V> {
|
|
||||||
clear(): void;
|
|
||||||
delete(key: K): boolean;
|
|
||||||
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
|
|
||||||
get(key: K): V;
|
|
||||||
has(key: K): boolean;
|
|
||||||
set(key: K, value?: V): Map<K, V>;
|
|
||||||
size: number;
|
|
||||||
entries(): IterableIteratorShim<[K, V]>;
|
|
||||||
keys(): IterableIteratorShim<K>;
|
|
||||||
values(): IterableIteratorShim<V>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MapConstructor {
|
|
||||||
new <K, V>(): Map<K, V>;
|
|
||||||
new <K, V>(iterable: IterableShim<[K, V]>): Map<K, V>;
|
|
||||||
prototype: Map<any, any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var Map: MapConstructor;
|
|
||||||
|
|
||||||
interface Set<T> {
|
|
||||||
add(value: T): Set<T>;
|
|
||||||
clear(): void;
|
|
||||||
delete(value: T): boolean;
|
|
||||||
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
|
|
||||||
has(value: T): boolean;
|
|
||||||
size: number;
|
|
||||||
entries(): IterableIteratorShim<[T, T]>;
|
|
||||||
keys(): IterableIteratorShim<T>;
|
|
||||||
values(): IterableIteratorShim<T>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface SetConstructor {
|
|
||||||
new <T>(): Set<T>;
|
|
||||||
new <T>(iterable: IterableShim<T>): Set<T>;
|
|
||||||
prototype: Set<any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var Set: SetConstructor;
|
|
||||||
|
|
||||||
interface WeakMap<K, V> {
|
|
||||||
delete(key: K): boolean;
|
|
||||||
get(key: K): V;
|
|
||||||
has(key: K): boolean;
|
|
||||||
set(key: K, value?: V): WeakMap<K, V>;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface WeakMapConstructor {
|
|
||||||
new <K, V>(): WeakMap<K, V>;
|
|
||||||
new <K, V>(iterable: IterableShim<[K, V]>): WeakMap<K, V>;
|
|
||||||
prototype: WeakMap<any, any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var WeakMap: WeakMapConstructor;
|
|
||||||
|
|
||||||
interface WeakSet<T> {
|
|
||||||
add(value: T): WeakSet<T>;
|
|
||||||
delete(value: T): boolean;
|
|
||||||
has(value: T): boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface WeakSetConstructor {
|
|
||||||
new <T>(): WeakSet<T>;
|
|
||||||
new <T>(iterable: IterableShim<T>): WeakSet<T>;
|
|
||||||
prototype: WeakSet<any>;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare var WeakSet: WeakSetConstructor;
|
|
||||||
|
|
||||||
declare module Reflect {
|
|
||||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
|
||||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
|
||||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
|
||||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function enumerate(target: any): IterableIteratorShim<any>;
|
|
||||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
|
||||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
|
||||||
function getPrototypeOf(target: any): any;
|
|
||||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function isExtensible(target: any): boolean;
|
|
||||||
function ownKeys(target: any): Array<PropertyKey>;
|
|
||||||
function preventExtensions(target: any): boolean;
|
|
||||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
|
||||||
function setPrototypeOf(target: any, proto: any): boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
declare module "es6-shim" {
|
|
||||||
var String: StringConstructor;
|
|
||||||
var Array: ArrayConstructor;
|
|
||||||
var Number: NumberConstructor;
|
|
||||||
var Math: Math;
|
|
||||||
var Object: ObjectConstructor;
|
|
||||||
var Map: MapConstructor;
|
|
||||||
var Set: SetConstructor;
|
|
||||||
var WeakMap: WeakMapConstructor;
|
|
||||||
var WeakSet: WeakSetConstructor;
|
|
||||||
var Promise: PromiseConstructor;
|
|
||||||
module Reflect {
|
|
||||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
|
||||||
function construct(target: Function, argumentsList: ArrayLike<any>): any;
|
|
||||||
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
|
|
||||||
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function enumerate(target: any): Iterator<any>;
|
|
||||||
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
|
|
||||||
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
|
|
||||||
function getPrototypeOf(target: any): any;
|
|
||||||
function has(target: any, propertyKey: PropertyKey): boolean;
|
|
||||||
function isExtensible(target: any): boolean;
|
|
||||||
function ownKeys(target: any): Array<PropertyKey>;
|
|
||||||
function preventExtensions(target: any): boolean;
|
|
||||||
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
|
||||||
function setPrototypeOf(target: any, proto: any): boolean;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
497
typings/main/definitions/moment/index.d.ts
vendored
497
typings/main/definitions/moment/index.d.ts
vendored
@@ -1,497 +0,0 @@
|
|||||||
// Generated by typings
|
|
||||||
// Source: https://raw.githubusercontent.com/typed-typings/npm-moment/a4075cd50e63efbedd850f654594f293ab81a385/moment.d.ts
|
|
||||||
declare module '~moment/moment' {
|
|
||||||
// Type definitions for Moment.js 2.10.5
|
|
||||||
|
|
||||||
function moment(): moment.Moment;
|
|
||||||
function moment(date: number): moment.Moment;
|
|
||||||
function moment(date: number[]): moment.Moment;
|
|
||||||
function moment(date: string, format?: string, strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, format?: string, language?: string, strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, formats: string[], strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, formats: string[], language?: string, strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, specialFormat: () => void, strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, specialFormat: () => void, language?: string, strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, formatsIncludingSpecial: any[], strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: string, formatsIncludingSpecial: any[], language?: string, strict?: boolean): moment.Moment;
|
|
||||||
function moment(date: Date): moment.Moment;
|
|
||||||
function moment(date: moment.Moment): moment.Moment;
|
|
||||||
function moment(date: Object): moment.Moment;
|
|
||||||
|
|
||||||
namespace moment {
|
|
||||||
type formatFunction = () => string;
|
|
||||||
|
|
||||||
interface MomentDateObject {
|
|
||||||
years?: number;
|
|
||||||
/* One digit */
|
|
||||||
months?: number;
|
|
||||||
/* Day of the month */
|
|
||||||
date?: number;
|
|
||||||
hours?: number;
|
|
||||||
minutes?: number;
|
|
||||||
seconds?: number;
|
|
||||||
milliseconds?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MomentLanguageData extends BaseMomentLanguage {
|
|
||||||
/**
|
|
||||||
* @param formatType should be L, LL, LLL, LLLL.
|
|
||||||
*/
|
|
||||||
longDateFormat(formatType: string): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Duration {
|
|
||||||
humanize(withSuffix?: boolean): string;
|
|
||||||
|
|
||||||
as(units: string): number;
|
|
||||||
|
|
||||||
milliseconds(): number;
|
|
||||||
asMilliseconds(): number;
|
|
||||||
|
|
||||||
seconds(): number;
|
|
||||||
asSeconds(): number;
|
|
||||||
|
|
||||||
minutes(): number;
|
|
||||||
asMinutes(): number;
|
|
||||||
|
|
||||||
hours(): number;
|
|
||||||
asHours(): number;
|
|
||||||
|
|
||||||
days(): number;
|
|
||||||
asDays(): number;
|
|
||||||
|
|
||||||
months(): number;
|
|
||||||
asMonths(): number;
|
|
||||||
|
|
||||||
years(): number;
|
|
||||||
asYears(): number;
|
|
||||||
|
|
||||||
add(n: number, p: string): Duration;
|
|
||||||
add(n: number): Duration;
|
|
||||||
add(d: Duration): Duration;
|
|
||||||
|
|
||||||
subtract(n: number, p: string): Duration;
|
|
||||||
subtract(n: number): Duration;
|
|
||||||
subtract(d: Duration): Duration;
|
|
||||||
|
|
||||||
toISOString(): string;
|
|
||||||
toJSON(): string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MomentInput {
|
|
||||||
/** Year */
|
|
||||||
years?: number;
|
|
||||||
/** Year */
|
|
||||||
year?: number;
|
|
||||||
/** Year */
|
|
||||||
y?: number;
|
|
||||||
|
|
||||||
/** Month */
|
|
||||||
months?: number;
|
|
||||||
/** Month */
|
|
||||||
month?: number;
|
|
||||||
/** Month */
|
|
||||||
M?: number;
|
|
||||||
|
|
||||||
/** Week */
|
|
||||||
weeks?: number;
|
|
||||||
/** Week */
|
|
||||||
week?: number;
|
|
||||||
/** Week */
|
|
||||||
w?: number;
|
|
||||||
|
|
||||||
/** Day/Date */
|
|
||||||
days?: number;
|
|
||||||
/** Day/Date */
|
|
||||||
day?: number;
|
|
||||||
/** Day/Date */
|
|
||||||
date?: number;
|
|
||||||
/** Day/Date */
|
|
||||||
d?: number;
|
|
||||||
|
|
||||||
/** Hour */
|
|
||||||
hours?: number;
|
|
||||||
/** Hour */
|
|
||||||
hour?: number;
|
|
||||||
/** Hour */
|
|
||||||
h?: number;
|
|
||||||
|
|
||||||
/** Minute */
|
|
||||||
minutes?: number;
|
|
||||||
/** Minute */
|
|
||||||
minute?: number;
|
|
||||||
/** Minute */
|
|
||||||
m?: number;
|
|
||||||
|
|
||||||
/** Second */
|
|
||||||
seconds?: number;
|
|
||||||
/** Second */
|
|
||||||
second?: number;
|
|
||||||
/** Second */
|
|
||||||
s?: number;
|
|
||||||
|
|
||||||
/** Millisecond */
|
|
||||||
milliseconds?: number;
|
|
||||||
/** Millisecond */
|
|
||||||
millisecond?: number;
|
|
||||||
/** Millisecond */
|
|
||||||
ms?: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MomentCalendar {
|
|
||||||
lastDay?: string | formatFunction;
|
|
||||||
sameDay?: string | formatFunction;
|
|
||||||
nextDay?: string | formatFunction;
|
|
||||||
lastWeek?: string | formatFunction;
|
|
||||||
nextWeek?: string | formatFunction;
|
|
||||||
sameElse?: string | formatFunction;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MomentRelativeTime {
|
|
||||||
future: any;
|
|
||||||
past: any;
|
|
||||||
s: any;
|
|
||||||
m: any;
|
|
||||||
mm: any;
|
|
||||||
h: any;
|
|
||||||
hh: any;
|
|
||||||
d: any;
|
|
||||||
dd: any;
|
|
||||||
M: any;
|
|
||||||
MM: any;
|
|
||||||
y: any;
|
|
||||||
yy: any;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MomentLongDateFormat {
|
|
||||||
L: string;
|
|
||||||
LL: string;
|
|
||||||
LLL: string;
|
|
||||||
LLLL: string;
|
|
||||||
LT: string;
|
|
||||||
LTS: string;
|
|
||||||
l?: string;
|
|
||||||
ll?: string;
|
|
||||||
lll?: string;
|
|
||||||
llll?: string;
|
|
||||||
lt?: string;
|
|
||||||
lts?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface BaseMomentLanguage {
|
|
||||||
months?: any;
|
|
||||||
monthsShort?: any;
|
|
||||||
weekdays?: any;
|
|
||||||
weekdaysShort?: any;
|
|
||||||
weekdaysMin?: any;
|
|
||||||
relativeTime?: MomentRelativeTime;
|
|
||||||
meridiem?: (hour: number, minute: number, isLowercase: boolean) => string;
|
|
||||||
calendar?: MomentCalendar;
|
|
||||||
ordinal?: (num: number) => string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface MomentLanguage extends BaseMomentLanguage {
|
|
||||||
longDateFormat?: MomentLongDateFormat;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Moment {
|
|
||||||
format(format: string): string;
|
|
||||||
format(): string;
|
|
||||||
|
|
||||||
fromNow(withoutSuffix?: boolean): string;
|
|
||||||
|
|
||||||
startOf(unitOfTime: string): Moment;
|
|
||||||
endOf(unitOfTime: string): Moment;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by adding time. (deprecated in 2.8.0)
|
|
||||||
*
|
|
||||||
* @param unitOfTime the unit of time you want to add (eg "years" / "hours" etc)
|
|
||||||
* @param amount the amount you want to add
|
|
||||||
*/
|
|
||||||
add(unitOfTime: string, amount: number): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by adding time.
|
|
||||||
*
|
|
||||||
* @param amount the amount you want to add
|
|
||||||
* @param unitOfTime the unit of time you want to add (eg "years" / "hours" etc)
|
|
||||||
*/
|
|
||||||
add(amount: number, unitOfTime: string): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by adding time. Note that the order of arguments can be flipped.
|
|
||||||
*
|
|
||||||
* @param amount the amount you want to add
|
|
||||||
* @param unitOfTime the unit of time you want to add (eg "years" / "hours" etc)
|
|
||||||
*/
|
|
||||||
add(amount: string, unitOfTime: string): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by adding time.
|
|
||||||
*
|
|
||||||
* @param objectLiteral an object literal that describes multiple time units {days:7,months:1}
|
|
||||||
*/
|
|
||||||
add(objectLiteral: MomentInput): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by adding time.
|
|
||||||
*
|
|
||||||
* @param duration a length of time
|
|
||||||
*/
|
|
||||||
add(duration: Duration): Moment;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by subtracting time. (deprecated in 2.8.0)
|
|
||||||
*
|
|
||||||
* @param unitOfTime the unit of time you want to subtract (eg "years" / "hours" etc)
|
|
||||||
* @param amount the amount you want to subtract
|
|
||||||
*/
|
|
||||||
subtract(unitOfTime: string, amount: number): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by subtracting time.
|
|
||||||
*
|
|
||||||
* @param unitOfTime the unit of time you want to subtract (eg "years" / "hours" etc)
|
|
||||||
* @param amount the amount you want to subtract
|
|
||||||
*/
|
|
||||||
subtract(amount: number, unitOfTime: string): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by subtracting time. Note that the order of arguments can be flipped.
|
|
||||||
*
|
|
||||||
* @param amount the amount you want to add
|
|
||||||
* @param unitOfTime the unit of time you want to subtract (eg "years" / "hours" etc)
|
|
||||||
*/
|
|
||||||
subtract(amount: string, unitOfTime: string): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by subtracting time.
|
|
||||||
*
|
|
||||||
* @param objectLiteral an object literal that describes multiple time units {days:7,months:1}
|
|
||||||
*/
|
|
||||||
subtract(objectLiteral: MomentInput): Moment;
|
|
||||||
/**
|
|
||||||
* Mutates the original moment by subtracting time.
|
|
||||||
*
|
|
||||||
* @param duration a length of time
|
|
||||||
*/
|
|
||||||
subtract(duration: Duration): Moment;
|
|
||||||
|
|
||||||
calendar(): string;
|
|
||||||
calendar(start: Moment): string;
|
|
||||||
calendar(start: Moment, formats: MomentCalendar): string;
|
|
||||||
|
|
||||||
clone(): Moment;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Unix timestamp, or milliseconds since the epoch.
|
|
||||||
*/
|
|
||||||
valueOf(): number;
|
|
||||||
|
|
||||||
local(): Moment; // current date/time in local mode
|
|
||||||
|
|
||||||
utc(): Moment; // current date/time in UTC mode
|
|
||||||
|
|
||||||
isValid(): boolean;
|
|
||||||
invalidAt(): number;
|
|
||||||
|
|
||||||
year(y: number): Moment;
|
|
||||||
year(): number;
|
|
||||||
quarter(): number;
|
|
||||||
quarter(q: number): Moment;
|
|
||||||
month(M: number): Moment;
|
|
||||||
month(M: string): Moment;
|
|
||||||
month(): number;
|
|
||||||
day(d: number): Moment;
|
|
||||||
day(d: string): Moment;
|
|
||||||
day(): number;
|
|
||||||
date(d: number): Moment;
|
|
||||||
date(): number;
|
|
||||||
hour(h: number): Moment;
|
|
||||||
hour(): number;
|
|
||||||
hours(h: number): Moment;
|
|
||||||
hours(): number;
|
|
||||||
minute(m: number): Moment;
|
|
||||||
minute(): number;
|
|
||||||
minutes(m: number): Moment;
|
|
||||||
minutes(): number;
|
|
||||||
second(s: number): Moment;
|
|
||||||
second(): number;
|
|
||||||
seconds(s: number): Moment;
|
|
||||||
seconds(): number;
|
|
||||||
millisecond(ms: number): Moment;
|
|
||||||
millisecond(): number;
|
|
||||||
milliseconds(ms: number): Moment;
|
|
||||||
milliseconds(): number;
|
|
||||||
weekday(): number;
|
|
||||||
weekday(d: number): Moment;
|
|
||||||
isoWeekday(): number;
|
|
||||||
isoWeekday(d: number): Moment;
|
|
||||||
weekYear(): number;
|
|
||||||
weekYear(d: number): Moment;
|
|
||||||
isoWeekYear(): number;
|
|
||||||
isoWeekYear(d: number): Moment;
|
|
||||||
week(): number;
|
|
||||||
week(d: number): Moment;
|
|
||||||
weeks(): number;
|
|
||||||
weeks(d: number): Moment;
|
|
||||||
isoWeek(): number;
|
|
||||||
isoWeek(d: number): Moment;
|
|
||||||
isoWeeks(): number;
|
|
||||||
isoWeeks(d: number): Moment;
|
|
||||||
weeksInYear(): number;
|
|
||||||
isoWeeksInYear(): number;
|
|
||||||
dayOfYear(): number;
|
|
||||||
dayOfYear(d: number): Moment;
|
|
||||||
|
|
||||||
from(f: Moment | string | number | Date | number[], suffix?: boolean): string;
|
|
||||||
to(f: Moment | string | number | Date | number[], suffix?: boolean): string;
|
|
||||||
toNow(withoutPrefix?: boolean): string;
|
|
||||||
|
|
||||||
diff(b: Moment): number;
|
|
||||||
diff(b: Moment, unitOfTime: string): number;
|
|
||||||
diff(b: Moment, unitOfTime: string, round: boolean): number;
|
|
||||||
|
|
||||||
toArray(): number[];
|
|
||||||
toDate(): Date;
|
|
||||||
toISOString(): string;
|
|
||||||
toJSON(): string;
|
|
||||||
unix(): number;
|
|
||||||
|
|
||||||
isLeapYear(): boolean;
|
|
||||||
zone(): number;
|
|
||||||
zone(b: number): Moment;
|
|
||||||
zone(b: string): Moment;
|
|
||||||
utcOffset(): number;
|
|
||||||
utcOffset(b: number): Moment;
|
|
||||||
utcOffset(b: string): Moment;
|
|
||||||
daysInMonth(): number;
|
|
||||||
isDST(): boolean;
|
|
||||||
|
|
||||||
isBefore(): boolean;
|
|
||||||
isBefore(b: Moment | string | number | Date | number[], granularity?: string): boolean;
|
|
||||||
|
|
||||||
isAfter(): boolean;
|
|
||||||
isAfter(b: Moment | string | number | Date | number[], granularity?: string): boolean;
|
|
||||||
|
|
||||||
isSame(b: Moment | string | number | Date | number[], granularity?: string): boolean;
|
|
||||||
isBetween(a: Moment | string | number | Date | number[], b: Moment | string | number | Date | number[], granularity?: string): boolean;
|
|
||||||
|
|
||||||
// Deprecated as of 2.8.0.
|
|
||||||
lang(language: string): Moment;
|
|
||||||
lang(reset: boolean): Moment;
|
|
||||||
lang(): MomentLanguage;
|
|
||||||
|
|
||||||
locale(language: string): Moment;
|
|
||||||
locale(reset: boolean): Moment;
|
|
||||||
locale(): string;
|
|
||||||
|
|
||||||
localeData(language: string): Moment;
|
|
||||||
localeData(reset: boolean): Moment;
|
|
||||||
localeData(): MomentLanguage;
|
|
||||||
|
|
||||||
// Deprecated as of 2.7.0.
|
|
||||||
max(date: Moment | string | number | Date | any[]): Moment;
|
|
||||||
max(date: string, format: string): Moment;
|
|
||||||
|
|
||||||
// Deprecated as of 2.7.0.
|
|
||||||
min(date: Moment | string | number | Date | any[]): Moment;
|
|
||||||
min(date: string, format: string): Moment;
|
|
||||||
|
|
||||||
get(unit: string): number;
|
|
||||||
set(unit: string, value: number): Moment;
|
|
||||||
set(objectLiteral: MomentInput): Moment;
|
|
||||||
|
|
||||||
/*This returns an object containing year, month, day-of-month, hour, minute, seconds, milliseconds.*/
|
|
||||||
//Works with version 2.10.5+
|
|
||||||
toObject(): MomentDateObject;
|
|
||||||
}
|
|
||||||
|
|
||||||
export var version: string;
|
|
||||||
export var fn: Moment;
|
|
||||||
|
|
||||||
export function utc(): Moment;
|
|
||||||
export function utc(date: number): Moment;
|
|
||||||
export function utc(date: number[]): Moment;
|
|
||||||
export function utc(date: string, format?: string, strict?: boolean): Moment;
|
|
||||||
export function utc(date: string, format?: string, language?: string, strict?: boolean): Moment;
|
|
||||||
export function utc(date: string, formats: string[], strict?: boolean): Moment;
|
|
||||||
export function utc(date: string, formats: string[], language?: string, strict?: boolean): Moment;
|
|
||||||
export function utc(date: Date): Moment;
|
|
||||||
export function utc(date: Moment): Moment;
|
|
||||||
export function utc(date: Object): Moment;
|
|
||||||
|
|
||||||
export function unix(timestamp: number): Moment;
|
|
||||||
|
|
||||||
export function invalid(parsingFlags?: Object): Moment;
|
|
||||||
export function isMoment(): boolean;
|
|
||||||
export function isMoment(m: any): boolean;
|
|
||||||
export function isDate(m: any): boolean;
|
|
||||||
export function isDuration(): boolean;
|
|
||||||
export function isDuration(d: any): boolean;
|
|
||||||
|
|
||||||
// Deprecated in 2.8.0.
|
|
||||||
export function lang(language?: string): string;
|
|
||||||
export function lang(language?: string, definition?: MomentLanguage): string;
|
|
||||||
|
|
||||||
export function locale(language?: string): string;
|
|
||||||
export function locale(language?: string[]): string;
|
|
||||||
export function locale(language?: string, definition?: MomentLanguage): string;
|
|
||||||
|
|
||||||
export function localeData(language?: string): MomentLanguageData;
|
|
||||||
|
|
||||||
export var longDateFormat: any;
|
|
||||||
export var relativeTime: any;
|
|
||||||
export var meridiem: (hour: number, minute: number, isLowercase: boolean) => string;
|
|
||||||
export var calendar: any;
|
|
||||||
export var ordinal: (num: number) => string;
|
|
||||||
|
|
||||||
export function duration(milliseconds: Number): Duration;
|
|
||||||
export function duration(num: Number, unitOfTime: string): Duration;
|
|
||||||
export function duration(input: MomentInput): Duration;
|
|
||||||
export function duration(object: any): Duration;
|
|
||||||
export function duration(): Duration;
|
|
||||||
|
|
||||||
export function parseZone(date: string): Moment;
|
|
||||||
|
|
||||||
export function months(): string[];
|
|
||||||
export function months(index: number): string;
|
|
||||||
export function months(format: string): string[];
|
|
||||||
export function months(format: string, index: number): string;
|
|
||||||
export function monthsShort(): string[];
|
|
||||||
export function monthsShort(index: number): string;
|
|
||||||
export function monthsShort(format: string): string[];
|
|
||||||
export function monthsShort(format: string, index: number): string;
|
|
||||||
|
|
||||||
export function weekdays(): string[];
|
|
||||||
export function weekdays(index: number): string;
|
|
||||||
export function weekdays(format: string): string[];
|
|
||||||
export function weekdays(format: string, index: number): string;
|
|
||||||
export function weekdaysShort(): string[];
|
|
||||||
export function weekdaysShort(index: number): string;
|
|
||||||
export function weekdaysShort(format: string): string[];
|
|
||||||
export function weekdaysShort(format: string, index: number): string;
|
|
||||||
export function weekdaysMin(): string[];
|
|
||||||
export function weekdaysMin(index: number): string;
|
|
||||||
export function weekdaysMin(format: string): string[];
|
|
||||||
export function weekdaysMin(format: string, index: number): string;
|
|
||||||
|
|
||||||
export function min(...moments: Moment[]): Moment;
|
|
||||||
export function max(...moments: Moment[]): Moment;
|
|
||||||
|
|
||||||
export function normalizeUnits(unit: string): string;
|
|
||||||
export function relativeTimeThreshold(threshold: string): number | boolean;
|
|
||||||
export function relativeTimeThreshold(threshold: string, limit: number): boolean;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constant used to enable explicit ISO_8601 format parsing.
|
|
||||||
*/
|
|
||||||
export function ISO_8601(): void;
|
|
||||||
|
|
||||||
export var defaultFormat: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export = moment;
|
|
||||||
}
|
|
||||||
declare module 'moment/moment' {
|
|
||||||
import main = require('~moment/moment');
|
|
||||||
export = main;
|
|
||||||
}
|
|
||||||
declare module 'moment' {
|
|
||||||
import main = require('~moment/moment');
|
|
||||||
export = main;
|
|
||||||
}
|
|
||||||
@@ -7,6 +7,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||||
<meta name="format-detection" content="telephone=no">
|
<meta name="format-detection" content="telephone=no">
|
||||||
<meta name="msapplication-tap-highlight" content="no">
|
<meta name="msapplication-tap-highlight" content="no">
|
||||||
|
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBxjWm2OvHOw-MKp51HUtjrfWOb2MQW_PA&libraries=places"></script>
|
||||||
|
|
||||||
<link ios-href="build/css/app.ios.css" rel="stylesheet">
|
<link ios-href="build/css/app.ios.css" rel="stylesheet">
|
||||||
<link md-href="build/css/app.md.css" rel="stylesheet">
|
<link md-href="build/css/app.md.css" rel="stylesheet">
|
||||||
@@ -28,4 +29,3 @@
|
|||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user