diff --git a/.gitignore b/.gitignore index d2042df..8027956 100644 --- a/.gitignore +++ b/.gitignore @@ -105,6 +105,4 @@ dist .tern-port # Stores VSCode versions used for testing VSCode extensions -.vscode-test - -lib +.vscode-test \ No newline at end of file diff --git a/lib/events/event.d.ts b/lib/events/event.d.ts new file mode 100644 index 0000000..09917b0 --- /dev/null +++ b/lib/events/event.d.ts @@ -0,0 +1,6 @@ +import { EventDelegate } from "./eventDelegate"; +export declare class Event extends Array> { + constructor(); + fire: (source: T, args: K) => void; +} +//# sourceMappingURL=event.d.ts.map \ No newline at end of file diff --git a/lib/events/event.d.ts.map b/lib/events/event.d.ts.map new file mode 100644 index 0000000..3350270 --- /dev/null +++ b/lib/events/event.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/events/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,qBAAa,KAAK,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,KAAK,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;;IAIlD,IAAI,WAAY,CAAC,QAAQ,CAAC,UAI/B;CACH"} \ No newline at end of file diff --git a/lib/events/event.js b/lib/events/event.js new file mode 100644 index 0000000..33c600a --- /dev/null +++ b/lib/events/event.js @@ -0,0 +1,32 @@ +"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 (Object.prototype.hasOwnProperty.call(b, 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 }); +exports.Event = void 0; +var Event = /** @class */ (function (_super) { + __extends(Event, _super); + function Event() { + var _this = _super.call(this) || this; + _this.fire = function (source, args) { + for (var _i = 0, _a = _this; _i < _a.length; _i++) { + var delegate = _a[_i]; + delegate(source, args); + } + }; + return _this; + } + return Event; +}(Array)); +exports.Event = Event; +//# sourceMappingURL=event.js.map \ No newline at end of file diff --git a/lib/events/event.js.map b/lib/events/event.js.map new file mode 100644 index 0000000..883a4e2 --- /dev/null +++ b/lib/events/event.js.map @@ -0,0 +1 @@ +{"version":3,"file":"event.js","sourceRoot":"","sources":["../../src/events/event.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA;IAAiC,yBAA0B;IACzD;QAAA,YACE,iBAAO,SACR;QACM,UAAI,GAAG,UAAC,MAAS,EAAE,IAAO;YAC/B,KAAuB,UAAI,EAAJ,KAAA,KAAI,EAAJ,cAAI,EAAJ,IAAI,EAAE;gBAAxB,IAAM,QAAQ,SAAA;gBACjB,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;aACxB;QACH,CAAC,CAAC;;IALF,CAAC;IAMH,YAAC;AAAD,CAAC,AATD,CAAiC,KAAK,GASrC;AATY,sBAAK"} \ No newline at end of file diff --git a/lib/events/eventDelegate.d.ts b/lib/events/eventDelegate.d.ts new file mode 100644 index 0000000..6ed9dd8 --- /dev/null +++ b/lib/events/eventDelegate.d.ts @@ -0,0 +1,2 @@ +export declare type EventDelegate = (sender: T, args: K) => void; +//# sourceMappingURL=eventDelegate.d.ts.map \ No newline at end of file diff --git a/lib/events/eventDelegate.d.ts.map b/lib/events/eventDelegate.d.ts.map new file mode 100644 index 0000000..6388c26 --- /dev/null +++ b/lib/events/eventDelegate.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"eventDelegate.d.ts","sourceRoot":"","sources":["../../src/events/eventDelegate.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC"} \ No newline at end of file diff --git a/lib/events/eventDelegate.js b/lib/events/eventDelegate.js new file mode 100644 index 0000000..ffe4695 --- /dev/null +++ b/lib/events/eventDelegate.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=eventDelegate.js.map \ No newline at end of file diff --git a/lib/events/eventDelegate.js.map b/lib/events/eventDelegate.js.map new file mode 100644 index 0000000..a2da2a6 --- /dev/null +++ b/lib/events/eventDelegate.js.map @@ -0,0 +1 @@ +{"version":3,"file":"eventDelegate.js","sourceRoot":"","sources":["../../src/events/eventDelegate.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/lib/events/index.d.ts b/lib/events/index.d.ts new file mode 100644 index 0000000..50bd170 --- /dev/null +++ b/lib/events/index.d.ts @@ -0,0 +1,3 @@ +export * from "./event"; +export * from "./eventDelegate"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/events/index.d.ts.map b/lib/events/index.d.ts.map new file mode 100644 index 0000000..e3d7f77 --- /dev/null +++ b/lib/events/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"} \ No newline at end of file diff --git a/lib/events/index.js b/lib/events/index.js new file mode 100644 index 0000000..8970eaa --- /dev/null +++ b/lib/events/index.js @@ -0,0 +1,15 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./event"), exports); +__exportStar(require("./eventDelegate"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/events/index.js.map b/lib/events/index.js.map new file mode 100644 index 0000000..ba4be02 --- /dev/null +++ b/lib/events/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/events/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAwB;AACxB,kDAAgC"} \ No newline at end of file diff --git a/lib/index.d.ts b/lib/index.d.ts new file mode 100644 index 0000000..e6f04a9 --- /dev/null +++ b/lib/index.d.ts @@ -0,0 +1,2 @@ +export * from "./events"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/lib/index.d.ts.map b/lib/index.d.ts.map new file mode 100644 index 0000000..3145d9b --- /dev/null +++ b/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..ef9c88e --- /dev/null +++ b/lib/index.js @@ -0,0 +1,14 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./events"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/lib/index.js.map b/lib/index.js.map new file mode 100644 index 0000000..5cdde71 --- /dev/null +++ b/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB"} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 07861bc..cf97a36 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,8 +8,8 @@ // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */ // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ - // "declaration": true, /* Generates corresponding '.d.ts' file. */ - // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + "declaration": true /* Generates corresponding '.d.ts' file. */, + "declarationMap": true /* Generates a sourcemap for each corresponding '.d.ts' file. */, "sourceMap": true /* Generates corresponding '.map' file. */, // "outFile": "./", /* Concatenate and emit output to single file. */ "outDir": "./lib" /* Redirect output structure to the directory. */,