Generated using http://github.com/rbuckton/grammarkdown
SourceCharacter ::
any Unicode code point
InputElementDiv ::
WhiteSpace
LineTerminator
Comment
Generated using http://github.com/rbuckton/grammarkdown
SourceCharacter ::
any Unicode code point
InputElementDiv ::
WhiteSpace
LineTerminator
Comment
| var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promise, generator) { | |
| return new Promise(function (resolve, reject) { | |
| generator = generator.call(thisArg, _arguments); | |
| function cast(value) { return value instanceof Promise && value.constructor === Promise ? value | |
| : new Promise(function (resolve) { resolve(value); }); } | |
| function onfulfill(value) { try { step("next", value); } catch (e) { reject(e); } } | |
| function onreject(value) { try { step("throw", value); } catch (e) { reject(e); } } | |
| function step(verb, value) { | |
| var result = generator[verb](value); | |
| result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject); |
| // Debug/Checked compilation | |
| const DEBUG = true; | |
| function conditional(condition) { | |
| return target => condition ? target : Function.prototype; | |
| } | |
| @conditional(DEBUG) | |
| function assert(condition, message = "assertion failed.") { | |
| if (!condition) throw new Error(message); |
| // extensions to global Reflect object | |
| declare namespace Reflect { | |
| function mirror(value: (...args: any[]) => any): FunctionMirror; | |
| function mirror(value: new (...args: any[]) => any): ClassMirror; | |
| function mirror(value: any): ObjectMirror; | |
| function mirror(value: any, propertyKey: PropertyKey): MemberMirror; | |
| } | |
| // Extensions to the Object() constructor function object. | |
| interface ObjectConstructor { |
| /** | |
| * A source for cancellation | |
| */ | |
| export declare class CancellationTokenSource { | |
| /** | |
| * @param links Other `CancellationToken` instances that will cancel this source if the tokens are canceled. | |
| */ | |
| constructor(links?: CancellationToken[]); | |
| /** | |
| * Gets the `CancellationToken` for this source. |
| declare namespace Reflect { | |
| /** | |
| * Gets a mirror for the target. | |
| * | |
| * @param target The target of the mirror. | |
| * @param usage The intended usage for the mirror, either a read-only introspection mirror or a writable mutation mirror. Default "mutation". | |
| * @returns A mirror for the provided target. | |
| */ | |
| function mirror(target: any, usage?: "introspection" | "mutation"): ObjectMirror | FunctionMirror | ClassMirror | undefined | null; | |
| } |
| // operators proposal | |
| // partial application (? and ...) | |
| f(?, 1) // (_a = f, _b = 1, (_c) => _a(_c, _b)) | |
| f(?, 1, ?) // (_a = f, _b = 1, (_c, _d) => _a(_c, _b, _d)) | |
| f(?1, ?0) // (_a = f, (_b, _c) => _a(_c, _b)) | |
| f(...) // (_a = f, (..._b) => _a(..._b)) | |
| f(?, 1, ...) // (_a = f, _b = 1, (_c, ..._d) => _a(_c, _b, ..._d)) | |
| o.f(?, 1) // (_a = o.f, _b = 1, (_c) => _a(_c, _b)) |
| declare function binarySearch<T>(array: T[], value: T, comparer?: (v1: T, v2: T) => number, offset?: number): number; | |
| declare function insertItemAt<T>(array: T[], offset: number, value: T): void; | |
| declare function orderedRemoveItemAt<T>(array: T[], index: number): void; | |
| declare function lastOrUndefined<T>(array: T[]): T; | |
| interface TextRange { pos: number, end: number } | |
| class IntervalTree<T extends TextRange> { | |
| public count: number = 0; |
Cancellation follows a source -> sink model and consists of three components: Source, Sink, and Signal.
CancellationSource.CancellationToken.| var __construct = (this && this.__construct) || (typeof Reflect !== "undefined" && Reflect.construct | |
| ? function (self, target, args) { return self !== null && Reflect.construct(target, args, self.constructor) || self; } | |
| : function (self, target, args) { return self !== null && target.apply(self, args) || self; }); | |
| var PatchedPromise = (function (_super) { | |
| __extends(PatchedPromise, _super); | |
| function PatchedPromise(executor) { | |
| var _this = this; | |
| _this = __construct(this, _super, [executor]); | |
| return _this; |