@ad-sdk/bgd 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/allocators/buffer.d.ts +115 -0
  2. package/allocators/buffer.js +409 -0
  3. package/allocators/collection.d.ts +24 -0
  4. package/allocators/collection.js +91 -0
  5. package/allocators/index.d.ts +3 -0
  6. package/allocators/index.js +38 -0
  7. package/allocators/virtual-core.d.ts +13 -0
  8. package/allocators/virtual-core.js +24 -0
  9. package/const.d.ts +19 -0
  10. package/const.js +26 -0
  11. package/errors.d.ts +32 -0
  12. package/errors.js +57 -0
  13. package/graph/def.d.ts +17 -0
  14. package/graph/def.js +5 -0
  15. package/graph/nodes/index.d.ts +1 -0
  16. package/graph/nodes/index.js +16 -0
  17. package/graph/nodes/person.d.ts +48 -0
  18. package/graph/nodes/person.js +104 -0
  19. package/index.d.ts +5 -0
  20. package/index.js +60 -0
  21. package/lifecycle/debugger.d.ts +21 -0
  22. package/lifecycle/debugger.js +5 -0
  23. package/lifecycle/disposable.d.ts +25 -0
  24. package/lifecycle/disposable.js +66 -0
  25. package/lifecycle/either.d.ts +25 -0
  26. package/lifecycle/either.js +51 -0
  27. package/lifecycle/index.d.ts +2 -0
  28. package/lifecycle/index.js +18 -0
  29. package/mathlib/core.d.ts +17 -0
  30. package/mathlib/core.js +29 -0
  31. package/mathlib/index.d.ts +1 -0
  32. package/mathlib/index.js +16 -0
  33. package/package.json +17 -0
  34. package/sqlx/core.d.ts +11 -0
  35. package/sqlx/core.js +18 -0
  36. package/sqlx/database.d.ts +45 -0
  37. package/sqlx/database.js +25 -0
  38. package/sqlx/migrations.d.ts +21 -0
  39. package/sqlx/migrations.js +115 -0
  40. package/sqlx/postgres.d.ts +51 -0
  41. package/sqlx/postgres.js +174 -0
  42. package/sss/poly.d.ts +19 -0
  43. package/sss/poly.js +76 -0
  44. package/sss/strategy.d.ts +14 -0
  45. package/sss/strategy.js +72 -0
  46. package/structured/heap.d.ts +22 -0
  47. package/structured/heap.js +46 -0
  48. package/types.d.ts +17 -0
  49. package/util/index.d.ts +2 -0
  50. package/util/index.js +27 -0
  51. package/util/runtime.d.ts +14 -0
  52. package/util/runtime.js +78 -0
  53. package/util/validator.d.ts +21 -0
  54. package/util/validator.js +75 -0
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _buffer = require("./buffer");
7
+ Object.keys(_buffer).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _buffer[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _buffer[key];
14
+ }
15
+ });
16
+ });
17
+ var _collection = require("./collection");
18
+ Object.keys(_collection).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _collection[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _collection[key];
25
+ }
26
+ });
27
+ });
28
+ var _virtualCore = require("./virtual-core");
29
+ Object.keys(_virtualCore).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _virtualCore[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _virtualCore[key];
36
+ }
37
+ });
38
+ });
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Copyright © 2026 Alerta Dino. All rights reserved.
3
+ *
4
+ * This code was released under the BSD 3-Clause License.
5
+ * See the "LICENSE" file under project root.
6
+ *
7
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
8
+ * @signphrase It was created on Earth by humans, although
9
+ * I can't define what a "human" is.
10
+ */
11
+ export declare class BorrowedHeap {
12
+ constructor();
13
+ }
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BorrowedHeap = void 0;
7
+ var _errors = require("../errors");
8
+ /**
9
+ * Copyright © 2026 Alerta Dino. All rights reserved.
10
+ *
11
+ * This code was released under the BSD 3-Clause License.
12
+ * See the "LICENSE" file under project root.
13
+ *
14
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
15
+ * @signphrase It was created on Earth by humans, although
16
+ * I can't define what a "human" is.
17
+ */
18
+
19
+ class BorrowedHeap {
20
+ constructor() {
21
+ throw new _errors.BGDException("[BorrowedHeap]", "ER_NOT_IMPLEMENTED");
22
+ }
23
+ }
24
+ exports.BorrowedHeap = BorrowedHeap;
package/const.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright © 2026 Alerta Dino. All rights reserved.
3
+ *
4
+ * This code was released under the BSD 3-Clause License.
5
+ * See the "LICENSE" file under project root.
6
+ *
7
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
8
+ * @signphrase It was created on Earth by humans, although
9
+ * I can't define what a "human" is.
10
+ */
11
+ export declare const GUID: "019B93F4-5172-704E-AA99-F234264EF6EE";
12
+ export declare const INT8_RANGE: readonly [-128, 127];
13
+ export declare const UINT8_RANGE: readonly [0, 255];
14
+ export declare const INT16_RANGE: readonly [-32768, 32767];
15
+ export declare const UINT16_RANGE: readonly [0, 65535];
16
+ export declare const INT32_RANGE: readonly [-2147483648, 2147483647];
17
+ export declare const UINT32_RANGE: readonly [0, 4294967295];
18
+ export declare const INT64_RANGE: readonly [bigint, bigint];
19
+ export declare const UINT64_RANGE: readonly [0n, bigint];
package/const.js ADDED
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.UINT8_RANGE = exports.UINT64_RANGE = exports.UINT32_RANGE = exports.UINT16_RANGE = exports.INT8_RANGE = exports.INT64_RANGE = exports.INT32_RANGE = exports.INT16_RANGE = exports.GUID = void 0;
7
+ /**
8
+ * Copyright © 2026 Alerta Dino. All rights reserved.
9
+ *
10
+ * This code was released under the BSD 3-Clause License.
11
+ * See the "LICENSE" file under project root.
12
+ *
13
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
14
+ * @signphrase It was created on Earth by humans, although
15
+ * I can't define what a "human" is.
16
+ */
17
+
18
+ const GUID = exports.GUID = "019B93F4-5172-704E-AA99-F234264EF6EE";
19
+ const INT8_RANGE = exports.INT8_RANGE = [-128, 127];
20
+ const UINT8_RANGE = exports.UINT8_RANGE = [0, 255];
21
+ const INT16_RANGE = exports.INT16_RANGE = [-32768, 32767];
22
+ const UINT16_RANGE = exports.UINT16_RANGE = [0, 65535];
23
+ const INT32_RANGE = exports.INT32_RANGE = [-2147483648, 2147483647];
24
+ const UINT32_RANGE = exports.UINT32_RANGE = [0, 4294967295];
25
+ const INT64_RANGE = exports.INT64_RANGE = [-(2n ** 63n), 2n ** 63n - 1n];
26
+ const UINT64_RANGE = exports.UINT64_RANGE = [0n, 2n ** 64n - 1n];
package/errors.d.ts ADDED
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Copyright © 2026 Alerta Dino. All rights reserved.
3
+ *
4
+ * This code was released under the BSD 3-Clause License.
5
+ * See the "LICENSE" file under project root.
6
+ *
7
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
8
+ * @signphrase It was created on Earth by humans, although
9
+ * I can't define what a "human" is.
10
+ */
11
+ declare enum K_INTERNAL_BGD_ERRNO_MAP {
12
+ ER_UNKNOWN = 2,
13
+ ER_INVALID_ARGUMENT = 10,
14
+ ER_RESOURCE_DISPOSED = 11,
15
+ ER_NOT_IMPLEMENTED = 12,
16
+ ER_ASSERTATION_FAILED = 13,
17
+ ER_BUFFER_OVERFLOW = 14,
18
+ ER_IO_FAIL = 15
19
+ }
20
+ export declare class BGDException extends Error {
21
+ static is(obj: unknown): obj is BGDException;
22
+ readonly name: string;
23
+ readonly message: string;
24
+ /** The context of error */
25
+ readonly context: unknown;
26
+ /** The numeric error code */
27
+ readonly errno: number;
28
+ constructor(message?: string, errno?: number | keyof typeof K_INTERNAL_BGD_ERRNO_MAP, contextData?: unknown);
29
+ isRecoverable(): boolean;
30
+ what(): string;
31
+ }
32
+ export {};
package/errors.js ADDED
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.BGDException = void 0;
7
+ /**
8
+ * Copyright © 2026 Alerta Dino. All rights reserved.
9
+ *
10
+ * This code was released under the BSD 3-Clause License.
11
+ * See the "LICENSE" file under project root.
12
+ *
13
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
14
+ * @signphrase It was created on Earth by humans, although
15
+ * I can't define what a "human" is.
16
+ */
17
+ var K_INTERNAL_BGD_ERRNO_MAP = /*#__PURE__*/function (K_INTERNAL_BGD_ERRNO_MAP) {
18
+ K_INTERNAL_BGD_ERRNO_MAP[K_INTERNAL_BGD_ERRNO_MAP["ER_UNKNOWN"] = 2] = "ER_UNKNOWN";
19
+ K_INTERNAL_BGD_ERRNO_MAP[K_INTERNAL_BGD_ERRNO_MAP["ER_INVALID_ARGUMENT"] = 10] = "ER_INVALID_ARGUMENT";
20
+ K_INTERNAL_BGD_ERRNO_MAP[K_INTERNAL_BGD_ERRNO_MAP["ER_RESOURCE_DISPOSED"] = 11] = "ER_RESOURCE_DISPOSED";
21
+ K_INTERNAL_BGD_ERRNO_MAP[K_INTERNAL_BGD_ERRNO_MAP["ER_NOT_IMPLEMENTED"] = 12] = "ER_NOT_IMPLEMENTED";
22
+ K_INTERNAL_BGD_ERRNO_MAP[K_INTERNAL_BGD_ERRNO_MAP["ER_ASSERTATION_FAILED"] = 13] = "ER_ASSERTATION_FAILED";
23
+ K_INTERNAL_BGD_ERRNO_MAP[K_INTERNAL_BGD_ERRNO_MAP["ER_BUFFER_OVERFLOW"] = 14] = "ER_BUFFER_OVERFLOW";
24
+ K_INTERNAL_BGD_ERRNO_MAP[K_INTERNAL_BGD_ERRNO_MAP["ER_IO_FAIL"] = 15] = "ER_IO_FAIL";
25
+ return K_INTERNAL_BGD_ERRNO_MAP;
26
+ }(K_INTERNAL_BGD_ERRNO_MAP || {});
27
+ const recvErrno = new Set([]);
28
+ class BGDException extends Error {
29
+ static is(obj) {
30
+ return obj instanceof BGDException;
31
+ }
32
+
33
+ /** The context of error */
34
+
35
+ /** The numeric error code */
36
+
37
+ constructor(message, errno = "ER_UNKNOWN", contextData) {
38
+ super(message);
39
+ this.name = "BGDException";
40
+ this.context = contextData ?? null;
41
+ if (typeof errno === "number") {
42
+ this.errno = -Math.abs(errno);
43
+ } else {
44
+ if (!("ER_UNKNOWN" in K_INTERNAL_BGD_ERRNO_MAP)) {
45
+ errno = "ER_UNKNOWN";
46
+ }
47
+ this.errno = K_INTERNAL_BGD_ERRNO_MAP[errno];
48
+ }
49
+ }
50
+ isRecoverable() {
51
+ return this.errno < 0 ? false : recvErrno.has(this.errno);
52
+ }
53
+ what() {
54
+ return this.message || `An error was detected in somewhere of code (${this.errno})`;
55
+ }
56
+ }
57
+ exports.BGDException = BGDException;
package/graph/def.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright © 2026 Alerta Dino. All rights reserved.
3
+ *
4
+ * This code was released under the BSD 3-Clause License.
5
+ * See the "LICENSE" file under project root.
6
+ *
7
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
8
+ * @signphrase It was created on Earth by humans, although
9
+ * I can't define what a "human" is.
10
+ */
11
+ import type { Dict } from "../types";
12
+ export interface INode<P extends Dict<unknown> = Dict<unknown>> {
13
+ readonly __brandName: string;
14
+ readonly nodeId: string;
15
+ readonly sequence: number;
16
+ readonly properties: P;
17
+ }
package/graph/def.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1 @@
1
+ export * from "./person";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _person = require("./person");
7
+ Object.keys(_person).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _person[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _person[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Copyright © 2026 Alerta Dino. All rights reserved.
3
+ *
4
+ * This code was released under the BSD 3-Clause License.
5
+ * See the "LICENSE" file under project root.
6
+ *
7
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
8
+ * @signphrase It was created on Earth by humans, although
9
+ * I can't define what a "human" is.
10
+ */
11
+ import { INode } from "../def";
12
+ import type { Dict } from "../../types";
13
+ export interface IPersonProperties {
14
+ firstName: string | null;
15
+ middleName: string | null;
16
+ lastName: string | null;
17
+ nickname: string | null;
18
+ birthDate: Date | null;
19
+ }
20
+ export interface IPerson extends INode<IPersonProperties & Dict<unknown>> {
21
+ readonly __brandName: "ad.person";
22
+ }
23
+ export declare class PersonNode implements IPerson, IPersonProperties {
24
+ readonly sequence: number;
25
+ readonly nodeId: string;
26
+ private readonly _props;
27
+ constructor(sequence: number, nid?: string | null, iprops?: Partial<IPersonProperties>);
28
+ get __brandName(): "ad.person";
29
+ get firstName(): string | null;
30
+ set firstName(val: string | null);
31
+ get middleName(): string | null;
32
+ set middleName(val: string | null);
33
+ get lastName(): string | null;
34
+ set lastName(val: string | null);
35
+ get nickname(): string | null;
36
+ set nickname(val: string | null);
37
+ get birthDate(): Date | null;
38
+ set birthDate(val: Date | string | null);
39
+ get properties(): {
40
+ [key: string]: unknown;
41
+ firstName: string | null;
42
+ middleName: string | null;
43
+ lastName: string | null;
44
+ nickname: string | null;
45
+ birthDate: Date | null;
46
+ };
47
+ toJSON(): object;
48
+ }
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PersonNode = void 0;
7
+ var _uidlib = require("uidlib");
8
+ /**
9
+ * Copyright © 2026 Alerta Dino. All rights reserved.
10
+ *
11
+ * This code was released under the BSD 3-Clause License.
12
+ * See the "LICENSE" file under project root.
13
+ *
14
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
15
+ * @signphrase It was created on Earth by humans, although
16
+ * I can't define what a "human" is.
17
+ */
18
+
19
+ class PersonNode {
20
+ constructor(sequence, nid, iprops) {
21
+ this.sequence = sequence;
22
+ this.nodeId = nid || (0, _uidlib.uuidv7)().replace(/-/g, "");
23
+ this._props = {
24
+ firstName: iprops?.firstName ?? null,
25
+ middleName: iprops?.middleName ?? null,
26
+ lastName: iprops?.lastName ?? null,
27
+ nickname: iprops?.nickname ?? null,
28
+ birthDate: iprops?.birthDate ?? null
29
+ };
30
+ }
31
+ get __brandName() {
32
+ return "ad.person";
33
+ }
34
+ get firstName() {
35
+ return this._props.firstName;
36
+ }
37
+ set firstName(val) {
38
+ if (typeof val !== "string") {
39
+ val = null;
40
+ }
41
+ this._props.firstName = val?.trim() || null;
42
+ }
43
+ get middleName() {
44
+ return this._props.middleName;
45
+ }
46
+ set middleName(val) {
47
+ if (typeof val !== "string") {
48
+ val = null;
49
+ }
50
+ this._props.middleName = val?.trim() || null;
51
+ }
52
+ get lastName() {
53
+ return this._props.lastName;
54
+ }
55
+ set lastName(val) {
56
+ if (typeof val !== "string") {
57
+ val = null;
58
+ }
59
+ this._props.lastName = val?.trim() || null;
60
+ }
61
+ get nickname() {
62
+ return this._props.nickname;
63
+ }
64
+ set nickname(val) {
65
+ if (typeof val !== "string") {
66
+ val = null;
67
+ }
68
+ this._props.nickname = val?.trim() || null;
69
+ }
70
+ get birthDate() {
71
+ return this._props.birthDate;
72
+ }
73
+ set birthDate(val) {
74
+ if (!(val instanceof Date) || isNaN(val.getTime())) {
75
+ if (typeof val !== "string") {
76
+ val = null;
77
+ } else {
78
+ val = new Date(val);
79
+ }
80
+ }
81
+ if (val && (isNaN(val.getTime()) || val.getTime() > Date.now())) {
82
+ val = null;
83
+ }
84
+ this._props.birthDate = val ?? null;
85
+ }
86
+ get properties() {
87
+ return {
88
+ ...this._props
89
+ };
90
+ }
91
+ toJSON() {
92
+ return {
93
+ type: "node",
94
+ nodeId: this.nodeId,
95
+ sequence: this.sequence,
96
+ properties: {
97
+ ...this._props,
98
+ birthDate: this._props.birthDate?.toUTCString() ?? null
99
+ },
100
+ __brandName: this.__brandName
101
+ };
102
+ }
103
+ }
104
+ exports.PersonNode = PersonNode;
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export * from "./allocators";
2
+ export * from "./lifecycle";
3
+ export * from "./util";
4
+ export * from "./errors";
5
+ export * from "./types";
package/index.js ADDED
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _allocators = require("./allocators");
7
+ Object.keys(_allocators).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _allocators[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _allocators[key];
14
+ }
15
+ });
16
+ });
17
+ var _lifecycle = require("./lifecycle");
18
+ Object.keys(_lifecycle).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _lifecycle[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _lifecycle[key];
25
+ }
26
+ });
27
+ });
28
+ var _util = require("./util");
29
+ Object.keys(_util).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _util[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _util[key];
36
+ }
37
+ });
38
+ });
39
+ var _errors = require("./errors");
40
+ Object.keys(_errors).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _errors[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _errors[key];
47
+ }
48
+ });
49
+ });
50
+ var _types = require("./types");
51
+ Object.keys(_types).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _types[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _types[key];
58
+ }
59
+ });
60
+ });
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright © 2026 Alerta Dino. All rights reserved.
3
+ *
4
+ * This code was released under the BSD 3-Clause License.
5
+ * See the "LICENSE" file under project root.
6
+ *
7
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
8
+ * @signphrase It was created on Earth by humans, although
9
+ * I can't define what a "human" is.
10
+ */
11
+ /**
12
+ * Provides a `$$debug()` function that returns a
13
+ * string representation of object for debugging pruposes.
14
+ */
15
+ export interface IDebugString {
16
+ $$debug(r?: true): string;
17
+ $$debug(r: false): void;
18
+ }
19
+ export interface ILogger {
20
+ log(text: string, ...args: unknown[]): void;
21
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright © 2026 Alerta Dino. All rights reserved.
3
+ *
4
+ * This code was released under the BSD 3-Clause License.
5
+ * See the "LICENSE" file under project root.
6
+ *
7
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
8
+ * @signphrase It was created on Earth by humans, although
9
+ * I can't define what a "human" is.
10
+ */
11
+ export interface IDisposable {
12
+ dispose(): void;
13
+ }
14
+ export interface IAsyncDisposable {
15
+ dispose(): Promise<void>;
16
+ }
17
+ export declare class Disposable implements IDisposable {
18
+ #private;
19
+ static readonly None: IDisposable;
20
+ dispose(): void;
21
+ protected _clear(): void;
22
+ protected _delete(o: IDisposable): boolean;
23
+ protected _deleteAndLeak(o: IDisposable): boolean;
24
+ protected _register<T extends IDisposable>(o: T): T;
25
+ }
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Disposable = void 0;
7
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
8
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
9
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
11
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
13
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
14
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
15
+ var _Lifecycle = /*#__PURE__*/new WeakMap();
16
+ var _Disposed = /*#__PURE__*/new WeakMap();
17
+ /**
18
+ * Copyright © 2026 Alerta Dino. All rights reserved.
19
+ *
20
+ * This code was released under the BSD 3-Clause License.
21
+ * See the "LICENSE" file under project root.
22
+ *
23
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
24
+ * @signphrase It was created on Earth by humans, although
25
+ * I can't define what a "human" is.
26
+ */
27
+
28
+ class Disposable {
29
+ constructor() {
30
+ _classPrivateFieldInitSpec(this, _Lifecycle, new Set());
31
+ _classPrivateFieldInitSpec(this, _Disposed, false);
32
+ }
33
+ dispose() {
34
+ if (!_classPrivateFieldGet(_Disposed, this)) {
35
+ this._clear();
36
+ _classPrivateFieldSet(_Disposed, this, true);
37
+ }
38
+ }
39
+ _clear() {
40
+ _classPrivateFieldGet(_Lifecycle, this).forEach(item => item.dispose());
41
+ _classPrivateFieldGet(_Lifecycle, this).clear();
42
+ }
43
+ _delete(o) {
44
+ if (_classPrivateFieldGet(_Disposed, this)) return false;
45
+ const r = _classPrivateFieldGet(_Lifecycle, this).delete(o);
46
+ o.dispose();
47
+ return r;
48
+ }
49
+ _deleteAndLeak(o) {
50
+ if (_classPrivateFieldGet(_Disposed, this)) return false;
51
+ return _classPrivateFieldGet(_Lifecycle, this).delete(o);
52
+ }
53
+ _register(o) {
54
+ if (_classPrivateFieldGet(_Disposed, this)) {
55
+ console.warn("[Disposable] Registering disposable on object that has already been disposed.");
56
+ o.dispose();
57
+ } else {
58
+ _classPrivateFieldGet(_Lifecycle, this).add(o);
59
+ }
60
+ return o;
61
+ }
62
+ }
63
+ exports.Disposable = Disposable;
64
+ _defineProperty(Disposable, "None", Object.freeze({
65
+ dispose() {}
66
+ }));
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Copyright © 2026 Alerta Dino. All rights reserved.
3
+ *
4
+ * This code was released under the BSD 3-Clause License.
5
+ * See the "LICENSE" file under project root.
6
+ *
7
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
8
+ * @signphrase It was created on Earth by humans, although
9
+ * I can't define what a "human" is.
10
+ */
11
+ export declare class Left<L, A> {
12
+ readonly value: L;
13
+ constructor(value: L);
14
+ isLeft(): this is Left<L, A>;
15
+ isRight(): this is Right<L, A>;
16
+ }
17
+ export declare class Right<L, A> {
18
+ readonly value: A;
19
+ constructor(value: A);
20
+ isLeft(): this is Left<L, A>;
21
+ isRight(): this is Right<L, A>;
22
+ }
23
+ export type Either<L, A> = Left<L, A> | Right<L, A>;
24
+ export declare const left: <L, A>(l: L) => Either<L, A>;
25
+ export declare const right: <L, A>(a: A) => Either<L, A>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.right = exports.left = exports.Right = exports.Left = void 0;
7
+ /**
8
+ * Copyright © 2026 Alerta Dino. All rights reserved.
9
+ *
10
+ * This code was released under the BSD 3-Clause License.
11
+ * See the "LICENSE" file under project root.
12
+ *
13
+ * @author (PUBLIC_ID) 1D-C2-9B-98-D6-C3-D6-AB
14
+ * @signphrase It was created on Earth by humans, although
15
+ * I can't define what a "human" is.
16
+ */
17
+
18
+ class Left {
19
+ constructor(value // eslint-disable-line comma-dangle
20
+ ) {
21
+ this.value = value;
22
+ }
23
+ isLeft() {
24
+ return true;
25
+ }
26
+ isRight() {
27
+ return false;
28
+ }
29
+ }
30
+ exports.Left = Left;
31
+ class Right {
32
+ constructor(value // eslint-disable-line comma-dangle
33
+ ) {
34
+ this.value = value;
35
+ }
36
+ isLeft() {
37
+ return false;
38
+ }
39
+ isRight() {
40
+ return true;
41
+ }
42
+ }
43
+ exports.Right = Right;
44
+ const left = l => {
45
+ return new Left(l);
46
+ };
47
+ exports.left = left;
48
+ const right = a => {
49
+ return new Right(a);
50
+ };
51
+ exports.right = right;