├── .editorconfig ├── .gitignore ├── README.md ├── package.json ├── src ├── components │ ├── app.component.html │ └── app.component.ts ├── index.html ├── main.ts └── vendor.ts ├── tsconfig.json ├── tslint.json ├── typings.json ├── typings ├── browser.d.ts ├── browser │ ├── ambient │ │ ├── angular-protractor │ │ │ └── index.d.ts │ │ ├── es6-shim │ │ │ └── index.d.ts │ │ ├── hammerjs │ │ │ └── index.d.ts │ │ ├── jasmine │ │ │ └── index.d.ts │ │ ├── node │ │ │ └── index.d.ts │ │ ├── selenium-webdriver │ │ │ └── index.d.ts │ │ └── webpack │ │ │ └── index.d.ts │ └── definitions │ │ └── es6-promise │ │ └── index.d.ts ├── main.d.ts └── main │ ├── ambient │ ├── angular-protractor │ │ └── index.d.ts │ ├── es6-shim │ │ └── index.d.ts │ ├── hammerjs │ │ └── index.d.ts │ ├── jasmine │ │ └── index.d.ts │ ├── node │ │ └── index.d.ts │ ├── selenium-webdriver │ │ └── index.d.ts │ └── webpack │ │ └── index.d.ts │ └── definitions │ └── es6-promise │ └── index.d.ts └── webpack.config.js /.editorconfig: -------------------------------------------------------------------------------- 1 | # @AngularClass 2 | # http://editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | indent_style = space 9 | indent_size = 2 10 | end_of_line = lf 11 | insert_final_newline = true 12 | trim_trailing_whitespace = true 13 | 14 | [*.md] 15 | insert_final_newline = false 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## angular2-webpack-starter-minimum 2 | 3 | ### Install & start 4 | 5 | ``` 6 | $ git clone https://github.com/shumpei/angular2-webpack-starter-minimum 7 | $ cd angular2-webpack-starter-minimum 8 | $ npm install 9 | $ npm start 10 | ``` 11 | 12 | And visit [http://localhost:8080/webpack-dev-server/](http://localhost:8080/webpack-dev-server/), you will see the simple output. 13 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ng-japan-example", 3 | "version": "0.0.1", 4 | "description": "ng-japan用のサンプルアプリケーション", 5 | "author": "Shumpei Shiraishi ", 6 | "license": "MIT", 7 | "scripts": { 8 | "clean": "rimraf dist", 9 | "start": "webpack-dev-server -d", 10 | "typings": "typings", 11 | "webpack": "webpack" 12 | }, 13 | "dependencies": { 14 | "angular2": "2.0.0-beta.9", 15 | "autoprefixer": "^6.3.3", 16 | "copy-webpack-plugin": "^1.1.1", 17 | "core-js": "^2.1.5", 18 | "html-webpack-plugin": "^2.10.0", 19 | "ie-shim": "^0.1.0", 20 | "node-sass": "^3.4.2", 21 | "rxjs": "5.0.0-beta.2", 22 | "sass-loader": "^3.2.0", 23 | "zone.js": "0.5.15" 24 | }, 25 | "devDependencies": { 26 | "es6-promise": "^3.1.2", 27 | "es6-shim": "^0.33.3", 28 | "es7-reflect-metadata": "^1.6.0", 29 | "awesome-typescript-loader": "^0.16.0-rc.0", 30 | "css-loader": "^0.23.1", 31 | "ie-shim": "^0.1.0", 32 | "raw-loader": "0.5.1", 33 | "rimraf": "^2.5.2", 34 | "style-loader": "^0.13.0", 35 | "tslint": "^3.5.0", 36 | "tslint-loader": "^2.1.3", 37 | "typescript": "~1.8.7", 38 | "typings": "^0.7.8", 39 | "webpack": "^1.12.14", 40 | "webpack-dev-server": "^1.14.1" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/components/app.component.html: -------------------------------------------------------------------------------- 1 |

My first Angular2 app!

2 | -------------------------------------------------------------------------------- /src/components/app.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from 'angular2/core'; 2 | 3 | @Component({ 4 | selector: 'my-app', 5 | templateUrl: '/src/components/app.component.html' 6 | }) 7 | export class AppComponent { 8 | } 9 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ng-japan-example 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | Loading... 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main.ts: -------------------------------------------------------------------------------- 1 | import {bootstrap} from 'angular2/platform/browser'; 2 | import {AppComponent} from './components/app.component'; 3 | 4 | bootstrap(AppComponent); 5 | -------------------------------------------------------------------------------- /src/vendor.ts: -------------------------------------------------------------------------------- 1 | import 'es6-promise'; 2 | import 'es6-shim'; 3 | import 'reflect-metadata'; 4 | import 'ie-shim'; 5 | import 'angular2/bundles/angular2-polyfills'; 6 | import 'angular2/platform/browser'; 7 | import 'angular2/platform/common_dom'; 8 | import 'angular2/core'; 9 | import 'angular2/router'; 10 | import 'angular2/http'; 11 | import 'rxjs/Rx'; 12 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "commonjs", 5 | "emitDecoratorMetadata": true, 6 | "experimentalDecorators": true, 7 | "sourceMap": true 8 | }, 9 | "exclude": [ 10 | "node_modules", 11 | "typings/main.d.ts", 12 | "typings/main" 13 | ], 14 | "filesGlob": [ 15 | "./src/**/*.ts", 16 | "./test/**/*.ts", 17 | "!./node_modules/**/*.ts", 18 | "src/custom-typings.d.ts", 19 | "typings/browser.d.ts" 20 | ], 21 | "awesomeTypescriptLoaderOptions": { 22 | "useCache": true, 23 | "resolveGlobs": true, 24 | "forkChecker": true, 25 | "cacheDirectory": "node_modules/.awesome-typescript-loader-cache" 26 | }, 27 | "compileOnSave": false, 28 | "buildOnSave": false, 29 | "atom": { "rewriteTsconfig": false } 30 | } 31 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/ng2lint/dist/src" 4 | ], 5 | "rules": { 6 | "component-selector-name": [true, "kebab-case"], 7 | "component-selector-type": [true, "element"], 8 | "host-parameter-decorator": true, 9 | "input-parameter-decorator": true, 10 | "output-parameter-decorator": true, 11 | "attribute-parameter-decorator": false, 12 | "input-property-directive": true, 13 | "output-property-directive": true, 14 | 15 | "class-name": true, 16 | "curly": false, 17 | "eofline": true, 18 | "indent": [ 19 | true, 20 | "spaces" 21 | ], 22 | "max-line-length": [ 23 | true, 24 | 100 25 | ], 26 | "member-ordering": [ 27 | true, 28 | "public-before-private", 29 | "static-before-instance", 30 | "variables-before-functions" 31 | ], 32 | "no-arg": true, 33 | "no-construct": true, 34 | "no-duplicate-key": true, 35 | "no-duplicate-variable": true, 36 | "no-empty": false, 37 | "no-eval": true, 38 | "trailing-comma": true, 39 | "no-trailing-whitespace": true, 40 | "no-unused-expression": true, 41 | "no-unused-variable": false, 42 | "no-unreachable": true, 43 | "no-use-before-declare": true, 44 | "one-line": [ 45 | true, 46 | "check-open-brace", 47 | "check-catch", 48 | "check-else", 49 | "check-whitespace" 50 | ], 51 | "quotemark": [ 52 | true, 53 | "single" 54 | ], 55 | "semicolon": true, 56 | "triple-equals": [ 57 | true, 58 | "allow-null-check" 59 | ], 60 | "variable-name": false, 61 | "whitespace": [ 62 | true, 63 | "check-branch", 64 | "check-decl", 65 | "check-operator", 66 | "check-separator", 67 | "check-type" 68 | ] 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /typings.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "es6-promise": "github:typed-typings/npm-es6-promise#fb04188767acfec1defd054fc8024fafa5cd4de7" 4 | }, 5 | "devDependencies": {}, 6 | "ambientDependencies": { 7 | "angular-protractor": "github:DefinitelyTyped/DefinitelyTyped/angular-protractor/angular-protractor.d.ts#64b25f63f0ec821040a5d3e049a976865062ed9d", 8 | "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#6697d6f7dadbf5773cb40ecda35a76027e0783b2", 9 | "hammerjs": "github:DefinitelyTyped/DefinitelyTyped/hammerjs/hammerjs.d.ts#74a4dfc1bc2dfadec47b8aae953b28546cb9c6b7", 10 | "jasmine": "github:DefinitelyTyped/DefinitelyTyped/jasmine/jasmine.d.ts#4b36b94d5910aa8a4d20bdcd5bd1f9ae6ad18d3c", 11 | "node": "github:DefinitelyTyped/DefinitelyTyped/node/node.d.ts#8cf8164641be73e8f1e652c2a5b967c7210b6729", 12 | "selenium-webdriver": "github:DefinitelyTyped/DefinitelyTyped/selenium-webdriver/selenium-webdriver.d.ts#a83677ed13add14c2ab06c7325d182d0ba2784ea", 13 | "webpack": "github:DefinitelyTyped/DefinitelyTyped/webpack/webpack.d.ts#95c02169ba8fa58ac1092422efbd2e3174a206f4" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /typings/browser.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | /// 8 | /// 9 | -------------------------------------------------------------------------------- /typings/browser/ambient/es6-shim/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/6697d6f7dadbf5773cb40ecda35a76027e0783b2/es6-shim/es6-shim.d.ts 3 | // Type definitions for es6-shim v0.31.2 4 | // Project: https://github.com/paulmillr/es6-shim 5 | // Definitions by: Ron Buckton 6 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 7 | 8 | declare type PropertyKey = string | number | symbol; 9 | 10 | interface IteratorResult { 11 | done: boolean; 12 | value?: T; 13 | } 14 | 15 | interface IterableShim { 16 | /** 17 | * Shim for an ES6 iterable. Not intended for direct use by user code. 18 | */ 19 | "_es6-shim iterator_"(): Iterator; 20 | } 21 | 22 | interface Iterator { 23 | next(value?: any): IteratorResult; 24 | return?(value?: any): IteratorResult; 25 | throw?(e?: any): IteratorResult; 26 | } 27 | 28 | interface IterableIteratorShim extends IterableShim, Iterator { 29 | /** 30 | * Shim for an ES6 iterable iterator. Not intended for direct use by user code. 31 | */ 32 | "_es6-shim iterator_"(): IterableIteratorShim; 33 | } 34 | 35 | interface StringConstructor { 36 | /** 37 | * Return the String value whose elements are, in order, the elements in the List elements. 38 | * If length is 0, the empty string is returned. 39 | */ 40 | fromCodePoint(...codePoints: number[]): string; 41 | 42 | /** 43 | * String.raw is intended for use as a tag function of a Tagged Template String. When called 44 | * as such the first argument will be a well formed template call site object and the rest 45 | * parameter will contain the substitution values. 46 | * @param template A well-formed template string call site representation. 47 | * @param substitutions A set of substitution values. 48 | */ 49 | raw(template: TemplateStringsArray, ...substitutions: any[]): string; 50 | } 51 | 52 | interface String { 53 | /** 54 | * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point 55 | * value of the UTF-16 encoded code point starting at the string element at position pos in 56 | * the String resulting from converting this object to a String. 57 | * If there is no element at that position, the result is undefined. 58 | * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. 59 | */ 60 | codePointAt(pos: number): number; 61 | 62 | /** 63 | * Returns true if searchString appears as a substring of the result of converting this 64 | * object to a String, at one or more positions that are 65 | * greater than or equal to position; otherwise, returns false. 66 | * @param searchString search string 67 | * @param position If position is undefined, 0 is assumed, so as to search all of the String. 68 | */ 69 | includes(searchString: string, position?: number): boolean; 70 | 71 | /** 72 | * Returns true if the sequence of elements of searchString converted to a String is the 73 | * same as the corresponding elements of this object (converted to a String) starting at 74 | * endPosition – length(this). Otherwise returns false. 75 | */ 76 | endsWith(searchString: string, endPosition?: number): boolean; 77 | 78 | /** 79 | * Returns a String value that is made from count copies appended together. If count is 0, 80 | * T is the empty String is returned. 81 | * @param count number of copies to append 82 | */ 83 | repeat(count: number): string; 84 | 85 | /** 86 | * Returns true if the sequence of elements of searchString converted to a String is the 87 | * same as the corresponding elements of this object (converted to a String) starting at 88 | * position. Otherwise returns false. 89 | */ 90 | startsWith(searchString: string, position?: number): boolean; 91 | 92 | /** 93 | * Returns an HTML anchor element and sets the name attribute to the text value 94 | * @param name 95 | */ 96 | anchor(name: string): string; 97 | 98 | /** Returns a HTML element */ 99 | big(): string; 100 | 101 | /** Returns a HTML element */ 102 | blink(): string; 103 | 104 | /** Returns a HTML element */ 105 | bold(): string; 106 | 107 | /** Returns a HTML element */ 108 | fixed(): string 109 | 110 | /** Returns a HTML element and sets the color attribute value */ 111 | fontcolor(color: string): string 112 | 113 | /** Returns a HTML element and sets the size attribute value */ 114 | fontsize(size: number): string; 115 | 116 | /** Returns a HTML element and sets the size attribute value */ 117 | fontsize(size: string): string; 118 | 119 | /** Returns an HTML element */ 120 | italics(): string; 121 | 122 | /** Returns an HTML element and sets the href attribute value */ 123 | link(url: string): string; 124 | 125 | /** Returns a HTML element */ 126 | small(): string; 127 | 128 | /** Returns a HTML element */ 129 | strike(): string; 130 | 131 | /** Returns a HTML element */ 132 | sub(): string; 133 | 134 | /** Returns a HTML element */ 135 | sup(): string; 136 | 137 | /** 138 | * Shim for an ES6 iterable. Not intended for direct use by user code. 139 | */ 140 | "_es6-shim iterator_"(): IterableIteratorShim; 141 | } 142 | 143 | interface ArrayConstructor { 144 | /** 145 | * Creates an array from an array-like object. 146 | * @param arrayLike An array-like object to convert to an array. 147 | * @param mapfn A mapping function to call on every element of the array. 148 | * @param thisArg Value of 'this' used to invoke the mapfn. 149 | */ 150 | from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; 151 | 152 | /** 153 | * Creates an array from an iterable object. 154 | * @param iterable An iterable object to convert to an array. 155 | * @param mapfn A mapping function to call on every element of the array. 156 | * @param thisArg Value of 'this' used to invoke the mapfn. 157 | */ 158 | from(iterable: IterableShim, mapfn: (v: T, k: number) => U, thisArg?: any): Array; 159 | 160 | /** 161 | * Creates an array from an array-like object. 162 | * @param arrayLike An array-like object to convert to an array. 163 | */ 164 | from(arrayLike: ArrayLike): Array; 165 | 166 | /** 167 | * Creates an array from an iterable object. 168 | * @param iterable An iterable object to convert to an array. 169 | */ 170 | from(iterable: IterableShim): Array; 171 | 172 | /** 173 | * Returns a new array from a set of elements. 174 | * @param items A set of elements to include in the new array object. 175 | */ 176 | of(...items: T[]): Array; 177 | } 178 | 179 | interface Array { 180 | /** 181 | * Returns the value of the first element in the array where predicate is true, and undefined 182 | * otherwise. 183 | * @param predicate find calls predicate once for each element of the array, in ascending 184 | * order, until it finds one where predicate returns true. If such an element is found, find 185 | * immediately returns that element value. Otherwise, find returns undefined. 186 | * @param thisArg If provided, it will be used as the this value for each invocation of 187 | * predicate. If it is not provided, undefined is used instead. 188 | */ 189 | find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; 190 | 191 | /** 192 | * Returns the index of the first element in the array where predicate is true, and undefined 193 | * otherwise. 194 | * @param predicate find calls predicate once for each element of the array, in ascending 195 | * order, until it finds one where predicate returns true. If such an element is found, find 196 | * immediately returns that element value. Otherwise, find returns undefined. 197 | * @param thisArg If provided, it will be used as the this value for each invocation of 198 | * predicate. If it is not provided, undefined is used instead. 199 | */ 200 | findIndex(predicate: (value: T) => boolean, thisArg?: any): number; 201 | 202 | /** 203 | * Returns the this object after filling the section identified by start and end with value 204 | * @param value value to fill array section with 205 | * @param start index to start filling the array at. If start is negative, it is treated as 206 | * length+start where length is the length of the array. 207 | * @param end index to stop filling the array at. If end is negative, it is treated as 208 | * length+end. 209 | */ 210 | fill(value: T, start?: number, end?: number): T[]; 211 | 212 | /** 213 | * Returns the this object after copying a section of the array identified by start and end 214 | * to the same array starting at position target 215 | * @param target If target is negative, it is treated as length+target where length is the 216 | * length of the array. 217 | * @param start If start is negative, it is treated as length+start. If end is negative, it 218 | * is treated as length+end. 219 | * @param end If not specified, length of the this object is used as its default value. 220 | */ 221 | copyWithin(target: number, start: number, end?: number): T[]; 222 | 223 | /** 224 | * Returns an array of key, value pairs for every entry in the array 225 | */ 226 | entries(): IterableIteratorShim<[number, T]>; 227 | 228 | /** 229 | * Returns an list of keys in the array 230 | */ 231 | keys(): IterableIteratorShim; 232 | 233 | /** 234 | * Returns an list of values in the array 235 | */ 236 | values(): IterableIteratorShim; 237 | 238 | /** 239 | * Shim for an ES6 iterable. Not intended for direct use by user code. 240 | */ 241 | "_es6-shim iterator_"(): IterableIteratorShim; 242 | } 243 | 244 | interface NumberConstructor { 245 | /** 246 | * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 247 | * that is representable as a Number value, which is approximately: 248 | * 2.2204460492503130808472633361816 x 10‍−‍16. 249 | */ 250 | EPSILON: number; 251 | 252 | /** 253 | * Returns true if passed value is finite. 254 | * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a 255 | * number. Only finite values of the type number, result in true. 256 | * @param number A numeric value. 257 | */ 258 | isFinite(number: number): boolean; 259 | 260 | /** 261 | * Returns true if the value passed is an integer, false otherwise. 262 | * @param number A numeric value. 263 | */ 264 | isInteger(number: number): boolean; 265 | 266 | /** 267 | * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a 268 | * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter 269 | * to a number. Only values of the type number, that are also NaN, result in true. 270 | * @param number A numeric value. 271 | */ 272 | isNaN(number: number): boolean; 273 | 274 | /** 275 | * Returns true if the value passed is a safe integer. 276 | * @param number A numeric value. 277 | */ 278 | isSafeInteger(number: number): boolean; 279 | 280 | /** 281 | * The value of the largest integer n such that n and n + 1 are both exactly representable as 282 | * a Number value. 283 | * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. 284 | */ 285 | MAX_SAFE_INTEGER: number; 286 | 287 | /** 288 | * The value of the smallest integer n such that n and n − 1 are both exactly representable as 289 | * a Number value. 290 | * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). 291 | */ 292 | MIN_SAFE_INTEGER: number; 293 | 294 | /** 295 | * Converts a string to a floating-point number. 296 | * @param string A string that contains a floating-point number. 297 | */ 298 | parseFloat(string: string): number; 299 | 300 | /** 301 | * Converts A string to an integer. 302 | * @param s A string to convert into a number. 303 | * @param radix A value between 2 and 36 that specifies the base of the number in numString. 304 | * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. 305 | * All other strings are considered decimal. 306 | */ 307 | parseInt(string: string, radix?: number): number; 308 | } 309 | 310 | interface ObjectConstructor { 311 | /** 312 | * Copy the values of all of the enumerable own properties from one or more source objects to a 313 | * target object. Returns the target object. 314 | * @param target The target object to copy to. 315 | * @param sources One or more source objects to copy properties from. 316 | */ 317 | assign(target: any, ...sources: any[]): any; 318 | 319 | /** 320 | * Returns true if the values are the same value, false otherwise. 321 | * @param value1 The first value. 322 | * @param value2 The second value. 323 | */ 324 | is(value1: any, value2: any): boolean; 325 | 326 | /** 327 | * Sets the prototype of a specified object o to object proto or null. Returns the object o. 328 | * @param o The object to change its prototype. 329 | * @param proto The value of the new prototype or null. 330 | * @remarks Requires `__proto__` support. 331 | */ 332 | setPrototypeOf(o: any, proto: any): any; 333 | } 334 | 335 | interface RegExp { 336 | /** 337 | * Returns a string indicating the flags of the regular expression in question. This field is read-only. 338 | * The characters in this string are sequenced and concatenated in the following order: 339 | * 340 | * - "g" for global 341 | * - "i" for ignoreCase 342 | * - "m" for multiline 343 | * - "u" for unicode 344 | * - "y" for sticky 345 | * 346 | * If no flags are set, the value is the empty string. 347 | */ 348 | flags: string; 349 | } 350 | 351 | interface Math { 352 | /** 353 | * Returns the number of leading zero bits in the 32-bit binary representation of a number. 354 | * @param x A numeric expression. 355 | */ 356 | clz32(x: number): number; 357 | 358 | /** 359 | * Returns the result of 32-bit multiplication of two numbers. 360 | * @param x First number 361 | * @param y Second number 362 | */ 363 | imul(x: number, y: number): number; 364 | 365 | /** 366 | * Returns the sign of the x, indicating whether x is positive, negative or zero. 367 | * @param x The numeric expression to test 368 | */ 369 | sign(x: number): number; 370 | 371 | /** 372 | * Returns the base 10 logarithm of a number. 373 | * @param x A numeric expression. 374 | */ 375 | log10(x: number): number; 376 | 377 | /** 378 | * Returns the base 2 logarithm of a number. 379 | * @param x A numeric expression. 380 | */ 381 | log2(x: number): number; 382 | 383 | /** 384 | * Returns the natural logarithm of 1 + x. 385 | * @param x A numeric expression. 386 | */ 387 | log1p(x: number): number; 388 | 389 | /** 390 | * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of 391 | * the natural logarithms). 392 | * @param x A numeric expression. 393 | */ 394 | expm1(x: number): number; 395 | 396 | /** 397 | * Returns the hyperbolic cosine of a number. 398 | * @param x A numeric expression that contains an angle measured in radians. 399 | */ 400 | cosh(x: number): number; 401 | 402 | /** 403 | * Returns the hyperbolic sine of a number. 404 | * @param x A numeric expression that contains an angle measured in radians. 405 | */ 406 | sinh(x: number): number; 407 | 408 | /** 409 | * Returns the hyperbolic tangent of a number. 410 | * @param x A numeric expression that contains an angle measured in radians. 411 | */ 412 | tanh(x: number): number; 413 | 414 | /** 415 | * Returns the inverse hyperbolic cosine of a number. 416 | * @param x A numeric expression that contains an angle measured in radians. 417 | */ 418 | acosh(x: number): number; 419 | 420 | /** 421 | * Returns the inverse hyperbolic sine of a number. 422 | * @param x A numeric expression that contains an angle measured in radians. 423 | */ 424 | asinh(x: number): number; 425 | 426 | /** 427 | * Returns the inverse hyperbolic tangent of a number. 428 | * @param x A numeric expression that contains an angle measured in radians. 429 | */ 430 | atanh(x: number): number; 431 | 432 | /** 433 | * Returns the square root of the sum of squares of its arguments. 434 | * @param values Values to compute the square root for. 435 | * If no arguments are passed, the result is +0. 436 | * If there is only one argument, the result is the absolute value. 437 | * If any argument is +Infinity or -Infinity, the result is +Infinity. 438 | * If any argument is NaN, the result is NaN. 439 | * If all arguments are either +0 or −0, the result is +0. 440 | */ 441 | hypot(...values: number[]): number; 442 | 443 | /** 444 | * Returns the integral part of the a numeric expression, x, removing any fractional digits. 445 | * If x is already an integer, the result is x. 446 | * @param x A numeric expression. 447 | */ 448 | trunc(x: number): number; 449 | 450 | /** 451 | * Returns the nearest single precision float representation of a number. 452 | * @param x A numeric expression. 453 | */ 454 | fround(x: number): number; 455 | 456 | /** 457 | * Returns an implementation-dependent approximation to the cube root of number. 458 | * @param x A numeric expression. 459 | */ 460 | cbrt(x: number): number; 461 | } 462 | 463 | interface PromiseLike { 464 | /** 465 | * Attaches callbacks for the resolution and/or rejection of the Promise. 466 | * @param onfulfilled The callback to execute when the Promise is resolved. 467 | * @param onrejected The callback to execute when the Promise is rejected. 468 | * @returns A Promise for the completion of which ever callback is executed. 469 | */ 470 | then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; 471 | then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; 472 | } 473 | 474 | /** 475 | * Represents the completion of an asynchronous operation 476 | */ 477 | interface Promise { 478 | /** 479 | * Attaches callbacks for the resolution and/or rejection of the Promise. 480 | * @param onfulfilled The callback to execute when the Promise is resolved. 481 | * @param onrejected The callback to execute when the Promise is rejected. 482 | * @returns A Promise for the completion of which ever callback is executed. 483 | */ 484 | then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; 485 | then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): Promise; 486 | 487 | /** 488 | * Attaches a callback for only the rejection of the Promise. 489 | * @param onrejected The callback to execute when the Promise is rejected. 490 | * @returns A Promise for the completion of the callback. 491 | */ 492 | catch(onrejected?: (reason: any) => T | PromiseLike): Promise; 493 | catch(onrejected?: (reason: any) => void): Promise; 494 | } 495 | 496 | interface PromiseConstructor { 497 | /** 498 | * A reference to the prototype. 499 | */ 500 | prototype: Promise; 501 | 502 | /** 503 | * Creates a new Promise. 504 | * @param executor A callback used to initialize the promise. This callback is passed two arguments: 505 | * a resolve callback used resolve the promise with a value or the result of another promise, 506 | * and a reject callback used to reject the promise with a provided reason or error. 507 | */ 508 | new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; 509 | 510 | /** 511 | * Creates a Promise that is resolved with an array of results when all of the provided Promises 512 | * resolve, or rejected when any Promise is rejected. 513 | * @param values An array of Promises. 514 | * @returns A new Promise. 515 | */ 516 | all(values: IterableShim>): Promise; 517 | 518 | /** 519 | * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved 520 | * or rejected. 521 | * @param values An array of Promises. 522 | * @returns A new Promise. 523 | */ 524 | race(values: IterableShim>): Promise; 525 | 526 | /** 527 | * Creates a new rejected promise for the provided reason. 528 | * @param reason The reason the promise was rejected. 529 | * @returns A new rejected Promise. 530 | */ 531 | reject(reason: any): Promise; 532 | 533 | /** 534 | * Creates a new rejected promise for the provided reason. 535 | * @param reason The reason the promise was rejected. 536 | * @returns A new rejected Promise. 537 | */ 538 | reject(reason: any): Promise; 539 | 540 | /** 541 | * Creates a new resolved promise for the provided value. 542 | * @param value A promise. 543 | * @returns A promise whose internal state matches the provided promise. 544 | */ 545 | resolve(value: T | PromiseLike): Promise; 546 | 547 | /** 548 | * Creates a new resolved promise . 549 | * @returns A resolved promise. 550 | */ 551 | resolve(): Promise; 552 | } 553 | 554 | declare var Promise: PromiseConstructor; 555 | 556 | interface Map { 557 | clear(): void; 558 | delete(key: K): boolean; 559 | forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; 560 | get(key: K): V; 561 | has(key: K): boolean; 562 | set(key: K, value?: V): Map; 563 | size: number; 564 | entries(): IterableIteratorShim<[K, V]>; 565 | keys(): IterableIteratorShim; 566 | values(): IterableIteratorShim; 567 | } 568 | 569 | interface MapConstructor { 570 | new (): Map; 571 | new (iterable: IterableShim<[K, V]>): Map; 572 | prototype: Map; 573 | } 574 | 575 | declare var Map: MapConstructor; 576 | 577 | interface Set { 578 | add(value: T): Set; 579 | clear(): void; 580 | delete(value: T): boolean; 581 | forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; 582 | has(value: T): boolean; 583 | size: number; 584 | entries(): IterableIteratorShim<[T, T]>; 585 | keys(): IterableIteratorShim; 586 | values(): IterableIteratorShim; 587 | } 588 | 589 | interface SetConstructor { 590 | new (): Set; 591 | new (iterable: IterableShim): Set; 592 | prototype: Set; 593 | } 594 | 595 | declare var Set: SetConstructor; 596 | 597 | interface WeakMap { 598 | delete(key: K): boolean; 599 | get(key: K): V; 600 | has(key: K): boolean; 601 | set(key: K, value?: V): WeakMap; 602 | } 603 | 604 | interface WeakMapConstructor { 605 | new (): WeakMap; 606 | new (iterable: IterableShim<[K, V]>): WeakMap; 607 | prototype: WeakMap; 608 | } 609 | 610 | declare var WeakMap: WeakMapConstructor; 611 | 612 | interface WeakSet { 613 | add(value: T): WeakSet; 614 | delete(value: T): boolean; 615 | has(value: T): boolean; 616 | } 617 | 618 | interface WeakSetConstructor { 619 | new (): WeakSet; 620 | new (iterable: IterableShim): WeakSet; 621 | prototype: WeakSet; 622 | } 623 | 624 | declare var WeakSet: WeakSetConstructor; 625 | 626 | declare module Reflect { 627 | function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; 628 | function construct(target: Function, argumentsList: ArrayLike): any; 629 | function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; 630 | function deleteProperty(target: any, propertyKey: PropertyKey): boolean; 631 | function enumerate(target: any): IterableIteratorShim; 632 | function get(target: any, propertyKey: PropertyKey, receiver?: any): any; 633 | function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; 634 | function getPrototypeOf(target: any): any; 635 | function has(target: any, propertyKey: PropertyKey): boolean; 636 | function isExtensible(target: any): boolean; 637 | function ownKeys(target: any): Array; 638 | function preventExtensions(target: any): boolean; 639 | function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; 640 | function setPrototypeOf(target: any, proto: any): boolean; 641 | } 642 | 643 | declare module "es6-shim" { 644 | var String: StringConstructor; 645 | var Array: ArrayConstructor; 646 | var Number: NumberConstructor; 647 | var Math: Math; 648 | var Object: ObjectConstructor; 649 | var Map: MapConstructor; 650 | var Set: SetConstructor; 651 | var WeakMap: WeakMapConstructor; 652 | var WeakSet: WeakSetConstructor; 653 | var Promise: PromiseConstructor; 654 | module Reflect { 655 | function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; 656 | function construct(target: Function, argumentsList: ArrayLike): any; 657 | function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; 658 | function deleteProperty(target: any, propertyKey: PropertyKey): boolean; 659 | function enumerate(target: any): Iterator; 660 | function get(target: any, propertyKey: PropertyKey, receiver?: any): any; 661 | function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; 662 | function getPrototypeOf(target: any): any; 663 | function has(target: any, propertyKey: PropertyKey): boolean; 664 | function isExtensible(target: any): boolean; 665 | function ownKeys(target: any): Array; 666 | function preventExtensions(target: any): boolean; 667 | function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; 668 | function setPrototypeOf(target: any, proto: any): boolean; 669 | } 670 | } -------------------------------------------------------------------------------- /typings/browser/ambient/hammerjs/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/74a4dfc1bc2dfadec47b8aae953b28546cb9c6b7/hammerjs/hammerjs.d.ts 3 | // Type definitions for Hammer.js 2.0.4 4 | // Project: http://hammerjs.github.io/ 5 | // Definitions by: Philip Bulley , Han Lin Yap 6 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 7 | 8 | declare var Hammer:HammerStatic; 9 | 10 | declare module "hammerjs" { 11 | export = Hammer; 12 | } 13 | 14 | interface HammerStatic 15 | { 16 | new( element:HTMLElement, options?:any ): HammerManager; 17 | 18 | defaults:HammerDefaults; 19 | 20 | VERSION: number; 21 | 22 | INPUT_START: number; 23 | INPUT_MOVE: number; 24 | INPUT_END: number; 25 | INPUT_CANCEL: number; 26 | 27 | STATE_POSSIBLE: number; 28 | STATE_BEGAN: number; 29 | STATE_CHANGED: number; 30 | STATE_ENDED: number; 31 | STATE_RECOGNIZED: number; 32 | STATE_CANCELLED: number; 33 | STATE_FAILED: number; 34 | 35 | DIRECTION_NONE: number; 36 | DIRECTION_LEFT: number; 37 | DIRECTION_RIGHT: number; 38 | DIRECTION_UP: number; 39 | DIRECTION_DOWN: number; 40 | DIRECTION_HORIZONTAL: number; 41 | DIRECTION_VERTICAL: number; 42 | DIRECTION_ALL: number; 43 | 44 | Manager: HammerManager; 45 | Input: HammerInput; 46 | TouchAction: TouchAction; 47 | 48 | TouchInput: TouchInput; 49 | MouseInput: MouseInput; 50 | PointerEventInput: PointerEventInput; 51 | TouchMouseInput: TouchMouseInput; 52 | SingleTouchInput: SingleTouchInput; 53 | 54 | Recognizer: RecognizerStatic; 55 | AttrRecognizer: AttrRecognizerStatic; 56 | Tap: TapRecognizerStatic; 57 | Pan: PanRecognizerStatic; 58 | Swipe: SwipeRecognizerStatic; 59 | Pinch: PinchRecognizerStatic; 60 | Rotate: RotateRecognizerStatic; 61 | Press: PressRecognizerStatic; 62 | 63 | on( target:EventTarget, types:string, handler:Function ):void; 64 | off( target:EventTarget, types:string, handler:Function ):void; 65 | each( obj:any, iterator:Function, context:any ): void; 66 | merge( dest:any, src:any ): any; 67 | extend( dest:any, src:any, merge:boolean ): any; 68 | inherit( child:Function, base:Function, properties:any ):any; 69 | bindFn( fn:Function, context:any ):Function; 70 | prefixed( obj:any, property:string ):string; 71 | } 72 | 73 | interface HammerDefaults 74 | { 75 | domEvents:boolean; 76 | enable:boolean; 77 | preset:any[]; 78 | touchAction:string; 79 | cssProps:CssProps; 80 | 81 | inputClass():void; 82 | inputTarget():void; 83 | } 84 | 85 | interface CssProps 86 | { 87 | contentZooming:string; 88 | tapHighlightColor:string; 89 | touchCallout:string; 90 | touchSelect:string; 91 | userDrag:string; 92 | userSelect:string; 93 | } 94 | 95 | interface HammerOptions extends HammerDefaults 96 | { 97 | 98 | } 99 | 100 | interface HammerManager 101 | { 102 | new( element:HTMLElement, options?:any ):HammerManager; 103 | 104 | add( recogniser:Recognizer ):Recognizer; 105 | add( recogniser:Recognizer ):HammerManager; 106 | add( recogniser:Recognizer[] ):Recognizer; 107 | add( recogniser:Recognizer[] ):HammerManager; 108 | destroy():void; 109 | emit( event:string, data:any ):void; 110 | get( recogniser:Recognizer ):Recognizer; 111 | get( recogniser:string ):Recognizer; 112 | off( events:string, handler?:( event:HammerInput ) => void ):void; 113 | on( events:string, handler:( event:HammerInput ) => void ):void; 114 | recognize( inputData:any ):void; 115 | remove( recogniser:Recognizer ):HammerManager; 116 | remove( recogniser:string ):HammerManager; 117 | set( options:HammerOptions ):HammerManager; 118 | stop( force:boolean ):void; 119 | } 120 | 121 | declare class HammerInput 122 | { 123 | constructor( manager:HammerManager, callback:Function ); 124 | 125 | destroy():void; 126 | handler():void; 127 | init():void; 128 | 129 | /** Name of the event. Like panstart. */ 130 | type:string; 131 | 132 | /** Movement of the X axis. */ 133 | deltaX:number; 134 | 135 | /** Movement of the Y axis. */ 136 | deltaY:number; 137 | 138 | /** Total time in ms since the first input. */ 139 | deltaTime:number; 140 | 141 | /** Distance moved. */ 142 | distance:number; 143 | 144 | /** Angle moved. */ 145 | angle:number; 146 | 147 | /** Velocity on the X axis, in px/ms. */ 148 | velocityX:number; 149 | 150 | /** Velocity on the Y axis, in px/ms */ 151 | velocityY:number; 152 | 153 | /** Highest velocityX/Y value. */ 154 | velocity:number; 155 | 156 | /** Direction moved. Matches the DIRECTION constants. */ 157 | direction:number; 158 | 159 | /** Direction moved from it's starting point. Matches the DIRECTION constants. */ 160 | offsetDirection:string; 161 | 162 | /** Scaling that has been done when multi-touch. 1 on a single touch. */ 163 | scale:number; 164 | 165 | /** Rotation that has been done when multi-touch. 0 on a single touch. */ 166 | rotation:number; 167 | 168 | /** Center position for multi-touch, or just the single pointer. */ 169 | center:HammerPoint; 170 | 171 | /** Source event object, type TouchEvent, MouseEvent or PointerEvent. */ 172 | srcEvent:TouchEvent | MouseEvent | PointerEvent; 173 | 174 | /** Target that received the event. */ 175 | target:HTMLElement; 176 | 177 | /** Primary pointer type, could be touch, mouse, pen or kinect. */ 178 | pointerType:string; 179 | 180 | /** Event type, matches the INPUT constants. */ 181 | eventType:string; 182 | 183 | /** true when the first input. */ 184 | isFirst:boolean; 185 | 186 | /** true when the final (last) input. */ 187 | isFinal:boolean; 188 | 189 | /** Array with all pointers, including the ended pointers (touchend, mouseup). */ 190 | pointers:any[]; 191 | 192 | /** Array with all new/moved/lost pointers. */ 193 | changedPointers:any[]; 194 | 195 | /** Reference to the srcEvent.preventDefault() method. Only for experts! */ 196 | preventDefault:Function; 197 | } 198 | 199 | declare class MouseInput extends HammerInput 200 | { 201 | constructor( manager:HammerManager, callback:Function ); 202 | } 203 | 204 | declare class PointerEventInput extends HammerInput 205 | { 206 | constructor( manager:HammerManager, callback:Function ); 207 | } 208 | 209 | declare class SingleTouchInput extends HammerInput 210 | { 211 | constructor( manager:HammerManager, callback:Function ); 212 | } 213 | 214 | declare class TouchInput extends HammerInput 215 | { 216 | constructor( manager:HammerManager, callback:Function ); 217 | } 218 | 219 | declare class TouchMouseInput extends HammerInput 220 | { 221 | constructor( manager:HammerManager, callback:Function ); 222 | } 223 | 224 | interface RecognizerStatic 225 | { 226 | new( options?:any ):Recognizer; 227 | } 228 | 229 | interface Recognizer 230 | { 231 | defaults:any; 232 | 233 | canEmit():boolean; 234 | canRecognizeWith( otherRecognizer:Recognizer ):boolean; 235 | dropRecognizeWith( otherRecognizer:Recognizer ):Recognizer; 236 | dropRecognizeWith( otherRecognizer:string ):Recognizer; 237 | dropRequireFailure( otherRecognizer:Recognizer ):Recognizer; 238 | dropRequireFailure( otherRecognizer:string ):Recognizer; 239 | emit( input:HammerInput ):void; 240 | getTouchAction():any[]; 241 | hasRequireFailures():boolean; 242 | process( inputData:HammerInput ):string; 243 | recognize( inputData:HammerInput ):void; 244 | recognizeWith( otherRecognizer:Recognizer ):Recognizer; 245 | recognizeWith( otherRecognizer:string ):Recognizer; 246 | requireFailure( otherRecognizer:Recognizer ):Recognizer; 247 | requireFailure( otherRecognizer:string ):Recognizer; 248 | reset():void; 249 | set( options?:any ):Recognizer; 250 | tryEmit( input:HammerInput ):void; 251 | } 252 | 253 | interface AttrRecognizerStatic 254 | { 255 | attrTest( input:HammerInput ):boolean; 256 | process( input:HammerInput ):any; 257 | } 258 | 259 | interface AttrRecognizer extends Recognizer 260 | { 261 | new( options?:any ):AttrRecognizer; 262 | } 263 | 264 | interface PanRecognizerStatic 265 | { 266 | new( options?:any ):PanRecognizer; 267 | } 268 | 269 | interface PanRecognizer extends AttrRecognizer 270 | { 271 | } 272 | 273 | interface PinchRecognizerStatic 274 | { 275 | new( options?:any ):PinchRecognizer; 276 | } 277 | 278 | interface PinchRecognizer extends AttrRecognizer 279 | { 280 | } 281 | 282 | interface PressRecognizerStatic 283 | { 284 | new( options?:any ):PressRecognizer; 285 | } 286 | 287 | interface PressRecognizer extends AttrRecognizer 288 | { 289 | } 290 | 291 | interface RotateRecognizerStatic 292 | { 293 | new( options?:any ):RotateRecognizer; 294 | } 295 | 296 | interface RotateRecognizer extends AttrRecognizer 297 | { 298 | } 299 | 300 | interface SwipeRecognizerStatic 301 | { 302 | new( options?:any ):SwipeRecognizer; 303 | } 304 | 305 | interface SwipeRecognizer extends AttrRecognizer 306 | { 307 | } 308 | 309 | interface TapRecognizerStatic 310 | { 311 | new( options?:any ):TapRecognizer; 312 | } 313 | 314 | interface TapRecognizer extends AttrRecognizer 315 | { 316 | } 317 | 318 | declare class TouchAction 319 | { 320 | constructor( manager:HammerManager, value:string ); 321 | 322 | compute():string; 323 | preventDefaults( input:HammerInput ):void; 324 | preventSrc( srcEvent:any ):void; 325 | set( value:string ):void; 326 | update():void; 327 | } 328 | 329 | interface HammerPoint 330 | { 331 | x: number; 332 | y: number; 333 | } -------------------------------------------------------------------------------- /typings/browser/ambient/jasmine/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/4b36b94d5910aa8a4d20bdcd5bd1f9ae6ad18d3c/jasmine/jasmine.d.ts 3 | // Type definitions for Jasmine 2.2 4 | // Project: http://jasmine.github.io/ 5 | // Definitions by: Boris Yankov , Theodore Brown , David Pärsson 6 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 7 | 8 | 9 | // For ddescribe / iit use : https://github.com/borisyankov/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts 10 | 11 | declare function describe(description: string, specDefinitions: () => void): void; 12 | declare function fdescribe(description: string, specDefinitions: () => void): void; 13 | declare function xdescribe(description: string, specDefinitions: () => void): void; 14 | 15 | declare function it(expectation: string, assertion?: () => void, timeout?: number): void; 16 | declare function it(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; 17 | declare function fit(expectation: string, assertion?: () => void, timeout?: number): void; 18 | declare function fit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; 19 | declare function xit(expectation: string, assertion?: () => void, timeout?: number): void; 20 | declare function xit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; 21 | 22 | /** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */ 23 | declare function pending(reason?: string): void; 24 | 25 | declare function beforeEach(action: () => void, timeout?: number): void; 26 | declare function beforeEach(action: (done: () => void) => void, timeout?: number): void; 27 | declare function afterEach(action: () => void, timeout?: number): void; 28 | declare function afterEach(action: (done: () => void) => void, timeout?: number): void; 29 | 30 | declare function beforeAll(action: () => void, timeout?: number): void; 31 | declare function beforeAll(action: (done: () => void) => void, timeout?: number): void; 32 | declare function afterAll(action: () => void, timeout?: number): void; 33 | declare function afterAll(action: (done: () => void) => void, timeout?: number): void; 34 | 35 | declare function expect(spy: Function): jasmine.Matchers; 36 | declare function expect(actual: any): jasmine.Matchers; 37 | 38 | declare function fail(e?: any): void; 39 | 40 | declare function spyOn(object: any, method: string): jasmine.Spy; 41 | 42 | declare function runs(asyncMethod: Function): void; 43 | declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void; 44 | declare function waits(timeout?: number): void; 45 | 46 | declare module jasmine { 47 | 48 | var clock: () => Clock; 49 | 50 | function any(aclass: any): Any; 51 | function anything(): Any; 52 | function arrayContaining(sample: any[]): ArrayContaining; 53 | function objectContaining(sample: any): ObjectContaining; 54 | function createSpy(name: string, originalFn?: Function): Spy; 55 | function createSpyObj(baseName: string, methodNames: any[]): any; 56 | function createSpyObj(baseName: string, methodNames: any[]): T; 57 | function pp(value: any): string; 58 | function getEnv(): Env; 59 | function addCustomEqualityTester(equalityTester: CustomEqualityTester): void; 60 | function addMatchers(matchers: CustomMatcherFactories): void; 61 | function stringMatching(str: string): Any; 62 | function stringMatching(str: RegExp): Any; 63 | 64 | interface Any { 65 | 66 | new (expectedClass: any): any; 67 | 68 | jasmineMatches(other: any): boolean; 69 | jasmineToString(): string; 70 | } 71 | 72 | // taken from TypeScript lib.core.es6.d.ts, applicable to CustomMatchers.contains() 73 | interface ArrayLike { 74 | length: number; 75 | [n: number]: T; 76 | } 77 | 78 | interface ArrayContaining { 79 | new (sample: any[]): any; 80 | 81 | asymmetricMatch(other: any): boolean; 82 | jasmineToString(): string; 83 | } 84 | 85 | interface ObjectContaining { 86 | new (sample: any): any; 87 | 88 | jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean; 89 | jasmineToString(): string; 90 | } 91 | 92 | interface Block { 93 | 94 | new (env: Env, func: SpecFunction, spec: Spec): any; 95 | 96 | execute(onComplete: () => void): void; 97 | } 98 | 99 | interface WaitsBlock extends Block { 100 | new (env: Env, timeout: number, spec: Spec): any; 101 | } 102 | 103 | interface WaitsForBlock extends Block { 104 | new (env: Env, timeout: number, latchFunction: SpecFunction, message: string, spec: Spec): any; 105 | } 106 | 107 | interface Clock { 108 | install(): void; 109 | uninstall(): void; 110 | /** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */ 111 | tick(ms: number): void; 112 | mockDate(date?: Date): void; 113 | } 114 | 115 | interface CustomEqualityTester { 116 | (first: any, second: any): boolean; 117 | } 118 | 119 | interface CustomMatcher { 120 | compare(actual: T, expected: T): CustomMatcherResult; 121 | compare(actual: any, expected: any): CustomMatcherResult; 122 | } 123 | 124 | interface CustomMatcherFactory { 125 | (util: MatchersUtil, customEqualityTesters: Array): CustomMatcher; 126 | } 127 | 128 | interface CustomMatcherFactories { 129 | [index: string]: CustomMatcherFactory; 130 | } 131 | 132 | interface CustomMatcherResult { 133 | pass: boolean; 134 | message?: string; 135 | } 136 | 137 | interface MatchersUtil { 138 | equals(a: any, b: any, customTesters?: Array): boolean; 139 | contains(haystack: ArrayLike | string, needle: any, customTesters?: Array): boolean; 140 | buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array): string; 141 | } 142 | 143 | interface Env { 144 | setTimeout: any; 145 | clearTimeout: void; 146 | setInterval: any; 147 | clearInterval: void; 148 | updateInterval: number; 149 | 150 | currentSpec: Spec; 151 | 152 | matchersClass: Matchers; 153 | 154 | version(): any; 155 | versionString(): string; 156 | nextSpecId(): number; 157 | addReporter(reporter: Reporter): void; 158 | execute(): void; 159 | describe(description: string, specDefinitions: () => void): Suite; 160 | // ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these 161 | beforeEach(beforeEachFunction: () => void): void; 162 | beforeAll(beforeAllFunction: () => void): void; 163 | currentRunner(): Runner; 164 | afterEach(afterEachFunction: () => void): void; 165 | afterAll(afterAllFunction: () => void): void; 166 | xdescribe(desc: string, specDefinitions: () => void): XSuite; 167 | it(description: string, func: () => void): Spec; 168 | // iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these 169 | xit(desc: string, func: () => void): XSpec; 170 | compareRegExps_(a: RegExp, b: RegExp, mismatchKeys: string[], mismatchValues: string[]): boolean; 171 | compareObjects_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; 172 | equals_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; 173 | contains_(haystack: any, needle: any): boolean; 174 | addCustomEqualityTester(equalityTester: CustomEqualityTester): void; 175 | addMatchers(matchers: CustomMatcherFactories): void; 176 | specFilter(spec: Spec): boolean; 177 | } 178 | 179 | interface FakeTimer { 180 | 181 | new (): any; 182 | 183 | reset(): void; 184 | tick(millis: number): void; 185 | runFunctionsWithinRange(oldMillis: number, nowMillis: number): void; 186 | scheduleFunction(timeoutKey: any, funcToCall: () => void, millis: number, recurring: boolean): void; 187 | } 188 | 189 | interface HtmlReporter { 190 | new (): any; 191 | } 192 | 193 | interface HtmlSpecFilter { 194 | new (): any; 195 | } 196 | 197 | interface Result { 198 | type: string; 199 | } 200 | 201 | interface NestedResults extends Result { 202 | description: string; 203 | 204 | totalCount: number; 205 | passedCount: number; 206 | failedCount: number; 207 | 208 | skipped: boolean; 209 | 210 | rollupCounts(result: NestedResults): void; 211 | log(values: any): void; 212 | getItems(): Result[]; 213 | addResult(result: Result): void; 214 | passed(): boolean; 215 | } 216 | 217 | interface MessageResult extends Result { 218 | values: any; 219 | trace: Trace; 220 | } 221 | 222 | interface ExpectationResult extends Result { 223 | matcherName: string; 224 | passed(): boolean; 225 | expected: any; 226 | actual: any; 227 | message: string; 228 | trace: Trace; 229 | } 230 | 231 | interface Trace { 232 | name: string; 233 | message: string; 234 | stack: any; 235 | } 236 | 237 | interface PrettyPrinter { 238 | 239 | new (): any; 240 | 241 | format(value: any): void; 242 | iterateObject(obj: any, fn: (property: string, isGetter: boolean) => void): void; 243 | emitScalar(value: any): void; 244 | emitString(value: string): void; 245 | emitArray(array: any[]): void; 246 | emitObject(obj: any): void; 247 | append(value: any): void; 248 | } 249 | 250 | interface StringPrettyPrinter extends PrettyPrinter { 251 | } 252 | 253 | interface Queue { 254 | 255 | new (env: any): any; 256 | 257 | env: Env; 258 | ensured: boolean[]; 259 | blocks: Block[]; 260 | running: boolean; 261 | index: number; 262 | offset: number; 263 | abort: boolean; 264 | 265 | addBefore(block: Block, ensure?: boolean): void; 266 | add(block: any, ensure?: boolean): void; 267 | insertNext(block: any, ensure?: boolean): void; 268 | start(onComplete?: () => void): void; 269 | isRunning(): boolean; 270 | next_(): void; 271 | results(): NestedResults; 272 | } 273 | 274 | interface Matchers { 275 | 276 | new (env: Env, actual: any, spec: Env, isNot?: boolean): any; 277 | 278 | env: Env; 279 | actual: any; 280 | spec: Env; 281 | isNot?: boolean; 282 | message(): any; 283 | 284 | (expected: any): boolean; 285 | toBe(expected: any, expectationFailOutput?: any): boolean; 286 | toEqual(expected: any, expectationFailOutput?: any): boolean; 287 | toMatch(expected: any, expectationFailOutput?: any): boolean; 288 | toBeDefined(expectationFailOutput?: any): boolean; 289 | toBeUndefined(expectationFailOutput?: any): boolean; 290 | toBeNull(expectationFailOutput?: any): boolean; 291 | toBeNaN(): boolean; 292 | toBeTruthy(expectationFailOutput?: any): boolean; 293 | toBeFalsy(expectationFailOutput?: any): boolean; 294 | toHaveBeenCalled(): boolean; 295 | toHaveBeenCalledWith(...params: any[]): boolean; 296 | toContain(expected: any, expectationFailOutput?: any): boolean; 297 | toBeLessThan(expected: any, expectationFailOutput?: any): boolean; 298 | toBeGreaterThan(expected: any, expectationFailOutput?: any): boolean; 299 | toBeCloseTo(expected: any, precision: any, expectationFailOutput?: any): boolean; 300 | toContainHtml(expected: string): boolean; 301 | toContainText(expected: string): boolean; 302 | toThrow(expected?: any): boolean; 303 | toThrowError(expected?: any, message?: string): boolean; 304 | not: Matchers; 305 | 306 | Any: Any; 307 | } 308 | 309 | interface Reporter { 310 | reportRunnerStarting(runner: Runner): void; 311 | reportRunnerResults(runner: Runner): void; 312 | reportSuiteResults(suite: Suite): void; 313 | reportSpecStarting(spec: Spec): void; 314 | reportSpecResults(spec: Spec): void; 315 | log(str: string): void; 316 | } 317 | 318 | interface MultiReporter extends Reporter { 319 | addReporter(reporter: Reporter): void; 320 | } 321 | 322 | interface Runner { 323 | 324 | new (env: Env): any; 325 | 326 | execute(): void; 327 | beforeEach(beforeEachFunction: SpecFunction): void; 328 | afterEach(afterEachFunction: SpecFunction): void; 329 | beforeAll(beforeAllFunction: SpecFunction): void; 330 | afterAll(afterAllFunction: SpecFunction): void; 331 | finishCallback(): void; 332 | addSuite(suite: Suite): void; 333 | add(block: Block): void; 334 | specs(): Spec[]; 335 | suites(): Suite[]; 336 | topLevelSuites(): Suite[]; 337 | results(): NestedResults; 338 | } 339 | 340 | interface SpecFunction { 341 | (spec?: Spec): void; 342 | } 343 | 344 | interface SuiteOrSpec { 345 | id: number; 346 | env: Env; 347 | description: string; 348 | queue: Queue; 349 | } 350 | 351 | interface Spec extends SuiteOrSpec { 352 | 353 | new (env: Env, suite: Suite, description: string): any; 354 | 355 | suite: Suite; 356 | 357 | afterCallbacks: SpecFunction[]; 358 | spies_: Spy[]; 359 | 360 | results_: NestedResults; 361 | matchersClass: Matchers; 362 | 363 | getFullName(): string; 364 | results(): NestedResults; 365 | log(arguments: any): any; 366 | runs(func: SpecFunction): Spec; 367 | addToQueue(block: Block): void; 368 | addMatcherResult(result: Result): void; 369 | expect(actual: any): any; 370 | waits(timeout: number): Spec; 371 | waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec; 372 | fail(e?: any): void; 373 | getMatchersClass_(): Matchers; 374 | addMatchers(matchersPrototype: CustomMatcherFactories): void; 375 | finishCallback(): void; 376 | finish(onComplete?: () => void): void; 377 | after(doAfter: SpecFunction): void; 378 | execute(onComplete?: () => void): any; 379 | addBeforesAndAftersToQueue(): void; 380 | explodes(): void; 381 | spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy; 382 | removeAllSpies(): void; 383 | } 384 | 385 | interface XSpec { 386 | id: number; 387 | runs(): void; 388 | } 389 | 390 | interface Suite extends SuiteOrSpec { 391 | 392 | new (env: Env, description: string, specDefinitions: () => void, parentSuite: Suite): any; 393 | 394 | parentSuite: Suite; 395 | 396 | getFullName(): string; 397 | finish(onComplete?: () => void): void; 398 | beforeEach(beforeEachFunction: SpecFunction): void; 399 | afterEach(afterEachFunction: SpecFunction): void; 400 | beforeAll(beforeAllFunction: SpecFunction): void; 401 | afterAll(afterAllFunction: SpecFunction): void; 402 | results(): NestedResults; 403 | add(suiteOrSpec: SuiteOrSpec): void; 404 | specs(): Spec[]; 405 | suites(): Suite[]; 406 | children(): any[]; 407 | execute(onComplete?: () => void): void; 408 | } 409 | 410 | interface XSuite { 411 | execute(): void; 412 | } 413 | 414 | interface Spy { 415 | (...params: any[]): any; 416 | 417 | identity: string; 418 | and: SpyAnd; 419 | calls: Calls; 420 | mostRecentCall: { args: any[]; }; 421 | argsForCall: any[]; 422 | wasCalled: boolean; 423 | callCount: number; 424 | } 425 | 426 | interface SpyAnd { 427 | /** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */ 428 | callThrough(): Spy; 429 | /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */ 430 | returnValue(val: any): void; 431 | /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */ 432 | callFake(fn: Function): Spy; 433 | /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */ 434 | throwError(msg: string): void; 435 | /** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */ 436 | stub(): Spy; 437 | } 438 | 439 | interface Calls { 440 | /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. **/ 441 | any(): boolean; 442 | /** By chaining the spy with calls.count(), will return the number of times the spy was called **/ 443 | count(): number; 444 | /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index **/ 445 | argsFor(index: number): any[]; 446 | /** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/ 447 | allArgs(): any[]; 448 | /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/ 449 | all(): CallInfo[]; 450 | /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/ 451 | mostRecent(): CallInfo; 452 | /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/ 453 | first(): CallInfo; 454 | /** By chaining the spy with calls.reset(), will clears all tracking for a spy **/ 455 | reset(): void; 456 | } 457 | 458 | interface CallInfo { 459 | /** The context (the this) for the call */ 460 | object: any; 461 | /** All arguments passed to the call */ 462 | args: any[]; 463 | } 464 | 465 | interface Util { 466 | inherit(childClass: Function, parentClass: Function): any; 467 | formatException(e: any): any; 468 | htmlEscape(str: string): string; 469 | argsToArray(args: any): any; 470 | extend(destination: any, source: any): any; 471 | } 472 | 473 | interface JsApiReporter extends Reporter { 474 | 475 | started: boolean; 476 | finished: boolean; 477 | result: any; 478 | messages: any; 479 | 480 | new (): any; 481 | 482 | suites(): Suite[]; 483 | summarize_(suiteOrSpec: SuiteOrSpec): any; 484 | results(): any; 485 | resultsForSpec(specId: any): any; 486 | log(str: any): any; 487 | resultsForSpecs(specIds: any): any; 488 | summarizeResult_(result: any): any; 489 | } 490 | 491 | interface Jasmine { 492 | Spec: Spec; 493 | clock: Clock; 494 | util: Util; 495 | } 496 | 497 | export var HtmlReporter: HtmlReporter; 498 | export var HtmlSpecFilter: HtmlSpecFilter; 499 | export var DEFAULT_TIMEOUT_INTERVAL: number; 500 | 501 | export interface GlobalPolluter { 502 | describe(description: string, specDefinitions: () => void): void; 503 | fdescribe(description: string, specDefinitions: () => void): void; 504 | xdescribe(description: string, specDefinitions: () => void): void; 505 | 506 | it(expectation: string, assertion?: () => void): void; 507 | it(expectation: string, assertion?: (done: () => void) => void): void; 508 | fit(expectation: string, assertion?: () => void): void; 509 | fit(expectation: string, assertion?: (done: () => void) => void): void; 510 | xit(expectation: string, assertion?: () => void): void; 511 | xit(expectation: string, assertion?: (done: () => void) => void): void; 512 | 513 | pending(): void; 514 | 515 | beforeEach(action: () => void): void; 516 | beforeEach(action: (done: () => void) => void): void; 517 | afterEach(action: () => void): void; 518 | afterEach(action: (done: () => void) => void): void; 519 | 520 | beforeAll(action: () => void): void; 521 | beforeAll(action: (done: () => void) => void): void; 522 | afterAll(action: () => void): void; 523 | afterAll(action: (done: () => void) => void): void; 524 | 525 | expect(spy: Function): jasmine.Matchers; 526 | expect(actual: any): jasmine.Matchers; 527 | 528 | fail(e?: any): void; 529 | 530 | spyOn(object: any, method: string): jasmine.Spy; 531 | 532 | runs(asyncMethod: Function): void; 533 | waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void; 534 | waits(timeout?: number): void; 535 | } 536 | } -------------------------------------------------------------------------------- /typings/browser/ambient/webpack/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/95c02169ba8fa58ac1092422efbd2e3174a206f4/webpack/webpack.d.ts 3 | // Type definitions for webpack 1.12.2 4 | // Project: https://github.com/webpack/webpack 5 | // Definitions by: Qubo 6 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 7 | 8 | declare module "webpack" { 9 | namespace webpack { 10 | interface Configuration { 11 | entry?: string|string[]|Entry; 12 | devtool?: string; 13 | output?: Output; 14 | module?: Module; 15 | plugins?: (Plugin|Function)[]; 16 | } 17 | 18 | interface Entry { 19 | [name: string]: string|string[]; 20 | } 21 | 22 | interface Output { 23 | path?: string; 24 | filename?: string; 25 | chunkFilename?: string; 26 | publicPath?: string; 27 | } 28 | 29 | interface Module { 30 | loaders?: Loader[]; 31 | } 32 | 33 | interface Loader { 34 | exclude?: string[]; 35 | include?: string[]; 36 | test: RegExp; 37 | loader?: string; 38 | loaders?: string[]; 39 | query?: { 40 | [name: string]: any; 41 | } 42 | } 43 | 44 | interface Plugin { } 45 | 46 | interface Webpack { 47 | /** 48 | * optimize namespace 49 | */ 50 | optimize: Optimize; 51 | /** 52 | * dependencies namespace 53 | */ 54 | dependencies: Dependencies; 55 | /** 56 | * Replace resources that matches resourceRegExp with newResource. 57 | * If newResource is relative, it is resolve relative to the previous resource. 58 | * If newResource is a function, it is expected to overwrite the ‘request’ attribute of the supplied object. 59 | */ 60 | NormalModuleReplacementPlugin: NormalModuleReplacementPluginStatic; 61 | /** 62 | * Replaces the default resource, recursive flag or regExp generated by parsing with newContentResource, 63 | * newContentRecursive resp. newContextRegExp if the resource (directory) matches resourceRegExp. 64 | * If newContentResource is relative, it is resolve relative to the previous resource. 65 | * If newContentResource is a function, it is expected to overwrite the ‘request’ attribute of the supplied object. 66 | */ 67 | ContextReplacementPlugin: ContextReplacementPluginStatic; 68 | /** 69 | * Don’t generate modules for requests matching the provided RegExp. 70 | */ 71 | IgnorePlugin: IgnorePluginStatic; 72 | /** 73 | * A request for a normal module, which is resolved and built even before a require to it occurs. 74 | * This can boost performance. Try to profile the build first to determine clever prefetching points. 75 | */ 76 | PrefetchPlugin: PrefetchPluginStatic; 77 | /** 78 | * Apply a plugin (or array of plugins) to one or more resolvers (as specified in types). 79 | */ 80 | ResolverPlugin: ResolverPluginStatic; 81 | /** 82 | * Adds a banner to the top of each generated chunk. 83 | */ 84 | BannerPlugin: BannerPluginStatic; 85 | /** 86 | * Define free variables. Useful for having development builds with debug logging or adding global constants. 87 | */ 88 | DefinePlugin: DefinePluginStatic; 89 | /** 90 | * Automatically loaded modules. 91 | * Module (value) is loaded when the identifier (key) is used as free variable in a module. 92 | * The identifier is filled with the exports of the loaded module. 93 | */ 94 | ProvidePlugin: ProvidePluginStatic; 95 | /** 96 | * Adds SourceMaps for assets. 97 | */ 98 | SourceMapDevToolPlugin: SourceMapDevToolPluginStatic; 99 | /** 100 | * Enables Hot Module Replacement. (This requires records data if not in dev-server mode, recordsPath) 101 | * Generates Hot Update Chunks of each chunk in the records. 102 | * It also enables the API and makes __webpack_hash__ available in the bundle. 103 | */ 104 | HotModuleReplacementPlugin: HotModuleReplacementPluginStatic; 105 | /** 106 | * Adds useful free vars to the bundle. 107 | */ 108 | ExtendedAPIPlugin: ExtendedAPIPluginStatic; 109 | /** 110 | * When there are errors while compiling this plugin skips the emitting phase (and recording phase), 111 | * so there are no assets emitted that include errors. The emitted flag in the stats is false for all assets. 112 | */ 113 | NoErrorsPlugin: NoErrorsPluginStatic; 114 | /** 115 | * Does not watch specified files matching provided paths or RegExps. 116 | */ 117 | WatchIgnorePlugin: WatchIgnorePluginStatic; 118 | } 119 | 120 | interface Optimize { 121 | /** 122 | * Search for equal or similar files and deduplicate them in the output. 123 | * This comes with some overhead for the entry chunk, but can reduce file size effectively. 124 | * This is experimental and may crash, because of some missing implementations. (Report an issue) 125 | */ 126 | DedupePlugin: optimize.DedupePluginStatic; 127 | /** 128 | * Limit the chunk count to a defined value. Chunks are merged until it fits. 129 | */ 130 | LimitChunkCountPlugin: optimize.LimitChunkCountPluginStatic; 131 | /** 132 | * Merge small chunks that are lower than this min size (in chars). Size is approximated. 133 | */ 134 | MinChunkSizePlugin: optimize.MinChunkSizePluginStatic; 135 | /** 136 | * Assign the module and chunk ids by occurrence count. Ids that are used often get lower (shorter) ids. 137 | * This make ids predictable, reduces to total file size and is recommended. 138 | */ 139 | OccurenceOrderPlugin: optimize.OccurenceOrderPluginStatic; 140 | /** 141 | * Minimize all JavaScript output of chunks. Loaders are switched into minimizing mode. 142 | * You can pass an object containing UglifyJs options. 143 | */ 144 | UglifyJsPlugin: optimize.UglifyJsPluginStatic; 145 | CommonsChunkPlugin: optimize.CommonsChunkPluginStatic; 146 | /** 147 | * A plugin for a more aggressive chunk merging strategy. 148 | * Even similar chunks are merged if the total size is reduced enough. 149 | * As an option modules that are not common in these chunks can be moved up the chunk tree to the parents. 150 | */ 151 | AggressiveMergingPlugin: optimize.AggressiveMergingPluginStatic; 152 | } 153 | 154 | interface Dependencies { 155 | /** 156 | * Support Labeled Modules. 157 | */ 158 | LabeledModulesPlugin: dependencies.LabeledModulesPluginStatic; 159 | } 160 | 161 | interface DirectoryDescriptionFilePluginStatic { 162 | new(file: string, files: string[]): Plugin; 163 | } 164 | 165 | interface NormalModuleReplacementPluginStatic { 166 | new(resourceRegExp: any, newResource: any): Plugin; 167 | } 168 | 169 | interface ContextReplacementPluginStatic { 170 | new(resourceRegExp: any, newContentResource?: any, newContentRecursive?: any, newContentRegExp?: any): Plugin 171 | } 172 | 173 | interface IgnorePluginStatic { 174 | new(requestRegExp: any, contextRegExp?: any): Plugin; 175 | } 176 | 177 | interface PrefetchPluginStatic { 178 | new(context: any, request: any): Plugin; 179 | new(request: any): Plugin; 180 | } 181 | 182 | interface ResolverPluginStatic { 183 | new(plugins: Plugin[], files?: string[]): Plugin; 184 | DirectoryDescriptionFilePlugin: DirectoryDescriptionFilePluginStatic; 185 | /** 186 | * This plugin will append a path to the module directory to find a match, 187 | * which can be useful if you have a module which has an incorrect “main” entry in its package.json/bower.json etc (e.g. "main": "Gruntfile.js"). 188 | * You can use this plugin as a special case to load the correct file for this module. Example: 189 | */ 190 | FileAppendPlugin: FileAppendPluginStatic; 191 | } 192 | 193 | interface FileAppendPluginStatic { 194 | new(files: string[]): Plugin; 195 | } 196 | 197 | interface BannerPluginStatic { 198 | new(banner: any, options: any): Plugin; 199 | } 200 | 201 | interface DefinePluginStatic { 202 | new(definitions: any): Plugin; 203 | } 204 | 205 | interface ProvidePluginStatic { 206 | new(definitions: any): Plugin; 207 | } 208 | 209 | interface SourceMapDevToolPluginStatic { 210 | new(options: any): Plugin; 211 | } 212 | 213 | interface HotModuleReplacementPluginStatic { 214 | new(): Plugin; 215 | } 216 | 217 | interface ExtendedAPIPluginStatic { 218 | new(): Plugin; 219 | } 220 | 221 | interface NoErrorsPluginStatic { 222 | new(): Plugin; 223 | } 224 | 225 | interface WatchIgnorePluginStatic { 226 | new(paths: RegExp[]): Plugin; 227 | } 228 | 229 | namespace optimize { 230 | interface DedupePluginStatic { 231 | new(): Plugin; 232 | } 233 | interface LimitChunkCountPluginStatic { 234 | new(options: any): Plugin 235 | } 236 | interface MinChunkSizePluginStatic { 237 | new(options: any): Plugin; 238 | } 239 | interface OccurenceOrderPluginStatic { 240 | new(preferEntry: boolean): Plugin; 241 | } 242 | interface UglifyJsPluginStatic { 243 | new(options?: any): Plugin; 244 | } 245 | interface CommonsChunkPluginStatic { 246 | new(chunkName: string, filenames?: string|string[]): Plugin; 247 | new(options?: any): Plugin; 248 | } 249 | interface AggressiveMergingPluginStatic { 250 | new(options: any): Plugin; 251 | } 252 | } 253 | 254 | namespace dependencies { 255 | interface LabeledModulesPluginStatic { 256 | new(): Plugin; 257 | } 258 | } 259 | } 260 | 261 | var webpack: webpack.Webpack; 262 | 263 | //export default webpack; 264 | export = webpack; 265 | } -------------------------------------------------------------------------------- /typings/browser/definitions/es6-promise/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/typed-typings/npm-es6-promise/fb04188767acfec1defd054fc8024fafa5cd4de7/dist/es6-promise.d.ts 3 | declare module '~es6-promise/dist/es6-promise' { 4 | export interface Thenable { 5 | then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; 6 | then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Thenable; 7 | } 8 | 9 | export class Promise implements Thenable { 10 | /** 11 | * If you call resolve in the body of the callback passed to the constructor, 12 | * your promise is fulfilled with result object passed to resolve. 13 | * If you call reject your promise is rejected with the object passed to resolve. 14 | * For consistency and debugging (eg stack traces), obj should be an instanceof Error. 15 | * Any errors thrown in the constructor callback will be implicitly passed to reject(). 16 | */ 17 | constructor (callback: (resolve : (value?: R | Thenable) => void, reject: (error?: any) => void) => void); 18 | 19 | /** 20 | * onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. 21 | * Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. 22 | * Both callbacks have a single parameter , the fulfillment value or rejection reason. 23 | * "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. 24 | * If an error is thrown in the callback, the returned promise rejects with that error. 25 | * 26 | * @param onFulfilled called when/if "promise" resolves 27 | * @param onRejected called when/if "promise" rejects 28 | */ 29 | then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Promise; 30 | then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Promise; 31 | 32 | /** 33 | * Sugar for promise.then(undefined, onRejected) 34 | * 35 | * @param onRejected called when/if "promise" rejects 36 | */ 37 | catch (onRejected?: (error: any) => U | Thenable): Promise; 38 | 39 | /** 40 | * Make a new promise from the thenable. 41 | * A thenable is promise-like in as far as it has a "then" method. 42 | */ 43 | static resolve (): Promise; 44 | static resolve (value: R | Thenable): Promise; 45 | 46 | /** 47 | * Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error 48 | */ 49 | static reject (error: any): Promise; 50 | 51 | /** 52 | * Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects. 53 | * the array passed to all can be a mixture of promise-like objects and other objects. 54 | * The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value. 55 | */ 56 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable, T10 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; 57 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; 58 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; 59 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; 60 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6]>; 61 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable]): Promise<[T1, T2, T3, T4, T5]>; 62 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable ]): Promise<[T1, T2, T3, T4]>; 63 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable]): Promise<[T1, T2, T3]>; 64 | static all(values: [T1 | Thenable, T2 | Thenable]): Promise<[T1, T2]>; 65 | static all(values: [T1 | Thenable]): Promise<[T1]>; 66 | static all(values: Array>): Promise; 67 | 68 | /** 69 | * Make a Promise that fulfills when any item fulfills, and rejects if any item rejects. 70 | */ 71 | static race (promises: (R | Thenable)[]): Promise; 72 | } 73 | 74 | /** 75 | * The polyfill method will patch the global environment (in this case to the Promise name) when called. 76 | */ 77 | export function polyfill (): void; 78 | } 79 | declare module 'es6-promise/dist/es6-promise' { 80 | export * from '~es6-promise/dist/es6-promise'; 81 | } 82 | declare module 'es6-promise' { 83 | export * from '~es6-promise/dist/es6-promise'; 84 | } 85 | -------------------------------------------------------------------------------- /typings/main.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | /// 6 | /// 7 | /// 8 | /// 9 | -------------------------------------------------------------------------------- /typings/main/ambient/es6-shim/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/6697d6f7dadbf5773cb40ecda35a76027e0783b2/es6-shim/es6-shim.d.ts 3 | // Type definitions for es6-shim v0.31.2 4 | // Project: https://github.com/paulmillr/es6-shim 5 | // Definitions by: Ron Buckton 6 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 7 | 8 | declare type PropertyKey = string | number | symbol; 9 | 10 | interface IteratorResult { 11 | done: boolean; 12 | value?: T; 13 | } 14 | 15 | interface IterableShim { 16 | /** 17 | * Shim for an ES6 iterable. Not intended for direct use by user code. 18 | */ 19 | "_es6-shim iterator_"(): Iterator; 20 | } 21 | 22 | interface Iterator { 23 | next(value?: any): IteratorResult; 24 | return?(value?: any): IteratorResult; 25 | throw?(e?: any): IteratorResult; 26 | } 27 | 28 | interface IterableIteratorShim extends IterableShim, Iterator { 29 | /** 30 | * Shim for an ES6 iterable iterator. Not intended for direct use by user code. 31 | */ 32 | "_es6-shim iterator_"(): IterableIteratorShim; 33 | } 34 | 35 | interface StringConstructor { 36 | /** 37 | * Return the String value whose elements are, in order, the elements in the List elements. 38 | * If length is 0, the empty string is returned. 39 | */ 40 | fromCodePoint(...codePoints: number[]): string; 41 | 42 | /** 43 | * String.raw is intended for use as a tag function of a Tagged Template String. When called 44 | * as such the first argument will be a well formed template call site object and the rest 45 | * parameter will contain the substitution values. 46 | * @param template A well-formed template string call site representation. 47 | * @param substitutions A set of substitution values. 48 | */ 49 | raw(template: TemplateStringsArray, ...substitutions: any[]): string; 50 | } 51 | 52 | interface String { 53 | /** 54 | * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point 55 | * value of the UTF-16 encoded code point starting at the string element at position pos in 56 | * the String resulting from converting this object to a String. 57 | * If there is no element at that position, the result is undefined. 58 | * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos. 59 | */ 60 | codePointAt(pos: number): number; 61 | 62 | /** 63 | * Returns true if searchString appears as a substring of the result of converting this 64 | * object to a String, at one or more positions that are 65 | * greater than or equal to position; otherwise, returns false. 66 | * @param searchString search string 67 | * @param position If position is undefined, 0 is assumed, so as to search all of the String. 68 | */ 69 | includes(searchString: string, position?: number): boolean; 70 | 71 | /** 72 | * Returns true if the sequence of elements of searchString converted to a String is the 73 | * same as the corresponding elements of this object (converted to a String) starting at 74 | * endPosition – length(this). Otherwise returns false. 75 | */ 76 | endsWith(searchString: string, endPosition?: number): boolean; 77 | 78 | /** 79 | * Returns a String value that is made from count copies appended together. If count is 0, 80 | * T is the empty String is returned. 81 | * @param count number of copies to append 82 | */ 83 | repeat(count: number): string; 84 | 85 | /** 86 | * Returns true if the sequence of elements of searchString converted to a String is the 87 | * same as the corresponding elements of this object (converted to a String) starting at 88 | * position. Otherwise returns false. 89 | */ 90 | startsWith(searchString: string, position?: number): boolean; 91 | 92 | /** 93 | * Returns an HTML anchor element and sets the name attribute to the text value 94 | * @param name 95 | */ 96 | anchor(name: string): string; 97 | 98 | /** Returns a HTML element */ 99 | big(): string; 100 | 101 | /** Returns a HTML element */ 102 | blink(): string; 103 | 104 | /** Returns a HTML element */ 105 | bold(): string; 106 | 107 | /** Returns a HTML element */ 108 | fixed(): string 109 | 110 | /** Returns a HTML element and sets the color attribute value */ 111 | fontcolor(color: string): string 112 | 113 | /** Returns a HTML element and sets the size attribute value */ 114 | fontsize(size: number): string; 115 | 116 | /** Returns a HTML element and sets the size attribute value */ 117 | fontsize(size: string): string; 118 | 119 | /** Returns an HTML element */ 120 | italics(): string; 121 | 122 | /** Returns an HTML element and sets the href attribute value */ 123 | link(url: string): string; 124 | 125 | /** Returns a HTML element */ 126 | small(): string; 127 | 128 | /** Returns a HTML element */ 129 | strike(): string; 130 | 131 | /** Returns a HTML element */ 132 | sub(): string; 133 | 134 | /** Returns a HTML element */ 135 | sup(): string; 136 | 137 | /** 138 | * Shim for an ES6 iterable. Not intended for direct use by user code. 139 | */ 140 | "_es6-shim iterator_"(): IterableIteratorShim; 141 | } 142 | 143 | interface ArrayConstructor { 144 | /** 145 | * Creates an array from an array-like object. 146 | * @param arrayLike An array-like object to convert to an array. 147 | * @param mapfn A mapping function to call on every element of the array. 148 | * @param thisArg Value of 'this' used to invoke the mapfn. 149 | */ 150 | from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): Array; 151 | 152 | /** 153 | * Creates an array from an iterable object. 154 | * @param iterable An iterable object to convert to an array. 155 | * @param mapfn A mapping function to call on every element of the array. 156 | * @param thisArg Value of 'this' used to invoke the mapfn. 157 | */ 158 | from(iterable: IterableShim, mapfn: (v: T, k: number) => U, thisArg?: any): Array; 159 | 160 | /** 161 | * Creates an array from an array-like object. 162 | * @param arrayLike An array-like object to convert to an array. 163 | */ 164 | from(arrayLike: ArrayLike): Array; 165 | 166 | /** 167 | * Creates an array from an iterable object. 168 | * @param iterable An iterable object to convert to an array. 169 | */ 170 | from(iterable: IterableShim): Array; 171 | 172 | /** 173 | * Returns a new array from a set of elements. 174 | * @param items A set of elements to include in the new array object. 175 | */ 176 | of(...items: T[]): Array; 177 | } 178 | 179 | interface Array { 180 | /** 181 | * Returns the value of the first element in the array where predicate is true, and undefined 182 | * otherwise. 183 | * @param predicate find calls predicate once for each element of the array, in ascending 184 | * order, until it finds one where predicate returns true. If such an element is found, find 185 | * immediately returns that element value. Otherwise, find returns undefined. 186 | * @param thisArg If provided, it will be used as the this value for each invocation of 187 | * predicate. If it is not provided, undefined is used instead. 188 | */ 189 | find(predicate: (value: T, index: number, obj: Array) => boolean, thisArg?: any): T; 190 | 191 | /** 192 | * Returns the index of the first element in the array where predicate is true, and undefined 193 | * otherwise. 194 | * @param predicate find calls predicate once for each element of the array, in ascending 195 | * order, until it finds one where predicate returns true. If such an element is found, find 196 | * immediately returns that element value. Otherwise, find returns undefined. 197 | * @param thisArg If provided, it will be used as the this value for each invocation of 198 | * predicate. If it is not provided, undefined is used instead. 199 | */ 200 | findIndex(predicate: (value: T) => boolean, thisArg?: any): number; 201 | 202 | /** 203 | * Returns the this object after filling the section identified by start and end with value 204 | * @param value value to fill array section with 205 | * @param start index to start filling the array at. If start is negative, it is treated as 206 | * length+start where length is the length of the array. 207 | * @param end index to stop filling the array at. If end is negative, it is treated as 208 | * length+end. 209 | */ 210 | fill(value: T, start?: number, end?: number): T[]; 211 | 212 | /** 213 | * Returns the this object after copying a section of the array identified by start and end 214 | * to the same array starting at position target 215 | * @param target If target is negative, it is treated as length+target where length is the 216 | * length of the array. 217 | * @param start If start is negative, it is treated as length+start. If end is negative, it 218 | * is treated as length+end. 219 | * @param end If not specified, length of the this object is used as its default value. 220 | */ 221 | copyWithin(target: number, start: number, end?: number): T[]; 222 | 223 | /** 224 | * Returns an array of key, value pairs for every entry in the array 225 | */ 226 | entries(): IterableIteratorShim<[number, T]>; 227 | 228 | /** 229 | * Returns an list of keys in the array 230 | */ 231 | keys(): IterableIteratorShim; 232 | 233 | /** 234 | * Returns an list of values in the array 235 | */ 236 | values(): IterableIteratorShim; 237 | 238 | /** 239 | * Shim for an ES6 iterable. Not intended for direct use by user code. 240 | */ 241 | "_es6-shim iterator_"(): IterableIteratorShim; 242 | } 243 | 244 | interface NumberConstructor { 245 | /** 246 | * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1 247 | * that is representable as a Number value, which is approximately: 248 | * 2.2204460492503130808472633361816 x 10‍−‍16. 249 | */ 250 | EPSILON: number; 251 | 252 | /** 253 | * Returns true if passed value is finite. 254 | * Unlike the global isFininte, Number.isFinite doesn't forcibly convert the parameter to a 255 | * number. Only finite values of the type number, result in true. 256 | * @param number A numeric value. 257 | */ 258 | isFinite(number: number): boolean; 259 | 260 | /** 261 | * Returns true if the value passed is an integer, false otherwise. 262 | * @param number A numeric value. 263 | */ 264 | isInteger(number: number): boolean; 265 | 266 | /** 267 | * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a 268 | * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter 269 | * to a number. Only values of the type number, that are also NaN, result in true. 270 | * @param number A numeric value. 271 | */ 272 | isNaN(number: number): boolean; 273 | 274 | /** 275 | * Returns true if the value passed is a safe integer. 276 | * @param number A numeric value. 277 | */ 278 | isSafeInteger(number: number): boolean; 279 | 280 | /** 281 | * The value of the largest integer n such that n and n + 1 are both exactly representable as 282 | * a Number value. 283 | * The value of Number.MIN_SAFE_INTEGER is 9007199254740991 2^53 − 1. 284 | */ 285 | MAX_SAFE_INTEGER: number; 286 | 287 | /** 288 | * The value of the smallest integer n such that n and n − 1 are both exactly representable as 289 | * a Number value. 290 | * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)). 291 | */ 292 | MIN_SAFE_INTEGER: number; 293 | 294 | /** 295 | * Converts a string to a floating-point number. 296 | * @param string A string that contains a floating-point number. 297 | */ 298 | parseFloat(string: string): number; 299 | 300 | /** 301 | * Converts A string to an integer. 302 | * @param s A string to convert into a number. 303 | * @param radix A value between 2 and 36 that specifies the base of the number in numString. 304 | * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal. 305 | * All other strings are considered decimal. 306 | */ 307 | parseInt(string: string, radix?: number): number; 308 | } 309 | 310 | interface ObjectConstructor { 311 | /** 312 | * Copy the values of all of the enumerable own properties from one or more source objects to a 313 | * target object. Returns the target object. 314 | * @param target The target object to copy to. 315 | * @param sources One or more source objects to copy properties from. 316 | */ 317 | assign(target: any, ...sources: any[]): any; 318 | 319 | /** 320 | * Returns true if the values are the same value, false otherwise. 321 | * @param value1 The first value. 322 | * @param value2 The second value. 323 | */ 324 | is(value1: any, value2: any): boolean; 325 | 326 | /** 327 | * Sets the prototype of a specified object o to object proto or null. Returns the object o. 328 | * @param o The object to change its prototype. 329 | * @param proto The value of the new prototype or null. 330 | * @remarks Requires `__proto__` support. 331 | */ 332 | setPrototypeOf(o: any, proto: any): any; 333 | } 334 | 335 | interface RegExp { 336 | /** 337 | * Returns a string indicating the flags of the regular expression in question. This field is read-only. 338 | * The characters in this string are sequenced and concatenated in the following order: 339 | * 340 | * - "g" for global 341 | * - "i" for ignoreCase 342 | * - "m" for multiline 343 | * - "u" for unicode 344 | * - "y" for sticky 345 | * 346 | * If no flags are set, the value is the empty string. 347 | */ 348 | flags: string; 349 | } 350 | 351 | interface Math { 352 | /** 353 | * Returns the number of leading zero bits in the 32-bit binary representation of a number. 354 | * @param x A numeric expression. 355 | */ 356 | clz32(x: number): number; 357 | 358 | /** 359 | * Returns the result of 32-bit multiplication of two numbers. 360 | * @param x First number 361 | * @param y Second number 362 | */ 363 | imul(x: number, y: number): number; 364 | 365 | /** 366 | * Returns the sign of the x, indicating whether x is positive, negative or zero. 367 | * @param x The numeric expression to test 368 | */ 369 | sign(x: number): number; 370 | 371 | /** 372 | * Returns the base 10 logarithm of a number. 373 | * @param x A numeric expression. 374 | */ 375 | log10(x: number): number; 376 | 377 | /** 378 | * Returns the base 2 logarithm of a number. 379 | * @param x A numeric expression. 380 | */ 381 | log2(x: number): number; 382 | 383 | /** 384 | * Returns the natural logarithm of 1 + x. 385 | * @param x A numeric expression. 386 | */ 387 | log1p(x: number): number; 388 | 389 | /** 390 | * Returns the result of (e^x - 1) of x (e raised to the power of x, where e is the base of 391 | * the natural logarithms). 392 | * @param x A numeric expression. 393 | */ 394 | expm1(x: number): number; 395 | 396 | /** 397 | * Returns the hyperbolic cosine of a number. 398 | * @param x A numeric expression that contains an angle measured in radians. 399 | */ 400 | cosh(x: number): number; 401 | 402 | /** 403 | * Returns the hyperbolic sine of a number. 404 | * @param x A numeric expression that contains an angle measured in radians. 405 | */ 406 | sinh(x: number): number; 407 | 408 | /** 409 | * Returns the hyperbolic tangent of a number. 410 | * @param x A numeric expression that contains an angle measured in radians. 411 | */ 412 | tanh(x: number): number; 413 | 414 | /** 415 | * Returns the inverse hyperbolic cosine of a number. 416 | * @param x A numeric expression that contains an angle measured in radians. 417 | */ 418 | acosh(x: number): number; 419 | 420 | /** 421 | * Returns the inverse hyperbolic sine of a number. 422 | * @param x A numeric expression that contains an angle measured in radians. 423 | */ 424 | asinh(x: number): number; 425 | 426 | /** 427 | * Returns the inverse hyperbolic tangent of a number. 428 | * @param x A numeric expression that contains an angle measured in radians. 429 | */ 430 | atanh(x: number): number; 431 | 432 | /** 433 | * Returns the square root of the sum of squares of its arguments. 434 | * @param values Values to compute the square root for. 435 | * If no arguments are passed, the result is +0. 436 | * If there is only one argument, the result is the absolute value. 437 | * If any argument is +Infinity or -Infinity, the result is +Infinity. 438 | * If any argument is NaN, the result is NaN. 439 | * If all arguments are either +0 or −0, the result is +0. 440 | */ 441 | hypot(...values: number[]): number; 442 | 443 | /** 444 | * Returns the integral part of the a numeric expression, x, removing any fractional digits. 445 | * If x is already an integer, the result is x. 446 | * @param x A numeric expression. 447 | */ 448 | trunc(x: number): number; 449 | 450 | /** 451 | * Returns the nearest single precision float representation of a number. 452 | * @param x A numeric expression. 453 | */ 454 | fround(x: number): number; 455 | 456 | /** 457 | * Returns an implementation-dependent approximation to the cube root of number. 458 | * @param x A numeric expression. 459 | */ 460 | cbrt(x: number): number; 461 | } 462 | 463 | interface PromiseLike { 464 | /** 465 | * Attaches callbacks for the resolution and/or rejection of the Promise. 466 | * @param onfulfilled The callback to execute when the Promise is resolved. 467 | * @param onrejected The callback to execute when the Promise is rejected. 468 | * @returns A Promise for the completion of which ever callback is executed. 469 | */ 470 | then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): PromiseLike; 471 | then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): PromiseLike; 472 | } 473 | 474 | /** 475 | * Represents the completion of an asynchronous operation 476 | */ 477 | interface Promise { 478 | /** 479 | * Attaches callbacks for the resolution and/or rejection of the Promise. 480 | * @param onfulfilled The callback to execute when the Promise is resolved. 481 | * @param onrejected The callback to execute when the Promise is rejected. 482 | * @returns A Promise for the completion of which ever callback is executed. 483 | */ 484 | then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => TResult | PromiseLike): Promise; 485 | then(onfulfilled?: (value: T) => TResult | PromiseLike, onrejected?: (reason: any) => void): Promise; 486 | 487 | /** 488 | * Attaches a callback for only the rejection of the Promise. 489 | * @param onrejected The callback to execute when the Promise is rejected. 490 | * @returns A Promise for the completion of the callback. 491 | */ 492 | catch(onrejected?: (reason: any) => T | PromiseLike): Promise; 493 | catch(onrejected?: (reason: any) => void): Promise; 494 | } 495 | 496 | interface PromiseConstructor { 497 | /** 498 | * A reference to the prototype. 499 | */ 500 | prototype: Promise; 501 | 502 | /** 503 | * Creates a new Promise. 504 | * @param executor A callback used to initialize the promise. This callback is passed two arguments: 505 | * a resolve callback used resolve the promise with a value or the result of another promise, 506 | * and a reject callback used to reject the promise with a provided reason or error. 507 | */ 508 | new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; 509 | 510 | /** 511 | * Creates a Promise that is resolved with an array of results when all of the provided Promises 512 | * resolve, or rejected when any Promise is rejected. 513 | * @param values An array of Promises. 514 | * @returns A new Promise. 515 | */ 516 | all(values: IterableShim>): Promise; 517 | 518 | /** 519 | * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved 520 | * or rejected. 521 | * @param values An array of Promises. 522 | * @returns A new Promise. 523 | */ 524 | race(values: IterableShim>): Promise; 525 | 526 | /** 527 | * Creates a new rejected promise for the provided reason. 528 | * @param reason The reason the promise was rejected. 529 | * @returns A new rejected Promise. 530 | */ 531 | reject(reason: any): Promise; 532 | 533 | /** 534 | * Creates a new rejected promise for the provided reason. 535 | * @param reason The reason the promise was rejected. 536 | * @returns A new rejected Promise. 537 | */ 538 | reject(reason: any): Promise; 539 | 540 | /** 541 | * Creates a new resolved promise for the provided value. 542 | * @param value A promise. 543 | * @returns A promise whose internal state matches the provided promise. 544 | */ 545 | resolve(value: T | PromiseLike): Promise; 546 | 547 | /** 548 | * Creates a new resolved promise . 549 | * @returns A resolved promise. 550 | */ 551 | resolve(): Promise; 552 | } 553 | 554 | declare var Promise: PromiseConstructor; 555 | 556 | interface Map { 557 | clear(): void; 558 | delete(key: K): boolean; 559 | forEach(callbackfn: (value: V, index: K, map: Map) => void, thisArg?: any): void; 560 | get(key: K): V; 561 | has(key: K): boolean; 562 | set(key: K, value?: V): Map; 563 | size: number; 564 | entries(): IterableIteratorShim<[K, V]>; 565 | keys(): IterableIteratorShim; 566 | values(): IterableIteratorShim; 567 | } 568 | 569 | interface MapConstructor { 570 | new (): Map; 571 | new (iterable: IterableShim<[K, V]>): Map; 572 | prototype: Map; 573 | } 574 | 575 | declare var Map: MapConstructor; 576 | 577 | interface Set { 578 | add(value: T): Set; 579 | clear(): void; 580 | delete(value: T): boolean; 581 | forEach(callbackfn: (value: T, index: T, set: Set) => void, thisArg?: any): void; 582 | has(value: T): boolean; 583 | size: number; 584 | entries(): IterableIteratorShim<[T, T]>; 585 | keys(): IterableIteratorShim; 586 | values(): IterableIteratorShim; 587 | } 588 | 589 | interface SetConstructor { 590 | new (): Set; 591 | new (iterable: IterableShim): Set; 592 | prototype: Set; 593 | } 594 | 595 | declare var Set: SetConstructor; 596 | 597 | interface WeakMap { 598 | delete(key: K): boolean; 599 | get(key: K): V; 600 | has(key: K): boolean; 601 | set(key: K, value?: V): WeakMap; 602 | } 603 | 604 | interface WeakMapConstructor { 605 | new (): WeakMap; 606 | new (iterable: IterableShim<[K, V]>): WeakMap; 607 | prototype: WeakMap; 608 | } 609 | 610 | declare var WeakMap: WeakMapConstructor; 611 | 612 | interface WeakSet { 613 | add(value: T): WeakSet; 614 | delete(value: T): boolean; 615 | has(value: T): boolean; 616 | } 617 | 618 | interface WeakSetConstructor { 619 | new (): WeakSet; 620 | new (iterable: IterableShim): WeakSet; 621 | prototype: WeakSet; 622 | } 623 | 624 | declare var WeakSet: WeakSetConstructor; 625 | 626 | declare module Reflect { 627 | function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; 628 | function construct(target: Function, argumentsList: ArrayLike): any; 629 | function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; 630 | function deleteProperty(target: any, propertyKey: PropertyKey): boolean; 631 | function enumerate(target: any): IterableIteratorShim; 632 | function get(target: any, propertyKey: PropertyKey, receiver?: any): any; 633 | function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; 634 | function getPrototypeOf(target: any): any; 635 | function has(target: any, propertyKey: PropertyKey): boolean; 636 | function isExtensible(target: any): boolean; 637 | function ownKeys(target: any): Array; 638 | function preventExtensions(target: any): boolean; 639 | function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; 640 | function setPrototypeOf(target: any, proto: any): boolean; 641 | } 642 | 643 | declare module "es6-shim" { 644 | var String: StringConstructor; 645 | var Array: ArrayConstructor; 646 | var Number: NumberConstructor; 647 | var Math: Math; 648 | var Object: ObjectConstructor; 649 | var Map: MapConstructor; 650 | var Set: SetConstructor; 651 | var WeakMap: WeakMapConstructor; 652 | var WeakSet: WeakSetConstructor; 653 | var Promise: PromiseConstructor; 654 | module Reflect { 655 | function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any; 656 | function construct(target: Function, argumentsList: ArrayLike): any; 657 | function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean; 658 | function deleteProperty(target: any, propertyKey: PropertyKey): boolean; 659 | function enumerate(target: any): Iterator; 660 | function get(target: any, propertyKey: PropertyKey, receiver?: any): any; 661 | function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor; 662 | function getPrototypeOf(target: any): any; 663 | function has(target: any, propertyKey: PropertyKey): boolean; 664 | function isExtensible(target: any): boolean; 665 | function ownKeys(target: any): Array; 666 | function preventExtensions(target: any): boolean; 667 | function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean; 668 | function setPrototypeOf(target: any, proto: any): boolean; 669 | } 670 | } -------------------------------------------------------------------------------- /typings/main/ambient/hammerjs/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/74a4dfc1bc2dfadec47b8aae953b28546cb9c6b7/hammerjs/hammerjs.d.ts 3 | // Type definitions for Hammer.js 2.0.4 4 | // Project: http://hammerjs.github.io/ 5 | // Definitions by: Philip Bulley , Han Lin Yap 6 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 7 | 8 | declare var Hammer:HammerStatic; 9 | 10 | declare module "hammerjs" { 11 | export = Hammer; 12 | } 13 | 14 | interface HammerStatic 15 | { 16 | new( element:HTMLElement, options?:any ): HammerManager; 17 | 18 | defaults:HammerDefaults; 19 | 20 | VERSION: number; 21 | 22 | INPUT_START: number; 23 | INPUT_MOVE: number; 24 | INPUT_END: number; 25 | INPUT_CANCEL: number; 26 | 27 | STATE_POSSIBLE: number; 28 | STATE_BEGAN: number; 29 | STATE_CHANGED: number; 30 | STATE_ENDED: number; 31 | STATE_RECOGNIZED: number; 32 | STATE_CANCELLED: number; 33 | STATE_FAILED: number; 34 | 35 | DIRECTION_NONE: number; 36 | DIRECTION_LEFT: number; 37 | DIRECTION_RIGHT: number; 38 | DIRECTION_UP: number; 39 | DIRECTION_DOWN: number; 40 | DIRECTION_HORIZONTAL: number; 41 | DIRECTION_VERTICAL: number; 42 | DIRECTION_ALL: number; 43 | 44 | Manager: HammerManager; 45 | Input: HammerInput; 46 | TouchAction: TouchAction; 47 | 48 | TouchInput: TouchInput; 49 | MouseInput: MouseInput; 50 | PointerEventInput: PointerEventInput; 51 | TouchMouseInput: TouchMouseInput; 52 | SingleTouchInput: SingleTouchInput; 53 | 54 | Recognizer: RecognizerStatic; 55 | AttrRecognizer: AttrRecognizerStatic; 56 | Tap: TapRecognizerStatic; 57 | Pan: PanRecognizerStatic; 58 | Swipe: SwipeRecognizerStatic; 59 | Pinch: PinchRecognizerStatic; 60 | Rotate: RotateRecognizerStatic; 61 | Press: PressRecognizerStatic; 62 | 63 | on( target:EventTarget, types:string, handler:Function ):void; 64 | off( target:EventTarget, types:string, handler:Function ):void; 65 | each( obj:any, iterator:Function, context:any ): void; 66 | merge( dest:any, src:any ): any; 67 | extend( dest:any, src:any, merge:boolean ): any; 68 | inherit( child:Function, base:Function, properties:any ):any; 69 | bindFn( fn:Function, context:any ):Function; 70 | prefixed( obj:any, property:string ):string; 71 | } 72 | 73 | interface HammerDefaults 74 | { 75 | domEvents:boolean; 76 | enable:boolean; 77 | preset:any[]; 78 | touchAction:string; 79 | cssProps:CssProps; 80 | 81 | inputClass():void; 82 | inputTarget():void; 83 | } 84 | 85 | interface CssProps 86 | { 87 | contentZooming:string; 88 | tapHighlightColor:string; 89 | touchCallout:string; 90 | touchSelect:string; 91 | userDrag:string; 92 | userSelect:string; 93 | } 94 | 95 | interface HammerOptions extends HammerDefaults 96 | { 97 | 98 | } 99 | 100 | interface HammerManager 101 | { 102 | new( element:HTMLElement, options?:any ):HammerManager; 103 | 104 | add( recogniser:Recognizer ):Recognizer; 105 | add( recogniser:Recognizer ):HammerManager; 106 | add( recogniser:Recognizer[] ):Recognizer; 107 | add( recogniser:Recognizer[] ):HammerManager; 108 | destroy():void; 109 | emit( event:string, data:any ):void; 110 | get( recogniser:Recognizer ):Recognizer; 111 | get( recogniser:string ):Recognizer; 112 | off( events:string, handler?:( event:HammerInput ) => void ):void; 113 | on( events:string, handler:( event:HammerInput ) => void ):void; 114 | recognize( inputData:any ):void; 115 | remove( recogniser:Recognizer ):HammerManager; 116 | remove( recogniser:string ):HammerManager; 117 | set( options:HammerOptions ):HammerManager; 118 | stop( force:boolean ):void; 119 | } 120 | 121 | declare class HammerInput 122 | { 123 | constructor( manager:HammerManager, callback:Function ); 124 | 125 | destroy():void; 126 | handler():void; 127 | init():void; 128 | 129 | /** Name of the event. Like panstart. */ 130 | type:string; 131 | 132 | /** Movement of the X axis. */ 133 | deltaX:number; 134 | 135 | /** Movement of the Y axis. */ 136 | deltaY:number; 137 | 138 | /** Total time in ms since the first input. */ 139 | deltaTime:number; 140 | 141 | /** Distance moved. */ 142 | distance:number; 143 | 144 | /** Angle moved. */ 145 | angle:number; 146 | 147 | /** Velocity on the X axis, in px/ms. */ 148 | velocityX:number; 149 | 150 | /** Velocity on the Y axis, in px/ms */ 151 | velocityY:number; 152 | 153 | /** Highest velocityX/Y value. */ 154 | velocity:number; 155 | 156 | /** Direction moved. Matches the DIRECTION constants. */ 157 | direction:number; 158 | 159 | /** Direction moved from it's starting point. Matches the DIRECTION constants. */ 160 | offsetDirection:string; 161 | 162 | /** Scaling that has been done when multi-touch. 1 on a single touch. */ 163 | scale:number; 164 | 165 | /** Rotation that has been done when multi-touch. 0 on a single touch. */ 166 | rotation:number; 167 | 168 | /** Center position for multi-touch, or just the single pointer. */ 169 | center:HammerPoint; 170 | 171 | /** Source event object, type TouchEvent, MouseEvent or PointerEvent. */ 172 | srcEvent:TouchEvent | MouseEvent | PointerEvent; 173 | 174 | /** Target that received the event. */ 175 | target:HTMLElement; 176 | 177 | /** Primary pointer type, could be touch, mouse, pen or kinect. */ 178 | pointerType:string; 179 | 180 | /** Event type, matches the INPUT constants. */ 181 | eventType:string; 182 | 183 | /** true when the first input. */ 184 | isFirst:boolean; 185 | 186 | /** true when the final (last) input. */ 187 | isFinal:boolean; 188 | 189 | /** Array with all pointers, including the ended pointers (touchend, mouseup). */ 190 | pointers:any[]; 191 | 192 | /** Array with all new/moved/lost pointers. */ 193 | changedPointers:any[]; 194 | 195 | /** Reference to the srcEvent.preventDefault() method. Only for experts! */ 196 | preventDefault:Function; 197 | } 198 | 199 | declare class MouseInput extends HammerInput 200 | { 201 | constructor( manager:HammerManager, callback:Function ); 202 | } 203 | 204 | declare class PointerEventInput extends HammerInput 205 | { 206 | constructor( manager:HammerManager, callback:Function ); 207 | } 208 | 209 | declare class SingleTouchInput extends HammerInput 210 | { 211 | constructor( manager:HammerManager, callback:Function ); 212 | } 213 | 214 | declare class TouchInput extends HammerInput 215 | { 216 | constructor( manager:HammerManager, callback:Function ); 217 | } 218 | 219 | declare class TouchMouseInput extends HammerInput 220 | { 221 | constructor( manager:HammerManager, callback:Function ); 222 | } 223 | 224 | interface RecognizerStatic 225 | { 226 | new( options?:any ):Recognizer; 227 | } 228 | 229 | interface Recognizer 230 | { 231 | defaults:any; 232 | 233 | canEmit():boolean; 234 | canRecognizeWith( otherRecognizer:Recognizer ):boolean; 235 | dropRecognizeWith( otherRecognizer:Recognizer ):Recognizer; 236 | dropRecognizeWith( otherRecognizer:string ):Recognizer; 237 | dropRequireFailure( otherRecognizer:Recognizer ):Recognizer; 238 | dropRequireFailure( otherRecognizer:string ):Recognizer; 239 | emit( input:HammerInput ):void; 240 | getTouchAction():any[]; 241 | hasRequireFailures():boolean; 242 | process( inputData:HammerInput ):string; 243 | recognize( inputData:HammerInput ):void; 244 | recognizeWith( otherRecognizer:Recognizer ):Recognizer; 245 | recognizeWith( otherRecognizer:string ):Recognizer; 246 | requireFailure( otherRecognizer:Recognizer ):Recognizer; 247 | requireFailure( otherRecognizer:string ):Recognizer; 248 | reset():void; 249 | set( options?:any ):Recognizer; 250 | tryEmit( input:HammerInput ):void; 251 | } 252 | 253 | interface AttrRecognizerStatic 254 | { 255 | attrTest( input:HammerInput ):boolean; 256 | process( input:HammerInput ):any; 257 | } 258 | 259 | interface AttrRecognizer extends Recognizer 260 | { 261 | new( options?:any ):AttrRecognizer; 262 | } 263 | 264 | interface PanRecognizerStatic 265 | { 266 | new( options?:any ):PanRecognizer; 267 | } 268 | 269 | interface PanRecognizer extends AttrRecognizer 270 | { 271 | } 272 | 273 | interface PinchRecognizerStatic 274 | { 275 | new( options?:any ):PinchRecognizer; 276 | } 277 | 278 | interface PinchRecognizer extends AttrRecognizer 279 | { 280 | } 281 | 282 | interface PressRecognizerStatic 283 | { 284 | new( options?:any ):PressRecognizer; 285 | } 286 | 287 | interface PressRecognizer extends AttrRecognizer 288 | { 289 | } 290 | 291 | interface RotateRecognizerStatic 292 | { 293 | new( options?:any ):RotateRecognizer; 294 | } 295 | 296 | interface RotateRecognizer extends AttrRecognizer 297 | { 298 | } 299 | 300 | interface SwipeRecognizerStatic 301 | { 302 | new( options?:any ):SwipeRecognizer; 303 | } 304 | 305 | interface SwipeRecognizer extends AttrRecognizer 306 | { 307 | } 308 | 309 | interface TapRecognizerStatic 310 | { 311 | new( options?:any ):TapRecognizer; 312 | } 313 | 314 | interface TapRecognizer extends AttrRecognizer 315 | { 316 | } 317 | 318 | declare class TouchAction 319 | { 320 | constructor( manager:HammerManager, value:string ); 321 | 322 | compute():string; 323 | preventDefaults( input:HammerInput ):void; 324 | preventSrc( srcEvent:any ):void; 325 | set( value:string ):void; 326 | update():void; 327 | } 328 | 329 | interface HammerPoint 330 | { 331 | x: number; 332 | y: number; 333 | } -------------------------------------------------------------------------------- /typings/main/ambient/jasmine/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/4b36b94d5910aa8a4d20bdcd5bd1f9ae6ad18d3c/jasmine/jasmine.d.ts 3 | // Type definitions for Jasmine 2.2 4 | // Project: http://jasmine.github.io/ 5 | // Definitions by: Boris Yankov , Theodore Brown , David Pärsson 6 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 7 | 8 | 9 | // For ddescribe / iit use : https://github.com/borisyankov/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts 10 | 11 | declare function describe(description: string, specDefinitions: () => void): void; 12 | declare function fdescribe(description: string, specDefinitions: () => void): void; 13 | declare function xdescribe(description: string, specDefinitions: () => void): void; 14 | 15 | declare function it(expectation: string, assertion?: () => void, timeout?: number): void; 16 | declare function it(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; 17 | declare function fit(expectation: string, assertion?: () => void, timeout?: number): void; 18 | declare function fit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; 19 | declare function xit(expectation: string, assertion?: () => void, timeout?: number): void; 20 | declare function xit(expectation: string, assertion?: (done: () => void) => void, timeout?: number): void; 21 | 22 | /** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */ 23 | declare function pending(reason?: string): void; 24 | 25 | declare function beforeEach(action: () => void, timeout?: number): void; 26 | declare function beforeEach(action: (done: () => void) => void, timeout?: number): void; 27 | declare function afterEach(action: () => void, timeout?: number): void; 28 | declare function afterEach(action: (done: () => void) => void, timeout?: number): void; 29 | 30 | declare function beforeAll(action: () => void, timeout?: number): void; 31 | declare function beforeAll(action: (done: () => void) => void, timeout?: number): void; 32 | declare function afterAll(action: () => void, timeout?: number): void; 33 | declare function afterAll(action: (done: () => void) => void, timeout?: number): void; 34 | 35 | declare function expect(spy: Function): jasmine.Matchers; 36 | declare function expect(actual: any): jasmine.Matchers; 37 | 38 | declare function fail(e?: any): void; 39 | 40 | declare function spyOn(object: any, method: string): jasmine.Spy; 41 | 42 | declare function runs(asyncMethod: Function): void; 43 | declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void; 44 | declare function waits(timeout?: number): void; 45 | 46 | declare module jasmine { 47 | 48 | var clock: () => Clock; 49 | 50 | function any(aclass: any): Any; 51 | function anything(): Any; 52 | function arrayContaining(sample: any[]): ArrayContaining; 53 | function objectContaining(sample: any): ObjectContaining; 54 | function createSpy(name: string, originalFn?: Function): Spy; 55 | function createSpyObj(baseName: string, methodNames: any[]): any; 56 | function createSpyObj(baseName: string, methodNames: any[]): T; 57 | function pp(value: any): string; 58 | function getEnv(): Env; 59 | function addCustomEqualityTester(equalityTester: CustomEqualityTester): void; 60 | function addMatchers(matchers: CustomMatcherFactories): void; 61 | function stringMatching(str: string): Any; 62 | function stringMatching(str: RegExp): Any; 63 | 64 | interface Any { 65 | 66 | new (expectedClass: any): any; 67 | 68 | jasmineMatches(other: any): boolean; 69 | jasmineToString(): string; 70 | } 71 | 72 | // taken from TypeScript lib.core.es6.d.ts, applicable to CustomMatchers.contains() 73 | interface ArrayLike { 74 | length: number; 75 | [n: number]: T; 76 | } 77 | 78 | interface ArrayContaining { 79 | new (sample: any[]): any; 80 | 81 | asymmetricMatch(other: any): boolean; 82 | jasmineToString(): string; 83 | } 84 | 85 | interface ObjectContaining { 86 | new (sample: any): any; 87 | 88 | jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean; 89 | jasmineToString(): string; 90 | } 91 | 92 | interface Block { 93 | 94 | new (env: Env, func: SpecFunction, spec: Spec): any; 95 | 96 | execute(onComplete: () => void): void; 97 | } 98 | 99 | interface WaitsBlock extends Block { 100 | new (env: Env, timeout: number, spec: Spec): any; 101 | } 102 | 103 | interface WaitsForBlock extends Block { 104 | new (env: Env, timeout: number, latchFunction: SpecFunction, message: string, spec: Spec): any; 105 | } 106 | 107 | interface Clock { 108 | install(): void; 109 | uninstall(): void; 110 | /** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */ 111 | tick(ms: number): void; 112 | mockDate(date?: Date): void; 113 | } 114 | 115 | interface CustomEqualityTester { 116 | (first: any, second: any): boolean; 117 | } 118 | 119 | interface CustomMatcher { 120 | compare(actual: T, expected: T): CustomMatcherResult; 121 | compare(actual: any, expected: any): CustomMatcherResult; 122 | } 123 | 124 | interface CustomMatcherFactory { 125 | (util: MatchersUtil, customEqualityTesters: Array): CustomMatcher; 126 | } 127 | 128 | interface CustomMatcherFactories { 129 | [index: string]: CustomMatcherFactory; 130 | } 131 | 132 | interface CustomMatcherResult { 133 | pass: boolean; 134 | message?: string; 135 | } 136 | 137 | interface MatchersUtil { 138 | equals(a: any, b: any, customTesters?: Array): boolean; 139 | contains(haystack: ArrayLike | string, needle: any, customTesters?: Array): boolean; 140 | buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array): string; 141 | } 142 | 143 | interface Env { 144 | setTimeout: any; 145 | clearTimeout: void; 146 | setInterval: any; 147 | clearInterval: void; 148 | updateInterval: number; 149 | 150 | currentSpec: Spec; 151 | 152 | matchersClass: Matchers; 153 | 154 | version(): any; 155 | versionString(): string; 156 | nextSpecId(): number; 157 | addReporter(reporter: Reporter): void; 158 | execute(): void; 159 | describe(description: string, specDefinitions: () => void): Suite; 160 | // ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these 161 | beforeEach(beforeEachFunction: () => void): void; 162 | beforeAll(beforeAllFunction: () => void): void; 163 | currentRunner(): Runner; 164 | afterEach(afterEachFunction: () => void): void; 165 | afterAll(afterAllFunction: () => void): void; 166 | xdescribe(desc: string, specDefinitions: () => void): XSuite; 167 | it(description: string, func: () => void): Spec; 168 | // iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these 169 | xit(desc: string, func: () => void): XSpec; 170 | compareRegExps_(a: RegExp, b: RegExp, mismatchKeys: string[], mismatchValues: string[]): boolean; 171 | compareObjects_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; 172 | equals_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; 173 | contains_(haystack: any, needle: any): boolean; 174 | addCustomEqualityTester(equalityTester: CustomEqualityTester): void; 175 | addMatchers(matchers: CustomMatcherFactories): void; 176 | specFilter(spec: Spec): boolean; 177 | } 178 | 179 | interface FakeTimer { 180 | 181 | new (): any; 182 | 183 | reset(): void; 184 | tick(millis: number): void; 185 | runFunctionsWithinRange(oldMillis: number, nowMillis: number): void; 186 | scheduleFunction(timeoutKey: any, funcToCall: () => void, millis: number, recurring: boolean): void; 187 | } 188 | 189 | interface HtmlReporter { 190 | new (): any; 191 | } 192 | 193 | interface HtmlSpecFilter { 194 | new (): any; 195 | } 196 | 197 | interface Result { 198 | type: string; 199 | } 200 | 201 | interface NestedResults extends Result { 202 | description: string; 203 | 204 | totalCount: number; 205 | passedCount: number; 206 | failedCount: number; 207 | 208 | skipped: boolean; 209 | 210 | rollupCounts(result: NestedResults): void; 211 | log(values: any): void; 212 | getItems(): Result[]; 213 | addResult(result: Result): void; 214 | passed(): boolean; 215 | } 216 | 217 | interface MessageResult extends Result { 218 | values: any; 219 | trace: Trace; 220 | } 221 | 222 | interface ExpectationResult extends Result { 223 | matcherName: string; 224 | passed(): boolean; 225 | expected: any; 226 | actual: any; 227 | message: string; 228 | trace: Trace; 229 | } 230 | 231 | interface Trace { 232 | name: string; 233 | message: string; 234 | stack: any; 235 | } 236 | 237 | interface PrettyPrinter { 238 | 239 | new (): any; 240 | 241 | format(value: any): void; 242 | iterateObject(obj: any, fn: (property: string, isGetter: boolean) => void): void; 243 | emitScalar(value: any): void; 244 | emitString(value: string): void; 245 | emitArray(array: any[]): void; 246 | emitObject(obj: any): void; 247 | append(value: any): void; 248 | } 249 | 250 | interface StringPrettyPrinter extends PrettyPrinter { 251 | } 252 | 253 | interface Queue { 254 | 255 | new (env: any): any; 256 | 257 | env: Env; 258 | ensured: boolean[]; 259 | blocks: Block[]; 260 | running: boolean; 261 | index: number; 262 | offset: number; 263 | abort: boolean; 264 | 265 | addBefore(block: Block, ensure?: boolean): void; 266 | add(block: any, ensure?: boolean): void; 267 | insertNext(block: any, ensure?: boolean): void; 268 | start(onComplete?: () => void): void; 269 | isRunning(): boolean; 270 | next_(): void; 271 | results(): NestedResults; 272 | } 273 | 274 | interface Matchers { 275 | 276 | new (env: Env, actual: any, spec: Env, isNot?: boolean): any; 277 | 278 | env: Env; 279 | actual: any; 280 | spec: Env; 281 | isNot?: boolean; 282 | message(): any; 283 | 284 | (expected: any): boolean; 285 | toBe(expected: any, expectationFailOutput?: any): boolean; 286 | toEqual(expected: any, expectationFailOutput?: any): boolean; 287 | toMatch(expected: any, expectationFailOutput?: any): boolean; 288 | toBeDefined(expectationFailOutput?: any): boolean; 289 | toBeUndefined(expectationFailOutput?: any): boolean; 290 | toBeNull(expectationFailOutput?: any): boolean; 291 | toBeNaN(): boolean; 292 | toBeTruthy(expectationFailOutput?: any): boolean; 293 | toBeFalsy(expectationFailOutput?: any): boolean; 294 | toHaveBeenCalled(): boolean; 295 | toHaveBeenCalledWith(...params: any[]): boolean; 296 | toContain(expected: any, expectationFailOutput?: any): boolean; 297 | toBeLessThan(expected: any, expectationFailOutput?: any): boolean; 298 | toBeGreaterThan(expected: any, expectationFailOutput?: any): boolean; 299 | toBeCloseTo(expected: any, precision: any, expectationFailOutput?: any): boolean; 300 | toContainHtml(expected: string): boolean; 301 | toContainText(expected: string): boolean; 302 | toThrow(expected?: any): boolean; 303 | toThrowError(expected?: any, message?: string): boolean; 304 | not: Matchers; 305 | 306 | Any: Any; 307 | } 308 | 309 | interface Reporter { 310 | reportRunnerStarting(runner: Runner): void; 311 | reportRunnerResults(runner: Runner): void; 312 | reportSuiteResults(suite: Suite): void; 313 | reportSpecStarting(spec: Spec): void; 314 | reportSpecResults(spec: Spec): void; 315 | log(str: string): void; 316 | } 317 | 318 | interface MultiReporter extends Reporter { 319 | addReporter(reporter: Reporter): void; 320 | } 321 | 322 | interface Runner { 323 | 324 | new (env: Env): any; 325 | 326 | execute(): void; 327 | beforeEach(beforeEachFunction: SpecFunction): void; 328 | afterEach(afterEachFunction: SpecFunction): void; 329 | beforeAll(beforeAllFunction: SpecFunction): void; 330 | afterAll(afterAllFunction: SpecFunction): void; 331 | finishCallback(): void; 332 | addSuite(suite: Suite): void; 333 | add(block: Block): void; 334 | specs(): Spec[]; 335 | suites(): Suite[]; 336 | topLevelSuites(): Suite[]; 337 | results(): NestedResults; 338 | } 339 | 340 | interface SpecFunction { 341 | (spec?: Spec): void; 342 | } 343 | 344 | interface SuiteOrSpec { 345 | id: number; 346 | env: Env; 347 | description: string; 348 | queue: Queue; 349 | } 350 | 351 | interface Spec extends SuiteOrSpec { 352 | 353 | new (env: Env, suite: Suite, description: string): any; 354 | 355 | suite: Suite; 356 | 357 | afterCallbacks: SpecFunction[]; 358 | spies_: Spy[]; 359 | 360 | results_: NestedResults; 361 | matchersClass: Matchers; 362 | 363 | getFullName(): string; 364 | results(): NestedResults; 365 | log(arguments: any): any; 366 | runs(func: SpecFunction): Spec; 367 | addToQueue(block: Block): void; 368 | addMatcherResult(result: Result): void; 369 | expect(actual: any): any; 370 | waits(timeout: number): Spec; 371 | waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec; 372 | fail(e?: any): void; 373 | getMatchersClass_(): Matchers; 374 | addMatchers(matchersPrototype: CustomMatcherFactories): void; 375 | finishCallback(): void; 376 | finish(onComplete?: () => void): void; 377 | after(doAfter: SpecFunction): void; 378 | execute(onComplete?: () => void): any; 379 | addBeforesAndAftersToQueue(): void; 380 | explodes(): void; 381 | spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy; 382 | removeAllSpies(): void; 383 | } 384 | 385 | interface XSpec { 386 | id: number; 387 | runs(): void; 388 | } 389 | 390 | interface Suite extends SuiteOrSpec { 391 | 392 | new (env: Env, description: string, specDefinitions: () => void, parentSuite: Suite): any; 393 | 394 | parentSuite: Suite; 395 | 396 | getFullName(): string; 397 | finish(onComplete?: () => void): void; 398 | beforeEach(beforeEachFunction: SpecFunction): void; 399 | afterEach(afterEachFunction: SpecFunction): void; 400 | beforeAll(beforeAllFunction: SpecFunction): void; 401 | afterAll(afterAllFunction: SpecFunction): void; 402 | results(): NestedResults; 403 | add(suiteOrSpec: SuiteOrSpec): void; 404 | specs(): Spec[]; 405 | suites(): Suite[]; 406 | children(): any[]; 407 | execute(onComplete?: () => void): void; 408 | } 409 | 410 | interface XSuite { 411 | execute(): void; 412 | } 413 | 414 | interface Spy { 415 | (...params: any[]): any; 416 | 417 | identity: string; 418 | and: SpyAnd; 419 | calls: Calls; 420 | mostRecentCall: { args: any[]; }; 421 | argsForCall: any[]; 422 | wasCalled: boolean; 423 | callCount: number; 424 | } 425 | 426 | interface SpyAnd { 427 | /** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */ 428 | callThrough(): Spy; 429 | /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */ 430 | returnValue(val: any): void; 431 | /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */ 432 | callFake(fn: Function): Spy; 433 | /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */ 434 | throwError(msg: string): void; 435 | /** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */ 436 | stub(): Spy; 437 | } 438 | 439 | interface Calls { 440 | /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. **/ 441 | any(): boolean; 442 | /** By chaining the spy with calls.count(), will return the number of times the spy was called **/ 443 | count(): number; 444 | /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index **/ 445 | argsFor(index: number): any[]; 446 | /** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/ 447 | allArgs(): any[]; 448 | /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/ 449 | all(): CallInfo[]; 450 | /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/ 451 | mostRecent(): CallInfo; 452 | /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/ 453 | first(): CallInfo; 454 | /** By chaining the spy with calls.reset(), will clears all tracking for a spy **/ 455 | reset(): void; 456 | } 457 | 458 | interface CallInfo { 459 | /** The context (the this) for the call */ 460 | object: any; 461 | /** All arguments passed to the call */ 462 | args: any[]; 463 | } 464 | 465 | interface Util { 466 | inherit(childClass: Function, parentClass: Function): any; 467 | formatException(e: any): any; 468 | htmlEscape(str: string): string; 469 | argsToArray(args: any): any; 470 | extend(destination: any, source: any): any; 471 | } 472 | 473 | interface JsApiReporter extends Reporter { 474 | 475 | started: boolean; 476 | finished: boolean; 477 | result: any; 478 | messages: any; 479 | 480 | new (): any; 481 | 482 | suites(): Suite[]; 483 | summarize_(suiteOrSpec: SuiteOrSpec): any; 484 | results(): any; 485 | resultsForSpec(specId: any): any; 486 | log(str: any): any; 487 | resultsForSpecs(specIds: any): any; 488 | summarizeResult_(result: any): any; 489 | } 490 | 491 | interface Jasmine { 492 | Spec: Spec; 493 | clock: Clock; 494 | util: Util; 495 | } 496 | 497 | export var HtmlReporter: HtmlReporter; 498 | export var HtmlSpecFilter: HtmlSpecFilter; 499 | export var DEFAULT_TIMEOUT_INTERVAL: number; 500 | 501 | export interface GlobalPolluter { 502 | describe(description: string, specDefinitions: () => void): void; 503 | fdescribe(description: string, specDefinitions: () => void): void; 504 | xdescribe(description: string, specDefinitions: () => void): void; 505 | 506 | it(expectation: string, assertion?: () => void): void; 507 | it(expectation: string, assertion?: (done: () => void) => void): void; 508 | fit(expectation: string, assertion?: () => void): void; 509 | fit(expectation: string, assertion?: (done: () => void) => void): void; 510 | xit(expectation: string, assertion?: () => void): void; 511 | xit(expectation: string, assertion?: (done: () => void) => void): void; 512 | 513 | pending(): void; 514 | 515 | beforeEach(action: () => void): void; 516 | beforeEach(action: (done: () => void) => void): void; 517 | afterEach(action: () => void): void; 518 | afterEach(action: (done: () => void) => void): void; 519 | 520 | beforeAll(action: () => void): void; 521 | beforeAll(action: (done: () => void) => void): void; 522 | afterAll(action: () => void): void; 523 | afterAll(action: (done: () => void) => void): void; 524 | 525 | expect(spy: Function): jasmine.Matchers; 526 | expect(actual: any): jasmine.Matchers; 527 | 528 | fail(e?: any): void; 529 | 530 | spyOn(object: any, method: string): jasmine.Spy; 531 | 532 | runs(asyncMethod: Function): void; 533 | waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void; 534 | waits(timeout?: number): void; 535 | } 536 | } -------------------------------------------------------------------------------- /typings/main/ambient/webpack/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/95c02169ba8fa58ac1092422efbd2e3174a206f4/webpack/webpack.d.ts 3 | // Type definitions for webpack 1.12.2 4 | // Project: https://github.com/webpack/webpack 5 | // Definitions by: Qubo 6 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 7 | 8 | declare module "webpack" { 9 | namespace webpack { 10 | interface Configuration { 11 | entry?: string|string[]|Entry; 12 | devtool?: string; 13 | output?: Output; 14 | module?: Module; 15 | plugins?: (Plugin|Function)[]; 16 | } 17 | 18 | interface Entry { 19 | [name: string]: string|string[]; 20 | } 21 | 22 | interface Output { 23 | path?: string; 24 | filename?: string; 25 | chunkFilename?: string; 26 | publicPath?: string; 27 | } 28 | 29 | interface Module { 30 | loaders?: Loader[]; 31 | } 32 | 33 | interface Loader { 34 | exclude?: string[]; 35 | include?: string[]; 36 | test: RegExp; 37 | loader?: string; 38 | loaders?: string[]; 39 | query?: { 40 | [name: string]: any; 41 | } 42 | } 43 | 44 | interface Plugin { } 45 | 46 | interface Webpack { 47 | /** 48 | * optimize namespace 49 | */ 50 | optimize: Optimize; 51 | /** 52 | * dependencies namespace 53 | */ 54 | dependencies: Dependencies; 55 | /** 56 | * Replace resources that matches resourceRegExp with newResource. 57 | * If newResource is relative, it is resolve relative to the previous resource. 58 | * If newResource is a function, it is expected to overwrite the ‘request’ attribute of the supplied object. 59 | */ 60 | NormalModuleReplacementPlugin: NormalModuleReplacementPluginStatic; 61 | /** 62 | * Replaces the default resource, recursive flag or regExp generated by parsing with newContentResource, 63 | * newContentRecursive resp. newContextRegExp if the resource (directory) matches resourceRegExp. 64 | * If newContentResource is relative, it is resolve relative to the previous resource. 65 | * If newContentResource is a function, it is expected to overwrite the ‘request’ attribute of the supplied object. 66 | */ 67 | ContextReplacementPlugin: ContextReplacementPluginStatic; 68 | /** 69 | * Don’t generate modules for requests matching the provided RegExp. 70 | */ 71 | IgnorePlugin: IgnorePluginStatic; 72 | /** 73 | * A request for a normal module, which is resolved and built even before a require to it occurs. 74 | * This can boost performance. Try to profile the build first to determine clever prefetching points. 75 | */ 76 | PrefetchPlugin: PrefetchPluginStatic; 77 | /** 78 | * Apply a plugin (or array of plugins) to one or more resolvers (as specified in types). 79 | */ 80 | ResolverPlugin: ResolverPluginStatic; 81 | /** 82 | * Adds a banner to the top of each generated chunk. 83 | */ 84 | BannerPlugin: BannerPluginStatic; 85 | /** 86 | * Define free variables. Useful for having development builds with debug logging or adding global constants. 87 | */ 88 | DefinePlugin: DefinePluginStatic; 89 | /** 90 | * Automatically loaded modules. 91 | * Module (value) is loaded when the identifier (key) is used as free variable in a module. 92 | * The identifier is filled with the exports of the loaded module. 93 | */ 94 | ProvidePlugin: ProvidePluginStatic; 95 | /** 96 | * Adds SourceMaps for assets. 97 | */ 98 | SourceMapDevToolPlugin: SourceMapDevToolPluginStatic; 99 | /** 100 | * Enables Hot Module Replacement. (This requires records data if not in dev-server mode, recordsPath) 101 | * Generates Hot Update Chunks of each chunk in the records. 102 | * It also enables the API and makes __webpack_hash__ available in the bundle. 103 | */ 104 | HotModuleReplacementPlugin: HotModuleReplacementPluginStatic; 105 | /** 106 | * Adds useful free vars to the bundle. 107 | */ 108 | ExtendedAPIPlugin: ExtendedAPIPluginStatic; 109 | /** 110 | * When there are errors while compiling this plugin skips the emitting phase (and recording phase), 111 | * so there are no assets emitted that include errors. The emitted flag in the stats is false for all assets. 112 | */ 113 | NoErrorsPlugin: NoErrorsPluginStatic; 114 | /** 115 | * Does not watch specified files matching provided paths or RegExps. 116 | */ 117 | WatchIgnorePlugin: WatchIgnorePluginStatic; 118 | } 119 | 120 | interface Optimize { 121 | /** 122 | * Search for equal or similar files and deduplicate them in the output. 123 | * This comes with some overhead for the entry chunk, but can reduce file size effectively. 124 | * This is experimental and may crash, because of some missing implementations. (Report an issue) 125 | */ 126 | DedupePlugin: optimize.DedupePluginStatic; 127 | /** 128 | * Limit the chunk count to a defined value. Chunks are merged until it fits. 129 | */ 130 | LimitChunkCountPlugin: optimize.LimitChunkCountPluginStatic; 131 | /** 132 | * Merge small chunks that are lower than this min size (in chars). Size is approximated. 133 | */ 134 | MinChunkSizePlugin: optimize.MinChunkSizePluginStatic; 135 | /** 136 | * Assign the module and chunk ids by occurrence count. Ids that are used often get lower (shorter) ids. 137 | * This make ids predictable, reduces to total file size and is recommended. 138 | */ 139 | OccurenceOrderPlugin: optimize.OccurenceOrderPluginStatic; 140 | /** 141 | * Minimize all JavaScript output of chunks. Loaders are switched into minimizing mode. 142 | * You can pass an object containing UglifyJs options. 143 | */ 144 | UglifyJsPlugin: optimize.UglifyJsPluginStatic; 145 | CommonsChunkPlugin: optimize.CommonsChunkPluginStatic; 146 | /** 147 | * A plugin for a more aggressive chunk merging strategy. 148 | * Even similar chunks are merged if the total size is reduced enough. 149 | * As an option modules that are not common in these chunks can be moved up the chunk tree to the parents. 150 | */ 151 | AggressiveMergingPlugin: optimize.AggressiveMergingPluginStatic; 152 | } 153 | 154 | interface Dependencies { 155 | /** 156 | * Support Labeled Modules. 157 | */ 158 | LabeledModulesPlugin: dependencies.LabeledModulesPluginStatic; 159 | } 160 | 161 | interface DirectoryDescriptionFilePluginStatic { 162 | new(file: string, files: string[]): Plugin; 163 | } 164 | 165 | interface NormalModuleReplacementPluginStatic { 166 | new(resourceRegExp: any, newResource: any): Plugin; 167 | } 168 | 169 | interface ContextReplacementPluginStatic { 170 | new(resourceRegExp: any, newContentResource?: any, newContentRecursive?: any, newContentRegExp?: any): Plugin 171 | } 172 | 173 | interface IgnorePluginStatic { 174 | new(requestRegExp: any, contextRegExp?: any): Plugin; 175 | } 176 | 177 | interface PrefetchPluginStatic { 178 | new(context: any, request: any): Plugin; 179 | new(request: any): Plugin; 180 | } 181 | 182 | interface ResolverPluginStatic { 183 | new(plugins: Plugin[], files?: string[]): Plugin; 184 | DirectoryDescriptionFilePlugin: DirectoryDescriptionFilePluginStatic; 185 | /** 186 | * This plugin will append a path to the module directory to find a match, 187 | * which can be useful if you have a module which has an incorrect “main” entry in its package.json/bower.json etc (e.g. "main": "Gruntfile.js"). 188 | * You can use this plugin as a special case to load the correct file for this module. Example: 189 | */ 190 | FileAppendPlugin: FileAppendPluginStatic; 191 | } 192 | 193 | interface FileAppendPluginStatic { 194 | new(files: string[]): Plugin; 195 | } 196 | 197 | interface BannerPluginStatic { 198 | new(banner: any, options: any): Plugin; 199 | } 200 | 201 | interface DefinePluginStatic { 202 | new(definitions: any): Plugin; 203 | } 204 | 205 | interface ProvidePluginStatic { 206 | new(definitions: any): Plugin; 207 | } 208 | 209 | interface SourceMapDevToolPluginStatic { 210 | new(options: any): Plugin; 211 | } 212 | 213 | interface HotModuleReplacementPluginStatic { 214 | new(): Plugin; 215 | } 216 | 217 | interface ExtendedAPIPluginStatic { 218 | new(): Plugin; 219 | } 220 | 221 | interface NoErrorsPluginStatic { 222 | new(): Plugin; 223 | } 224 | 225 | interface WatchIgnorePluginStatic { 226 | new(paths: RegExp[]): Plugin; 227 | } 228 | 229 | namespace optimize { 230 | interface DedupePluginStatic { 231 | new(): Plugin; 232 | } 233 | interface LimitChunkCountPluginStatic { 234 | new(options: any): Plugin 235 | } 236 | interface MinChunkSizePluginStatic { 237 | new(options: any): Plugin; 238 | } 239 | interface OccurenceOrderPluginStatic { 240 | new(preferEntry: boolean): Plugin; 241 | } 242 | interface UglifyJsPluginStatic { 243 | new(options?: any): Plugin; 244 | } 245 | interface CommonsChunkPluginStatic { 246 | new(chunkName: string, filenames?: string|string[]): Plugin; 247 | new(options?: any): Plugin; 248 | } 249 | interface AggressiveMergingPluginStatic { 250 | new(options: any): Plugin; 251 | } 252 | } 253 | 254 | namespace dependencies { 255 | interface LabeledModulesPluginStatic { 256 | new(): Plugin; 257 | } 258 | } 259 | } 260 | 261 | var webpack: webpack.Webpack; 262 | 263 | //export default webpack; 264 | export = webpack; 265 | } -------------------------------------------------------------------------------- /typings/main/definitions/es6-promise/index.d.ts: -------------------------------------------------------------------------------- 1 | // Generated by typings 2 | // Source: https://raw.githubusercontent.com/typed-typings/npm-es6-promise/fb04188767acfec1defd054fc8024fafa5cd4de7/dist/es6-promise.d.ts 3 | declare module '~es6-promise/dist/es6-promise' { 4 | export interface Thenable { 5 | then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; 6 | then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Thenable; 7 | } 8 | 9 | export class Promise implements Thenable { 10 | /** 11 | * If you call resolve in the body of the callback passed to the constructor, 12 | * your promise is fulfilled with result object passed to resolve. 13 | * If you call reject your promise is rejected with the object passed to resolve. 14 | * For consistency and debugging (eg stack traces), obj should be an instanceof Error. 15 | * Any errors thrown in the constructor callback will be implicitly passed to reject(). 16 | */ 17 | constructor (callback: (resolve : (value?: R | Thenable) => void, reject: (error?: any) => void) => void); 18 | 19 | /** 20 | * onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. 21 | * Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. 22 | * Both callbacks have a single parameter , the fulfillment value or rejection reason. 23 | * "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. 24 | * If an error is thrown in the callback, the returned promise rejects with that error. 25 | * 26 | * @param onFulfilled called when/if "promise" resolves 27 | * @param onRejected called when/if "promise" rejects 28 | */ 29 | then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Promise; 30 | then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Promise; 31 | 32 | /** 33 | * Sugar for promise.then(undefined, onRejected) 34 | * 35 | * @param onRejected called when/if "promise" rejects 36 | */ 37 | catch (onRejected?: (error: any) => U | Thenable): Promise; 38 | 39 | /** 40 | * Make a new promise from the thenable. 41 | * A thenable is promise-like in as far as it has a "then" method. 42 | */ 43 | static resolve (): Promise; 44 | static resolve (value: R | Thenable): Promise; 45 | 46 | /** 47 | * Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error 48 | */ 49 | static reject (error: any): Promise; 50 | 51 | /** 52 | * Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects. 53 | * the array passed to all can be a mixture of promise-like objects and other objects. 54 | * The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value. 55 | */ 56 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable, T10 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; 57 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; 58 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; 59 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; 60 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6]>; 61 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable]): Promise<[T1, T2, T3, T4, T5]>; 62 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable ]): Promise<[T1, T2, T3, T4]>; 63 | static all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable]): Promise<[T1, T2, T3]>; 64 | static all(values: [T1 | Thenable, T2 | Thenable]): Promise<[T1, T2]>; 65 | static all(values: [T1 | Thenable]): Promise<[T1]>; 66 | static all(values: Array>): Promise; 67 | 68 | /** 69 | * Make a Promise that fulfills when any item fulfills, and rejects if any item rejects. 70 | */ 71 | static race (promises: (R | Thenable)[]): Promise; 72 | } 73 | 74 | /** 75 | * The polyfill method will patch the global environment (in this case to the Promise name) when called. 76 | */ 77 | export function polyfill (): void; 78 | } 79 | declare module 'es6-promise/dist/es6-promise' { 80 | export * from '~es6-promise/dist/es6-promise'; 81 | } 82 | declare module 'es6-promise' { 83 | export * from '~es6-promise/dist/es6-promise'; 84 | } 85 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const webpack = require('webpack'); 4 | const path = require('path'); 5 | const autoprefixer = require('autoprefixer'); 6 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 7 | const CopyWebpackPlugin = require('copy-webpack-plugin'); 8 | 9 | const ENV = process.env.NODE_ENV; 10 | const isTest = ENV === 'test'; 11 | const isProd = ENV === 'production'; 12 | const isDev = ENV === 'development' || ENV === ''; 13 | 14 | const config = { 15 | entry: { 16 | vendor: path.join(__dirname, 'src/vendor.ts'), 17 | main: path.join(__dirname, 'src/main.ts'), 18 | }, 19 | output: { 20 | path: `${__dirname}/dist`, 21 | filename: '[name].js', 22 | publicPath: '/' 23 | }, 24 | devtool: 'cheap-module-eval-source-map', 25 | debug: isDev, 26 | devServer: { 27 | contentBase: './dist', 28 | // 'content-base': './dist' 29 | }, 30 | // externals, 31 | resolve: { 32 | cache: !isTest, 33 | root: path.join(__dirname, 'src'), 34 | extensions: ['', '.ts', '.js', '.json', '.css', '.scss', '.html'], 35 | alias: { 36 | 'techfeed': path.resolve(__dirname, '..') 37 | } 38 | }, 39 | module: { 40 | loaders: [ 41 | { 42 | test: /\.ts$/, 43 | loader: 'awesome-typescript' 44 | }, 45 | { 46 | test: /\.json$/, 47 | loader: 'json' 48 | }, 49 | { 50 | test: /\.css$/, 51 | loaders: ['raw', 'css', 'postcss'] 52 | }, 53 | { 54 | test: /\.scss$/, 55 | loaders: ['raw', 'sass?sourceMap'], 56 | exclude: /node_modules/ 57 | }, 58 | { 59 | test: /\.html$/, 60 | loaders: ['raw'], 61 | exclude: ['src/index.html'] 62 | } 63 | ] 64 | }, 65 | plugins: [ 66 | new webpack.optimize.CommonsChunkPlugin({ 67 | name: 'vendor', 68 | minChunks: Infinity, 69 | }), 70 | new webpack.DefinePlugin({ENV}), 71 | new HtmlWebpackPlugin({ 72 | template: 'src/index.html', 73 | inject: true 74 | }), 75 | new CopyWebpackPlugin([ 76 | { 77 | from: 'src/**/*.html', 78 | to: 'dist' 79 | } 80 | ]), 81 | ], 82 | postcss: [ 83 | autoprefixer({ 84 | browsers: ['last 2 version'] 85 | }) 86 | ] 87 | }; 88 | // プロダクション環境限定の調整 89 | if (isProd) { 90 | config.plugins.push( 91 | new webpack.NoErrorsPlugin(), 92 | new webpack.optimize.DedupePlugin(), 93 | new webpack.optimize.UglifyJsPlugin() 94 | ); 95 | } 96 | 97 | module.exports = config; 98 | --------------------------------------------------------------------------------