new license file version [CI SKIP]

This commit is contained in:
2023-03-15 13:43:57 +00:00
parent d8a3063735
commit 00359d25c1
5600 changed files with 523898 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var AsapAction_1 = require("./AsapAction");
var AsapScheduler_1 = require("./AsapScheduler");
exports.asapScheduler = new AsapScheduler_1.AsapScheduler(AsapAction_1.AsapAction);
exports.asap = exports.asapScheduler;
//# sourceMappingURL=asap.js.map

View File

@@ -0,0 +1,96 @@
'use strict';
const {Transform} = require('stream');
module.exports = {
download(response, emitter, downloadBodySize) {
let downloaded = 0;
return new Transform({
transform(chunk, encoding, callback) {
downloaded += chunk.length;
const percent = downloadBodySize ? downloaded / downloadBodySize : 0;
// Let `flush()` be responsible for emitting the last event
if (percent < 1) {
emitter.emit('downloadProgress', {
percent,
transferred: downloaded,
total: downloadBodySize
});
}
callback(null, chunk);
},
flush(callback) {
emitter.emit('downloadProgress', {
percent: 1,
transferred: downloaded,
total: downloadBodySize
});
callback();
}
});
},
upload(request, emitter, uploadBodySize) {
const uploadEventFrequency = 150;
let uploaded = 0;
let progressInterval;
emitter.emit('uploadProgress', {
percent: 0,
transferred: 0,
total: uploadBodySize
});
request.once('error', () => {
clearInterval(progressInterval);
});
request.once('response', () => {
clearInterval(progressInterval);
emitter.emit('uploadProgress', {
percent: 1,
transferred: uploaded,
total: uploadBodySize
});
});
request.once('socket', socket => {
const onSocketConnect = () => {
progressInterval = setInterval(() => {
const lastUploaded = uploaded;
/* istanbul ignore next: see #490 (occurs randomly!) */
const headersSize = request._header ? Buffer.byteLength(request._header) : 0;
uploaded = socket.bytesWritten - headersSize;
// Don't emit events with unchanged progress and
// prevent last event from being emitted, because
// it's emitted when `response` is emitted
if (uploaded === lastUploaded || uploaded === uploadBodySize) {
return;
}
emitter.emit('uploadProgress', {
percent: uploadBodySize ? uploaded / uploadBodySize : 0,
transferred: uploaded,
total: uploadBodySize
});
}, uploadEventFrequency);
};
/* istanbul ignore next: hard to test */
if (socket.connecting) {
socket.once('connect', onSocketConnect);
} else if (socket.writable) {
// The socket is being reused from pool,
// so the connect event will not be emitted
onSocketConnect();
}
});
}
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"endWith.js","sources":["../../src/internal/operators/endWith.ts"],"names":[],"mappings":";;AACA,+CAA8C;AAC9C,uCAAsC;AA8DtC,SAAgB,OAAO;IAAI,eAAkC;SAAlC,UAAkC,EAAlC,qBAAkC,EAAlC,IAAkC;QAAlC,0BAAkC;;IAC3D,OAAO,UAAC,MAAqB,IAAK,OAAA,eAAM,CAAC,MAAM,EAAE,OAAE,eAAI,KAAK,EAAmB,EAA7C,CAA6C,CAAC;AAClF,CAAC;AAFD,0BAEC"}

View File

@@ -0,0 +1 @@
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0.00444,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0.00444,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0.00887,"78":0.01775,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0.00444,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0.00887,"99":0.00444,"100":0.00444,"101":0.00444,"102":0.02662,"103":0.00444,"104":0.00444,"105":0.00444,"106":0.00444,"107":0.01775,"108":1.30004,"109":0.7676,"110":0,"111":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0.00444,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.00887,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0.00887,"66":0,"67":0,"68":0.00444,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0.00444,"75":0,"76":0,"77":0.00887,"78":0,"79":0.00444,"80":0.01331,"81":0.00444,"83":0,"84":0,"85":0,"86":0,"87":0.00887,"88":0,"89":0.00444,"90":0,"91":0,"92":0.00887,"93":0.00444,"94":0,"95":0.15086,"96":0.01775,"97":0,"98":0,"99":0.00444,"100":0,"101":0.00444,"102":0.00444,"103":0.0355,"104":0.00444,"105":0.0355,"106":0.02219,"107":0.11093,"108":5.00937,"109":4.84077,"110":0,"111":0,"112":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00444,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.00887,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0.00444,"90":0,"91":0,"92":0,"93":0.28397,"94":0.42595,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0.00444,"18":0,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0.00444,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00444,"93":0,"94":0,"95":0,"96":0.00444,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.02219,"103":0,"104":0.01331,"105":0.00887,"106":0.00444,"107":0.04881,"108":1.24236,"109":1.4154},E:{"4":0.00444,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0.00444,"13":0.00444,"14":0.06656,"15":0.00887,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0.02662,"12.1":0.02219,"13.1":0.09318,"14.1":0.16417,"15.1":0.02662,"15.2-15.3":0.06656,"15.4":0.30615,"15.5":0.18635,"15.6":0.5635,"16.0":0.0843,"16.1":0.30172,"16.2":0.70548,"16.3":0.11536},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0,"8.1-8.4":0.01442,"9.0-9.2":0,"9.3":0.06054,"10.0-10.2":0,"10.3":0.08649,"11.0-11.2":0.00577,"11.3-11.4":0.00288,"12.0-12.1":0,"12.2-12.5":0.3229,"13.0-13.1":0.00288,"13.2":0,"13.3":0.01442,"13.4-13.7":0.03748,"14.0-14.4":0.4757,"14.5-14.8":0.64869,"15.0-15.1":0.19316,"15.2-15.3":0.2883,"15.4":0.38921,"15.5":1.07826,"15.6":3.57498,"16.0":5.41148,"16.1":7.90243,"16.2":6.3946,"16.3":0.82743},P:{"4":0.05168,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.02067,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.04134,"12.0":0.01034,"13.0":0.04134,"14.0":0.14471,"15.0":0.02067,"16.0":0.17571,"17.0":0.04134,"18.0":0.21706,"19.0":4.33083},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.10543},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.04733,"9":0,"10":0,"11":0.09466,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.35603},Q:{"13.1":0},O:{"0":0.01113},H:{"0":0.1106},L:{"0":45.0677},S:{"2.5":0}};

View File

@@ -0,0 +1,31 @@
import { Observable } from '../Observable';
import { Unsubscribable, ObservableInput } from '../types';
/**
* Creates an Observable that uses a resource which will be disposed at the same time as the Observable.
*
* <span class="informal">Use it when you catch yourself cleaning up after an Observable.</span>
*
* `using` is a factory operator, which accepts two functions. First function returns a disposable resource.
* It can be an arbitrary object that implements `unsubscribe` method. Second function will be injected with
* that object and should return an Observable. That Observable can use resource object during its execution.
* Both functions passed to `using` will be called every time someone subscribes - neither an Observable nor
* resource object will be shared in any way between subscriptions.
*
* When Observable returned by `using` is subscribed, Observable returned from the second function will be subscribed
* as well. All its notifications (nexted values, completion and error events) will be emitted unchanged by the output
* Observable. If however someone unsubscribes from the Observable or source Observable completes or errors by itself,
* the `unsubscribe` method on resource object will be called. This can be used to do any necessary clean up, which
* otherwise would have to be handled by hand. Note that complete or error notifications are not emitted when someone
* cancels subscription to an Observable via `unsubscribe`, so `using` can be used as a hook, allowing you to make
* sure that all resources which need to exist during an Observable execution will be disposed at appropriate time.
*
* @see {@link defer}
*
* @param {function(): ISubscription} resourceFactory A function which creates any resource object
* that implements `unsubscribe` method.
* @param {function(resource: ISubscription): Observable<T>} observableFactory A function which
* creates an Observable, that can use injected resource object.
* @return {Observable<T>} An Observable that behaves the same as Observable returned by `observableFactory`, but
* which - when completed, errored or unsubscribed - will also call `unsubscribe` on created resource object.
*/
export declare function using<T>(resourceFactory: () => Unsubscribable | void, observableFactory: (resource: Unsubscribable | void) => ObservableInput<T> | void): Observable<T>;

View File

@@ -0,0 +1,4 @@
// Microdata support
// http://www.w3.org/TR/html5/microdata.html
// By Addy Osmani
Modernizr.addTest('microdata', !!(document['getItems']));

View File

@@ -0,0 +1 @@
{"version":3,"file":"publishLast.js","sources":["../src/operator/publishLast.ts"],"names":[],"mappings":";;;;;AAAA,sDAAiD"}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J E F G BC","8":"A B"},B:{"1":"P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t","578":"C K L H M N O"},C:{"1":"0 O v w x y z SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"CC tB DC EC","4":"I u J E F G A B C K L H M N","194":"1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"I u J E F G A B C K L H M N O v w x"},E:{"2":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"G B C OC PC QC RC qB 9B SC rB"},G:{"1":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"2":"nC"},I:{"1":"tB I D oC pC qC rC AC sC tC"},J:{"1":"E A"},K:{"1":"B C e qB 9B rB","2":"A"},L:{"1":"D"},M:{"1":"D"},N:{"8":"A","260":"B"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"2":"9C"}},B:2,C:"Touch events"};

View File

@@ -0,0 +1,38 @@
let Declaration = require('../declaration')
class MaskBorder extends Declaration {
/**
* Return property name by final spec
*/
normalize () {
return this.name.replace('box-image', 'border')
}
/**
* Return flex property for 2012 spec
*/
prefixed (prop, prefix) {
let result = super.prefixed(prop, prefix)
if (prefix === '-webkit-') {
result = result.replace('border', 'box-image')
}
return result
}
}
MaskBorder.names = [
'mask-border',
'mask-border-source',
'mask-border-slice',
'mask-border-width',
'mask-border-outset',
'mask-border-repeat',
'mask-box-image',
'mask-box-image-source',
'mask-box-image-slice',
'mask-box-image-width',
'mask-box-image-outset',
'mask-box-image-repeat'
]
module.exports = MaskBorder

View File

@@ -0,0 +1 @@
{"version":3,"file":"fromEvent.js","sources":["../../src/add/observable/fromEvent.ts"],"names":[],"mappings":";;AAAA,gDAA8C"}

View File

@@ -0,0 +1,16 @@
export interface EmptyError extends Error {
}
export interface EmptyErrorCtor {
new (): EmptyError;
}
/**
* An error thrown when an Observable or a sequence was queried but has no
* elements.
*
* @see {@link first}
* @see {@link last}
* @see {@link single}
*
* @class EmptyError
*/
export declare const EmptyError: EmptyErrorCtor;

View File

@@ -0,0 +1,7 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("rxjs-compat/operators/tap"));
//# sourceMappingURL=tap.js.map

View File

@@ -0,0 +1,67 @@
import { Observable } from '../Observable';
import { concat } from '../observable/concat';
import { of } from '../observable/of';
import { MonoTypeOperatorFunction, SchedulerLike, OperatorFunction } from '../types';
/* tslint:disable:max-line-length */
/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
export function endWith<T>(scheduler: SchedulerLike): MonoTypeOperatorFunction<T>;
/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
export function endWith<T, A>(v1: A, scheduler: SchedulerLike): OperatorFunction<T, T | A>;
/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
export function endWith<T, A, B>(v1: A, v2: B, scheduler: SchedulerLike): OperatorFunction<T, T | A | B>;
/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
export function endWith<T, A, B, C>(v1: A, v2: B, v3: C, scheduler: SchedulerLike): OperatorFunction<T, T | A | B | C>;
/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
export function endWith<T, A, B, C, D>(v1: A, v2: B, v3: C, v4: D, scheduler: SchedulerLike): OperatorFunction<T, T | A | B | C | D>;
/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
export function endWith<T, A, B, C, D, E>(v1: A, v2: B, v3: C, v4: D, v5: E, scheduler: SchedulerLike): OperatorFunction<T, T | A | B | C | D | E>;
/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
export function endWith<T, A, B, C, D, E, F>(v1: A, v2: B, v3: C, v4: D, v5: E, v6: F, scheduler: SchedulerLike): OperatorFunction<T, T | A | B | C | D | E | F>;
export function endWith<T, A>(v1: A): OperatorFunction<T, T | A>;
export function endWith<T, A, B>(v1: A, v2: B): OperatorFunction<T, T | A | B>;
export function endWith<T, A, B, C>(v1: A, v2: B, v3: C): OperatorFunction<T, T | A | B | C>;
export function endWith<T, A, B, C, D>(v1: A, v2: B, v3: C, v4: D): OperatorFunction<T, T | A | B | C | D>;
export function endWith<T, A, B, C, D, E>(v1: A, v2: B, v3: C, v4: D, v5: E): OperatorFunction<T, T | A | B | C | D | E>;
export function endWith<T, A, B, C, D, E, F>(v1: A, v2: B, v3: C, v4: D, v5: E, v6: F): OperatorFunction<T, T | A | B | C | D | E | F>;
export function endWith<T, Z = T>(...array: Z[]): OperatorFunction<T, T | Z>;
/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
export function endWith<T, Z = T>(...array: Array<Z | SchedulerLike>): OperatorFunction<T, T | Z>;
/* tslint:enable:max-line-length */
/**
* Returns an Observable that emits the items you specify as arguments after it finishes emitting
* items emitted by the source Observable.
*
* ![](endWith.png)
*
* ## Example
* ### After the source observable completes, appends an emission and then completes too.
*
* ```ts
* import { of } from 'rxjs';
* import { endWith } from 'rxjs/operators';
*
* of('hi', 'how are you?', 'sorry, I have to go now').pipe(
* endWith('goodbye!'),
* )
* .subscribe(word => console.log(word));
* // result:
* // 'hi'
* // 'how are you?'
* // 'sorry, I have to go now'
* // 'goodbye!'
* ```
*
* @param {...T} values - Items you want the modified Observable to emit last.
* @param {SchedulerLike} [scheduler] - A {@link SchedulerLike} to use for scheduling
* the emissions of the `next` notifications.
* @return {Observable} An Observable that emits the items emitted by the source Observable
* and then emits the items in the specified Iterable.
* @method endWith
* @owner Observable
*/
export function endWith<T>(...array: Array<T | SchedulerLike>): MonoTypeOperatorFunction<T> {
return (source: Observable<T>) => concat(source, of(...array)) as Observable<T>;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"merge.js","sources":["../../src/add/observable/merge.ts"],"names":[],"mappings":";;AAAA,4CAA0C"}

View File

@@ -0,0 +1,96 @@
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var Subject_1 = require("../Subject");
var OuterSubscriber_1 = require("../OuterSubscriber");
var subscribeToResult_1 = require("../util/subscribeToResult");
function windowWhen(closingSelector) {
return function windowWhenOperatorFunction(source) {
return source.lift(new WindowOperator(closingSelector));
};
}
exports.windowWhen = windowWhen;
var WindowOperator = (function () {
function WindowOperator(closingSelector) {
this.closingSelector = closingSelector;
}
WindowOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));
};
return WindowOperator;
}());
var WindowSubscriber = (function (_super) {
__extends(WindowSubscriber, _super);
function WindowSubscriber(destination, closingSelector) {
var _this = _super.call(this, destination) || this;
_this.destination = destination;
_this.closingSelector = closingSelector;
_this.openWindow();
return _this;
}
WindowSubscriber.prototype.notifyNext = function (_outerValue, _innerValue, _outerIndex, _innerIndex, innerSub) {
this.openWindow(innerSub);
};
WindowSubscriber.prototype.notifyError = function (error) {
this._error(error);
};
WindowSubscriber.prototype.notifyComplete = function (innerSub) {
this.openWindow(innerSub);
};
WindowSubscriber.prototype._next = function (value) {
this.window.next(value);
};
WindowSubscriber.prototype._error = function (err) {
this.window.error(err);
this.destination.error(err);
this.unsubscribeClosingNotification();
};
WindowSubscriber.prototype._complete = function () {
this.window.complete();
this.destination.complete();
this.unsubscribeClosingNotification();
};
WindowSubscriber.prototype.unsubscribeClosingNotification = function () {
if (this.closingNotification) {
this.closingNotification.unsubscribe();
}
};
WindowSubscriber.prototype.openWindow = function (innerSub) {
if (innerSub === void 0) { innerSub = null; }
if (innerSub) {
this.remove(innerSub);
innerSub.unsubscribe();
}
var prevWindow = this.window;
if (prevWindow) {
prevWindow.complete();
}
var window = this.window = new Subject_1.Subject();
this.destination.next(window);
var closingNotifier;
try {
var closingSelector = this.closingSelector;
closingNotifier = closingSelector();
}
catch (e) {
this.destination.error(e);
this.window.error(e);
return;
}
this.add(this.closingNotification = subscribeToResult_1.subscribeToResult(this, closingNotifier));
};
return WindowSubscriber;
}(OuterSubscriber_1.OuterSubscriber));
//# sourceMappingURL=windowWhen.js.map

View File

@@ -0,0 +1,23 @@
import Binding from '../../../nodes/Binding';
import ElementWrapper from '../Element';
import InlineComponentWrapper from '../InlineComponent';
import Block from '../../Block';
import { Node, Identifier } from 'estree';
export default class BindingWrapper {
node: Binding;
parent: ElementWrapper | InlineComponentWrapper;
object: string;
handler: {
uses_context: boolean;
mutation: (Node | Node[]);
contextual_dependencies: Set<string>;
lhs?: Node;
};
snippet: Node;
is_readonly: boolean;
needs_lock: boolean;
constructor(block: Block, node: Binding, parent: ElementWrapper | InlineComponentWrapper);
get_dependencies(): Set<string>;
is_readonly_media_attribute(): boolean;
render(block: Block, lock: Identifier): void;
}

View File

@@ -0,0 +1,169 @@
import { Observable } from '../Observable';
import { isArray } from '../util/isArray';
import { isFunction } from '../util/isFunction';
import { NodeEventHandler } from './fromEvent';
import { map } from '../operators/map';
/* tslint:disable:max-line-length */
export function fromEventPattern<T>(addHandler: (handler: NodeEventHandler) => any, removeHandler?: (handler: NodeEventHandler, signal?: any) => void): Observable<T>;
/** @deprecated resultSelector no longer supported, pipe to map instead */
export function fromEventPattern<T>(addHandler: (handler: NodeEventHandler) => any, removeHandler?: (handler: NodeEventHandler, signal?: any) => void, resultSelector?: (...args: any[]) => T): Observable<T>;
/* tslint:enable:max-line-length */
/**
* Creates an Observable from an arbitrary API for registering event handlers.
*
* <span class="informal">When that method for adding event handler was something {@link fromEvent}
* was not prepared for.</span>
*
* ![](fromEventPattern.png)
*
* `fromEventPattern` allows you to convert into an Observable any API that supports registering handler functions
* for events. It is similar to {@link fromEvent}, but far
* more flexible. In fact, all use cases of {@link fromEvent} could be easily handled by
* `fromEventPattern` (although in slightly more verbose way).
*
* This operator accepts as a first argument an `addHandler` function, which will be injected with
* handler parameter. That handler is actually an event handler function that you now can pass
* to API expecting it. `addHandler` will be called whenever Observable
* returned by the operator is subscribed, so registering handler in API will not
* necessarily happen when `fromEventPattern` is called.
*
* After registration, every time an event that we listen to happens,
* Observable returned by `fromEventPattern` will emit value that event handler
* function was called with. Note that if event handler was called with more
* then one argument, second and following arguments will not appear in the Observable.
*
* If API you are using allows to unregister event handlers as well, you can pass to `fromEventPattern`
* another function - `removeHandler` - as a second parameter. It will be injected
* with the same handler function as before, which now you can use to unregister
* it from the API. `removeHandler` will be called when consumer of resulting Observable
* unsubscribes from it.
*
* In some APIs unregistering is actually handled differently. Method registering an event handler
* returns some kind of token, which is later used to identify which function should
* be unregistered or it itself has method that unregisters event handler.
* If that is the case with your API, make sure token returned
* by registering method is returned by `addHandler`. Then it will be passed
* as a second argument to `removeHandler`, where you will be able to use it.
*
* If you need access to all event handler parameters (not only the first one),
* or you need to transform them in any way, you can call `fromEventPattern` with optional
* third parameter - project function which will accept all arguments passed to
* event handler when it is called. Whatever is returned from project function will appear on
* resulting stream instead of usual event handlers first argument. This means
* that default project can be thought of as function that takes its first parameter
* and ignores the rest.
*
* ## Example
* ### Emits clicks happening on the DOM document
*
* ```ts
* import { fromEventPattern } from 'rxjs';
*
* function addClickHandler(handler) {
* document.addEventListener('click', handler);
* }
*
* function removeClickHandler(handler) {
* document.removeEventListener('click', handler);
* }
*
* const clicks = fromEventPattern(
* addClickHandler,
* removeClickHandler
* );
* clicks.subscribe(x => console.log(x));
*
* // Whenever you click anywhere in the browser, DOM MouseEvent
* // object will be logged.
* ```
*
* ## Example
* ### Use with API that returns cancellation token
*
* ```ts
* import { fromEventPattern } from 'rxjs';
*
* const token = someAPI.registerEventHandler(function() {});
* someAPI.unregisterEventHandler(token); // this APIs cancellation method accepts
* // not handler itself, but special token.
*
* const someAPIObservable = fromEventPattern(
* function(handler) { return someAPI.registerEventHandler(handler); }, // Note that we return the token here...
* function(handler, token) { someAPI.unregisterEventHandler(token); } // ...to then use it here.
* );
* ```
*
* ## Example
* ### Use with project function
*
* ```ts
* import { fromEventPattern } from 'rxjs';
*
* someAPI.registerEventHandler((eventType, eventMessage) => {
* console.log(eventType, eventMessage); // Logs "EVENT_TYPE" "EVENT_MESSAGE" to console.
* });
*
* const someAPIObservable = fromEventPattern(
* handler => someAPI.registerEventHandler(handler),
* handler => someAPI.unregisterEventHandler(handler)
* (eventType, eventMessage) => eventType + " --- " + eventMessage // without that function only "EVENT_TYPE"
* ); // would be emitted by the Observable
*
* someAPIObservable.subscribe(value => console.log(value));
*
* // Logs:
* // "EVENT_TYPE --- EVENT_MESSAGE"
* ```
*
* @see {@link fromEvent}
* @see {@link bindCallback}
* @see {@link bindNodeCallback}
*
* @param {function(handler: Function): any} addHandler A function that takes
* a `handler` function as argument and attaches it somehow to the actual
* source of events.
* @param {function(handler: Function, token?: any): void} [removeHandler] A function that
* takes a `handler` function as an argument and removes it from the event source. If `addHandler`
* returns some kind of token, `removeHandler` function will have it as a second parameter.
* @param {function(...args: any): T} [project] A function to
* transform results. It takes the arguments from the event handler and
* should return a single value.
* @return {Observable<T>} Observable which, when an event happens, emits first parameter
* passed to registered event handler. Alternatively it emits whatever project function returns
* at that moment.
* @static true
* @name fromEventPattern
* @owner Observable
*/
export function fromEventPattern<T>(addHandler: (handler: NodeEventHandler) => any,
removeHandler?: (handler: NodeEventHandler, signal?: any) => void,
resultSelector?: (...args: any[]) => T): Observable<T | T[]> {
if (resultSelector) {
// DEPRECATED PATH
return fromEventPattern<T>(addHandler, removeHandler).pipe(
map(args => isArray(args) ? resultSelector(...args) : resultSelector(args))
);
}
return new Observable<T | T[]>(subscriber => {
const handler = (...e: T[]) => subscriber.next(e.length === 1 ? e[0] : e);
let retValue: any;
try {
retValue = addHandler(handler);
} catch (err) {
subscriber.error(err);
return undefined;
}
if (!isFunction(removeHandler)) {
return undefined;
}
return () => removeHandler(handler, retValue) ;
});
}

View File

@@ -0,0 +1,11 @@
import EventHandler from '../../../nodes/EventHandler';
import Wrapper from '../shared/Wrapper';
import Block from '../../Block';
import { Expression } from 'estree';
export default class EventHandlerWrapper {
node: EventHandler;
parent: Wrapper;
constructor(node: EventHandler, parent: Wrapper);
get_snippet(block: any): any;
render(block: Block, target: string | Expression): void;
}

View File

@@ -0,0 +1,14 @@
module.exports = {
prefix (prop) {
let match = prop.match(/^(-\w+-)/)
if (match) {
return match[0]
}
return ''
},
unprefixed (prop) {
return prop.replace(/^-\w+-/, '')
}
}

View File

@@ -0,0 +1,27 @@
// display: table and table-cell test. (both are tested under one name "table-cell" )
// By @scottjehl
// all additional table display values are here: http://pastebin.com/Gk9PeVaQ though Scott has seen some IE false positives with that sort of weak detection.
// more testing neccessary perhaps.
Modernizr.addTest( "display-table",function(){
var doc = window.document,
docElem = doc.documentElement,
parent = doc.createElement( "div" ),
child = doc.createElement( "div" ),
childb = doc.createElement( "div" ),
ret;
parent.style.cssText = "display: table";
child.style.cssText = childb.style.cssText = "display: table-cell; padding: 10px";
parent.appendChild( child );
parent.appendChild( childb );
docElem.insertBefore( parent, docElem.firstChild );
ret = child.offsetLeft < childb.offsetLeft;
docElem.removeChild(parent);
return ret;
});